Inbound call route based on number dialed. Is it possible?

Hello,

I have 4 different phone numbers forwarding to one softphone account with vonage…

I would like to have a inbound call rule that when someone dials this 800 number it gets a specific route…

I tried just putting the DID number in the route… but that did not seem to work…

I can see in the sip debug that the number being forwarded is getting its number passed along however I don’t know how to have asterisk forward based on that…

Thanks for any input.

Joe

could you please post the sample debug messages here

To: sip:1877NUMHERE@atlas4.atlas.vonage.net:5061;user=phone;

    -- Executing Set("SIP/1248XXXXX-XXXX", "LOOPCOUNT=0") in new stack
    -- Executing Set("SIP/124823XXX-XXXXX", "__DIR-CONTEXT=default") in new stack
    -- Executing Answer("SIP/1248XXXX-XXX", "") in new stack
We're at 71.92.43.42 port 18732
Adding codec 0x100 (g729) to SDP
Adding codec 0x4 (ulaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 216.115.20.41:5061:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 216.115.20.41:5061;received=216.115.20.41
Via: SIP/2.0/UDP 69.59.242.97:5060
Via: SIP/2.0/UDP 69.59.242.97:5060
Via: SIP/2.0/UDP 69.59.242.97:5060
Via: SIP/2.0/UDP 216.115.30.28:5061
Via: SIP/2.0/UDP 192.168.1.100:5061;branch=z9hG4bK-45ad5e67-148acf03-3b11
From: "248-2XX-XXXX" <sip:12482XXXXXX@atlas4.atlas.vonage.net:5061;user=phone>;tag=1909094917;natted=71.238.25.107
To: <sip:1877XXXXXX@atlas4.atlas.vonage.net:5061;user=phone>;tag=as2bc6884e
Call-ID: 9452d4d0-30353-1168989798-20678473-128603326500362700000000-0@192.168.1.100
CSeq: 2 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: <sip:1248XXXXX@XXXXXX>
Content-Type: application/sdp
Content-Length: 259

it seems I’m missing something… :unamused:

What is the number you want to route on ?
Do you have 4 numbers like ‘1877NUMHERE’ ?

I have 1 toll free number it is not actually THENUMBER…

sip:1877XXXXXXX@atlas4.atlas.vonage.net:5061;user=phone;

That toll free number is forwarded to a vonage softphone account…

From there I want calls that come in from customer dialing that number to be routed to a extension…

But the softphone SIP account is actually 1248 something…

But when the calls come in I can see that the to: is correctly showing the toll free number…

But when I try to create a inbound route for that number it just gets routed as if it was the 1248 number… or the account number for the softphone trunk.

Sorry if I am not explaining clearly…

if I understood you correctly you may use the following example
forums.digium.com/viewtopic.php?p=41192#41192