Self-Peering Switchvox

OK, the title sounds freaky, doesn't it? Why in the world would anyone want to peer a switchvox with itself? Well, one good reason is that it allows for post-processing of outbound calls with the full power and functionality of the Switchvox inbound IVR system. "Wow" should be the word your lips are uttering at this moment!

Let's build a simple self-peered Switchvox system, utilizing it to ask for a PIN number on international outbound calls and then saying the digits it could actually be dialing! We'll start by making a recording, asking for a PIN number.

Prompt Recording

In the Switchvox Admin Suite, go to Tools > Sound Manager and record a sound that simply says, "Enter PIN number." Save it in a convenient folder, but remember that Switchvox will default to saving the sound in the IVR folder if you do not change it.

IVR Asking for PIN Number

If we want to use the power of Switchvox's IVR capabilities, we have to create an IVR. Don't worry, this is an easy one! Go to Tools > IVR Editor and then click on Create IVR Menu. It will ask for Name and Description, so let's name it "International PIN," leave the Description blank for simplicity, and click Save IVR Menu. Now, under Actions, click Modify Actions and add actions as follows.

The process is really simple, we wait 1 second to make sure the call is set up, we play our recorded sound, we wait for the user to enter 5 digits on their telephone keypad, we check to see if the digits entered were 12345 (our PIN number, which, admittedly, isn't very secure) and if not, we go to the beginning of this IVR and ask for the PIN number again. However, if the PIN number entered was 12345, we set a variable to the global variable INCOMING_DID, which is the international number the user dialed (this is because, due to the self peering, this outbound call is currently appearing as an inbound call. Crazy yet?), we then say the digits of this outbound number to the caller, wait 1 second, and then rudely hangup. Hey, this is just showing what could be done, some exercises have to be left for the reader, right?

Now that we have our call processing IVR in place, let's assign it to an extension. We are using 898, but feel free to use whatever works for you. Start at Setup > Manage and then click on Create Extension. Select Extension Type to be IVR and then click Create Extension. We entered our data as follows, but yours might be different.

Peer 1

Let's set up the first peer. Our call processing needed to be in place first, so that one side of the peer could reference it. Go to Setup > VOIP Providers and click on Create IAX Provider. You;ll need to enter data as follows. Take note of the password that you use for the first peer, because you'll have to use the exact same password for the second peer. As always, these should be strong passwords!

One very critical thing in this setup is that Your Account ID in this peer must be identical to the IAX Provider Name and IAX Provider Label in the second peer. Also note that the callback extension is the IVR we created above.

Peer 2

We are going to build the second peer nearly identical to the first. There will, however, be a couple of nuances.

Once again, Your Account ID in this peer must be identical to the IAX Provider Name and IAX Provider Label in the first peer. Note that there is no callback extension on the first tab because on the second tab we have Apply Incoming Call Rules to Provider set to NO.

Outbound Call Rules

We are so close that we can taste it! All that is left is the set the outgoing call rule to use our new "peer." To do this, go to Setup > Outgoing Calls, and modify the International Rule. Ours looks like this, but yours might be slightly different.

Make sure that the Primary Calls Through Provider is set to the second peer, as the first peer is the one hooked to the IVR.

Testing

No trial is ever complete without the final test. Go to a phone, dial an outbound international number (on our system, 9011123456789 was such a number, but your dialing rules may be slightly different). Do you get prompted for the PIN? Does it repeat back the number you could have dialed (minus the leading 9, in our case)? If so, great job! If not, check your work—you can do it!!