Engin DID congif

Hi I cannot get DID to work with the australian based provider Engin

My Trunk confiig is as follows:
Outbound
username=0312345678
type=peer
secret=Password
insecure=invite,port
host=trunk.engin.com.au
fromuser=0312345678
fromdomain=voice.mibroadband.com.au
dtmfmode=rfc2833
canreinvite=yes
allow=ulaw&alaw&g729
qualify=no
auth=md5
reinvite=yes
disallow=all
context=from-pstn-toheader

Inbound
User Context 0312345678
User Details Context=from-pstn-toheader
register string= 0312345678:[email protected]

My inbound route is configured with the one of the numbers available in the range as the DID number and the extension configured with my extension.

I get “the number you have dialed is not in service”

Any Tips, I can see the to field in the sip message as

To: "Michael Smith"sip:[email protected];tag=as203dabec

Logs of the failure to connect are absolutely critical for us to help you on this. For some reason (the logs will tell), your connection to the server is not getting registered.

I think you misunderstood my issue. My server is registering fine with my provider, I can make and receive calls just fine. The problems come when I try to define an inbound route that aims to route the call to correct extension based on the DID number. I can see asterisk playing the noservice wav file when I call in when ihave a inbound route configured with a DID defined.

Last login: Tue Oct 31 15:06:10 2017 from 192.168.70.3


| | __ ___ | _ | __ ) / /
| |
| '
/ _ / _ \ |
) | _ \ /
| || | | __/ __/ __/| |) /
|
| |
| _|_|| |__//_\

NOTICE! You have 9 notifications! Please log into the UI to see them!

Current Network Configuration
±----------±------------------±-------------------------+
| Interface | MAC Address | IP Addresses |
±----------±------------------±-------------------------+
| eth0 | 00:0C:29:34:62:C0 | 192.168.50.1 |
| | | fe80::20c:29ff:fe34:62c0 |
±----------±------------------±-------------------------+

Please note most tasks should be handled through the GUI.
You can access the GUI by typing one of the above IPs in to your web browser.
For support please visit:
http://www.freepbx.org/support-and-professional-services

[[email protected] ~]# asterisk -rvvv
Asterisk 13.12.1, Copyright © 1999 - 2014, Digium, Inc. and others.
Created by Mark Spencer [email protected]
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

Connected to Asterisk 13.12.1 currently running on MBICPBX01 (pid = 2016)
MBICPBX01*CLI> sip set debug on
SIP Debugging re-enabled

<— SIP read from UDP:203.161.160.71:5060 —>
INVITE sip:[email protected]:5160 SIP/2.0
Via: SIP/2.0/UDP 203.161.160.71:5060;branch=z9hG4bKn4f9b51040lk43grmpu0.1
From: "Anonymous"sip:[email protected];tag=SDrketd01-463339434-1509422998105-
To: "Joe Bloggs"sip:[email protected]
Call-ID: SDrketd01-6471232ddad54f73b5f6107ab02834cc-jm6gpa0
CSeq: 944738605 INVITE
Contact: sip:[email protected]:5060;transport=udp
P-Called-Party-ID: sip:[email protected]
Supported: 100rel,timer
Allow: ACK,BYE,CANCEL,INFO,INVITE,OPTIONS,PRACK,REFER,NOTIFY,UPDATE
Recv-Info: x-broadworks-client-session-info
Accept: application/media_control+xml,application/sdp,multipart/mixed
Min-SE: 60
Session-Expires: 1800;refresher=uas
Max-Forwards: 29
Content-Type: application/sdp
Content-Length: 355

v=0
o=BroadWorks 220378594 1 IN IP4 203.161.160.71
s=-
c=IN IP4 203.161.160.71
t=0 0
m=audio 23746 RTP/AVP 8 18 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=yes
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=silenceSupp:off - - - -
a=ptime:20
a=maxptime:30
a=sqn:0
a=cdsc: 1 image udptl t38
<------------->
— (17 headers 17 lines) —
Sending to 203.161.160.71:5060 (NAT)
Sending to 203.161.160.71:5060 (NAT)
Using INVITE request as basis request - SDrketd01-6471232ddad54f73b5f6107ab02834cc-jm6gpa0
Found peer ‘Engine’ for ‘anonymous’ from 203.161.160.71:5060
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
Found RTP audio format 8
Found RTP audio format 18
Found RTP audio format 0
Found RTP audio format 101
Found audio description format PCMA for ID 8
Found audio description format G729 for ID 18
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw|alaw|gsm|g726|g729), peer - audio=(ulaw|alaw|g729)/video=(nothing)/text=(nothing), combined - (ulaw|alaw|g729)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 203.161.160.71:23746
Looking for s in from-trunk-sip-Engine (domain 110.XXX.XX.XX)
sip_route_dump: route/path hop: sip:[email protected]:5060;transport=udp

