Different route for multiple DID

Hi,

I got 2 DIDs. What I would like to do is to have 1 DID routed to an IVR, and another one to go directly to a specific extension. My provider is Inphonex. Unfortunately, as per what I can see in the console, when a call comes in, Asterisk does not recognize the DID, is that possible?
When I configure the 2 inbound routes properly with both DIDs, it doesn’t go anywhere. This is the reading I got from it:

-- Executing [[email protected]:1] GotoIf("SIP/sip.inphonex.com2-ac4abbf0", "1?from-trunk||1") in new stack
-- Goto (from-trunk,s,1)
-- Executing [[email protected]:1] NoOp("SIP/sip.inphonex.com2-ac4abbf0", "No DID or CID Match") in new stack
-- Executing [[email protected]:2] Answer("SIP/sip.inphonex.com2-ac4abbf0", "") in new stack
-- Executing [[email protected]:3] Wait("SIP/sip.inphonex.com2-ac4abbf0", "2") in new stack
-- Executing [[email protected]:4] Playback("SIP/sip.inphonex.com2-ac4abbf0", "ss-noservice") in new stack
-- <SIP/sip.inphonex.com2-ac4abbf0> Playing 'ss-noservice' (language 'en')

== Spawn extension (from-trunk, s, 4) exited non-zero on ‘SIP/sip.inphonex.com2-ac4abbf0’
– Executing [[email protected]:1] Hangup(“SIP/sip.inphonex.com2-ac4abbf0”, “”) in new stack
== Spawn extension (from-trunk, h, 1) exited non-zero on ‘SIP/sip.inphonex.com2-ac4abbf0’

I tried to set 1 inbound route so that all DID go to my IVR to have the DID showing, but it doesn’t…
This is the reading…:

-- Executing [[email protected]:1] GotoIf("SIP/sip.inphonex.com2-ac46c760", "1?from-trunk||1") in new stack
-- Goto (from-trunk,s,1)
-- Executing [[email protected]:1] Set("SIP/sip.inphonex.com2-ac46c760", "__FROM_DID=s") in new stack
-- Executing [[email protected]:2] ExecIf("SIP/sip.inphonex.com2-ac46c760", "0 |Set|CALLERID(name)=18190000000") in new stack
-- Executing [[email protected]:3] Set("SIP/sip.inphonex.com2-ac46c760", "__CALLINGPRES_SV=allowed_not_screened") in new stack
-- Executing [[email protected]:4] SetCallerPres("SIP/sip.inphonex.com2-ac46c760", "allowed_not_screened") in new stack
-- Executing [[email protected]:5] Goto("SIP/sip.inphonex.com2-ac46c760", "ivr-2|s|1") in new stack
-- Goto (ivr-2,s,1)
-- Executing [[email protected]:1] Set("SIP/sip.inphonex.com2-ac46c760", "MSG=custom/IVR14") in new stack
-- Executing [[email protected]:2] Set("SIP/sip.inphonex.com2-ac46c760", "LOOPCOUNT=0") in new stack
-- Executing [[email protected]:3] Set("SIP/sip.inphonex.com2-ac46c760", "__DIR-CONTEXT=default") in new stack
-- Executing [[email protected]:4] Set("SIP/sip.inphonex.com2-ac46c760", "_IVR_CONTEXT_ivr-2=") in new stack
-- Executing [[email protected]:5] Set("SIP/sip.inphonex.com2-ac46c760", "_IVR_CONTEXT=ivr-2") in new stack
-- Executing [[email protected]:6] GotoIf("SIP/sip.inphonex.com2-ac46c760", "0?begin") in new stack
-- Executing [[email protected]:7] Answer("SIP/sip.inphonex.com2-ac46c760", "") in new stack
-- Executing [[email protected]:8] Wait("SIP/sip.inphonex.com2-ac46c760", "1") in new stack
-- Executing [[email protected]:9] Set("SIP/sip.inphonex.com2-ac46c760", "TIMEOUT(digit)=3") in new stack
-- Digit timeout set to 3
-- Executing [[email protected]:10] Set("SIP/sip.inphonex.com2-ac46c760", "TIMEOUT(response)=10") in new stack
-- Response timeout set to 10
-- Executing [[email protected]:11] Set("SIP/sip.inphonex.com2-ac46c760", "__IVR_RETVM=") in new stack
-- Executing [[email protected]:12] ExecIf("SIP/sip.inphonex.com2-ac46c760", "1|Background|custom/IVR14") in new stack
-- <SIP/sip.inphonex.com2-ac46c760> Playing 'custom/IVR14' (language 'en')

I would really appreciate any help, thanks!!

See How to get the DID of a SIP trunk when the provider doesn’t send it (and why some incoming SIP calls fail)

Oh wow, that thing fixed it!!! I added my DID number after the registration string and it worked!! Thanks a lot!!!