Incoming Call By DID

Home » Asterisk Users » Incoming Call By DID
Asterisk Users 2 Comments

Hi,

My sip provider gave me 2 numbers for the incoming call via pstn.

nro1 = 12341234
nro2 = 45674567

I have a dialplan for each. if i put this on my dialplan:

exten => s,1,Dial(SIP/1001)
exten => Hangup()

Works!

But if i put one of them:

exten => 12341234,1,Dial(SIP/1001)
exten => _1234XXXX,1,Dial(SIP/1001)
exten => 45674567,1,Dial(SIP/1001)
exten => _4567XXXX,1,Dial(SIP/1001)

incoming calls do not arrive.

Any ideas?

2 thoughts on - Incoming Call By DID

  • It seems like your SIP provider is not sending and DID information, or that the information is not being sent in the same format you are using in your dialplan.

    You can check this by looking at the SIP debug information for the inbound calls and/or by checking with your SIP provider (that they are sending the DID number and what format it is in).

    All the best, David

    Hi,

    My sip provider gave me 2 numbers for the incoming call via pstn.

    nro1 = 12341234
    nro2 = 45674567

    I have a dialplan for each. if i put this on my dialplan:

    exten => s,1,Dial(SIP/1001)
    exten => Hangup()

    Works!

    But if i put one of them:

    exten => 12341234,1,Dial(SIP/1001)
    exten => _1234XXXX,1,Dial(SIP/1001)
    exten => 45674567,1,Dial(SIP/1001)
    exten => _4567XXXX,1,Dial(SIP/1001)

    incoming calls do not arrive.

    Any ideas?

  • The incoming call must be arriving with ${EXTEN} containing something that doesn’t match 12341234, _1234XXXX, 45674567 or _4567XXXX, so it is not triggering any of the extensions in your dialplan. Maybe it still has the STD code or even the IDD code prepended. (Been caught this way once before
    ….. our old ISDN-30 provider used to send just the local number, then we moved to a new ISDN-30 provider who send the number with STD code but no initial 0. Cue frantic editing of dialplan before rest of staff arrived …..)

    So try this;

    exten => s,1,NoOp(Incoming call for ‘${EXTEN}’)
    exten => s,n,Dial(SIP/1001)
    exten => s,n,Hangup()

    Run `# asterisk -vvvvvvvvvvvvvvvvvvvvvvvr`, dial one of your DDI numbers from a mobile phone and watch the messages scrolling past.

    Now you will be seeing exactly what ${EXTEN} contains when a call comes in, so you should be able to work out what is going on, and craft your extension expressions to suit. If in doubt, post an excerpt from your CLI output.