We recently switched from Vonage to running our own Asterisk server with one trunk. This worked great after a learning curve for myself (I had to set it up), and we have multiple extensions and such which all work. Now we added a second trunk. I added the trunk to my sip.conf, but I am not sure how to make it work. The original trunk is configured as “line1” and the new one is “line2”. I currently dial as follows.
; USA / Canada
exten => _1NXXNXXXXXX,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to ${EXTEN} through Nextiva)
exten => _1NXXNXXXXXX,2,Dial(SIP/line1/${EXTEN},120)
exten => _1NXXNXXXXXX,n,Playtones(congestion)
exten => _1NXXNXXXXXX,n,Hangup()
; 10 Digits dialing
exten => _NXXNXXXXXX,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to 1${EXTEN} through Nextiva)
exten => _NXXNXXXXXX,2,Dial(SIP/line1/1${EXTEN},120)
exten => _NXXNXXXXXX,n,Playtones(congestion)
exten => _NXXNXXXXXX,n,Hangup()
; 7 Digits local
exten => _NXXXXXX,1,Log(NOTICE, Dialing out from ${CALLERID(all)} to 1910${EXTEN} through Nextiva)
exten => _NXXXXXX,2,Dial(SIP/line1/1910${EXTEN},120)
exten => _NXXXXXX,n,Playtones(congestion)
exten => _NXXXXXX,n,Hangup()
How would I configure Asterisk to dial out on line2 if line1 is in use, or vice-versa? My hunch is that I would have to script something along the lines of “if I cannot dial line1, dial line2, els eplay the congestion tone”, but I am not quite sure how to do that yet. Also, our published telephone number is line1. If somebody is on line1 and another client calls in, how would I roll that over to line2?