Pattern matching in Dial Plan

amit

Joined
Sep 12, 2009
Messages
22
Likes
0
Points
0
#1
Hi All,

I want to write a dial plan so that either

  • 9818786955 or
  • 919818786955 or
  • 09818786955
call to my extension then forward to my number (let say 9715347865).

So, how can I write that dial plan.

Thanks,
Amit Saini
 

tylerd

Joined
Jul 14, 2007
Messages
33
Likes
0
Points
0
#2
could you explain this better? what is that number? an inbound route? or an outbound one? or you want when anyone dial this number, the call be forwarded to your cell phone or anything? Why we have to guess what you really want? If you need help, please write a understandable question...
 

amit

Joined
Sep 12, 2009
Messages
22
Likes
0
Points
0
#3
Hi tylerd,

Here I am explained my whole problem, but before that I want to inform you that I have not so much knowledge in Asterisk/Elastix.

Background - I am using Elastix 1.5 for developing our application (for that I am customizing in Elastix code). I am writing the dial-plan in the '/etc/asterisk/extensions_additional.conf' file under the [ext-did-0001] context. In Elastix, I have created some extensions (based on zap).
Our Objective - I want to write a rule (generic rule) so that if anybody dial an extension number - 43148161 (already created in Elastix), then Asterisk forwards to my number (let say my number is 9999235678). For this I have written a dial plan like -

[ext-did-0001]
exten => 43148161/_XXXXXXXXXXX,1,dial(dahdi,1,9999235678)


For your information, this dial-plan is working fine.

Problem - This dial-plan is not working, if caller is calling with STD number. For finding the reason of this problem I see in the asterisk console (using asterisk -r). And I found that if caller call to extension number (43148161) with local number then asterisk receive 11 digit caller number (let say caller number is 9818123456 and asterisk receive 09818123456) and it match to my dial plan, because in my dial plan I am using patter matching (_XXXXXXXXXX) 11 'X' digits. But if caller calling to extension number (43148161) with STD number (let say caller STD number is 9717567890) then asterisk receive 14 digits (00919717567890), which is not match my dial plan.

So, how should I changed my dial plan (specially patter matcher code), so my dial plan will handle local as well as STD incoming call?

Regards,
Amit Saini
 

dicko

Joined
Oct 24, 2008
Messages
4,099
Likes
0
Points
0
#4
# 9818786955 or

# 919818786955 or

# 09818786955

regex would be

.9818786955
 

amit

Joined
Sep 12, 2009
Messages
22
Likes
0
Points
0
#5
dicko, it's not working if I am using .9818786955 :(
 

dicko

Joined
Oct 24, 2008
Messages
4,099
Likes
0
Points
0

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,902
Messages
130,886
Members
17,563
Latest member
dineshr
Top