Inbound call routing

Here is my current scenario…
Inbound route 1 (DID ######9259) >> extension 1000
Inbound route 2 (DID ######9260) >> extension 1001

My expected result would be…
Call to ######9259 rings extension 1000
Call to ######9260 rings extension 1001

Actual result…
Call to ######9259 rings extension 1000
Call to ######9260 rings extension 1000

I’m not sure where I’ve gone wrong here, any help would be greatly appreciated.

I have not tried this but I believe you should be using X not # as per wiki below.

http://wiki.freepbx.org/display/F2/Inbound+Routes

good luck.

What you have done wrong is not post ANY useful information about your system and what you did do, right or wrong, did you read the wiki yet?

max123 - I apologize, the #'s were just used in my post as placeholders.
dicko - below are more details of my system. I have been reading the wiki, but am very new to this. I believe I am set up correctly, but the results say otherwise…

PBX Firmware: 5.211.65-6
PBX Service Pack: 1.0.0.0

Inbound route settings:
Route 1 Description x9259
DID Number: 8143269259
Destination: Extensions <1000>
Route 2 Description x9260
DID Number: 8143269260
Destination: Extensions <1001>
Extension settings:
Ext#1000 Display Name: Eric
Assigned DID/CID: 8143269259
Ext#1001 Display Name: Shel
Assigned DID/CID: 8143269260

If there is more info that you are looking for, please let me know.
Thanks.

You should post a clip of /var/log/asterisk/full of an inbound call to your 9260 number, also how your trunk is setup.

here is what i believe to be the pertinent portion of the log…
[2014-02-26 11:47:58] VERBOSE[1753][C-00000017] netsock2.c: == Using SIP RTP TOS bits 184
[2014-02-26 11:47:58] VERBOSE[1753][C-00000017] netsock2.c: == Using SIP RTP CoS mark 5
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:1] ExecIf(“SIP/aisling-0000002e”, “1?Set(__FROM_DID=s)”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:2] Gosub(“SIP/aisling-0000002e”, “app-blacklist-check,s,1()”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:1] GotoIf(“SIP/aisling-0000002e”, “0?blacklisted”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:2] Set(“SIP/aisling-0000002e”, “CALLED_BLACKLIST=1”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:3] Return(“SIP/aisling-0000002e”, “”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:3] Set(“SIP/aisling-0000002e”, “CDR(did)=s”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:4] ExecIf(“SIP/aisling-0000002e”, “0 ?Set(CALLERID(name)=5704391924)”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:5] Set(“SIP/aisling-0000002e”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:6] Set(“SIP/aisling-0000002e”, “CALLERPRES()=allowed_not_screened”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:7] Goto(“SIP/aisling-0000002e”, “from-did-direct,1000,1”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Goto (from-did-direct,1000,1)
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:1] Set(“SIP/aisling-0000002e”, “__RINGTIMER=15”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:2] Macro(“SIP/aisling-0000002e”, “exten-vm,1000,1000,0,0,0”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:1] Macro(“SIP/aisling-0000002e”, “user-callerid,”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:1] Set(“SIP/aisling-0000002e”, “TOUCH_MONITOR=1393433278.46”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:2] Set(“SIP/aisling-0000002e”, “AMPUSER=5704391924”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:3] GotoIf(“SIP/aisling-0000002e”, “0?report”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:4] ExecIf(“SIP/aisling-0000002e”, “1?Set(REALCALLERIDNUM=5704391924)”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:5] Set(“SIP/aisling-0000002e”, “AMPUSER=”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:6] Set(“SIP/aisling-0000002e”, “AMPUSERCIDNAME=”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:7] GotoIf(“SIP/aisling-0000002e”, “1?report”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Goto (macro-user-callerid,s,15)
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:15] GotoIf(“SIP/aisling-0000002e”, “0?continue”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:16] Set(“SIP/aisling-0000002e”, “__TTL=64”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:17] GotoIf(“SIP/aisling-0000002e”, “1?continue”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Goto (macro-user-callerid,s,28)
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:28] Set(“SIP/aisling-0000002e”, “CALLERID(number)=5704391924”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:29] Set(“SIP/aisling-0000002e”, “CALLERID(name)=5704391924”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]-callerid:30] Set(“SIP/aisling-0000002e”, “CDR(cnum)=5704391924”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:31] Set(“SIP/aisling-0000002e”, “CDR(cnam)=5704391924”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:32] Set(“SIP/aisling-0000002e”, “CHANNEL(language)=en”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:2] Set(“SIP/aisling-0000002e”, “RingGroupMethod=none”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:3] Set(“SIP/aisling-0000002e”, “__EXTTOCALL=1000”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:4] Set(“SIP/aisling-0000002e”, “__PICKUPMARK=1000”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:5] Set(“SIP/aisling-0000002e”, “RT=15”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:6] ExecIf(“SIP/aisling-0000002e”, “0?Macro(vm,1000,DIRECTDIAL,)”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:7] ExecIf(“SIP/aisling-0000002e”, “0?MacroExit()”) in new stack
[2014-02-26 11:47:58] VERBOSE[6444][C-00000017] pbx.c: – Executing [[email protected]:8] Gosub(“SIP/aisling-0000002e”, “sub-record-check,s,1(exten,1000,)”) in new stack

