Devices configuration

Getting started with the SIP Sorcery
User avatar
Aaron
Site Admin
Posts: 4563
Joined: Thu Jul 12, 2007 12:13 am

Re: Devices configuration

Post by Aaron » Mon Sep 03, 2012 10:40 am

A default sipsorcery dialplan gets created for each new account with a single line of sys.Dial("music@iptel.org"). The rationale being its better for new users to get something when they dial for the first time rather than an error message or dead air. If you hear the music it means your device is configured correctly and your next step is to add rules to your sipsorcery dialplan to allow you to make calls through your providers. Your sipsorcery dialplan is the equivalent of Voxalot's Smart Call and Speed Dials. The simplest example to allow you to place real calls in your dialplan is:

Code: Select all

sys.Dial("your_provider") 
Replace your_provider with the name of one of the providers you have created on the SIP Providers tab.

User avatar
Flip
Posts: 82
Joined: Sun Aug 19, 2012 3:53 am

Re: Devices configuration

Post by Flip » Mon Sep 03, 2012 4:23 pm

You have got to be kidding me!
So it has been working all this time???

So what is the equivelant of "x.S0" (Wait for numbers, 1 second pause, Dial!).

Okay, so are there any resources available to convert any of my current dial plans into EXTEN compatible or RUBY compatible dial plans (or whatever it is you recommend)?


Default Linksys Dial Plan:

Code: Select all

(*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)
My Customised Linksys Dial Plan:

Code: Select all

