<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix"><tt>Hi, James!<br>
<br>
You can access the username in the R-URI with the $rU variable.
Next, you can use the uac_replace_to()[1] function to change the
To header.<br>
<br>
[1]
<a class="moz-txt-link-freetext" href="http://www.opensips.org/html/docs/modules/2.1.x/uac.html#id293640">http://www.opensips.org/html/docs/modules/2.1.x/uac.html#id293640</a><br>
<br>
Best regards,<br>
</tt>
<pre class="moz-signature" cols="72">Răzvan Crainea
OpenSIPS Solutions
<a class="moz-txt-link-abbreviated" href="http://www.opensips-solutions.com">www.opensips-solutions.com</a></pre>
On 12/12/2014 10:18 PM, <a class="moz-txt-link-abbreviated" href="mailto:discodog62@aol.com">discodog62@aol.com</a> wrote:<br>
</div>
<blockquote
cite="mid:8D1E45FFD0E81CC-1994-BCB2@webmail-vm185.sysops.aol.com"
type="cite"><font color="black" face="arial" size="2">
<pre><font face="Arial, Helvetica, sans-serif" size="2">The call is coming in from an entity located before Opensips.</font></pre>
<pre><font face="Arial, Helvetica, sans-serif" size="2">What I would like to do is grab the toll-free number from the initial INVITE</font></pre>
<pre><pre style="font-family: arial;"><font size="2"> INVITE sip:<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">+18552223333 at 111.222.333.444</a>:5060 SIP/2.0</font></pre><pre style="font-family: arial;"><font size="2">then update the To: address to be the toll-free number not the local number 8585554444.</font></pre><pre style="font-family: arial;"><font size="2">
</font></pre><pre><font face="arial" size="2">I have found that I can see the initial INVITE info if dump the buffer $mb. How can I search using a regex expression and return the match so I can update $tU. Is that possible?</font></pre></pre>
<pre style="color: black; font-family: arial;"><font size="2">
</font></pre>
<pre style="color: black; font-family: arial;"><font size="2">Thanks,</font></pre>
<pre style="color: black; font-family: arial;"><font size="2">James</font></pre>
<pre style="color: black; font-size: 10pt; font-family: arial;">
</pre>
<pre style="color: black; font-size: 10pt; font-family: arial;">
</pre>
<pre style="color: black; font-size: 10pt; font-family: arial;">Hello,
Who is doing the actual forward ? Is it a SIP proxy / entity located
before OpenSIPS ?
Just by looking at the INVITE message you've posted, the originally
dialled number ( 8585554444 ) is located in the TO username ( readable
via the $tU variable in the script ).
Best Regards,
Vlad Paiu
OpenSIPS Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com/">http://www.opensips-solutions.com</a>
On 12.12.2014 03:57, <a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">discodog62 at aol.com</a> wrote:
><i> Good day to all.
</i>><i> Here is what I am trying to do and I am hoping someone can set me in
</i>><i> the right direction. I am using Opensips 1.11.2
</i>><i>
</i>><i> I have an inbound SIP call. This call is actually a forward. When I
</i>><i> dial the number 8585554444 it is forwarded to 8585554444.
</i>><i>
</i>><i> Dialed number: 8585554444 forwards to 18552223333
</i>><i>
</i>><i> When the call comes in Opensips this is my initial invite...
</i>><i>
</i>><i>
</i>><i> INVITE sip:<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">+18552223333 at 111.222.333.444</a>:5060 SIP/2.0
</i>><i> Via: SIP/2.0/UDP 11.11.11.11:5060;branch=z9hG4bK08B4ca619b00ce6405c
</i>><i> From: <sip:<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">+18586669999 at 11.11.11.11</a>:5060;isup-oli=0>;tag=gK084a85fd
</i>><i> To: <sip:<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">8585554444 at 111.222.333.444</a>:5060>
</i>><i> Call-ID: <a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">537432242_53736858 at 11.11.11.11</a>
</i>><i> CSeq: 17719 INVITE
</i>><i> Max-Forwards: 93
</i>><i> Allow: INVITE,ACK,CANCEL,BYE,PRACK,UPDATE
</i>><i> Accept: application/sdp, application/isup, application/dtmf,
</i>><i> application/dtmf-relay, multipart/mixed
</i>><i> Contact: <sip:<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">+18586669999 at 11.11.11.11</a>:5060>
</i>><i> P-Asserted-Identity: <sip:<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">+18586669999 at 11.11.11.11</a>:5060>
</i>><i> Diversion: <sip:<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">+18585554444 at 11.11.11.11</a>:5060>;privacy=off;screen=no;
</i>><i> reason=no-answer; counter=1
</i>><i> Supported: 100rel
</i>><i> Content-Length: 200
</i>><i> Content-Disposition: session; handling=required
</i>><i> Content-Type: application/sdp
</i>><i>
</i>><i> I see that the initial INVITE shows the toll free number that the call
</i>><i> was forwarded to but the TO: shows the original dialed number.
</i>><i> My question is can I grab the phone number from the initial INVITE? I
</i>><i> have goggled around and tried using the search but it just returns a 1
</i>><i> or 0 for a match. I know once I am able to grab the number from the
</i>><i> INVITE can then update the TO:field. I have dumped out almost all of
</i>><i> the vars from Opensips and none of them show me the phone number from
</i>><i> the initial INVITE.
</i>><i>
</i>><i> Any help is appreciated.
</i>><i>
</i>><i> Thanks,
</i>><i>
</i>><i>
</i>><i> James
</i>><i>
</i>><i>
</i>><i>
</i>><i> _______________________________________________
</i>><i> Users mailing list
</i>><i> <a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">Users at lists.opensips.org</a>
</i>><i> <a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</i>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <<a moz-do-not-send="true" href="http://lists.opensips.org/pipermail/users/attachments/20141212/4edf7d23/attachment.htm">http://lists.opensips.org/pipermail/users/attachments/20141212/4edf7d23/attachment.htm</a>></pre>
</font>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>