News:

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

Main Menu

OBiBT InboundCallRoute issue

Started by rendrag, March 25, 2013, 06:35:51 PM

Previous topic - Next topic

rendrag

I have a 202 with the OBiBT that is acting as a gateway to asterisk for my cell phone.  It all works as i want except one scenario where i want to place an outgoing call from my cell phone without turning off blue tooth.

Here's the setup:

I have sp1 set up as an extension to my asterisk server and set up InboundCallRoute adapting from here:
http://michigantelephone.wordpress.com/2012/03/22/how-to-divert-incoming-google-voice-calls-from-an-obihai-voip-device-to-an-asterisk-server-for-additional-processing-such-as-caller-id-lookup/ including the other asterisk modifications, trunk, and inbound route settings.

It looks like this:

{(7xx):aa},{sp1(10-digit-cell-phone-number/$1@192.168.xxx.yyy;ui=asterisk-trunk-name:asterisk-trunk-secret)},{ph1,ph2}

& it seems to work fine.  The first rule is simply so i can call the aa from one specific asterisk extention.  The 2nd rule acts on incoming calls and forks them to my asterisk system ringing all phones in the house and callerId number gets passed and looked up in asterisk.  Moreover, the mobile phone continues to rings and if i answer it (instead of the asterisk phone), all i need to do is disengage the bluetooth and the call is on the cell phone's speaker. 

This all works fine.

However, if i make an outgoing call from my cellphone without turning off bluetooth, whatever number i dial is forked to asterisk.  & after thinking about it, i think i understand what is happening.  The OBiBT simply sees an incoming call and forks to asterisk per the inbound call route.  It doesn't matter where it originated based on my rule.

Ok.  so, i tried adding a digitmap to the rule so that the only calls that would get processed by that rule would be any calls that originated from a number other than the cell phone.  So i changed the 2nd rule in the above route to this:

{(!x.10-digit-cell-phone-number)>:sp1(10-digit-cell-phone-number/$1@192.168.xxx.yyy;ui=asterisk-trunk-name:asterisk-trunk-secret)}

My reading of the above rule says that any inbound call where the caller is a number other than one ending in my 10-digit-cell-phone-number would trigger that rule.  But it didn't work.  The incoming call rings my cell phone and never gets forked.  OBi sees the correct originating number per it's call history but the call just rings until cell phone voice mail kicks in.  I've also tried the opposite rule:

{(>x.10-digit-cell-phone-number):sp1(10-digit-cell-phone-number/$1@192.168.xxx.yyy;ui=asterisk-trunk-name:asterisk-trunk-secret)}

with the same result.  Interestingly, this does produce the correct behavior when dialing from my cell phone - only the dialed destination rings.

Cannot seem to find a rule adjustment that works for both incoming and outgoing calls.  I know the easy workaround is simply to turn off blue tooth on my cell phone to make an outgoing call, but why the modified rules aren't working is puzzling.

Any ideas?

thx, jay

ianobi

jay - welcome to the forum.

I'm not sure that I have the full picture here. For instance, is the BT InboundCallRoute relevant to this?

Anyhow, I will blunder on and make a wild guess with no testing to back it up  :)

This rule may hold the answer:
{(!x.10-digit-cell-phone-number)>:sp1(10-digit-cell-phone-number/$1@192.168.xxx.yyy;ui=asterisk-trunk-name:asterisk-trunk-secret)}

As you know {(!x.10-digit-cell-phone-number)> is the "caller-list". When you had no "caller-list" in your original rule, then that implies that any CallerID is allowed. Now you have a "caller-list" with a rule in it I'm guessing that nothing is implied and all must be stated explicitly. You could try this rule:

{(!x.10-digit-cell-phone-number|xx.)>:sp1(10-digit-cell-phone-number/$1@192.168.xxx.yyy;ui=asterisk-trunk-name:asterisk-trunk-secret)}

Now the "caller-list" explicitly bars your cell phone CallerID and explicitly allows any others.

It is more or less true in any OBi rule that as soon as you use parenthesis then anything inside them is a digit map and only the rules in that digit map will apply.

Anyhow, like I said, there's some guesswork in my reasoning. If you test it, then that will save me the trouble  :D

rendrag

thanks.  that appears to work.  i can't quite get my head wrapped around all of the nuances of digit maps but your explanation makes total sense.

the one thing i can't figure out though is why the opposite rule didn't work:

{(>x.10-digit-cell-phone-number):sp1(10-digit-cell-phone-number/$1@192.168.xxx.yyy;ui=asterisk-trunk-name:asterisk-trunk-secret)}

which i would have thought meant to match any callerid dialing my cell phone...

-jay

ianobi

I think this would work to match any CallerID, but the callee has to be your cell phone number:

{>(x.10-digit-cell-phone-number):sp1(10-digit-cell-phone-number/$1@192.168.xxx.yyy;ui=asterisk-trunk-name:asterisk-trunk-secret)}


Going back to the rule that works:
{(!x.10-digit-cell-phone-number|xx.)>:sp1(10-digit-cell-phone-number/$1@192.168.xxx.yyy;ui=asterisk-trunk-name:asterisk-trunk-secret)}

The ">" is not needed, but does no harm.

In the arguement following sp1 I would have thought that a ">" is needed at the end like so:

{(!x.10-digit-cell-phone-number|xx.):sp1(10-digit-cell-phone-number/$1@192.168.xxx.yyy;ui=asterisk-trunk-name:asterisk-trunk-secret>)}

This would make the arguement a "cid" rather than a "target". However, I know nothing about asterisk and if a rule works then it works, but it is nice to know why  :)

ianobi

I just had a read of that blog by michigantelephone. Maybe it should be a "target". I'm not gonna argue with a man of his stature in voip telecoms  :)

rendrag

Yes, me either...   :)

QuoteI think this would work to match any CallerID, but the callee has to be your cell phone number:

{>(x.10-digit-cell-phone-number):sp1(10-digit-cell-phone-number/$1@192.168.xxx.yyy;ui=asterisk-trunk-name:asterisk-trunk-secret)}

Exactly my point - it didn't work.  and i see that you've put the ">" outside the () - below i had it inside... maybe that is why.

re:
QuoteIn the arguement following sp1 I would have thought that a ">" is needed at the end like so:

{(!x.10-digit-cell-phone-number|xx.):sp1(10-digit-cell-phone-number/$1@192.168.xxx.yyy;ui=asterisk-trunk-name:asterisk-trunk-secret>)}

My assumption was that this form i found from michigantelephone essentially maps the Obi's cid>target syntax to a syntax that asterisk can understand of DID/CID, where CID is simply $1 -& the target becomes the DID into asterisk.

I tried many ways of passing cid as the $1 parameter to either an asterisk extension or as the cid to another voip provider for which i have a free inum trunk back to my asterisk system.  None of the formats worked.  This is the only one that passed the correct value of caller ID back to asterisk.  I may play around with it some more now that you've helped me better understand digit maps and see if i can find some other ways to do this that doesn't require the gateway.

Will post back if i find anything else, but appreciate your help.

thx, jay