The Old Dial Plans (Here for those interested, still fully supported)
Making Calls
a)
Basic Dial Plan: Let one provider handle all your calls (no *1, *2 etc. required)
exten => _X.,1,Switch(user,pass,${EXTEN}@providerproxy1.com)
Whatever number you dial will be routed with Provider1
b)
Use Multiple Providers and choose among them using *1, *2 etc, :
exten => _*1X.,1,Switch(user,pass,${EXTEN:2}@providerproxy1.com)
exten => _*2X.,1,Switch(user,pass,${EXTEN:2}@providerproxy2.com)
So if I wanted to call 14161112222 via provider 1, I would dial *114161112222
If I wanted to dial 14161112222 via provider 2, I would dial *214161112222
c)
Use Multiple Providers and choose which provider to use based on the destionation called:
If I wanted to route all North American numbers dialed in 1-xxx-xxx-xxxx format via one provider and long distance numbers via another provider:
exten => _1X.,1,Switch(user,pass,${EXTEN}@NorthAmericalProvider.com)
exten => _011X.,1,Switch(user,pass,${EXTEN}@LongDistance.com)
d) Adjust for
local dialing
If I wanted to be able to dial all North American numbers without dialing the 1 (just xxx-xxx-xxxx) while leaving long distance dialing intact:
exten => _011X.,1,Switch(user,pass,${EXTEN}@LongDistance.com)
exten => _X.,1,Switch(user,pass,1${EXTEN}@NorthAmericalProvider.com)
Note the order of Dial Rules
Understanding the Dial Plan expression (Only read if interested, not required for basic outgoing call setup)
The general format for the dial plan has been designed to be somewhat familiar to Asterisk users.
Basic General Expression:
exten = number,priority,Switch(username,password,${EXTEN}@sip.provider.com)
General Expression with Optional features:
exten = number,priority,Switch(username,password,${EXTEN}@sip.provider.com, FromUser, SendTo)
A basic example is:
exten => _*1X.,1,Switch(user,pass,${EXTEN:2}@sip.blueface.ie)
Meaning: All calls that start with *1 will be dialed via BlueFace after removing the *1 from the front
BreakDown:
exten is the keyword to indicate the start of a new dial plan extension.
Operator: can be =, == or => for an equality match or =~ for a regular expression match.
Number or pattern: (the _*1X. for example) is the value the operator is applied to along with the user part of the user's call into the proxy. Eg.If the number starts with *1 that this rule will apply...
Code: Select all
Asterisk compatible patterns must begin with an underscore _
-X matches any digit from 0-9
-Z matches any digit from 1-9
-N matches any digit from 2-9
-[ ] matches any digits in the brackets.
eg
[25] will match 2 or 5, but will not match 0,1,3,4 etc.
[2-5] will match 2, 3, 4, 5, but will not match 0,1,6,7 etc.
[02-5] will match 0,2,3,4,5 but will not match 1,6,7 etc.
- . wildcard (full stop), matches one or more characters
Here are some examples
_9XXXXXXX matches 98175555 etc
_9817XXXX matches 98175555 but not 92595555 etc
_13ZXX. matches 131241 but not 1300 123 456 (because the Z excludes 0 as an option)
Code: Select all
Regular Expressions
-collecting info on this feature
Priority: (_*1X.,
1,Switch): for the time being this should be left to 1 by default
Switch: is the application command.
Authentication: (user,pass,) is the username and password for the provider you want to use
Replacement pattern: (${EXTEN} or ${dst}) Both can be used interchangeably. They allow you to modify how the number will be sent to your provider.
Code: Select all
${EXTEN:2} or ${dst:2} means the first 2 characters will be removed from any number you dialed before being sent to the provider for calling.
1${EXTEN} or 1${dst} means a 1 will be added to any number you dial before being sent to the provider for calling
1${EXTEN:2} means the first two characters of whatever you dial will be removed and a 1 will be added in front of what'sleft before sending the number to the provider for calling.
Host: finally at the end @sipproviderhost.com is the host address of the provider you want to use for that specific dial plan
Optional: Sending Caller ID
This will only work if the provider you are using let's you specify your own CID. This is the case with some BetaMax providers which will let you send your own number as CID after you have verified it with them.
General expression:
exten => _X.,1,Switch(user,pass,${EXTEN}@sip.blueface.ie)
Modified:
With Name:
exten => _X.,1,Switch(user,pass,${EXTEN}@sip.blueface.ie,
"MyName" <sip:12345@sip.blueface.ie>)
-CID sent will be: MyName 12345
Without Name:
exten => _X.,1,Switch(user,pass,${EXTEN}@sip.blueface.ie,
<sip:12345@sip.blueface.ie>)
-CID sent will be: 12345
Discussion:
http://www.mysipswitch.com/forum/viewtopic.php?t=122
Optional: Specifying Outbound Proxy
Some providers require an outbound proxy to be specified that's different from the host address for registration.
General Expression:
exten => _X.,1,Switch(user,pass,${EXTEN}@sip.blueface.ie)
Modified:
exten => _X.,1,Switch(user,pass,${EXTEN}@sip.blueface.ie
,,sip.outboundproxy.com)
note two commas ,,
Modified, including sending CID:
exten => _X.,1,Switch(user,pass,${EXTEN}@sip.blueface.ie, "MyName" <sip:
12345@sip.blueface.ie>,
sip.outboundproxy.com)
Discussion:
http://www.mysipswitch.com/forum/viewtopic.php?t=99
Most of the above info was obtained from https://www.mysipswitch.com/helpinfo/di ... thelp.html
Receiving Calls
Receiving Calls by registering ATA with MySipSwitch
1. Register your ATA with MySipSwitch
2. Register provider in your MySipSwitch account (Config page, under Registrations):
Username: Provider Username
Password: Provider Password
Server: ProviderServer.com or ProviderServer.com:5060 (use actual server as required by your provider)
Domain/Realm [optional] :
Expiry Seconds (60 to 3600) : 3600 (this is the default value, change if required)
Contact:
SipSwitchUsername@sip.mysipswitch.com
Add it, and use the Monitoring page to see that everything went fine. Now calls to the third party provider will ring your ATA/SoftPhone registered with MySipSwitch
Receiving Calls in your ATA registered with another provider
-Other provider that will receive the call must support SIP URI calls from third party networks
-This is an example on how to use MySipSwitch to forward calls coming in from certain providers via SIP URI to a different location
-Register provider in your MySipSwitch account (Config page, under Registrations):
Username: Provider Username
Password: Provider Password
Server: ProviderServer.com or ProviderServer.com:5060 (use actual server as required by your provider)
Domain/Realm [optional] :
Expiry Seconds (60 to 3600) : 3600 (this is the default value, change if required)
Contact:
username@ReceivingVSP.com (eg.
123456@voxalot.com)
Receiving Calls on an actual PSTN/Telephone number
1. Create a Special DialPlan (preferrably near the end of the list if you have other Dial Plans you are using):
(a)
exten =
SipSwitchUsername,1,SwitchCall(user,pass,
NumberToCall@OutgoingProvider.com)
Now all calls to
SipSwitchUser@sip.mysipswitch.com will ring your regular phone.
(b)
You can also create a Dial Plan to apply to only a specific instance:
exten =
anything.SipSwitchUsername,1,SwitchCall(user,pass,
NumberToCall@OutgoingProvider.com)
Where I wrote
anything, you can literally put in anything that you like, but try to keep it short and hopefully make it descriptive, like cell.MySipSwitchUsername
Now all calls to
anything.
SipSwitchUsername@sip.mysipswitch.com will ring your regular phone, but calls to
SipSwitchUsername@sip.mysipswitch.com will continue to ring your ATA if you've got one registered.
Using this pattern you can assing multiple SIP URIs to ring multiple phones.
2. Register provider in your MySipSwitch account (Config page, under Registrations) and point to ring your PSTN phone.
Username: Provider Username
Password: Provider Password
Server: ProviderServer.com or ProviderServer.com:5060 (use actual server as required by your provider)
Domain/Realm [optional] :
Expiry Seconds (60 to 3600) : 3600 (this is the default value, change if required)
Contact:
anything.SipSwitchUsername@sip.mysipswitch.com
Now calls to any providers which have been pointed to
anyhting.SipSwitchUsername@sip.mysipswitch.com, or SIP URI calls to
anything.SipSwitchUsername@sip.mysipswitch.com will ring the Phone Number you setup.
Optional: Capturing and Passing Caller ID
When someone calls a DID that's been pointed to
anything.SipSwitchUsername@sip.mysipswitch.com, your phone will ring but you may not receive the CID of the caller. To ensure MySipSwitch is passing through CID, set your Dial Plan from Step 1 as:
exten = anything.SipSwitchUsername,1,SwitchCall(user,pass,
NumberToCall@OutgoingProvider.com,
${fromname} <sip:${fromuriuser}@sip.mysipswitch.com>)
Discussion:
http://www.mysipswitch.com/forum/viewtopic.php?t=154
http://www.mysipswitch.com/forum/viewtopic.php?t=230
Troubleshooting
If any of the outgoing calls are having a problem, or the forwarding to your PSTN number is having an issue, one way to start troubleshooting is by getting a trace for the call.
Adjust any of your dial plan lines for which need a trace as follows:
Without any of the other optional features:
exten => _X.,1,SwitchCall(user,pass,${EXTEN}@sip.blueface.ie,,,
True)
or
Including the other optional features
exten => _X.,1,SwitchCall(user,pass,${EXTEN}@sip.blueface.ie,From User, OutboundProxy,
True)
By setting the last parameter as True a trace of the call will be recorded and emailed to the sipswitch owner of the call after it's complete. Providing a trace of a problematic call makes it a lot easier to troubleshoot