Hi,
I am new to Asterisk and recently I was able to set up local calls and External incoming calls.
My problem is making outgoing calls to the world.
My VoIP provider authenticates me with caller ID and the IP address.
My set up is as follows:
Asterisk 1.6
2 ethernet cards one with real IP 85.130.104.19 and local net 192.168.10.0/255.255.255.0
sip.conf
[general]
defaultip = 85.130.104.19
localnet = 192.168.10.0/255.255.255.0
externrefresh = 60
nat = no
canreinvite = no
srvlookup=yes
musicclass=default
realm = asterisk
[100]
type=friend
username=100
secret=100
host=dynamic
disallow=all
allow=ulaw
allow=alaw
allow=g729
allow=g723.1
context=users
[101]
type=friend
username=101
secret=101
host=dynamic
context=users
[spnet] ;my VoIP Provide
type=peer
host = 87.227.149.115
fromdomain = 85.130.104.19
fromuser =102109
incominglimit = 3
canreinvite=yes
qualify=no
dtmfmode=RFC2833
port=5060
insecure=very
disallow=all
allow = all
;allow=g729
;allow=gsm
;allow=ulaw
;allow=alaw
;allow=speex
context = incoming
extensions.conf
[users]
exten=>100,1,Dial(SIP/100,20)
exten=>101,1,Dial(SIP/101,20)
exten => _X.,1,Dial(SIP/102109359${EXTEN}@87.227.149.115)
[incoming]
exten => 10210935924218592,1,Dial(SIP/100,60)
exten => 10210935924218592,n,Hangup()
[outgoing]
exten => _X.,1,Dial(SIP/102109359${EXTEN}@87.227.149.115)
;[users]
;include => office
;include => incoming
;include => outgoing
Output
Asterisk*CLI>
<— SIP read from UDP:192.168.10.4:51009 —>
INVITE sip:888775869@192.168.10.199:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.4:51009;branch=z9hG4bK-d8754z-4a11071da61f3b12-1—d8754z-;rport
Max-Forwards: 70
Contact: sip:100@192.168.10.4:51009;rinstance=8143804d6a081477
To: sip:888775869@192.168.10.199:5060
From: "100"sip:100@192.168.10.199:5060;tag=95177749
Call-ID: Njg5NjdlNzAwNTQyYzAxNTI2MGNlNDhlZjNhZWNlMzI.
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REGISTER, SUBSCRIBE, NOTIFY, REFER, INFO, MESSAGE
Content-Type: application/sdp
Supported: replaces
User-Agent: 3CXPhone 6.0.20943.0
Content-Length: 280
v=0
o=3cxVCE 101710455 400064415 IN IP4 192.168.10.4
s=3cxVCE Audio Call
c=IN IP4 192.168.10.4
t=0 0
m=audio 40008 RTP/AVP 3 8 0 100
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:100 telephone-event/8000
a=fmtp:100 0-15
a=ptime:20
a=sendrecv
<------------->
— (13 headers 13 lines) —
== Using SIP RTP CoS mark 5
Sending to 192.168.10.4 : 51009 (no NAT)
Using INVITE request as basis request - Njg5NjdlNzAwNTQyYzAxNTI2MGNlNDhlZjNhZWNlMzI.
Found peer ‘100’ for ‘100’ from 192.168.10.4:51009
<— Reliably Transmitting (no NAT) to 192.168.10.4:51009 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.10.4:51009;branch=z9hG4bK-d8754z-4a11071da61f3b12-1—d8754z-;received=192.168.10.4;rport=51009
From: "100"sip:100@192.168.10.199:5060;tag=95177749
To: sip:888775869@192.168.10.199:5060;tag=as4554d5c7
Call-ID: Njg5NjdlNzAwNTQyYzAxNTI2MGNlNDhlZjNhZWNlMzI.
CSeq: 1 INVITE
Server: Asterisk PBX 1.6.2.11
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="327340ec"
Content-Length: 0
<------------>
Scheduling destruction of SIP dialog ‘Njg5NjdlNzAwNTQyYzAxNTI2MGNlNDhlZjNhZWNlMzI.’ in 32000 ms (Method: INVITE)
<— SIP read from UDP:192.168.10.4:51009 —>
ACK sip:888775869@192.168.10.199:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.4:51009;branch=z9hG4bK-d8754z-4a11071da61f3b12-1—d8754z-;rport
Max-Forwards: 70
To: sip:888775869@192.168.10.199:5060;tag=as4554d5c7
From: "100"sip:100@192.168.10.199:5060;tag=95177749
Call-ID: Njg5NjdlNzAwNTQyYzAxNTI2MGNlNDhlZjNhZWNlMzI.
CSeq: 1 ACK
Content-Length: 0
<------------->
— (8 headers 0 lines) —
<— SIP read from UDP:192.168.10.4:51009 —>
INVITE sip:888775869@192.168.10.199:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.4:51009;branch=z9hG4bK-d8754z-3e065e0a6328b93f-1—d8754z-;rport
Max-Forwards: 70
Contact: sip:100@192.168.10.4:51009;rinstance=8143804d6a081477
To: sip:888775869@192.168.10.199:5060
From: "100"sip:100@192.168.10.199:5060;tag=95177749
Call-ID: Njg5NjdlNzAwNTQyYzAxNTI2MGNlNDhlZjNhZWNlMzI.
CSeq: 2 INVITE
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REGISTER, SUBSCRIBE, NOTIFY, REFER, INFO, MESSAGE
Content-Type: application/sdp
Supported: replaces
User-Agent: 3CXPhone 6.0.20943.0
Authorization: Digest username=“100”,realm=“asterisk”,nonce=“327340ec”,uri=“sip:888775869@192.168.10.199:5060”,response=“2400a91e1eafd17b7cde2e9acb0b4c6d”,algorithm=MD5
Content-Length: 280
v=0
o=3cxVCE 101710455 400064415 IN IP4 192.168.10.4
s=3cxVCE Audio Call
c=IN IP4 192.168.10.4
t=0 0
m=audio 40008 RTP/AVP 3 8 0 100
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:100 telephone-event/8000
a=fmtp:100 0-15
a=ptime:20
a=sendrecv
<------------->
— (14 headers 13 lines) —
Sending to 192.168.10.4 : 51009 (no NAT)
Using INVITE request as basis request - Njg5NjdlNzAwNTQyYzAxNTI2MGNlNDhlZjNhZWNlMzI.
Found peer ‘100’ for ‘100’ from 192.168.10.4:51009
Found RTP audio format 3
Found RTP audio format 8
Found RTP audio format 0
Found RTP audio format 100
Found audio description format GSM for ID 3
Found audio description format PCMA for ID 8
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 100
Capabilities: us - 0x10d (g723|ulaw|alaw|g729), peer - audio=0xe (gsm|ulaw|alaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0xc (ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 192.168.10.4:40008
Looking for 888775869 in users (domain 192.168.10.199)
list_route: hop: sip:100@192.168.10.4:51009;rinstance=8143804d6a081477
<— Transmitting (no NAT) to 192.168.10.4:51009 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.10.4:51009;branch=z9hG4bK-d8754z-3e065e0a6328b93f-1—d8754z-;received=192.168.10.4;rport=51009
From: "100"sip:100@192.168.10.199:5060;tag=95177749
To: sip:888775869@192.168.10.199:5060
Call-ID: Njg5NjdlNzAwNTQyYzAxNTI2MGNlNDhlZjNhZWNlMzI.
CSeq: 2 INVITE
Server: Asterisk PBX 1.6.2.11
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: sip:888775869@192.168.10.199
Content-Length: 0
<------------>
– Executing [888775869@users:1] Dial(“SIP/100-00000042”, “SIP/102109359888775869@87.227.149.115”) in new stack
== Using SIP RTP CoS mark 5
Audio is at 85.130.104.19 port 17966
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x2 (gsm) to SDP
Adding codec 0x8 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 87.227.149.115:5060:
INVITE sip:102109359888775869@87.227.149.115 SIP/2.0
Via: SIP/2.0/UDP 85.130.104.19:5060;branch=z9hG4bK1971da51;rport
Max-Forwards: 70
From: “100” sip:100@85.130.104.19;tag=as5f51b0e2
To: sip:102109359888775869@87.227.149.115
Contact: sip:100@85.130.104.19
Call-ID: 353689932fe158380f51f40a005efe63@85.130.104.19
CSeq: 102 INVITE
ser-Agent: Asterisk PBX 1.6.2.11
Date: Mon, 05 Dec 2011 11:16:00 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 286
v=0
o=root 1440014089 1440014089 IN IP4 85.130.104.19
s=Asterisk PBX 1.6.2.11
c=IN IP4 85.130.104.19
t=0 0
m=audio 17966 RTP/AVP 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
-- Called 102109359888775869@87.227.149.115
Retransmitting #1 (no NAT) to 87.227.149.115:5060:
INVITE sip:102109359888775869@87.227.149.115 SIP/2.0
Via: SIP/2.0/UDP 85.130.104.19:5060;branch=z9hG4bK1971da51;rport
Max-Forwards: 70
From: “100” sip:100@85.130.104.19;tag=as5f51b0e2
To: sip:102109359888775869@87.227.149.115
Contact: sip:100@85.130.104.19
Call-ID: 353689932fe158380f51f40a005efe63@85.130.104.19
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.6.2.11
Date: Mon, 05 Dec 2011 11:16:00 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 286
v=0
o=root 1440014089 1440014089 IN IP4 85.130.104.19
s=Asterisk PBX 1.6.2.11
c=IN IP4 85.130.104.19
t=0 0
m=audio 17966 RTP/AVP 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
<— SIP read from UDP:192.168.10.4:51009 —>
CANCEL sip:888775869@192.168.10.199:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.4:51009;branch=z9hG4bK-d8754z-3e065e0a6328b93f-1—d8754z-;rport
Max-Forwards: 70
To: sip:888775869@192.168.10.199:5060
From: "100"sip:100@192.168.10.199:5060;tag=95177749
Call-ID: Njg5NjdlNzAwNTQyYzAxNTI2MGNlNDhlZjNhZWNlMzI.
CSeq: 2 CANCEL
User-Agent: 3CXPhone 6.0.20943.0
Authorization: Digest username=“100”,realm=“asterisk”,nonce=“327340ec”,uri=“sip:888775869@192.168.10.199:5060”,response=“b154d8da2798ff765a2bb68c319d6d2f”,algorithm=MD5
Content-Length: 0
<------------->
— (10 headers 0 lines) —
Sending to 192.168.10.4 : 51009 (no NAT)
<— Reliably Transmitting (no NAT) to 192.168.10.4:51009 —>
SIP/2.0 487 Request Terminated
Via: SIP/2.0/UDP 192.168.10.4:51009;branch=z9hG4bK-d8754z-3e065e0a6328b93f-1—d8754z-;received=192.168.10.4;rport=51009
From: "100"sip:100@192.168.10.199:5060;tag=95177749
To: sip:888775869@192.168.10.199:5060;tag=as4f5e1aa9
Call-ID: Njg5NjdlNzAwNTQyYzAxNTI2MGNlNDhlZjNhZWNlMzI.
CSeq: 2 INVITE
Server: Asterisk PBX 1.6.2.11
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0
<------------>
<— Transmitting (no NAT) to 192.168.10.4:51009 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.10.4:51009;branch=z9hG4bK-d8754z-3e065e0a6328b93f-1—d8754z-;received=192.168.10.4;rport=51009
From: "100"sip:100@192.168.10.199:5060;tag=95177749
To: sip:888775869@192.168.10.199:5060;tag=as4f5e1aa9
Call-ID: Njg5NjdlNzAwNTQyYzAxNTI2MGNlNDhlZjNhZWNlMzI.
CSeq: 2 CANCEL
Server: Asterisk PBX 1.6.2.11
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0
<------------>
Scheduling destruction of SIP dialog ‘353689932fe158380f51f40a005efe63@85.130.104.19’ in 32000 ms (Method: INVITE)
== Spawn extension (users, 888775869, 1) exited non-zero on ‘SIP/100-00000042’
<— SIP read from UDP:192.168.10.4:51009 —>
ACK sip:888775869@192.168.10.199:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.10.4:51009;branch=z9hG4bK-d8754z-3e065e0a6328b93f-1—d8754z-;rport
Max-Forwards: 70
To: sip:888775869@192.168.10.199:5060;tag=as4f5e1aa9
From: "100"sip:100@192.168.10.199:5060;tag=95177749
Call-ID: Njg5NjdlNzAwNTQyYzAxNTI2MGNlNDhlZjNhZWNlMzI.
CSeq: 2 ACK
Content-Length: 0
<------------->
Thank you in advance.