OBiTALK Community

General Support => Day-to-Day Use => Topic started by: user17600 on July 27, 2012, 08:01:12 AM

Title: Obi-100 (or 202!) and Sipsorcery
Post by: user17600 on July 27, 2012, 08:01:12 AM
I've searched the forums and can't find the answer to my specific issue.

Background: I'm using Sipsorcery to aggregate 6 SIP providers, including several GV accounts. The dialplan is set up so that I dial an asterisk and a number between 1 and 9 (e.g., *2-555-444-1212) to indicate which account (trunk) I want the call to go out through.  I'm currently using a Linksys ATA which is intermittently failing.

The Obi's use a similar convention to force the use of an account (trunk): **1, **2, etc.  I'm pretty sure I read somewhere that the Obi's can be configured to change this behavior.

What I'd like to do is have the Obi trunk be driven by pound signs (#'s), or to separate the behavior of Obi and Sipsorcery in some manner.  I'm open to pretty much any approach to address this issue.

Does anyone have this same setup, and how have you worked around this issue?

Many thanks.
Title: Re: Obi-100 and Sipsorcery
Post by: ianobi on July 27, 2012, 09:04:53 AM
This post may be of interest:

http://www.obitalk.com/forum/index.php?topic=701.msg4299#msg4299
Title: Re: Obi-100 and Sipsorcery
Post by: user17600 on July 27, 2012, 09:34:15 AM
Thanks, Ian.  Gives me a place to start.

Still, if anyone is successfully using Sipsorcery with an Obi unit, would appreciate a comment, or even a sample digitmap, and positive or negative experiences with an Obi/SS combo.

u1
Title: Re: Obi-100 and Sipsorcery
Post by: pc44 on July 27, 2012, 10:41:38 AM
Hi user17600,

I think lhm. is the user you will want to hear from.  Hopefully he will see this thread and respond.  While I have used Sipsorcery in the past, I no longer rely upon it since the introduction of the OBi.  In fact, the OBi was the reason I no longer need to use Sipsorcery.  I still maintain an active account with them, but I would probably not be of any "real" help to you.  All of those Ruby script edits are in my past now. :)

Here's a post by lhm. (http://www.obitalk.com/forum/index.php?topic=1821.msg11750#msg11750)  Also, if you search the forum for "sipsorcery" you should see several results.

pc44
Title: Re: Obi-100 and Sipsorcery
Post by: user17600 on July 27, 2012, 11:41:43 AM
Super.  Can't test the above link b/c I have a -110 right now and a leading # opens the POTS line, so looking for some confirmation before purchase.

Cheers
Title: Re: Obi-100 and Sipsorcery
Post by: ianobi on July 28, 2012, 12:55:09 AM
# bridges the phone port to the line port because of this rule in Phone Port OutboundCallRoute ...,{(<#:>|911):li},...

The default Phone Port OutboundCallRoute is:

