[asterisk-users] Incoming Call by DID

A J Stiles asterisk_list at earthshod.co.uk
Thu Oct 27 03:34:43 CDT 2016


On Wednesday 26 Oct 2016, KyD wrote:
> 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.

-- 
AJS

Note:  Originating address only accepts e-mail from list!  If replying off-
list, change address to asterisk1list at earthshod dot co dot uk .



More information about the asterisk-users mailing list