[OpenSIPS-Users] Parse initial INVITE Request-URI

discodog62 at aol.com discodog62 at aol.com
Fri Dec 12 02:57:45 CET 2014

Good day to all.  
Here is what I am trying to do and I am hoping someone can set me in the right direction.  I am using Opensips 1.11.2

I have an inbound SIP call.  This call is actually a forward.  When I dial the number 8585554444 it is forwarded to 8585554444.  

Dialed number: 8585554444 forwards to 18552223333

When the call comes in Opensips this is my initial invite...

INVITE sip:+18552223333 at 111.222.333.444:5060 SIP/2.0
Via: SIP/2.0/UDP;branch=z9hG4bK08B4ca619b00ce6405c
From: <sip:+18586669999 at;isup-oli=0>;tag=gK084a85fd
To: <sip:8585554444 at 111.222.333.444:5060>
Call-ID: 537432242_53736858 at
CSeq: 17719 INVITE
Max-Forwards: 93
Accept: application/sdp, application/isup, application/dtmf, application/dtmf-relay,  multipart/mixed
Contact: <sip:+18586669999 at>
P-Asserted-Identity: <sip:+18586669999 at>
Diversion: <sip:+18585554444 at>;privacy=off;screen=no; reason=no-answer; counter=1
Supported: 100rel
Content-Length:  200
Content-Disposition: session; handling=required
Content-Type: application/sdp

I see that the initial INVITE shows the toll free number that the call was forwarded to but the TO: shows the original dialed number.  
My question is can I grab the phone number from the initial INVITE?  I have goggled around and tried using the search but it just returns a 1 or 0 for a match.  I know once I am able to grab the number from the INVITE can then update the TO:field.  I have dumped out almost all of the vars from Opensips and none of them show me the phone number from the initial INVITE.

Any help is appreciated.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20141211/ca4fa108/attachment.htm>

More information about the Users mailing list