rendered paste bodySip.conf:
; Note: If your SIP devices are behind a NAT and your Asterisk
; server isn't, try adding "nat=1" to each peer definition to
; solve translation problems.
[general]
bindport = 5060 ; Port to bind to (SIP is 5060)
bindaddr = 1.0.1.3 ; Address to bind to (all addresses on machine)
disallow=all
allow=ulaw
allow=alaw
; If you need to answer unauthenticated calls, you should change this
; next line to 'from-trunk', rather than 'from-sip-external'.
; You'll know this is happening if when you call in you get a message
; saying "The number you have dialed is not in service. Please check the
; number and try again."
context = from-sip-external ; Send unknown SIP callers to this context
callerid = Unknown
tos=0x68
; #, in this configuration file, is NOT A COMMENT. This is exactly
; how it should be.
#include sip_nat.conf
#include sip_registrations_custom.conf
#include sip_registrations.conf
#include sip_custom.conf
#include sip_additional.conf
AND IN SIP_ADDITIONAL:
[529]
username=529
type=friend
secret=0000
record_out=Adhoc
record_in=Adhoc
qualify=no
port=5060
nat=never
mailbox=529@device
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=no
callerid=Bertrand Pallier <529>
********************************************************
********************************************************
********************************************************
Asterisk log:
-- Executing Macro("SIP/529-09c480c8", "get-vmcontext|529") in new stack
-- Executing Set("SIP/529-09c480c8", "VMCONTEXT=") in new stack
-- Executing GotoIf("SIP/529-09c480c8", "1?200:300") in new stack
-- Goto (macro-get-vmcontext,s,200)
-- Executing Set("SIP/529-09c480c8", "VMCONTEXT=default") in new stack
-- Executing MailboxExists("SIP/529-09c480c8", "529@default") in new stack
-- Executing VoiceMailMain("SIP/529-09c480c8", "529@default") in new stack
-- Playing 'vm-password' (language 'en')
bkb-srv-ast01*CLI>
********************************************************
********************************************************
********************************************************
TCPDUMP:
[root@bkb-srv-ast01 ~]# tcpdump -i eth1
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth1, link-type EN10MB (Ethernet), capture size 96 bytes
14:45:36.966324 IP 1.0.1.29.5060 > 1.0.1.3.5060: UDP, length 735
14:45:36.969967 IP 1.0.1.3.5060 > 1.0.1.29.5060: UDP, length 476
14:45:36.976296 IP 1.0.1.29.5060 > 1.0.1.3.5060: UDP, length 444
14:45:36.981918 IP 1.0.1.29.5060 > 1.0.1.3.5060: UDP, length 898
14:45:36.989042 IP 1.0.1.3.5060 > 1.0.1.29.5060: UDP, length 388
14:45:36.996886 IP 1.0.1.3.5060 > 1.0.1.29.5060: UDP, length 604
14:45:37.012779 IP 1.0.1.29.5060 > 1.0.1.3.5060: UDP, length 607
14:45:37.024396 IP 1.0.1.29.5004 > 1.0.1.3.10318: UDP, length 172
14:45:37.039248 IP 1.0.1.29.5004 > 1.0.1.3.10318: UDP, length 172
14:45:37.056868 IP 1.0.1.29.5004 > 1.0.1.3.10318: UDP, length 172
14:45:37.072251 IP 1.0.1.29.5004 > 1.0.1.3.10318: UDP, length 172
14:45:37.094268 IP 1.0.1.29.5004 > 1.0.1.3.10318: UDP, length 172
14:45:37.113246 IP 1.0.1.29.5004 > 1.0.1.3.10318: UDP, length 172
14:45:37.138263 IP 1.0.1.29.5004 > 1.0.1.3.10318: UDP, length 172
14:45:37.155882 IP 1.0.1.29.5004 > 1.0.1.3.10318: UDP, length 172
14:45:37.174233 IP 1.0.1.29.5004 > 1.0.1.3.10318: UDP, length 172
14:45:37.192937 IP 1.0.1.29.5004 > 1.0.1.3.10318: UDP, length 172
14:45:37.209241 IP 1.0.1.29.5004 > 1.0.1.3.10318: UDP, length 172
14:45:37.226269 IP 1.0.1.29.5004 > 1.0.1.3.10318: UDP, length 172
[...]
********************************************************
********************************************************
********************************************************
Sip debug:
<-- SIP read from 1.0.1.29:5060:
INVITE sip:*97@1.0.1.3 SIP/2.0
Via: SIP/2.0/UDP 1.0.1.29:5060;branch=z9hG4bKaa4cd83390fd64a6
From: "Bertrand Pallier" <sip:529@1.0.1.3>;tag=098a024e33782f95
To: <sip:*97@1.0.1.3>
Contact: <sip:529@1.0.1.29:5060>
Supported: replaces, timer
Call-ID: 824a703b6149dbeb@1.0.1.29
CSeq: 39633 INVITE
User-Agent: Grandstream BT200 1.1.0.16
Max-Forwards: 70
Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK
Content-Type: application/sdp
Content-Length: 243
v=0
o=529 8000 8000 IN IP4 1.0.1.29
s=SIP Call
c=IN IP4 1.0.1.29
t=0 0
m=audio 5004 RTP/AVP 8 0 4 18 3
a=sendrecv
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:4 G723/8000
a=rtpmap:18 G729/8000
a=rtpmap:3 GSM/8000
a=ptime:90
--- (13 headers 13 lines) ---
Using INVITE request as basis request - 824a703b6149dbeb@1.0.1.29
Sending to 1.0.1.29 : 5060 (NAT)
Reliably Transmitting (no NAT) to 1.0.1.29:5060:
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 1.0.1.29:5060;branch=z9hG4bKaa4cd83390fd64a6;received=1.0.1.29
From: "Bertrand Pallier" <sip:529@1.0.1.3>;tag=098a024e33782f95
To: <sip:*97@1.0.1.3>;tag=as60fa8e3d
Call-ID: 824a703b6149dbeb@1.0.1.29
CSeq: 39633 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Proxy-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="3b3ba768"
Content-Length: 0
---
Scheduling destruction of call '824a703b6149dbeb@1.0.1.29' in 15000 ms
Found user '529'
bkb-srv-ast01*CLI>
<-- SIP read from 1.0.1.29:5060:
ACK sip:*97@1.0.1.3 SIP/2.0
Via: SIP/2.0/UDP 1.0.1.29:5060;branch=z9hG4bKaa4cd83390fd64a6
From: "Bertrand Pallier" <sip:529@1.0.1.3>;tag=098a024e33782f95
To: <sip:*97@1.0.1.3>;tag=as60fa8e3d
Contact: <sip:529@1.0.1.29:5060>
Call-ID: 824a703b6149dbeb@1.0.1.29
CSeq: 39633 ACK
User-Agent: Grandstream BT200 1.1.0.16
Max-Forwards: 70
Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK
Content-Length: 0
--- (11 headers 0 lines) ---
bkb-srv-ast01*CLI>
<-- SIP read from 1.0.1.29:5060:
INVITE sip:*97@1.0.1.3 SIP/2.0
Via: SIP/2.0/UDP 1.0.1.29:5060;branch=z9hG4bK678966af7ee9d770
From: "Bertrand Pallier" <sip:529@1.0.1.3>;tag=098a024e33782f95
To: <sip:*97@1.0.1.3>
Contact: <sip:529@1.0.1.29:5060>
Supported: replaces, timer
Proxy-Authorization: Digest username="529", realm="asterisk", algorithm=MD5, uri="sip:*97@1.0.1.3", nonce="3b3ba768", response="f48a9df092778b316a294ebb5be2c5df"
Call-ID: 824a703b6149dbeb@1.0.1.29
CSeq: 39634 INVITE
User-Agent: Grandstream BT200 1.1.0.16
Max-Forwards: 70
Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK
Content-Type: application/sdp
Content-Length: 243
v=0
o=529 8000 8001 IN IP4 1.0.1.29
s=SIP Call
c=IN IP4 1.0.1.29
t=0 0
m=audio 5004 RTP/AVP 8 0 4 18 3
a=sendrecv
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:4 G723/8000
a=rtpmap:18 G729/8000
a=rtpmap:3 GSM/8000
a=ptime:90
--- (14 headers 13 lines) ---
Using INVITE request as basis request - 824a703b6149dbeb@1.0.1.29
Sending to 1.0.1.29 : 5060 (non-NAT)
Found user '529'
Found RTP audio format 8
Found RTP audio format 0
Found RTP audio format 4
Found RTP audio format 18
Found RTP audio format 3
Peer audio RTP is at port 1.0.1.29:5004
Found description format PCMA
Found description format PCMU
Found description format G723
Found description format G729
Found description format GSM
Capabilities: us - 0xc (ulaw|alaw), peer - audio=0x10f (g723|gsm|ulaw|alaw|g729)/video=0x0 (nothing), combined - 0xc (ulaw|alaw)
Non-codec capabilities: us - 0x1 (telephone-event), peer - 0x0 (nothing), combined - 0x0 (nothing)
Looking for *97 in from-internal (domain 1.0.1.3)
list_route: hop: <sip:529@1.0.1.29:5060>
Transmitting (no NAT) to 1.0.1.29:5060:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 1.0.1.29:5060;branch=z9hG4bK678966af7ee9d770;received=1.0.1.29
From: "Bertrand Pallier" <sip:529@1.0.1.3>;tag=098a024e33782f95
To: <sip:*97@1.0.1.3>
Call-ID: 824a703b6149dbeb@1.0.1.29
CSeq: 39634 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: <sip:*97@1.0.1.3>
Content-Length: 0
---
We're at 1.0.1.3 port 12824
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x8 (alaw) to SDP
Reliably Transmitting (no NAT) to 1.0.1.29:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 1.0.1.29:5060;branch=z9hG4bK678966af7ee9d770;received=1.0.1.29
From: "Bertrand Pallier" <sip:529@1.0.1.3>;tag=098a024e33782f95
To: <sip:*97@1.0.1.3>;tag=as7b1591f0
Call-ID: 824a703b6149dbeb@1.0.1.29
CSeq: 39634 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: <sip:*97@1.0.1.3>
Content-Type: application/sdp
Content-Length: 172
v=0
o=root 8076 8076 IN IP4 1.0.1.3
s=session
c=IN IP4 1.0.1.3
t=0 0
m=audio 12824 RTP/AVP 0 8
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=silenceSupp:off - - - -
---
<-- SIP read from 1.0.1.29:5060:
ACK sip:*97@1.0.1.3 SIP/2.0
Via: SIP/2.0/UDP 1.0.1.29:5060;branch=z9hG4bK49ee9ca8361b4dd9
From: "Bertrand Pallier" <sip:529@1.0.1.3>;tag=098a024e33782f95
To: <sip:*97@1.0.1.3>;tag=as7b1591f0
Contact: <sip:529@1.0.1.29:5060>
Proxy-Authorization: Digest username="529", realm="asterisk", algorithm=MD5, uri="sip:*97@1.0.1.3", nonce="3b3ba768", response="d833bc14c8470a6903b6cdf3f7fdfa96"
Call-ID: 824a703b6149dbeb@1.0.1.29
CSeq: 39634 ACK
User-Agent: Grandstream BT200 1.1.0.16
Max-Forwards: 70
Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK
Content-Length: 0
--- (12 headers 0 lines) ---
********************************************************
********************************************************
********************************************************
Sip show history:
bkb-srv-ast01*CLI> sip show history ec627e656675b732@1.0.1.29
bkb-srv-ast01*CLI>
* SIP Call
1. Rx INVITE / 9050 INVITE /sip:*97@1.0.1.3
2. CancelDestroy
3. TxRespRel SIP/2.0 / 9050 INVITE
4. SchedDestroy 15000 ms
5. Rx ACK / 9050 ACK /sip:*97@1.0.1.3
6. Rx INVITE / 9051 INVITE /sip:*97@1.0.1.3
7. CancelDestroy
8. CancelDestroy
9. TxResp SIP/2.0 / 9051 INVITE
10. TxRespRel SIP/2.0 / 9051 INVITE
11. Rx ACK / 9051 ACK /sip:*97@1.0.1.3