News:

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

Main Menu

Trying to figure out best way to use phone port as Asterisk extension

Started by MichiganTelephone, February 10, 2011, 11:06:02 AM

Previous topic - Next topic

MichiganTelephone

I'm going to try and explain this as best I can and hope perhaps someone can give me an insight on what I could do to make this work.  I'm sure if I think about it long enough I'll figure out a way (and really, I have, I just don't much care for the approach I'm thinking of).  Since what I'm thinking might not be the best way, I'm asking for thoughts here.

Basically I have set up my OBi100 as described in my article, where SP1 is set up with a Google Voice account and SP2 is used as a trunk to Asterisk (trunk, not extension).  However, I got to thinking that it would be more useful yet if the phone port could also be made an extension off the Asterisk box.  This would be easy if there were another service provider slot but since there are only two, it makes things a little more challenging.

In FreePBX you can create what's called a CUSTOM extension, and I found that sending calls to the phone port are easy.  You simply create your custom extension, and then using the "dial" string, send your calls to sip/trunk_name/extension_number.  So if your trunk (that is used with SP2 on the OBi device) is named OBi, and the extension number is 345, your dial string would be sip/OBi/345.  Then on the OBi device, you simply go into your SP2 Service settings, and add {>(345):ph}, (including the comma at the end) to the start of your X_InboundCallRoute.  When you do that, any call you dial to extension 345 will be routed to the phone port on the device.

The problem is handling outgoing calls FROM the phone port.  I can, of course, set the calls to go out via SP2 or use the **2 prefix, but Asterisk thinks they are coming from the trunk (and therefore, from either the Google Voice account or the OBiTalk account).  So from the phone, I can only dial a number associated with an Inbound Route in FreePBX, otherwise the call is rejected.  This is because Asterisk has no way to distinguish between a call coming from the phone port and a call coming from either the Google Voice or the OBiTalk trunk.

I'm sure I could write some custom dial plan (a custom trunk context) that would look at the number called and if it's one of the two numbers associated with Google Voice or the OBiTALK network, send the call on to from-trunk for processing by the inbound routes, and if it's anything else assume it's from the phone port and send it to the from-internal context.  That is just a bit more complicated than I'd prefer, and I was wondering if there might be an easier way.  What I'm trying to figure out is if there's some way to mark the call as coming from the phone port, perhaps by sending a specific Caller ID name and number.  It might still require a bit of custom trunk context but at least it could be something more generic.

Of course what would be ideal is if perhaps we could have a couple additional Service Provider slots (SP3 and SP4, perhaps), but I suppose those eat up a lot of the device's memory.  I know as I'm writing this that I'm not thinking this through clearly, but I'm just not sure what other approach I could take to make this work.  I'd appreciate any thoughts on this.
Inactive, no longer posting or responding to messages.  Goodbye and good luck.  Some of my old Obihai-related blog posts have been moved to http://tech.iprock.com - note this in NOT my blog; I have simply given the owner permission to repost some of my old stuff.

QBZappy

In the "PHONE Port" section there are actually 5 service providers listed as the "PrimaryLine". I'm thinking if there is a clever way to use the PSNT or Trunk Group1 as the path to identify the call other than SP1, SP1, and the Obitalk service, which you are already using in your design.

Just my musings. Might not lead anywhere.
Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.

QBZappy

Another thought.

Asterisk can give dial tone. Offering dial tone to the Obi 110 unit? It has an FXO port probably not being used. Does that make any sense?
Owner of the 1st OBi110/100 units in service in Canada & South America. 1st OBi202 on my street. 1st OBi1032 in Montreal.

MichiganTelephone

Quote from: QBZappy on February 10, 2011, 01:07:47 PM
In the "PHONE Port" section there are actually 5 service providers listed as the "PrimaryLine". I'm thinking if there is a clever way to use the PSNT or Trunk Group1 as the path to identify the call other than SP1, SP1, and the Obitalk service, which you are already using in your design.

PSTN is the device's Line port, which doesn't exist on an OBi100.  As far as I can tell, Trunk Groups are simply a way of specifying multiple outbound services (so that if a call fails on one, it can roll over to another) and while that may be quite useful in other circumstances (for example, if you have two SIP or Google Voice accounts), it's not what I am looking for here.

I think I'll put in a feature request for additional Service Provider slots.  It may not be possible due to memory constraints, but I suppose it never hurts to ask, and I can conceive of several situations where they would prove useful.
Inactive, no longer posting or responding to messages.  Goodbye and good luck.  Some of my old Obihai-related blog posts have been moved to http://tech.iprock.com - note this in NOT my blog; I have simply given the owner permission to repost some of my old stuff.