Swich channels

Hi
I have Asterisk 1.0.9 working fine, when a call is made to PSTN is using a ITSP ,I have a 256 Internet connection and a E1 card adapter, so i can make only 3 concurrents calls to PSTN, i want to make calls by E1 when is bussy the ITSP Connection,
Its possible to swich sip and zap channels???
Any ideas???

Thank you

That’s an easy one.

You would create a macro that will dial your ITSP the way that you normally would, and when your ITSP lines are all busy, would jump to the E1 trunks (at priority x+101) and try your E1 trunks.

[macro-dialitspoverflow]
exten => s,1,Dial(${ITSP}/${MACRO_EXTEN})
exten => s,2,Congestion
exten => s,102,Dial(${E1_TRUNK}/${MACRO_EXTEN})
exten => s,203,Busy

Then you just refer to the macro:

[default]
exten => _NXXNXXXXXX,1,Macro(dialitspoverflow)

thank you for your answer, the trouble in concurrent calls is that quality goes down when more calls, i ve notice that the optimal quality is with 3 concurrent calls , so if i implement your macro it will let me make 5 calls before send me to congestion event, do you know a way to fix that???

You need to set a “calls in progress” value anytime you place a call.

Just use a SetVar() command to do that.

On hangup, just decrement the variable.

(Or, load Asterisk onto a better computer. Either should solve your porblem.)