[index] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16]
Voicepulse Rollover
I send my outgoing PSTN calls over voicepulse's "connect" service. Voicepulse conveniently provides two iax2 servers which can be used and suggests placing them each in series in the dialplan. In this way, if the first server is unavailable the dial will then be tried on their second server. It's a nice option to have
I was frustrated, though, because that first server is down from time to time and waiting for it to timeout introduces a considerable delay to the dialing process. I found myself going into my extensions.conf and swapping the order of the two servers around so that the second server would be tried when the first one was down. I realized recently that it wouldn't be too much of a challenge to automate this process. Instead, now my dialplan always first tries whichever server successfully completed the previous call.
This solution is painless and simply, but is probably not "threadsafe" for high call volume environments due to its reliance on global variables and the non-atomic method used for setting the call priority. It would be safer, but more ugly, to reduce the toggle to a single variable, but I don't know if I have the motivation to do that.
TRUNK => IAX2/${VOICEPULSELOGIN}:${VOICEPULSEPASSWD}@gwiaxt01.voicepulse.com
TRUNK2 => IAX2/${VOICEPULSELOGIN}:${VOICEPULSEPASSWD}@gwiaxt02.voicepulse.com
TRUNKBUF => IAX2/${VOICEPULSELOGIN}:${VOICEPULSEPASSWD}@gwiaxt02.voicepulse.com
[macro-swapvp]
exten => s,1,NoOp(Swapping voicpulse trunk priority)
exten => s,2,SetGlobalVar(TRUNKBUF=${TRUNK})
exten => s,3,SetGlobalVar(TRUNK=${TRUNK2})
exten => s,4,SetGlobalVar(TRUNK2=${TRUNKBUF})
exten => s,5,NoOp(Swapped)
exten => s,6,NoOp(Priority 1 ${TRUNK})
exten => s,7,NoOp(Priority 2 ${TRUNK2})
[macro-vpdial]
exten => s,1,NoOp(Outbound VP call ${ARG1})
exten => s,2,SetCIDNum(5125380508)
exten => s,3,Dial(${TRUNK}/${ARG1})
exten => s,4,NoOp(TRUNK failed rolling over to TRUNK2)
exten => s,5,Playback(hang-on-a-second)
exten => s,6,Macro(swapvp)
exten => s,7,Dial(${TRUNK}/${ARG1})
exten => s,8,Congestion()
With this approach, if the Dial to ${TRUNK} fails, I call the swapvp macro and it reverses the order of the two trunks. Then the Dial is again attempted, this time using the "new" TRUNK1. Since these variables are global, all subsequent placed calls will use the new prioritization until that TRUNK fails, which will cause them to be swapped back.
Next: Voicepulse Customer Support
© Copyright 1995-2010 David McNett. All Rights Reserved.