and here is my trunk config…
GENERAL SETTINGS:
Trunk Name: 168049
Outbound CallerID: 8143269259
CID Options: Allow Any CID
OUTGOING SETTINGS:
Trunk Name: aisling
Peer Details:
canreinvite=nonat
nat=yes
context=from-trunk
host=107.6.67.238
secret=Qu3brach0
type=peer
username=168049
disallow=all
allow=ulaw
fromuser=168049
trustrpid=yes
sendrpid=yes
insecure=invite
qualify=yes

Thank you.

As a guess, It looks like your provider is not using “conventional” SIP headers to route your inbound calls, try using the

from-pstn-toheader

context instead of

from-trunk

What is your registration string in the trunks?
I suspect you’re not passing to the registrar what is the DDI you want to be presented for calls on that registration.

Some providers allow you to define it using this format in the “Register String” parameter of the trunk:
:@<sip_server>/

Try that.

N.B. Obfuscate at least the passwords when you post here (that’s the “secret” parameter in the trunk).

Note to self: PREVIEW before posting.
The string format is <username><password>@<sip_server>/<DDI>.

if I use this, all incoming calls ring as busy.

It’s been a long day, fortunately I caught myself after the last post and changed my password…

my registration string is 168049:**********@newyork4.voip.ms:5060

Thanks.

OK.

  1. The :5060 is not necessary, it’s the standard SIP port.
    2> change it to 168049:**********@newyork4.voip.ms/THE_NUMBER_YOU_WANT

Please bear with me as I am just learning. I am confused as to how that change to the registration string will affect inbound routing? Do I need a SIP trunk for each number? Outbound works fine, but calls to both numbers are routed to the same extension.

Thank you.

There are a couple of lines before the context from-trunk,1 that will identify what the perceived DID number was, , I suggest you turn on SIP debugging to your providers ip address and post another call.

Passing that DDI in the registration you’re instructing the registrar to use it when they pass you calls made to that account.

Not all providers accept it, some disregard it and use the DDI that is assigned on the username on their servers.

You MUST have different registration credentials (username + password) for each one of your numbers.
You MUST have one trunk for each registration, even if it’s to the same provider.

Some providers allow you to “pile on” DDIs on the same registration, but that is unsuitable for Asterisk, and generally bad for serious VoIP where you want to send inbound calls to the right destination and to have accountability for outbound calls.

The PEER section in the trunk is how you authenticate to the provider for outbound calls, the USER section (rarely used, usually it’s empty) is how the provider must authenticate itself to you when passing inbound calls, and the Register String section says to the registrar you’re alive, where you are, and other things.

Welcome to the fascinating mess that is SIP and VoIP in general.

Suggested reading: http://voip-info.org.

so, if I use this string;
168049:*********@newyork4.voip.ms/8143269259
all calls go to extension 1000,
if I use this string;
168049:*********@newyork4.voip.ms/8143269260
all calls go to extension 1001.

I need 9259 to go to ext. 1000, and 9260 to go to ext. 1001.

Love this system so far, but this piece has me stumped…

OK, on voip.ms you can create sub-accounts. Create two sub-accounts and assign one DDI each.
DO NOT use your main account credentials in the trunks, but the sub-accounts credentials.
That should allow you to have one registration for each DDI, and solve your inbound problem.

See here: http://wiki.voip.ms/article/Features#Sub_Accounts

That did the trick, many thanks.

Great to know, and thanks for coming back to validate my guidance.

Welcome to the thunderdome.