{([1-9]x?*(Mpli)):pp},{(<#:>|911):li},{**0:aa},{***:aa2},{(<**1:>(Msp1)):sp1},{(<**2:>(Msp2)):sp2},{(<**8:>(Mli)):li},{(<**9:>(Mpp)):pp},{(Mpli):pli}

You could make changes such that #1, #2 etc replace **1, **2 etc, then maybe use ** to replace # in the default rule. The OBi is very flexible in this respect - they are rules not laws :)

It is worth reading the admin guide to make sure that any rule changes do not give you unexpected results. E.g. single * is used for "Star Codes", so best not use it for other uses.
Title: Re: Obi-100 and Sipsorcery
Post by: azrobert on July 28, 2012, 03:17:33 PM
I did it this way:
Any valid 7 or 10 digit number or 10 digits with a "1" prefix routed to SP1/GV.
Any valid 7 or 10 digit number with a prefix "2" thru "9" routed to SP2/SipSorcery.

SP1 DigitMap:
(1?[2-9]xx[2-9]xxxxxx|<480>[2-9]xxxxxx)

SP2 DigitMap:
(x[2-9]xx[2-9]xxxxxx|x[2-9]xxxxxx)

Add to Phone Port DigitMap:
(Msp1)|(Msp2)|

Add to Phone Port OutCallRoute:
{(Msp1):sp1},{(Msp2):sp2},

If you want to use #2 Thru #9 use SP2 DigitMap:
(#x[2-9]xx[2-9]xxxxxx|#x[2-9]xxxxxx)

Nothing else has to change as long as you place SP2 CallRoute entry before the LI entry.

Title: Re: Obi-100 and Sipsorcery
Post by: user17600 on August 01, 2012, 04:04:25 PM
Thanks ian and robert.  Been away and just getting back to checking in on this.

Robert, this looks great, but a question for you: does your SS dialplan have multiple accounts, where you use an asterisk (*) to denote the outgoing line (trunk)?

I ask because I'm trying to envisage daily use: if I use SP2 to dial out on my SS trunk 2 (a GV number on SS), then I would need to dial #2*2(555)444-3333.  I'm trying to determine if the *2 is being sent properly in your experience.

Thanks, just trying to gather some real-world experiences.

Cheers
Title: Re: Obi-100 and Sipsorcery
Post by: azrobert on August 01, 2012, 08:10:31 PM
I use the prefix (2-9) to determine the outbound trunk in SipSorcery.
You would dial 25554443333.

Below  is a sample SipSorcery Dialplan.
Hope I didn't make any mistakes.

outnum="#{req.URI.User}"                              #  Save outbound number
outnum.insert(1,"480") if outnum.match /^[2-9]\d{7}$/    #   Insert local area code w/7 digits
if outnum.match /^2(\d{10}$)/                       #   Prefix 2 = Trunk1
    sys.Dial("#{$1}@Trunk1")
elsif outnum.match /^3(\d{10}$)/                 #   Prefix 3 = Trunk2
    sys.Dial("1#{$1}@Trunk2")                          #    Insert "1" before out number
elsif outnum.match /^4(\d{10}$)/                  #   Prefix 4 = Trunk3
    sys.Dial("#{$1}@Trunk3")
end
Title: Re: Obi-100 and Sipsorcery
Post by: user17600 on August 24, 2012, 06:30:03 AM
My new OBI-202 arrived last night  ;D, but so far I have been completely thwarted in setting up SP3 in the manner I described previously.  Sorry to say, I must just not get the settings logic to enable what I would like to do.

So, is there anyone who has a -100 (or a -202) that is using multiple SIP/GV accounts in Sipsorcery, but forces selection of the outbound trunk in SS?  As I noted above, with my old ATA, I would dial *1(XXX)xxx-xxxx to force a call on SS trunk 1 (GV in this case), or *2(XXX)xxx-xxxx to force the call on SS trunk 2 (a VOSP), etc, all the way through *9.

Even with the changes suggested by others, I can't seem to get the -202 to pass the *1 on through to SS.  Maybe there is no way to do this (in which case I'll need to keep my old ATA), but I have to believe that I'm just missing a particular phrase in the digitmap or call routes.

After I sort this out, I intent to add another SIP provider to SP4, but I want to sort out this SS on SP3 issue first.

Thanks for your assistance and patience.
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: azrobert on August 24, 2012, 08:38:13 AM
Please post the following:

   SPx DigitMaps
   Phone port DigitMap
   Phone port OutCallRoute

It's hard to help you without seeing your config.
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: user17600 on August 24, 2012, 01:45:02 PM
Yeah, I was hoping someone had already solved for this, rather than bother you kind people trying to create from scratch...


ISTP C Digitmap: (#x[2-9]xx[2-9]xxxxxx|#x[2-9]xxxxxx)

Phone 2 Digitmap: ([1-9]x?*(Mpli)|[1-9]S9|[1-9][0-9]S9|911|**0|***|#8(Mbt)|#1(Msp1)|#2(Msp2)|#3(Msp3)|#4(Msp4)|#9(Mpp)|(Mpli))

Phone 2 Outbound call route: {(Msp1):sp1},{(Msp2):sp2},{([1-9]x?*(Mpli)):pp},{(<**8:>(Mbt)):bt},{**0:aa},{***:aa2},{(<#1:>(Msp1)):sp1},{(<#2:>(Msp2)):sp2},{(<#3:>(Msp3)):sp3},{(<#4:>(Msp4)):sp4},{(<#9:>(Mpp)):pp},{(Mpli):pli}

There may have been a couple of other variations over the course of the evening, but this is where I ended up.  No outgoing with this config.

Thanks again.
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: azrobert on August 24, 2012, 09:14:48 PM
Change ITSP A, C & D DigitMap from 480 to your area code for 7 digit dialing.
I have an OBI110, so I couldn't do a complete test.
Let me know how it works or if you have any questions.


ITSP A DigitMap:
(1?[2-9]xx[2-9]xxxxxx|<480>[2-9]xxxxxx)

ITSP B DigitMap:
([2-9]xx[2-9]xxxxxx|[2-9]xxxxxx)

ITSP C DigitMap:
([2-9]xx[2-9]xxxxxx|<480>[2-9]xxxxxx)

ITSP D DigitMap:
(<1>[2-9]xx[2-9]xxxxxx|<1480>[2-9]xxxxxx)

Add to front of default Phone Port DigitMap:
(Msp1)|(#x(Msp2))|

Add to front of default Phone Port OutCallRoute:
{(Msp1):sp1},{(<#8:>(Msp3)):sp3},{(<#9:>(Msp4)):sp4},{(#x(Msp2)):sp2},

8005551212 routed to SP1 (GV)
5551212 routed to SP1 (GV) as 4805551212
18005551212 routed to SP1 (GV)
#18005551212 thru #78005551212 routed to SP2 (SIPSorcery)
#15551212 thru #75551212 routed to SP2 (SIPSorcery)
#88005551212 routed to SP3 as 8005551212
#85551212 routed to SP3 as 4805551212
#98005551212 routed to SP4 as 18005551212
#95551212 routed to SP4 as 14805551212
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: user17600 on August 25, 2012, 08:13:21 AM
Thanks very much Robert.  Very helpful and I can report success in using the # key to denote the SP on the -202.

I only wish there was some way to send the * to Sipsorcery (as in *2-800.555.1212 to use SS trunk two), but I've gone in as you previously suggested and removed the * in the dialplan, so instead of dialing *2 to get SS trunk two, we just dial 2 (as in 2-800.555.1212).  Just need to get used to that change after years of dialing the *.

Thanks again for your patience and assistance.

U1
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: QBZappy on August 25, 2012, 09:01:36 AM
user17600,

If memory serves me right, I think RonR came up with a scheme to do exactly what your are asking. He has so many posts to search through. If you are up to it search his posts.
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: azrobert on August 25, 2012, 09:12:42 AM
Wow, you're a pain in the butt!
Just kidding.

Change Physical Interfaces >> Phone Port >> StarCodeProfile = None


ITSP A DigitMap:
(1?[2-9]xx[2-9]xxxxxx|<480>[2-9]xxxxxx)

ITSP B DigitMap:
([2-9]xx[2-9]xxxxxx|[2-9]xxxxxx)

ITSP C DigitMap:
([2-9]xx[2-9]xxxxxx|<480>[2-9]xxxxxx)

ITSP D DigitMap:
(<1>[2-9]xx[2-9]xxxxxx|<1480>[2-9]xxxxxx)

Add to front of default Phone Port DigitMap:
(Msp1)|(*x(Msp2))|

Add to front of default Phone Port OutCallRoute:
{(Msp1):sp1},{(<*8:>(Msp3)):sp3},{(<*9:>(Msp4)):sp4},{(*x(Msp2)):sp2},

8005551212 routed to SP1 (GV)
5551212 routed to SP1 (GV) as 4805551212
18005551212 routed to SP1 (GV)
*18005551212 thru *78005551212 routed to SP2 (SIPSorcery)
*15551212 thru *75551212 routed to SP2 (SIPSorcery)
*88005551212 routed to SP3 as 8005551212
*85551212 routed to SP3 as 4805551212
*98005551212 routed to SP4 as 18005551212
*95551212 routed to SP4 as 14805551212
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: user17600 on August 25, 2012, 09:14:41 AM
Nah, just persistent.

That's the ticket.  Thanks again, it's like you're the new RonR.

U1

Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: GregoryZ on August 25, 2012, 09:35:12 AM
Quote from: user17600 on August 25, 2012, 09:14:41 AM

That's the ticket.  Thanks again, it's like you're the new RonR.


Who knows....RonR could mean Ron Robert.  AKA AZRobert.
Same person, different User ID?? ???

Just kidding azrobert.  Great Job! 

We all Appriciate Your Knowledge and Willingness to help Others!!!

-G
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: azrobert on August 25, 2012, 10:36:53 AM
I see a lot of people are reading this thread, so here is a tutorial on what I did.

The ITSP DigitMaps don't do any processing.  It's a place to define a DigitMap.
Everything happens in the Phone Port DigitMap and OutCallRoute.

The Phone Port DigitMap is processed first and verifies the number you dialed.
The (Msp1) portion of the DigitMap refers back to the ITSP A DigitMap and lets pass numbers for GV.
The (*x(Msp2)) adds *x to the ITSP B DigitMap and lets pass numbers for SP2, SP3 and SP4.

At this point everything we need has been verified and processing goes to the OutCallRoute.
The OutCallRoute is processed left to right.

The (Msp1) portion of {(Msp1):sp1} is another DigitMap that checks for GV numbers and routes them to SP1.

(<*8:>(Msp3)) Checks for numbers prefixed with *8, but routes the number to SP3 without the *8.
I did not put the <*8:> in the ITSP C DigitMap for a reason.  If I did, when the Phone Port DigitMap processed the number the *8 would have been stripped off at that point.  Then the OutCallRoute would not see the *8 and route the call to SP1.

Same for (<*9:>(Msp4))

At this point *8 and *9 have already been routed, so (*x(Msp2)) routes the remainder *1 thru *7 to SP2.


Hope this helps someone out there.
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: azrobert on August 25, 2012, 10:45:28 AM
Just to kill any rumors that I'm RonR, check my profile.
I registered on January 29, 2011.
If I remember correctly RonR helped me a couple times when I was a newbie.
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: jimates on August 25, 2012, 11:22:17 AM
we know you are not RonR, he would never explain anything. He just puts it out there and expects everyone to know why it does what it does.
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: QBZappy on August 25, 2012, 12:38:30 PM
GregoryZ,

Nah, I got the impression that RonR was taller. I think that azrobert is another person.  :D
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: GregoryZ on August 25, 2012, 04:01:39 PM
 :D

Quote from: QBZappy on August 25, 2012, 12:38:30 PM
GregoryZ,

Nah, I got the impression that RonR was taller. I think that azrobert is another person.  :D

I think you're right.  Besides, AZRobert's voice is much deeper too.   8)

Keep the help comming AZRobert.  The way you explain things is Top Notch, even I can understand it.

-G
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: GregoryZ on August 25, 2012, 04:09:14 PM
Quote from: azrobert on August 25, 2012, 10:45:28 AM
Just to kill any rumors that I'm RonR, check my profile.
I registered on January 29, 2011.
If I remember correctly RonR helped me a couple times when I was a newbie.

I hope you consider the comparison a Compliment.  Personally, I have high regards for RonR.  He had already left this fourm before I arrived.  But his work lingers, and has helped me and many others.


Just having some fun by Stiring Things Up.  ;)

Best Regards,
Gregory
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: azrobert on August 25, 2012, 04:11:16 PM
Hay guys,
Should I be insulted?  You describe me as this short person with a deep voice.
LOL!

Really, thanks for the kind words!
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: GregoryZ on August 25, 2012, 04:29:43 PM
 ;D
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: azrobert on August 30, 2012, 08:14:52 AM
There is a couple of mistakes with my tutorial.
I said:
QuoteI did not put the <*8:> in the ITSP C DigitMap for a reason. If I did, when the Phone Port DigitMap processed the number the *8 would have been stripped off at that point. Then the OutCallRoute would not see the *8 and route the call to SP1.

The Phone Port DigitMap does not reference ITSP C DigitMap, so it's a false statement.  I had to use this method when testing with my OBi110 because I only had ITSP B DigitMap to process numbers with a leading *.

Also, *0 is routed to SP2.

Don't know why it took so long before this info popped in my head.  Must be getting too old.

There is nothing wrong with the config, but the following is cleaner:

ITSP A DigitMap:
(1?[2-9]xx[2-9]xxxxxx|<480>[2-9]xxxxxx)

ITSP B DigitMap:
(*x[2-9]xx[2-9]xxxxxx|*x[2-9]xxxxxx)

ITSP C DigitMap:
(<*8:>[2-9]xx[2-9]xxxxxx|<*8:480>[2-9]xxxxxx)

ITSP D DigitMap:
(<*9:1>[2-9]xx[2-9]xxxxxx|<*9:1480>[2-9]xxxxxx)

Add to front of default Phone Port DigitMap:
(Msp1)|(Msp2)|

Add to front of default Phone Port OutCallRoute:
{(Msp1):sp1},{(Msp3):sp3},{(Msp4):sp4},{(Msp2):sp2},
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: azrobert on August 30, 2012, 10:38:42 AM
User17600,

I had another thought.  You said you have 6 providers, including several GV accts.
You can have 3 GV accts and 1 registered SIP provider on your OBi202.
If the other 2 providers are outgoing only SIP providers, you can define them as Voice Gateways on the OBI202 and eliminate SipSorcery. Let me know if this is the case and you need help.

Bob
Title: Re: Obi-100 (or 202!) and Sipsorcery
Post by: user17600 on September 17, 2012, 03:19:28 PM
Yes, I use some of the trunks on the -101 for outgoing calls. Unfortunately some of the numbers are also for incoming (various parts of the country where I 'need' a presence).

Thanks, again!

U1