(<:61>13[1-9]xxxS0|<:61>1[38]00xxxxxxS0|<:02>[2-9]xxxxxxxS0|0[12378]xxxxxxxxS0|0[4]xxxxxxxxS0|77[1-9]S0|1[258]1S0|888xxxxxx.S0|000S0|1223S0|0011xx.S0|1900xxxxxx!|<#9:>xx.<:@gw0>|[*x]x.)
This equates to "Match Dialled Number..." with "|" meaning OR (splitting each rule):

Code: Select all

(<:61>13[1-9]xxxS0|
<:61>1[38]00xxxxxxS0|
<:02>[2-9]xxxxxxxS0|
0[12378]xxxxxxxxS0|
0[4]xxxxxxxxS0|
...
0011xx.S0|
1900xxxxxx!|
<#9:>xx.<:@gw0>|
[*x]x.)
What It Means!
» <:61>13[1-9]xxxS0
»»»
13 Numbers - Six digit 13x-000 numbers. Inserts / prepends a 61 at the front of the number when dialing.

» <:61>1[38]00xxxxxxS0
»»»
Local / Free Call - 1300 / 1800 xxx xxx national business phone numbers.

» <:02>[2-9]xxxxxxxS0
»»»
Local Phone Calls - When any 8 digit telephone number is dialled, starting with 2/3/4/5/6/7/8/9 (2 - 9), Insert / prepend a 02.

» 0[12378]xxxxxxxxS0
»»»
National Phone Calls - When 01, 02, 03, 07, 08 detected at start number will match.

» 0[4]xxxxxxxxS0
»»»
Mobile Phone Calls - Rather than being National 03 number, 04 is for mobiles - separate plan in case blocking or using different VSP.

» 77[1-9]S0
»»»
Pennytel Service numbers 771, 775, 777, 778.

» 1[258]1S0
»»»
MyNetFone Service numbers 121, 151, 181.

» 888xxxxxx.S0
»»»
PennyTel Internal "Free"/"Member" Numbers + Echo Test #'s.

» 000S0
»»»
Emergency Police/Ambulance/Fire.

» 1223S0
»»»
Directory Enquiry - Directory assistance 1223 for whitepages.

» 0011xx.S0
»»»
International - Countries quite often will vary the number of digits in their phone numbers, so wait for more digits, pause and dial.

» 1900xxxxxx!
»»»
Block all premium telephone numbers @ $10/min.

» <#9:>xx.<:@gw0>
»»»
Bypass VoIP - Waits for #9 and sends phone calls though fallback telephone line. Not supported in PAP2T, only in SPA2xxx, SPA3xxx, etc models.

» [*x]x.
»»»
Generic Default Plan - String I've never removed from the end of the dial plan! Might be a good time to ... oh actually this might have something to do with the *7 and *71 speed dials you can configure into Cisco/Linksys devices...


So we could easily build a SipSorcery dial plan builder, where it queries people questions about how to dial mobiles, national, international, etc, and then after inputting numbers asks them to select the part of the input that is 'generic' (leaving the prefix). There just has to be a way to make this process easier!

Thanks Aaron for your assistance (and patience). Can't wait to get another 30 plans set up for clients!
Cheers!
Last edited by Flip on Sun Oct 02, 2016 5:13 am, edited 1 time in total.
ISP: Exetel ADSL2+ $60 Bundle. 22.4/1.2Mbps, 200/∞ GB [AAPT] + PSTN Bundle [Telstra].
VSP: Telecube¹, SIPTalk², MyNetFone³ via SIPSorcery & Ol' Voxalot. [OMG! Ewww Yuck!! Avoid DIDLogic!!!
H/W: Asus RT-AC66U; Cisco SPA232D, 3 x SPA302's, 2 x SPA901's, SPA3102; Yealink SIP-T46G.

User avatar
Aaron
Site Admin
Posts: 4563
Joined: Thu Jul 12, 2007 12:13 am

Re: Devices configuration

Post by Aaron » Tue Sep 04, 2012 12:30 pm

So what is the equivelant of "x.S0" (Wait for numbers, 1 second pause, Dial!).
There is no equivalent because it doesn't make sense for a SIP server. With a phone/ATA you enter one number at a time and at some point the phone decides to place the call and initiates the SIP call request to the server. With a server there is no concept of a number being entered one digit at a time instead the server has the whole destination straight away.
Okay, so are there any resources available to convert any of my current dial plans into EXTEN compatible or RUBY compatible dial plans (or whatever it is you recommend)?
The closest thing would the SIPSorcery SimpleWizard dialplan. With SimpleWizard dialplans you can create a series of rules that match a call prefix or an exact destination, do some manipulation of the number if required and then forward it to your provider of choice.

Using your first rule as an example <:61>13[0-9]xxxS0

A line you could use in a Ruby dialplan to achieve the equivalent would be:

Code: Select all

case req.URI.User
  when /^13\d{4}/ then sys.Dial("61${EXTEN}@some_provider")
  else sys.Dial("${EXTEN}@some_other_provider")
end
And an example for the same rule for 1300 numbers in the SimpleWizard is shown in the screenshot below. In this case for completeness I've implemented the same rule twice once as a prefix match and once as a regular expression match.
simple-wizard-example.png
simple-wizard-example.png (59.11 KiB) Viewed 2031 times

User avatar
Flip
Posts: 82
Joined: Sun Aug 19, 2012 3:53 am

Re: Devices configuration

Post by Flip » Wed Sep 05, 2012 10:25 pm

Thanks for your detailed response Aaron. Okay Extern makes sense but am intrigued by this wizard...
Aron wrote:There is no equivalent because it doesn't make sense for a SIP server. With a phone/ATA you enter one number at a time and at some point the phone decides to place the call and initiates the SIP call request to the server. With a server there is no concept of a number being entered one digit at a time instead the server has the whole destination straight away.
It was more to add some data - as Voxalot had these same Dialing Rules (obviously "Rules", not "Dial Plans", sorry for throwing that word around.) and when the pattern is matched "________" it would use Provider 1/2/3/4/5 etc.

However to program Voxalot, it used a fairly simple interface to just enter details and choose which Account was destination (via drop down - not entering name). i.e. If name of account was changed, no need to update all dial plans! (Feature Request!)


Okay, maybe that's what we were misunderstanding (you said that device has dial plan stored, not SipSorcery), what I have used before was having the dialling rules built into the VSP (Voxalot / Ayagy) interface which allows you to program each SIP provider to be used when a dialled rule is matched (e.g. for International calls use A, for Mobile calls use B, for Local calls use C, for National calls use C....).

Am I now making sense? :B
ISP: Exetel ADSL2+ $60 Bundle. 22.4/1.2Mbps, 200/∞ GB [AAPT] + PSTN Bundle [Telstra].
VSP: Telecube¹, SIPTalk², MyNetFone³ via SIPSorcery & Ol' Voxalot. [OMG! Ewww Yuck!! Avoid DIDLogic!!!
H/W: Asus RT-AC66U; Cisco SPA232D, 3 x SPA302's, 2 x SPA901's, SPA3102; Yealink SIP-T46G.

User avatar
Aaron
Site Admin
Posts: 4563
Joined: Thu Jul 12, 2007 12:13 am

Re: Devices configuration

Post by Aaron » Thu Sep 06, 2012 12:09 pm

Flip wrote:However to program Voxalot, it used a fairly simple interface to just enter details and choose which Account was destination (via drop down - not entering name). i.e. If name of account was changed, no need to update all dial plans! (Feature Request!)/quote]
The sipsorcery SimpleWizard dialplan does allow you to choose your provider from a drop down. In fact the SimpleWizard was designed to be somewhat familiar to Voxalot users since it was deployed around the same time Voxalot shut down. I'll add the feature to update the SimpleWizard "Dial" rules when the provider name changes.
Flip wrote:Okay, maybe that's what we were misunderstanding (you said that device has dial plan stored, not SipSorcery), what I have used before was having the dialling rules built into the VSP (Voxalot / Ayagy) interface which allows you to program each SIP provider to be used when a dialled rule is matched (e.g. for International calls use A, for Mobile calls use B, for Local calls use C, for National calls use C....).
The rule examples seemed to be for a Linksys ATA such as a PAP2. The rules in your ATA don't translate as easily to sipsorcery as your Voxalot rules would have. in fact at the time Voxalot shut down I wrote a migration utility for Voxalot users that converted their rules into the sipsorcery format.