<— Transmitting (NAT) to 203.161.160.71:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 203.161.160.71:5060;branch=z9hG4bKn4f9b51040lk43grmpu0.1;received=203.161.160.71;rport=5060
From: "Anonymous"sip:[email protected];tag=SDrketd01-463339434-1509422998105-
To: "Joe Bloggs"sip:[email protected]
Call-ID: SDrketd01-6471232ddad54f73b5f6107ab02834cc-jm6gpa0
CSeq: 944738605 INVITE
Server: FPBX-13.0.192.16(13.12.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: sip:[email protected]:5160
Content-Length: 0

<------------>
– Executing [[email protected]:1] Set(“SIP/Engine-00000005”, “GROUP()=OUT_2”) in new stack
– Executing [[email protected]:2] Goto(“SIP/Engine-00000005”, “from-trunk,s,1”) in new stack
– Goto (from-trunk,s,1)
– Executing [[email protected]:1] NoOp(“SIP/Engine-00000005”, “No DID or CID Match”) in new stack
– Executing [[email protected]:2] Answer(“SIP/Engine-00000005”, “”) in new stack
Audio is at 10008
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec g729 to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<— Reliably Transmitting (NAT) to 203.161.160.71:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 203.161.160.71:5060;branch=z9hG4bKn4f9b51040lk43grmpu0.1;received=203.161.160.71;rport=5060
From: "Anonymous"sip:[email protected];tag=SDrketd01-463339434-1509422998105-
To: "Joe Bloggs"sip:[email protected];tag=as538c59fe
Call-ID: SDrketd01-6471232ddad54f73b5f6107ab02834cc-jm6gpa0
CSeq: 944738605 INVITE
Server: FPBX-13.0.192.16(13.12.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: sip:[email protected]:5160
Content-Type: application/sdp
Require: timer
Content-Length: 325

v=0
o=root 1251476768 1251476768 IN IP4 110.XXX.XX.XX
s=Asterisk PBX 13.12.1
c=IN IP4 110.XXX.XX.XX
t=0 0
m=audio 10008 RTP/AVP 0 8 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<------------>

<— SIP read from UDP:203.161.160.71:5060 —>
ACK sip:[email protected]:5160 SIP/2.0
Via: SIP/2.0/UDP 203.161.160.71:5060;branch=z9hG4bKruao2l009g3eiuvl0vj0.1
From: "Anonymous"sip:[email protected];tag=SDrketd01-463339434-1509422998105-
To: "Joe Bloggs"sip:[email protected];tag=as538c59fe
Call-ID: SDrketd01-6471232ddad54f73b5f6107ab02834cc-jm6gpa0
CSeq: 944738605 ACK
Contact: sip:[email protected]:5060;transport=udp
Max-Forwards: 29
Content-Length: 0

<------------->
— (9 headers 0 lines) —

<— SIP read from UDP:203.161.160.71:5060 —>
INVITE sip:[email protected]:5160 SIP/2.0
Via: SIP/2.0/UDP 203.161.160.71:5060;branch=z9hG4bKruao2l009g3eiuvl0vj0cbopj29n0.1
From: "Anonymous"sip:[email protected];tag=SDrketd01-463339434-1509422998105-
To: "Joe Bloggs"sip:[email protected];tag=as538c59fe
Call-ID: SDrketd01-6471232ddad54f73b5f6107ab02834cc-jm6gpa0
CSeq: 944738606 INVITE
Contact: sip:[email protected]:5060;transport=udp
Remote-Party-ID: "Anonymous"sip:[email protected];screen=yes;party=called;privacy=full;id-type=subscriber
Allow: ACK,BYE,CANCEL,INFO,INVITE,OPTIONS,PRACK,REFER,NOTIFY,UPDATE
Supported: timer
Min-SE: 60
Session-Expires: 1800;refresher=uas
Accept: application/media_control+xml,application/sdp,multipart/mixed
Max-Forwards: 29
Content-Type: application/sdp
Content-Length: 355

v=0
o=BroadWorks 220378594 2 IN IP4 203.161.160.71
s=-
c=IN IP4 203.161.160.71
t=0 0
m=audio 23746 RTP/AVP 0 8 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=silenceSupp:off - - - -
a=ptime:20
a=maxptime:150
a=sqn:0
a=cdsc: 1 image udptl t38
<------------->
— (16 headers 17 lines) —
Sending to 203.161.160.71:5060 (NAT)
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 18
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format G729 for ID 18
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw|alaw|gsm|g726|g729), peer - audio=(ulaw|alaw|g729)/video=(nothing)/text=(nothing), combined - (ulaw|alaw|g729)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 203.161.160.71:23746

<— Transmitting (NAT) to 203.161.160.71:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 203.161.160.71:5060;branch=z9hG4bKruao2l009g3eiuvl0vj0cbopj29n0.1;received=203.161.160.71;rport=5060
From: "Anonymous"sip:[email protected];tag=SDrketd01-463339434-1509422998105-
To: "Joe Bloggs"sip:[email protected];tag=as538c59fe
Call-ID: SDrketd01-6471232ddad54f73b5f6107ab02834cc-jm6gpa0
CSeq: 944738606 INVITE
Server: FPBX-13.0.192.16(13.12.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: sip:[email protected]:5160
Content-Length: 0

<------------>
Audio is at 10008
Adding codec ulaw to SDP
Adding codec alaw to SDP
Adding codec g729 to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<— Reliably Transmitting (NAT) to 203.161.160.71:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 203.161.160.71:5060;branch=z9hG4bKruao2l009g3eiuvl0vj0cbopj29n0.1;received=203.161.160.71;rport=5060
From: "Anonymous"sip:[email protected];tag=SDrketd01-463339434-1509422998105-
To: "Joe Bloggs"sip:[email protected];tag=as538c59fe
Call-ID: SDrketd01-6471232ddad54f73b5f6107ab02834cc-jm6gpa0
CSeq: 944738606 INVITE
Server: FPBX-13.0.192.16(13.12.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: sip:[email protected]:5160
Content-Type: application/sdp
Require: timer
Content-Length: 325

v=0
o=root 1251476768 1251476769 IN IP4 110.XXX.XX.XX
s=Asterisk PBX 13.12.1
c=IN IP4 110.XXX.XX.XX
t=0 0
m=audio 10008 RTP/AVP 0 8 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

<------------>

<— SIP read from UDP:203.161.160.71:5060 —>
ACK sip:[email protected]:5160 SIP/2.0
Via: SIP/2.0/UDP 203.161.160.71:5060;branch=z9hG4bKin9b3k30a0btiqecfd00.1
From: "Anonymous"sip:[email protected];tag=SDrketd01-463339434-1509422998105-
To: "Joe Bloggs"sip:[email protected];tag=as538c59fe
Call-ID: SDrketd01-6471232ddad54f73b5f6107ab02834cc-jm6gpa0
CSeq: 944738606 ACK
Contact: sip:[email protected]:5060;transport=udp
Max-Forwards: 29
Content-Length: 0

<------------->
— (9 headers 0 lines) —
[2017-10-31 15:09:58] NOTICE[2250]: chan_sip.c:15603 sip_reregister: – Re-registration for [email protected]
REGISTER 12 headers, 0 lines
Reliably Transmitting (NAT) to 203.161.160.71:5060:
REGISTER sip:trunk.engin.com.au SIP/2.0
Via: SIP/2.0/UDP 110.XXX.XX.XX:5160;branch=z9hG4bK78528585;rport
Max-Forwards: 70
From: sip:[email protected];tag=as2268ef53
To: sip:[email protected]
Call-ID: [email protected][::1]
CSeq: 1109 REGISTER
Supported: replaces, timer
User-Agent: FPBX-13.0.192.16(13.12.1)
Authorization: Digest username=“0372349870”, realm=“voice.mibroadband.com.au”, algorithm=MD5, uri=“sip:trunk.engin.com.au”, nonce=“BroadWorksXj9f2bkpwTr3vfv8BW”, response=“25161d2540407e7960e589a3b7b05696”, qop=auth, cnonce=“69add447”, nc=0000002c
Expires: 120
Contact: sip:[email protected]:5160
Content-Length: 0


<— SIP read from UDP:203.161.160.71:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 110.XXX.XX.XX:5160;received=58.96.75.50;branch=z9hG4bK78528585;rport=5160
From: sip:[email protected];tag=as2268ef53
To: sip:[email protected];tag=aprqum37goai33c43-u1vpbm00001a5
Call-ID: [email protected][::1]
CSeq: 1109 REGISTER
Contact: sip:[email protected]:5160;expires=60

<------------->
— (7 headers 0 lines) —
[2017-10-31 15:09:58] NOTICE[2250]: chan_sip.c:24396 handle_response_register: Outbound Registration: Expiry for trunk.engin.com.au is 60 sec (Scheduling reregistration in 45 s)
Really destroying SIP dialog ‘[email protected][::1]’ Method: REGISTER
– Executing [[email protected]:3] Log(“SIP/Engine-00000005”, “WARNING,Friendly Scanner from 203.161.160.71”) in new stack
[2017-10-31 15:09:58] WARNING[16409][C-00000006]: Ext. s:3 @ from-trunk: Friendly Scanner from 203.161.160.71
– Executing [[email protected]:4] Wait(“SIP/Engine-00000005”, “2”) in new stack
– Executing [[email protected]:5] Playback(“SIP/Engine-00000005”, “ss-noservice”) in new stack
– <SIP/Engine-00000005> Playing ‘ss-noservice.ulaw’ (language ‘en_AU’)

<— SIP read from UDP:203.161.160.71:5060 —>
BYE sip:[email protected]:5160 SIP/2.0
Via: SIP/2.0/UDP 203.161.160.71:5060;branch=z9hG4bKruao2l009g3eiuvl0vj0cdopj2pn0.1
From: "Anonymous"sip:[email protected];tag=SDrketd01-463339434-1509422998105-
To: "Joe Bloggs"sip:[email protected];tag=as538c59fe
Call-ID: SDrketd01-6471232ddad54f73b5f6107ab02834cc-jm6gpa0
CSeq: 944738607 BYE
Max-Forwards: 29
Content-Length: 0

<------------->
— (8 headers 0 lines) —
Sending to 203.161.160.71:5060 (NAT)
Scheduling destruction of SIP dialog ‘SDrketd01-6471232ddad54f73b5f6107ab02834cc-jm6gpa0’ in 32000 ms (Method: BYE)

<— Transmitting (NAT) to 203.161.160.71:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 203.161.160.71:5060;branch=z9hG4bKruao2l009g3eiuvl0vj0cdopj2pn0.1;received=203.161.160.71;rport=5060
From: "Anonymous"sip:[email protected];tag=SDrketd01-463339434-1509422998105-
To: "Joe Bloggs"sip:[email protected];tag=as538c59fe
Call-ID: SDrketd01-6471232ddad54f73b5f6107ab02834cc-jm6gpa0
CSeq: 944738607 BYE
Server: FPBX-13.0.192.16(13.12.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0

<------------>
– Executing [[email protected]:1] Macro(“SIP/Engine-00000005”, “hangupcall,”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/Engine-00000005”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,3)
– Executing [[email protected]:3] ExecIf(“SIP/Engine-00000005”, “0?Set(CDR(recordingfile)=)”) in new stack
– Executing [[email protected]:4] Hangup(“SIP/Engine-00000005”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on ‘SIP/Engine-00000005’ in macro ‘hangupcall’
== Spawn extension (from-trunk, h, 1) exited non-zero on 'SIP/Engine-00000005’
MBICPBX01*CLI>

So it appears that the DID is contained in the To header and not in the INVITE:

To: "Joe Bloggs"sip:[email protected]

So the conventional way to fix is to ensure your trunk(s) use the built in context from-pstn-toheader. From the config you posted above, it looks like they are set that way, but when the call arrives its in a different context called from-trunk-sip-Engine:

-- Executing [[email protected]:1] Set("SIP/Engine-00000005", "GROUP()=OUT_2") in new stack

Not sure what’s going on, there is a misconfig somewhere thats preventing the context from being applied properly to the inbound INVITE.

1 Like

Ive fixed it,
I had another engin trunk configured with different credentials and also different context name. It seems that the second trunk was using the context set in the other trunk. Once i deleted the other trunk it started working fine.

Thanks for spotting that. As soon as i opened sip_additional.conf, i could see what was possibly going wrong.

1 Like