No DID send from caller - how to redirect this to an extension?

Hello all !

I have the following problem : my service provider sends me calls though a sip account. I registered this sip account as a sip-trunk and calls come in. BUT the caller gets the message “The number you have dialed is not in service. Please check the number and try again.”. The thing is that the service provider does not indicate the called DID. Now, do you have any idea how I could redirect these calls to an extension (or even better to a language) ? Becaus “any did / any cid” doesn’t catch these calls.

Thanks a lot for any support !

Regards,
Fabianus

please post a trace. As the any/any rule should catch everything. it’s the last item to be processed in the inbound routes.

Hello fskrotzki !

Thanks a lot for your support.

hmmmm … :slight_smile: … it’s a shame, but how to I get a trace ?

Thanks for litle hint. Which is the file that contains such a trace ?

Regards,
Fabianus

get into the asterisk CLI.

to do that type asterisk -r
then type set debug 5
then make a call in and capture everything that scrolls by on the screen and post it.
you can type set debug 0 to stop the hundreds of lines from coming out after the capture.

Hi fskrotzki,

thanks a lot for your instructions !

Here is what you asked for. I tried to call 0049303406002537 from this asterisk server (outgoing call uses trunk SIP/Ovh_7548), this call is then send to me by my service provider via a sip account (SIP/000387816943) that I registered as a trunk and then I get the message “The number you have dialed is not in service. Please check the number and try again.”

Thanks for any suggestions - I do not understand anything from this trace … :slight_smile:

[[email protected] ~]# asterisk -r
Asterisk 1.4.22-rc5, Copyright © 1999 - 2008 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 1.4.22-rc5 currently running on asterisk (pid = 2614)
Verbosity is at least 3
Core debug is at least 5
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
== Manager ‘admin’ logged off from 127.0.0.1
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
== Manager ‘admin’ logged off from 127.0.0.1
– Executing [[email protected]:1] Macro(“SIP/2107-b7b033d0”, “user-callerid|SKIPTTL|”) in new stack
– Executing [[email protected]:1] NoOp(“SIP/2107-b7b033d0”, “user-callerid: device 2107”) in new stack
– Executing [[email protected]:2] Set(“SIP/2107-b7b033d0”, “AMPUSER=2107”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/2107-b7b033d0”, “0?report”) in new stack
– Executing [[email protected]:4] ExecIf(“SIP/2107-b7b033d0”, “1|Set|REALCALLERIDNUM=2107”) in new stack
– Executing [[email protected]:5] NoOp(“SIP/2107-b7b033d0”, “REALCALLERIDNUM is 2107”) in new stack
– Executing [[email protected]:6] Set(“SIP/2107-b7b033d0”, “AMPUSER=2107”) in new stack
– Executing [[email protected]:7] Set(“SIP/2107-b7b033d0”, “AMPUSERCIDNAME=Fabianus”) in new stack
– Executing [[email protected]:8] GotoIf(“SIP/2107-b7b033d0”, “0?report”) in new stack
– Executing [[email protected]:9] Set(“SIP/2107-b7b033d0”, “AMPUSERCID=2107”) in new stack
– Executing [[email protected]:10] Set(“SIP/2107-b7b033d0”, “CALLERID(all)=“Fabianus” <2107>”) in new stack
– Executing [[email protected]:11] Set(“SIP/2107-b7b033d0”, “REALCALLERIDNUM=2107”) in new stack
– Executing [[email protected]:12] ExecIf(“SIP/2107-b7b033d0”, “0|Set|CHANNEL(language)=”) in new stack
– Executing [[email protected]:13] NoOp(“SIP/2107-b7b033d0”, “TTL: ARG1: SKIPTTL”) in new stack
– Executing [[email protected]:14] GotoIf(“SIP/2107-b7b033d0”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,23)
– Executing [[email protected]:23] NoOp(“SIP/2107-b7b033d0”, “Using CallerID “Fabianus” <2107>”) in new stack
– Executing [[email protected]:2] Set(“SIP/2107-b7b033d0”, “_NODEST=”) in new stack
– Executing [[email protected]:3] Macro(“SIP/2107-b7b033d0”, “record-enable|2107|OUT|”) in new stack
– Executing [[email protected]:1] GotoIf(“SIP/2107-b7b033d0”, “0?2:4”) in new stack
– Goto (macro-record-enable,s,4)
– Executing [[email protected]:4] AGI(“SIP/2107-b7b033d0”, “recordingcheck|20081114-193152|1226687512.38296”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
recordingcheck|20081114-193152|1226687512.38296: Outbound recording not enabled
– AGI Script recordingcheck completed, returning 0
– Executing [[email protected]:5] NoOp(“SIP/2107-b7b033d0”, “No recording needed”) in new stack
– Executing [[email protected]:4] Macro(“SIP/2107-b7b033d0”, “dialout-trunk|4|0049303406002537||”) in new stack
– Executing [[email protected]:1] Set(“SIP/2107-b7b033d0”, “DIAL_TRUNK=4”) in new stack
– Executing [[email protected]:2] ExecIf(“SIP/2107-b7b033d0”, “0|Authenticate|”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/2107-b7b033d0”, “0?disabletrunk|1”) in new stack
– Executing [[email protected]:4] Set(“SIP/2107-b7b033d0”, “DIAL_NUMBER=0049303406002537”) in new stack
– Executing [[email protected]:5] Set(“SIP/2107-b7b033d0”, “DIAL_TRUNK_OPTIONS=trw”) in new stack
– Executing [[email protected]:6] Set(“SIP/2107-b7b033d0”, “GROUP()=OUT_4”) in new stack
– Executing [[email protected]:7] GotoIf(“SIP/2107-b7b033d0”, “1?nomax”) in new stack
– Goto (macro-dialout-trunk,s,9)
– Executing [[email protected]:9] GotoIf(“SIP/2107-b7b033d0”, “0?skipoutcid”) in new stack
– Executing [[email protected]:10] Set(“SIP/2107-b7b033d0”, “DIAL_TRUNK_OPTIONS=w”) in new stack
– Executing [[email protected]:11] Macro(“SIP/2107-b7b033d0”, “outbound-callerid|4”) in new stack
– Executing [[email protected]:1] ExecIf(“SIP/2107-b7b033d0”, “0|SetCallerPres|”) in new stack
– Executing [[email protected]:2] GotoIf(“SIP/2107-b7b033d0”, “1?start”) in new stack
– Goto (macro-outbound-callerid,s,4)
– Executing [[email protected]:4] NoOp(“SIP/2107-b7b033d0”, “REALCALLERIDNUM is 2107”) in new stack
– Executing [[email protected]:5] GotoIf(“SIP/2107-b7b033d0”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,10)
– Executing [[email protected]:10] Set(“SIP/2107-b7b033d0”, “USEROUTCID=”) in new stack
– Executing [[email protected]:11] Set(“SIP/2107-b7b033d0”, “EMERGENCYCID=”) in new stack
– Executing [[email protected]:12] Set(“SIP/2107-b7b033d0”, “TRUNKOUTCID=”) in new stack
– Executing [[email protected]:13] GotoIf(“SIP/2107-b7b033d0”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,17)
– Executing [[email protected]:17] GotoIf(“SIP/2107-b7b033d0”, “1?usercid”) in new stack
– Goto (macro-outbound-callerid,s,19)
– Executing [[email protected]:19] GotoIf(“SIP/2107-b7b033d0”, “1?report”) in new stack
– Goto (macro-outbound-callerid,s,23)
– Executing [[email protected]:23] NoOp(“SIP/2107-b7b033d0”, “CallerID set to “Fabianus” <2107>”) in new stack
– Executing [[email protected]:12] AGI(“SIP/2107-b7b033d0”, “fixlocalprefix”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
– AGI Script fixlocalprefix completed, returning 0
– Executing [[email protected]:13] Set(“SIP/2107-b7b033d0”, “OUTNUM=0049303406002537”) in new stack
– Executing [[email protected]:14] Set(“SIP/2107-b7b033d0”, “custom=SIP/Ovh_7548”) in new stack
– Executing [[email protected]:15] GotoIf(“SIP/2107-b7b033d0”, “1?gocall”) in new stack
– Goto (macro-dialout-trunk,s,17)
– Executing [[email protected]:17] Macro(“SIP/2107-b7b033d0”, “dialout-trunk-predial-hook|”) in new stack
– Executing [[email protected]:18] GotoIf(“SIP/2107-b7b033d0”, “0?bypass|1”) in new stack
– Executing [[email protected]:19] GotoIf(“SIP/2107-b7b033d0”, “0?customtrunk”) in new stack
– Executing [[email protected]:20] Dial(“SIP/2107-b7b033d0”, “SIP/Ovh_7548/0049303406002537|300|w”) in new stack
– Called Ovh_7548/0049303406002537
Really destroying SIP dialog ‘[email protected]’ Method: OPTIONS
Really destroying SIP dialog ‘[email protected]’ Method: OPTIONS
Really destroying SIP dialog ‘[email protected]’ Method: OPTIONS
Really destroying SIP dialog ‘[email protected]’ Method: OPTIONS
Really destroying SIP dialog ‘[email protected]’ Method: OPTIONS
Really destroying SIP dialog ‘[email protected]’ Method: OPTIONS
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
== Manager ‘admin’ logged off from 127.0.0.1
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
== Manager ‘admin’ logged off from 127.0.0.1
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
== Manager ‘admin’ logged off from 127.0.0.1
Really destroying SIP dialog ‘[email protected]’ Method: OPTIONS
– Executing [[email protected]:1] NoOp(“SIP/000387816943-b7b0df18”, “Received incoming SIP connection from unknown peer to 0303406002537”) in new stack
– Executing [[email protected]:2] Set(“SIP/000387816943-b7b0df18”, “DID=0303406002537”) in new stack
– Executing [[email protected]:3] Goto(“SIP/000387816943-b7b0df18”, “s|1”) in new stack
– Goto (from-sip-external,s,1)
– Executing [[email protected]:1] GotoIf(“SIP/000387816943-b7b0df18”, “0?from-trunk|0303406002537|1”) in new stack
– Executing [[email protected]:2] Set(“SIP/000387816943-b7b0df18”, “TIMEOUT(absolute)=15”) in new stack
– Channel will hangup at 2008-11-14 18:32:15 UTC.
– Executing [[email protected]:3] Answer(“SIP/000387816943-b7b0df18”, “”) in new stack
– Executing [[email protected]:4] Wait(“SIP/000387816943-b7b0df18”, “2”) in new stack
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
== Manager ‘admin’ logged off from 127.0.0.1
– SIP/Ovh_7548-082d1138 answered SIP/2107-b7b033d0
Really destroying SIP dialog ‘NjBhMTQ4NGY3ZGIwMTNhMGZmYWU1MmNjNDJlMGNhNTU.’ Method: REGISTER
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
== Manager ‘admin’ logged off from 127.0.0.1
– Executing [[email protected]:5] Playback(“SIP/000387816943-b7b0df18”, “ss-noservice”) in new stack
– <SIP/000387816943-b7b0df18> Playing ‘ss-noservice’ (language ‘en’)
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
== Manager ‘admin’ logged off from 127.0.0.1
== Spawn extension (macro-dial, s, 7) exited non-zero on ‘Local/[email protected],2’
– Executing [[email protected]:1] Macro(“Local/[email protected],2”, “hangupcall”) in new stack
– Executing [[email protected]:1] ResetCDR(“Local/[email protected],2”, “w”) in new stack
– Executing [[email protected]:2] NoCDR(“Local/[email protected],2”, “”) in new stack
– Executing [[email protected]:3] GotoIf(“Local/[email protected],2”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,6)
– Executing [[email protected]:6] GotoIf(“Local/[email protected],2”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [[email protected]:9] GotoIf(“Local/[email protected],2”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,11)
– Executing [[email protected]:11] Hangup(“Local/[email protected],2”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 11) exited non-zero on ‘Local/[email protected],2’
== Spawn extension (ext-queues, 21112, 10) exited non-zero on 'SIP/10099-08388688’
Really destroying SIP dialog ‘[email protected]’ Method: BYE
Really destroying SIP dialog ‘[email protected]’ Method: ACK
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
== Manager ‘admin’ logged off from 127.0.0.1
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
== Manager ‘admin’ logged off from 127.0.0.1
– Executing [[email protected]:6] PlayTones(“SIP/000387816943-b7b0df18”, “congestion”) in new stack
– Executing [[email protected]:7] Congestion(“SIP/000387816943-b7b0df18”, “5”) in new stack
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_additional.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 127.0.0.1
== Manager ‘admin’ logged off from 127.0.0.1
asterisk*CLI> exit
[[email protected] ~]#

ok I see that the call goes out and does come back in with it’s DID set to 0303406002537 by these two lines:

– Executing [[email protected]:1] NoOp(“SIP/000387816943-b7b0df18”, “Received incoming SIP connection from unknown peer to 0303406002537”) in new stack
– Executing [[email protected]:2] Set(“SIP/000387816943-b7b0df18”, “DID=0303406002537”) in new stack

So do you have a DID coming it. Now either create a inbound route for any CID (leave the caller ID number field blank) and put 0303406002537 as the DID and then down below set the extensions to the extension you want it to arrive at.
OR
go into that extension and put that DID as the DID for the extension. The issue you might have is if you have more then one way for a call to arrive and each has a different DID format coming in. then you put one valid DID in the DID field (I’d do shortest one but that is me) for the extension and you’ll have to do the rest as inbound routes pointing to the extension.

Now for the any/any rule you need to be sure that the CID and DID fields are blank and point to the destination extension you want them to arrive at. To be sure you have it right once it is created it should be listed on the right as “any DID / any CID”.

The only other reason that I can think of to get no service is if the extension you are pointing at has never registered and you don’t have a voice mail account setup for that extension.

THANKS a lot for your detailed and comprehensible explenation !

I checked again everything, and I am 100% about this :

  1. I have a any DID / any CID incoming route that points to a registered extension.
  2. I have an incoming route that has as DID this : 303406002537 and it points to the same registered extension.

I really don’t understand why this incoming call is not routed as it should.

Do you have any other idea what else I could check for?

Thanks,
Fabianus

ok the inbound routes do a string based compare. So 0303406002537 is not equal to 303406002537.

same problem :frowning:

I also deleted this specific inbound route so that the any DID / any CID route could catch the call - same resulte.

I hope you have an other suggestion !

Regards,
Fabianus

which version of FreePBX are you using currently? (should have asked that earlier)…

freepbx_version=2.4.1.2

I just discovered the answer (thanks to Stinger81 : http://www.elastix.org/index.php?option=com_fireboard&Itemid=55&func=view&catid=32&id=13090#13090 )

I had to “Allow Anonymous Inbound SIP Calls” !

Thanks a lot for your kind support - I learned a lot !

Regards,
Fabianus