Page 1 of 1

second trunk in extensions.conf

PostPosted: Mon Dec 22, 2008 11:44 am
by newx22
I have this code in my extensions.conf file :

; dial a long distance outbound number to the SPAIN
; This 'o' Dial flag is VERY important for VICIDIAL on outbound calls,
exten => _00034XXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _00034XXXXXXXXX,2,Dial(${TRUNK}/${EXTEN:1},55,To)
exten => _00034XXXXXXXXX,3,Hangup


now I need to add other code for my second trunk (always for spain) : TRUNKX

can i use this :
exten => _00034XXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _00034XXXXXXXXX,2,Dial(${TRUNKX}/${EXTEN:1},55,To)
exten => _00034XXXXXXXXX,3,Hangup

I mean changing only {TRUNK} to {TRUNKX} ?

would the system know that I need to use the two trunks for same destination.

thanks in advance.

PostPosted: Mon Dec 22, 2008 2:20 pm
by pylinuxian
I thought it was :

extensions if using a T1 channelbank
exten => _19XX,1,Dial(Zap/${EXTEN:2},30,o)
exten => _19XX,2,Hangup


for all trunks

Re: second trunk in extensions.conf

PostPosted: Mon Dec 22, 2008 8:16 pm
by williamconley
newx22 wrote:I have this code in my extensions.conf file :

; dial a long distance outbound number to the SPAIN
; This 'o' Dial flag is VERY important for VICIDIAL on outbound calls,
exten => _00034XXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _00034XXXXXXXXX,2,Dial(${TRUNK}/${EXTEN:1},55,To)
exten => _00034XXXXXXXXX,3,Hangup


now I need to add other code for my second trunk (always for spain) : TRUNKX

can i use this :
exten => _00034XXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _00034XXXXXXXXX,2,Dial(${TRUNKX}/${EXTEN:1},55,To)
exten => _00034XXXXXXXXX,3,Hangup

I mean changing only {TRUNK} to {TRUNKX} ?

would the system know that I need to use the two trunks for same destination.

thanks in advance.


no, the system would not separate these. it would consider them duplicates.

Instead:


;Trunk 1: dial 9 before regular dial:
exten => _900034XXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _900034XXXXXXXXX,2,Dial(${TRUNK}/${EXTEN:2},55,To)
exten => _900034XXXXXXXXX,3,Hangup

;Trunk 2: dial 8 before regular dial:
exten => _800034XXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _800034XXXXXXXXX,2,Dial(${TRUNKX}/${EXTEN:2},55,To)
exten => _800034XXXXXXXXX,3,Hangup


Please note the :2 instead of :1 to remove the first two numbers of the dial plan instead of just 1 (I presume you were stripping off the first "0" before sending to your VOIP company for the calls).

Otherwise, the system has no way to tell which one to use. Now if you dial 9 before your number it will use TRUNK and if you dial 8 it will use TRUNKX.

This is one method, there are MANY.

PostPosted: Tue Dec 23, 2008 6:21 am
by newx22
what if I don't need to differenciate between the two trunks. I mean use both of them transparently as if they were one single trunk.

in other words whats the code for this question ?

for exten 00034XXXXXXXXX dial any one of TRUNK or TRUNKX whats ever is available


note : the trunks are two E1 ports not voip.

PostPosted: Tue Dec 23, 2008 10:46 am
by williamconley
But that's just it, isn't it: they aren't one trunk. Can you hook two land lines to one telephone without having a button to press to choose between them?

You could say "No, but I could buy a telephone that handles that automatically" ... but the response to that is that the telephone would then consider them two different lines (because they are) and automatically choose between them.

If you cut the wires and splice them into one line ... it won't work. Same thing here.

There are two separate lines, you can set up a dial plan to try one and then the other in case of failure (FreePBX and many other systems are set up for this, and there are many methods to manually build a dial plan that will attempt one and then the other in case of failure or all lines busy or whatever).

The way dial plans are defined is by the extension and the priority. If you define the same extension and priority in more than one place, one will win and one will be forgotten. So the functional version of this dialplan would be to find a way to define them separately and have the system choose between them when the time comes (one and then the other, based on some criteria of your choosing for which is first).

PostPosted: Tue Dec 23, 2008 11:17 am
by newx22
so is this correct ?

Code: Select all
exten => _00034XXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _00034XXXXXXXXX,2,Dial(${TRUNK}/${EXTEN:1},55,To)
exten => _00034XXXXXXXXX,3,Dial(${TRUNKX}/${EXTEN:1},55,To)
exten => _00034XXXXXXXXX,4,Hangup

PostPosted: Tue Dec 23, 2008 2:16 pm
by williamconley
If you want to call the same person twice. After the end of the first call on the first trunk it will call again on the second trunk.

PostPosted: Tue Dec 23, 2008 2:20 pm
by newx22
I don't want to call the same person twice.

PostPosted: Tue Dec 23, 2008 4:18 pm
by williamconley
In that case, go back to my original suggestion, two separate extension patterns ... one for each trunk. If you want to have a dial plan that "checks for busy" in case you've used up all the available channels from a carrier and then uses the other trunk if that one is full, that requires a bit more work. Peronally, I've found that using FreePBX for this is simpler than building my own dial plan.

Are you looking for "failover" or "all lines full" detection or ... well, why do you need to use two trunks?

PostPosted: Wed Dec 24, 2008 5:02 am
by newx22
I am not looking for failover, just want to start working with the second span of my digium card & don't know how to do it.

as you know, so far I got one span working properly. now whats left is the second span because for a call center 60 lines is always better than 30 lines.

you suggested solution means that I need to add a '9' for one campain and an '8' for another so that one goes thru one trunk & the other thru the second & I prefer not to mix campains with trunks, I let trunk configuration be handled apart.

In my eyes the perfect solution would be to have Asterisk use the 60 lines transparently for anyone and any campain.

PostPosted: Wed Dec 24, 2008 7:02 am
by newx22
this is my zapata.conf file :

Code: Select all
callgroup=1
pickupgroup=1
immediate=no
group=1,2
channel => 1-15
channel => 17-31
group=1,3
channel => 32-46
channel => 48-62



maybe I should put it this way :

Code: Select all
callgroup=1
pickupgroup=1
immediate=no
group=1
channel => 1-15
channel => 17-31
channel => 32-46
channel => 48-62


will this make both spans on the card available for group 1 ?

Thanks in advance

PostPosted: Wed Dec 24, 2008 9:09 am
by williamconley
That helps a lot! Knowing why you want to "combine the trunks" (especially zap trunks) ... that's not even a vicidial thing. That's not nearly as complex.

Zap trunks can be combined into dial groups, your exact configuration is going to differ. But for this you should be on the Digium website. There are standard methods for grouping / managing digium hardware within asterisk, and a LOT of direct support.

PostPosted: Wed Dec 24, 2008 12:46 pm
by newx22
okey got you.

PostPosted: Thu Dec 25, 2008 1:08 pm
by newx22
this is my zapata.conf file :

Code: Select all
callgroup=1
pickupgroup=1
immediate=no
group=1,2
channel => 1-15
channel => 17-31
group=1,3
channel => 32-46
channel => 48-62


maybe I should put it this way :

Code: Select all
callgroup=1
pickupgroup=1
immediate=no
group=1
channel => 1-15
channel => 17-31
channel => 32-46
channel => 48-62



will this make both spans on the card available for group 1 ?

Thanks in advance

(I hope someone with insight will answer me)