Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

sip.conf

Code Block
themeRDark
titlesip.conf
[general]

register => trunk_username:trunk_password@sip-connect.netvoip.ch/trunk_username  

allowguest=no
alwaysauthreject=yes
nat=force_rport,comedia
allow=!all,alaw,ulaw,g722
dtmfmode=rfc2833
rtptimeout=60
rtpholdtimeout=300
directmedia=no

[phone1]
type=peer
defaultuser=phone1_username
secret=phone1_password
context=my-phones
host=dynamic
transport=udp
qualify=yes

[phone2]
type=peer
defaultuser=phone2_username
secret=phone_password
context=my-phones
host=dynamic
transport=udp
qualify=yes

[nexphone-out]
host=sip-connect.netvoip.ch
port=5060
defaultuser=trunk_username
secret=trunk_password
fromdomain=sip-connect.netvoip.ch 
type=peer
context=nexphone-in
insecure=port,invite
transport=udp
qualify=yes

extensions.conf

Code Block
themeRDark
titleBasic dialplan
collapsetrue
[general]

static=yes
writeprotect=no

[nexphone-in]

exten => 0245457883,1,Dial(SIP/phone1,30)
   same => n,Hungup()

[my-phones]

exten => _X.,1,Log(NOTICE, Dialing out from ${CALLERID(num)} to ${EXTEN} via Nexphone)
   same => n,Set(CALLERID(num)=0245457883)
   same => n,Dial(SIP/${EXTEN}@nexphone-out,40)
   same => n,Hungup()


REGISTER

Code Block
themeRDark
titleHow a REGISTER should look like
collapsetrue
2021/06/25 08:50:15.204871 185.185.33.226:5060 -> 185.185.32.60:5060
REGISTER sip:sip-connect.netvoip.ch SIP/2.0
Via: SIP/2.0/UDP 185.185.33.226:5060;branch=z9hG4bK7dfce29f;rport
Max-Forwards: 70
From: <sip:2135779136.8813@sip-connect.netvoip.ch>;tag=as56773fe7
To: <sip:2135779136.8813@sip-connect.netvoip.ch>
Call-ID: 551889076cc9417d2105b16a52ee6768@10.2.6.226
CSeq: 102 REGISTER
Supported: replaces, timer
User-Agent: Asterisk PBX 18.5.0
Expires: 120
Contact: <sip:2135779136.8813@185.185.33.226:5060>
Content-Length: 0
----------
2021/06/25 08:50:15.206060 185.185.32.60:5060 -> 185.185.33.226:5060
SIP/2.0 401 Unauthorized
From: <sip:2135779136.8813@sip-connect.netvoip.ch>;tag=as56773fe7
To: <sip:2135779136.8813@sip-connect.netvoip.ch>
Call-ID: 551889076cc9417d2105b16a52ee6768@10.2.6.226
CSeq: 102 REGISTER
Server: AareSwitch/6.12.12884
Via: SIP/2.0/UDP 185.185.33.226:5060;rport;branch=z9hG4bK7dfce29f
WWW-Authenticate: Digest realm="sip-connect.netvoip.ch",nonce="60d57ca86c22fd941cf04d6a817761fc3416ec6b"
----------
2021/06/25 08:50:15.215947 185.185.33.226:5060 -> 185.185.32.60:5060
REGISTER sip:sip-connect.netvoip.ch SIP/2.0
Via: SIP/2.0/UDP 185.185.33.226:5060;branch=z9hG4bK5749ceb4;rport
Max-Forwards: 70
From: <sip:2135779136.8813@sip-connect.netvoip.ch>;tag=as56773fe7
To: <sip:2135779136.8813@sip-connect.netvoip.ch>
Call-ID: 551889076cc9417d2105b16a52ee6768@10.2.6.226
CSeq: 103 REGISTER
Supported: replaces, timer
User-Agent: Asterisk PBX 18.5.0
Authorization: Digest username="2135779136.8813", realm="sip-connect.netvoip.ch", algorithm=MD5, uri="sip:sip-connect.netvoip.ch", nonce="60d57ca86c22fd941cf04d6a817761fc3416ec6b", response="a8722cc04229819c0ef42d1d3fa1c32c"
Expires: 120
Contact: <sip:2135779136.8813@185.185.33.226:5060>
Content-Length: 0
----------
2021/06/25 08:50:15.223565 185.185.32.60:5060 -> 185.185.33.226:5060
SIP/2.0 200 OK
From: <sip:2135779136.8813@sip-connect.netvoip.ch>;tag=as56773fe7
To: <sip:2135779136.8813@sip-connect.netvoip.ch>;tag=sc2nxp3-5152540d1bf9318f
Call-ID: 551889076cc9417d2105b16a52ee6768@10.2.6.226
CSeq: 103 REGISTER
Via: SIP/2.0/UDP 185.185.33.226:5060;rport;branch=z9hG4bK5749ceb4
Contact: <sip:2135779136.8813@185.185.33.226:5060>;expires=600