User avatar
Flip
Posts: 82
Joined: Sun Aug 19, 2012 3:53 am

Re: Devices configuration

Post by Flip » Fri Sep 07, 2012 4:10 am

Hi Aaron,
Yes, I am familiar with a few manufacturer's devices - however 90% of exposure is with the Cisco / Linksys devices.
Just so you know I am well aware that these are Linksys dial plans. From the very start, I've been trying to convert these across to SipSorcery into a relevant form.

Having now tried SimpleWiz, it does not appear to be that 'simple'... ;P But I get the principle.

I'm familiar with Exten and it's L-R and R-L (-) trimming, etc, but am in no way an expert!:
-- ${87654:0:1} Trim/drop all after digit #0 - #1 (=8),
-- ${87654:-0:1} or -1:1} Trim/drop all after digit #0 - #1 (from RHS) (=4) ??? I think... ???
-- ${87654:1} Trim/drop digit #1 (=7654),
-- ${87654:-1} Trim/drop digit #1 from RHS (=8765).

I'll just have to spend more time at playing with Ruby and SimpleWiz!


I'm glad you saw the 'logic' loophole and improvement in my request. Cheers! ;)

Next Feature Request:
- Perhaps, where time permits, add an enable/disable option for Ruby dial plans (e.g. Disable 'Default' and enable 'UK' plan and 'US & Canada' plan whilst travelling (example), to avoid conflicts with default/home profile and local UK or US/CA numbers). :)


Okay, if this /^13\d{4}/ is for 13xxxx , then what would it be for 1[38]00xxxxxx?? ([38] = 3,8 (3 or 8.))??
/^1[38]00\d{6}/

What would it be for 1[3-8]00xxxxxx?? ([3-8] = 3 to 8 (3,4,5,6,7,8.))
/^1[3-8]00\d{6}/
ISP: Exetel ADSL2+ $60 Bundle. 22.4/1.2Mbps, 200/∞ GB [AAPT] + PSTN Bundle [Telstra].
VSP: Telecube¹, SIPTalk², MyNetFone³ via SIPSorcery & Ol' Voxalot. [OMG! Ewww Yuck!! Avoid DIDLogic!!!
H/W: Asus RT-AC66U; Cisco SPA232D, 3 x SPA302's, 2 x SPA901's, SPA3102; Yealink SIP-T46G.

User avatar
Aaron
Site Admin
Posts: 4563
Joined: Thu Jul 12, 2007 12:13 am

Re: Devices configuration

Post by Aaron » Fri Sep 07, 2012 12:02 pm

Flip wrote:Okay, if this /^13\d{4}/ is for 13xxxx , then what would it be for 1[38]00xxxxxx?? ([38] = 3,8 (3 or 8.))??
/^1[38]00\d{6}/

What would it be for 1[3-8]00xxxxxx?? ([3-8] = 3 to 8 (3,4,5,6,7,8.))
/^1[3-8]00\d{6}/
Yep both your patterns are correct.

The patterns that I originally supplied and the ones that you've formulated from them are regular expressions which are both a standard and incredibly powerful way to do string matching. Any search on "regular expressions" will get you thousands of hits and one of the best sites is http://www.regular-expressions.info/index.html.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest