News:

On Tuesday September 6th the forum will be down for maintenance from 9:30 PM to 11:59 PM PDT

Main Menu

Obi-100 (or 202!) and Sipsorcery

Started by user17600, July 27, 2012, 08:01:12 AM

Previous topic - Next topic

user17600

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.

ianobi


user17600

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

pc44

#3
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.  Also, if you search the forum for "sipsorcery" you should see several results.

pc44

user17600

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

ianobi

# 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.

azrobert

#6
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.


user17600

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

azrobert

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

user17600

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.

azrobert

Please post the following:

   SPx DigitMaps
   Phone port DigitMap
   Phone port OutCallRoute

It's hard to help you without seeing your config.

user17600

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.

azrobert

#12
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

user17600

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

QBZappy

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.
Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.

azrobert

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

user17600

Nah, just persistent.

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

U1


GregoryZ

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
OBi100, OBi110, OBi200, OBi202

azrobert

#18
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.

azrobert

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.