INVITE

Code Block
themeRDark
titleHow an INVITE should look like
collapsetrue
2021/06/25 08:47:38.034981 185.185.33.226:5060 -> 185.185.32.60:5060
INVITE sip:0800800800@sip-connect.netvoip.ch:5060 SIP/2.0
Via: SIP/2.0/UDP 185.185.33.226:5060;branch=z9hG4bK10850df7;rport
Max-Forwards: 70
From: <sip:0245457883@sip-connect.netvoip.ch>;tag=as0ffb18b1
To: <sip:0800800800@sip-connect.netvoip.ch:5060>
Contact: <sip:0245457883@185.185.33.226:5060>
Call-ID: 5ee830c66b70d81e1e2ffe5b11b1e711@sip-connect.netvoip.ch
CSeq: 102 INVITE
User-Agent: Asterisk PBX 18.5.0
Date: Fri, 25 Jun 2021 06:47:38 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 301

v=0
o=root 993606471 993606471 IN IP4 185.185.33.226
s=Asterisk PBX 18.5.0
c=IN IP4 185.185.33.226
t=0 0
m=audio 43230 RTP/AVP 8 0 9 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
----------
2021/06/25 08:47:38.037822 185.185.32.60:5060 -> 185.185.33.226:5060
SIP/2.0 401 Unauthorized
From: <sip:0245457883@sip-connect.netvoip.ch>;tag=as0ffb18b1
To: <sip:0800800800@sip-connect.netvoip.ch:5060>;tag=sc1nxp3-83e077b2e132d394
Call-ID: 5ee830c66b70d81e1e2ffe5b11b1e711@sip-connect.netvoip.ch
CSeq: 102 INVITE
Server: AareSwitch/6.12.12884
Via: SIP/2.0/UDP 185.185.33.226:5060;rport;branch=z9hG4bK10850df7
Contact: <sip:0800800800@185.185.32.60:5060>
WWW-Authenticate: Digest realm="185.185.32.60",nonce="60d57c0f521e0897cb7e6ce8c88b2f4726cf636d"
----------
2021/06/25 08:47:38.038047 185.185.33.226:5060 -> 185.185.32.60:5060
INVITE sip:0800800800@sip-connect.netvoip.ch:5060 SIP/2.0
Via: SIP/2.0/UDP 185.185.33.226:5060;branch=z9hG4bK31b0a47c;rport
Max-Forwards: 70
From: <sip:0245457883@sip-connect.netvoip.ch>;tag=as0ffb18b1
To: <sip:0800800800@sip-connect.netvoip.ch:5060>
Contact: <sip:0245457883@185.185.33.226:5060>
Call-ID: 5ee830c66b70d81e1e2ffe5b11b1e711@sip-connect.netvoip.ch
CSeq: 103 INVITE
User-Agent: Asterisk PBX 18.5.0
Authorization: Digest username="2135779136.8813", realm="185.185.32.60", algorithm=MD5, uri="sip:0800800800@sip-connect.netvoip.ch:5060", nonce="60d57c0f521e0897cb7e6ce8c88b2f4726cf636d", response="900e52bd6af66256bd6ffc67cd80bb50"
Date: Fri, 25 Jun 2021 06:47:38 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 301

v=0
o=root 993606471 993606472 IN IP4 185.185.33.226
s=Asterisk PBX 18.5.0
c=IN IP4 185.185.33.226
t=0 0
m=audio 43230 RTP/AVP 8 0 9 101
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

...