Ok, I've now subscribed to
voip.co.uk in the UK, for cheap PSTN calls.
As a result, I've decided to hook into SipBroker for ENUM lookups, so I only use PSTN when I have to...
Again, this is on my SPA3102.
My new dialplan is thus :
Code:
L:5,S:5,(<*:>764xxxx<#:@gw1>S0|<S0#><:@gw0>|999S0<:@gw0>|<00:>x.<#:@sipbroker.com>|<:44121>xxxxxxx<#:@sipbroker.com>|<0:44>[12578]x.<#:@sipbroker.com>|*xx<#:>,S0|*x.<:@gw1>|*x.<#:@gw1>|x.)
The ATA is registered with voip.co.uk, and gw1 is setup as Voxalot
Chunk by chunk :
<*:>764xxxx<#:@gw1>S0
I've setup 764 as a "dialplan" at Voxalot, for a friends PBX. I want to be able to dial *xxx (where xxx is the SIP shortcode in SipBroker/Voxalot), but Voxalot passes anything with a * direct to SipBroker - and 764 is my friends exchange, and not recognised by SipBroker. This bit removes the leading * when it's dialled, and fires 764xxxx (4 digit extension) at Voxalot. It also removes any trailing # pressed - still immediately connecting, but not sending the # which confuses Voxalot
<S0#><:@gw0>
When going "off-hook" on Line1, pressing # will immediately present a PSTN dialtone. This is to override any VOIP dialling and get an outside line if necessary.
999S0<:@gw0>
Route 999 straight to PSTN immediately. For emergency calls.
And now the SipBroker bits
If you've not already gone to look at it, go check
http://www.sipbroker.com and
http://www.e164.org. If someone (like I have) registers their PSTN number with e164, they can point it to a SIP number, and VOIP->PSTN callers will actually make a VOIP->VOIP call.
<00:>x.<#:@sipbroker.com>
In the UK, starting a number with 00 means it's international. This removes the 00, leaves the rest of the number intact, and passes it up to SipBroker. It also removes any trailing # pressed - still immediately connecting the call.
The SPA3102 uses # as a "I've finished dialling" message, but still sometimes sends it if pressed. I don't have to press #, but if I do, it does what it should, but also ensures it isn't passed along.
<:44121>xxxxxxx<#:@sipbroker.com>
This handles local calls. If you're in the UK and not in Birmingham, replace 121 with your local area code (less the leading zero). If your local numbers are not 7 digits long, change the number of xs accordingly. The dialplan prepends 44<area code> on the number, and fires it to SipBroker as above, again dealing with #s - no local numbers should start with 0, so this doesnt have anything to remove them.
<0:44>[12578]x.<#:@sipbroker.com>
This handles national calls, detected by dialling 0<digit>. Any leading zero is removed and replaced with 44, leaving the rest of the number intact. Again, this deals with #s and passes to SipBroker.
*xx<#:>,S0
The SPA3102 has *xx codes used for altering behaviour - *18 for example turns secure calls on. As I want to use * for calling via Voxalot, I use this dialplan to detect *xx# - however this again removes the #, dials the code, and presents me a dialtone so I can dial as normal.
I can go off hook and dial *18# and then dial a full number, or I can dial *18#<full number> and go off hook.
Interestingly, although this chunk of the dial plan is near the end, the
, allows a new dialstring, which still checks the other dial plans - all calls route as they should.
*x.<:@gw1>
Route anything else starting with * via Voxalot
*x.<#:@gw1>
The same, forcing # removal - I can remove the previous rule I just haven't yet - this was there to check it behaved as intended.
x.
Route anything else via voip.co.uk
In a nutshell, I can now use the phone for PSTN calls, and they route over voip.co.uk for 1 ppm or 2 ppm depending on time of day. However, the SipBroker bit means if friends/family have a SIP address, they can register @ e164.org , and I will connect to them for free - and don't have to dial any other numbers. Any number not found in SipBroker just routes back to my provider and out.
Hopefully that will help someone out