• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1048
  • Last Modified:

How to setup Asterisk Prefix Based dialing

Hello Guys,

I'm newbie in VOIP world and playing with Asterisk PBX.
I Have setup two Asterisk server (1.6.2) and configured SIP end points for both and connected each with other with IAX2 trunk

I'm successfully able to call between Asterisks with below dialplan, But I want to do prefix based dialing where in I just dial prefix number to reach extension of other asterisk and vice versa

Any help appreciated

Asterisk server 1 Dialplan (Extn 4XXX)

exten => 4000,1,Dial(SIP/4000)
exten => _1X.,1,Dial(IAX2/server2/${EXTEN})
exten => _4X.,1,Dial(SIP/${EXTEN},20,tr)

Asterisk server 1 Dialplan (Extn 1XXX)
include => parkedcalls

include => parkedcalls
exten => _1XXX,1,Dial(SIP/${EXTEN},10,tr)
exten => _1XXX,2, VoiceMail(${EXTEN}@voicemail_test,u,b)
exten => _1XXX,3,Playback(vm-goodbye)
exten => _1XXX,4,Hangup()
exten => 9998,1,VoiceMailMain(_1XXX@voicemail_test)

exten => _4X.,1,Dial(IAX2/server1/${EXTEN})

exten => _1X.,1,Dial(SIP/${EXTEN},20,tr)erisk server 1 Dialplan (Extn 4XXX)

1 Solution
AnanthahkAuthor Commented:
I was able to set up perfix based dialing by following code

exten => _801X.,1,Dial(IAX2/server2/${EXTEN:2})

exten => _811X.,1,Dial(IAX2/server1/${EXTEN:2})
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now