Help with incoming caller ID

Catalog of dial plans
Post Reply
gm_w
Posts: 3
Joined: Wed May 26, 2010 11:11 am

Help with incoming caller ID

Post by gm_w » Wed May 26, 2010 11:15 am

I have my nokia n900 setup to receive sipsorcery calls. Whenever I received a call, I get caller ID as 1234567890@12.23.456.78, basically in the form of <number>@<ip address>

The @<ipaddress> part is very cumbersome. First, it does not allow the phone to recognize the caller in the address book. Second, when I want to do a simple call back, the @<ipaddress> will screw up the dial plan. Is there anyway to remove the @<ipaddress> part from the incoming caller ID?

THanks

MikeTelis
Posts: 1582
Joined: Wed Jul 30, 2008 6:48 am

Re: Help with incoming caller ID

Post by MikeTelis » Wed May 26, 2010 1:43 pm

I have Nokia E71 and as far as I remember, it doesn't match numbers with "regular" phone fields of the Contacts (like Home, Mobile or Work phone). You have to have an entry in the "SIP" field for the contact.

As far as the "host" part is concerned, you can change it using fh option in sys.Dial:

sys.Dial("#{sys.Username}@local[fh=sipsorcery.com]")

while forwarding incoming calls to your phone. Then all calls will arrive with @sipsorcery.com as the host and you should have no problems matching them with your contacts and calling back.

gm_w
Posts: 3
Joined: Wed May 26, 2010 11:11 am

Re: Help with incoming caller ID

Post by gm_w » Sun May 30, 2010 4:18 pm

thanks for the suggestion. It indeed made the incoming number looked like @sipsorcery.com

Here is my other problem: the incoming number from sip now look like

+12345678901@sipsorcery.com

The actual number that I would store in my phone's contact list is 2345678901. So sipsorcery put a +1 in front of the number. Is there anyway to remove the +1 from the incoming caller ID?

Also, is there anyway I can completely remove the @sipsorcery.com part?

MikeTelis
Posts: 1582
Joined: Wed Jul 30, 2008 6:48 am

Re: Help with incoming caller ID

Post by MikeTelis » Sun May 30, 2010 6:30 pm

I don't think Sipsorcery is changing caller's number, the "+1" prefix must be coming from your DID. You can change it to anything you want, something like this:

Code: Select all

num = req.Header.from.FromURI.User.to_s  #get original caller's number
num =~ /^(\+?1)?([2-9]\d\d[2-9]\d{6})/ && num = $2
sys.Dial("#{sys.Username}@local[fu=#{num},fh=sipsorcery.com]")
For more sophisticated example, check out this dialplan or refer to Caller's name lookup dialplan.

I wouldn't recommend removing the country code ('1'), though.

As to the host name, you can't remove it. SIP URI is in form:

Name <sip:User@Host>

Name is optional. You must have something before and after '@'.

Post Reply