Help with Dialplan

I’m hoping that someone can help me with some configuration issues surrounding getting a dial plan going that will allow me to interconnect my Asterisk system with my XO Communications hardware as well as my legacy Comdial system. Right now, the XO and Comdial systems are linked via 2 x T1 interfaces. Due to issues XO has with the fact that I’m not using a “Supported” PBX, they won’t allow me to SIP trunk, so my fall-back solution is to link the XO system to my Asterisk system via 2 x T1 lines, and then 2 x T1 lines between the Comdial system and the Asterisk system. I’ve ordered a quad-port T1 card with echo cancellation that I’m planning on using for this purpose.

However, in order to make sure things will work correctly, I need to set up routes such that DIDs that come into the Asterisk system from XO will get routed locally if the local extensions exist, otherwise they’ll get pushed on to the Comdial system. Can someone help me with this? It seems like you can do just about anything routing-wise in Asterisk, so I’m confident it can be done, just need to know the best way to do this. Basically, I need to look at DIDs coming in on the two T1s from XO, search the local system, and then, if the DID/extension is not found, route it back out one of the other T1s over to the Comdial system.

Thanks!
-Nick

You could create each DID as an extension in the incoming context, routing them to whatever phone device or other that they’re going to, and then create a pattern match to catch everything else that isn’t otherwise specifically matched.

Cheers.

That’s what I was hoping to do, and I sort of have that working. However, I’m not 100% sure about how, on the incoming or DID rules how to tell Asterisk to route from one set of T1 trunks to the other set. Any chance I could get some examples??

Thanks!
-Nick

Howdy,

When you built your channel mappings, did you put all of the channels from one T1 into one group, and all of the channels from the other T1 into a second group?

In that case, your Dial strings to push calls back out the second T1 are like:

exten => _X.,1,Dial(DAHDI/g2/${EXTEN})

Cheers.

I have a quad-port T1 card, and two of the T1s will be fed by my XO Communications CPE, and the other two will feed my existing Comdial PBX. When I configured the T1 card, I configured the first two T1 links as “from-external” and the second two T1 links as “from-internal.” I don’t know if this automatically groups all of the lines together - I may need to do some more editing of the config files to nail that down.

Thanks for the code snippet - I’ll give this a shot and see if I can make it work!

The group configuration is in chan_dahdi.conf inside of /etc/asterisk

Cheers.

Here are the config sections for each of the ports. Looks like they’re already grouped together, so I should just be able to use “g0” for the XO and “g1” for the Comdial system, right?

switchtype=national
context=from-pstn
group=0
signalling=pri_net
channel =>1-23

switchtype=national
context=from-pstn
group=0
signalling=pri_net
channel =>25-47

switchtype=national
context=from-internal
group=1
signalling=pri_cpe
channel =>49-71

switchtype=national
context=from-internal
group=1
signalling=pri_cpe
channel =>73-95

Yupperz.

Hi all

Please help me

Hi all…
I have been trying configuration of sip trunk between two asterisk servers located with in a single LAN. I installed asterisk 1.6.2.16.1 on centos 5.5 linux. In server1 sip.conf is implemented as

[interboxsip2]
type=peer
host=192.168.1.4
context=callfromserver2
dtmfmode=rfc2833
disallow=all
allow=ulaw
allow=gsm
insecure=invite
[1000]
user=1000
secret=1000
type=peer
host = dynamic
context=internal
allow=all

and server 2 as
[interboxsip1]

type=peer
host=192.168.1.8
context=callfromserver1
dtmfmode=rfc2833
disallow=all
allow=ulaw
allow=alaw
allow=gsm
insecure=invite

[2000]
username=2000
type=peer
host=dynamic
context=phones
secret=abc123
allow=all

DIALPLAN of server1 as

[callfromserver2]

exten => _9xxxx.,1,NoOp()
exten => _9xxxx.,2,Dial(SIP/interboxsip2/${EXTEN},30)
exten => _9xxxx.,3,Hangup()

[internal]
exten => 1000,1,NoOp()
exten => 1000,2,Dial(SIP/1000,30)
exten => 1000,3,Hangup()

and server2 As

[callfromserver1]

exten => _8xxxx.,1,NoOp()
exten => _8xxxx.,2,Dial(SIP/interboxsip1/${EXTEN},30)
exten => _8xxxx.,3,Hangup()

[phones]
exten => 2000,1,NoOp()
exten => 2000,2,Dial(SIP/2000,30)
exten => 2000,3,Hangup()

But its not working
can anyone help me …