<div dir="ltr"><div><div><div>Hi Razvan,<br><br></div>I need to register some clients in Opensips. Those clients will come from different IP addresses.<br><br>Then, allow Opensips to redirect INVITES to those registered clients to B2BUA gateway. In that B2BUA server there is an identical location entry as per Opensips received.<br>
<br></div>Scenario is:<br><br></div>WebCliente--------- REGISTER ---------------------Opensips------SipEndpoint<br><div><div> \------- REGISTER---B2BUA</div><div><br></div><div>- WebClient is sending now two REGISTER messages to both B2BUA and SipEndpoint<br>
</div><div>- Opensips must save() and replace Contact IP:Port to point to B2BUA (that's the Contact change I would like to do)<br></div><div>- Then, INVITE from SipEndpoint to Opensips must search for this registered user and then send the call to B2BUA <br>
(not to WebCliente)<br><br></div><div><br></div><div>Do you think, it's not possible to update contact in location database?<br></div><div><br></div><div><div><br></div></div></div></div><div class="gmail_extra"><br>
<br><div class="gmail_quote">On Thu, Jun 19, 2014 at 5:30 PM, Răzvan Crainea <span dir="ltr"><<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi, Miguel!<br>
<br>
There is no way you can change the contact header - it is something taken from the SIP message. What you are changing there is the AOR username and domain of that customer.<br>
May I ask you what are you trying to achieve? Perhaps there's a different way of doing it.<div class=""><br>
<br>
Best regards,<br>
<br>
Razvan Crainea<br>
OpenSIPS Core Developer<br>
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.<u></u>com</a><br>
<br></div><div class="">
On 06/19/2014 10:13 AM, Miguel Oyarzo wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
<br>
Ok, thanks.<br>
<br>
I did<br>
<br>
if (is_method("REGISTER")) # WebRTC (accepts anything for now)<br>
{<br>
<br>
$avp(aor) = "sip:" + $tU + "@" + $si + ":5092";<br>
if (!save("location","","$avp(<u></u>aor)")) {<br>
sl_reply_error();<br>
xlog("Location could not be saved");<br>
}<br>
xlog("$si has been registered [tU:$tU/si:$si]");<br>
exit;<br>
}<br>
<br>
restart OK.<br>
log: Jun 19 17:13:04 ip-10-10-1-105 /usr/sbin/opensips[22253]:<br>
10.10.1.120 has been registered [tU:61370000000/si:10.10.1.<u></u>120]<br>
<br>
But,<br>
balancer=# SELECT username,contact from location;<br>
username | contact<br>
-------------+----------------<u></u>------------------------------<u></u>-------------------------<br>
61370000000 |<br>
sips:61370000000@df7jal23ls0d.<u></u>invalid;rtcweb-breaker=no;<u></u>transport=wss<br>
<br>
<br>
Contact is still the original. Any idea?<br>
<br>
<br>
<br>
<br>
<br>
On Thu, Jun 19, 2014 at 5:04 PM, Răzvan Crainea <<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a><br></div><div class="">
<mailto:<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a>>> wrote:<br>
<br>
Hi, Miguel!<br>
<br></div><div class="">
The save() function[1] only accepts a pseudovariable, not a format<br>
as parameter. And the way you build the $avp(aor) is not a valid<br>
syntax. You should have something like:<br>
<br>
$avp(aor) = "sip:" + $tU + "@" + $si + ":5092";<br>
<br>
[1]<br></div>
<a href="http://www.opensips.org/html/__docs/modules/1.11.x/registrar#__id294034" target="_blank">http://www.opensips.org/html/_<u></u>_docs/modules/1.11.x/<u></u>registrar#__id294034</a><div class=""><br>
<<a href="http://www.opensips.org/html/docs/modules/1.11.x/registrar#id294034" target="_blank">http://www.opensips.org/html/<u></u>docs/modules/1.11.x/registrar#<u></u>id294034</a>><br>
<br>
<br>
Best regards,<br>
<br>
Razvan Crainea<br>
OpenSIPS Core Developer<br></div>
<a href="http://www.opensips-solutions." target="_blank">http://www.opensips-solutions.</a><u></u>__com <<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-<u></u>solutions.com</a>><br>
<br><div class="">
On 06/19/2014 10:00 AM, Miguel Oyarzo wrote:<br>
<br>
<br>
Hi Razvan,<br>
<br>
Thanks for your reply.<br>
That was a good question. I want to change the contact in database.<br>
<br>
Would like to get something like<br>
balancer=# SELECT username,contact from location;<br>
username | contact<br></div>
-------------+----------------<u></u>__----------------------------<u></u>--__-------------------------<div class=""><br>
61370000000 | <a href="mailto:sips%3A61370000000@10.10.1.120" target="_blank">sips:61370000000@10.10.1.120</a><br>
<mailto:<a href="mailto:sips%253A61370000000@10.10.1.120" target="_blank">sips%3A61370000000@10.<u></u>10.1.120</a>><br></div>
<mailto:<a href="mailto:sips%253A61370000000@10." target="_blank">sips%3A61370000000@10.</a><u></u>__10.1.120<br>
<mailto:<a href="mailto:sips%25253A61370000000@10.10.1.120" target="_blank">sips%253A61370000000@<u></u>10.10.1.120</a>>><div class=""><br>
<br>
<br>
I was thinking in something like ' $avp(aor)="sip:$tU@$si:5092" '<br>
but the variables $tU@$si doesn't like to be expanded in save().<br>
<br>
I must be dynamic (not hard-code)<br>
<br>
Any idea how to do it?<br>
<br>
<br>
<br>
On Thu, Jun 19, 2014 at 4:39 PM, Răzvan Crainea<br>
<<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a> <mailto:<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a>><br></div><div class="">
<mailto:<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a> <mailto:<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a>>>> wrote:<br>
<br>
Hi, Miguel!<br>
<br>
Do you only want to change the Contact info that is stored in<br>
OpenSIPS database or change the Contact header in the<br>
REGISTER message?<br>
The code you pasted changes only the info in the location<br>
table. If<br>
you want to change the header, you can remove it and add a<br>
new one.<br>
Something like:<br>
<br>
remove_hf("Contact");<br>
append_hf("Contact: <sip:$tU@$si:5092>\r\n");<br>
<br>
See [1] for more details.<br>
<br>
[1]<br></div>
<a href="http://www.opensips.org/html/____docs/modules/devel/sipmsgops#____id249696" target="_blank">http://www.opensips.org/html/_<u></u>___docs/modules/devel/<u></u>sipmsgops#____id249696</a><br>
<<a href="http://www.opensips.org/html/__docs/modules/devel/sipmsgops#__id249696" target="_blank">http://www.opensips.org/html/<u></u>__docs/modules/devel/<u></u>sipmsgops#__id249696</a>><div class=""><br>
<br>
<br>
<<a href="http://www.opensips.org/html/__docs/modules/devel/sipmsgops#__id249696" target="_blank">http://www.opensips.org/html/<u></u>__docs/modules/devel/<u></u>sipmsgops#__id249696</a><br>
<<a href="http://www.opensips.org/html/docs/modules/devel/sipmsgops#id249696" target="_blank">http://www.opensips.org/html/<u></u>docs/modules/devel/sipmsgops#<u></u>id249696</a>>><br>
<br>
Best regards,<br>
<br>
Razvan Crainea<br>
OpenSIPS Core Developer<br></div>
<a href="http://www.opensips-solutions." target="_blank">http://www.opensips-solutions.</a><u></u>____com<br>
<<a href="http://www.opensips-__solutions.com" target="_blank">http://www.opensips-__<u></u>solutions.com</a><div class=""><br>
<<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-<u></u>solutions.com</a>>><br>
<br>
<br>
<br>
On 06/19/2014 09:10 AM, Miguel Oyarzo wrote:<br>
<br>
<br>
Hi,<br>
<br>
How can I change the Contact info in REGISTER messages?<br>
<br>
I have tried<br>
if (is_method("REGISTER"))<br>
{<br>
<br>
if<br></div>
(!save("location","","<a href="http://sip:____61370000000@10.10.1.120:5090" target="_blank">sip:____<u></u>61370000000@10.10.1.120:5090</a><br>
<<a href="http://sip:__61370000000@10.10.1.120:5090" target="_blank">http://sip:__61370000000@10.<u></u>10.1.120:5090</a>><div class=""><br>
<http://sip:61370000000@10.10.<u></u>__1.120:5090<br>
<<a href="http://sip:61370000000@10.10.1.120:5090" target="_blank">http://sip:61370000000@10.10.<u></u>1.120:5090</a>>><br></div>
<http://sip:61370000000@10.10.<u></u>____1.120:5090<div class=""><br>
<br>
<http://sip:61370000000@10.10.<u></u>__1.120:5090<br>
<<a href="http://sip:61370000000@10.10.1.120:5090" target="_blank">http://sip:61370000000@10.10.<u></u>1.120:5090</a>>>>")) { .... }<br>
<br>
- and -<br>
$avp(aor)="sip:$tU@$si:5092";<br></div>
if (!save("location","f","$avp(__<u></u>__aor))") { ... }<div class=""><br>
<br>
<br>
}<br>
<br>
But doesn't work.<br>
<br>
Any suggestion?<br>
<br>
<br>
<br>
--<br>
"Efficiency is doing things right; effectiveness is<br>
doing the right<br>
things(Peter Drucker)"<br>
<br>
<br>
Miguel Oyarzo<br>
DevOps & VoIP Engineer<br>
Linux User: # 483188 - <a href="http://counter.li.org" target="_blank">counter.li.org</a><br>
<<a href="http://counter.li.org" target="_blank">http://counter.li.org</a>> <<a href="http://counter.li.org" target="_blank">http://counter.li.org</a>><br></div>
<<a href="http://counter.li.org" target="_blank">http://counter.li.org</a>><br>
<a href="http://au.linkedin.com/in/____mikeaustralia" target="_blank">http://au.linkedin.com/in/____<u></u>mikeaustralia</a><br>
<<a href="http://au.linkedin.com/in/__mikeaustralia" target="_blank">http://au.linkedin.com/in/__<u></u>mikeaustralia</a>><div class=""><br>
<<a href="http://au.linkedin.com/in/__mikeaustralia" target="_blank">http://au.linkedin.com/in/__<u></u>mikeaustralia</a><br>
<<a href="http://au.linkedin.com/in/mikeaustralia" target="_blank">http://au.linkedin.com/in/<u></u>mikeaustralia</a>>><br>
Melbourne, Australia<br>
<br>
<br></div>
______________________________<u></u>_____________________<div class=""><br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.<u></u>org</a>><br></div>
<mailto:<a href="mailto:Users@lists.opensips." target="_blank">Users@lists.opensips.</a>_<u></u>_org<br>
<mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.<u></u>org</a>>><br>
<a href="http://lists.opensips.org/cgi-____bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>____bin/mailman/listinfo/users</a><br>
<<a href="http://lists.opensips.org/cgi-__bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/<u></u>cgi-__bin/mailman/listinfo/<u></u>users</a>><br>
<br>
<<a href="http://lists.opensips.org/__cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/__<u></u>cgi-bin/mailman/listinfo/users</a><br>
<<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/<u></u>cgi-bin/mailman/listinfo/users</a><u></u>>__><br>
<br>
<br>
______________________________<u></u>_____________________<div class=""><br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.<u></u>org</a>><br></div>
<mailto:<a href="mailto:Users@lists.opensips." target="_blank">Users@lists.opensips.</a>_<u></u>_org<br>
<mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.<u></u>org</a>>><br>
<a href="http://lists.opensips.org/cgi-____bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>____bin/mailman/listinfo/users</a><br>
<<a href="http://lists.opensips.org/cgi-__bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/<u></u>cgi-__bin/mailman/listinfo/<u></u>users</a>><br>
<br>
<<a href="http://lists.opensips.org/__cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/__<u></u>cgi-bin/mailman/listinfo/users</a><br>
<<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/<u></u>cgi-bin/mailman/listinfo/users</a><u></u>>__><div><div class="h5"><br>
<br>
<br>
<br>
<br>
--<br>
"Efficiency is doing things right; effectiveness is doing the right<br>
things(Peter Drucker)"<br>
<br>
Miguel Oyarzo<br>
DevOps & VoIP Engineer<br>
Linux User: # 483188 - <a href="http://counter.li.org" target="_blank">counter.li.org</a> <<a href="http://counter.li.org" target="_blank">http://counter.li.org</a>><br>
<<a href="http://counter.li.org" target="_blank">http://counter.li.org</a>><br>
<a href="http://au.linkedin.com/in/__mikeaustralia" target="_blank">http://au.linkedin.com/in/__<u></u>mikeaustralia</a><br>
<<a href="http://au.linkedin.com/in/mikeaustralia" target="_blank">http://au.linkedin.com/in/<u></u>mikeaustralia</a>><br>
Melbourne, Australia<br>
<br>
<br>
______________________________<u></u>___________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.<u></u>org</a>><br>
<a href="http://lists.opensips.org/cgi-__bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>__bin/mailman/listinfo/users</a><br>
<<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/<u></u>cgi-bin/mailman/listinfo/users</a><u></u>><br>
<br>
<br>
______________________________<u></u>___________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> <mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.<u></u>org</a>><br>
<a href="http://lists.opensips.org/cgi-__bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>__bin/mailman/listinfo/users</a><br>
<<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/<u></u>cgi-bin/mailman/listinfo/users</a><u></u>><br>
<br>
<br>
<br>
<br>
--<br>
"Efficiency is doing things right; effectiveness is doing the right<br>
things(Peter Drucker)"<br>
<br>
Miguel Oyarzo<br>
DevOps & VoIP Engineer<br>
Linux User: # 483188 - <a href="http://counter.li.org" target="_blank">counter.li.org</a> <<a href="http://counter.li.org" target="_blank">http://counter.li.org</a>><br>
<a href="http://au.linkedin.com/in/mikeaustralia" target="_blank">http://au.linkedin.com/in/<u></u>mikeaustralia</a><br>
Melbourne, Australia<br>
<br>
<br>
______________________________<u></u>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>bin/mailman/listinfo/users</a><br>
<br>
</div></div></blockquote><div class="HOEnZb"><div class="h5">
<br>
______________________________<u></u>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>bin/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr"><div><span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">"Efficiency is doing things right; effectiveness is doing the right things</span><span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> (Peter Drucker)</span>"<br>
</span></div><br><div><span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Miguel Oyarzo</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">DevOps & VoIP Engineer</span><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Linux User: # 483188 - </span><font color="#888888" face="arial, sans-serif"><a href="http://counter.li.org" target="_blank">counter.li.org</a></font><br style="color:rgb(136,136,136);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="background-color:rgb(255,255,255)"><font color="#888888" face="arial, sans-serif"><a href="http://au.linkedin.com/in/mikeaustralia" target="_blank">http://au.linkedin.com/in/mikeaustralia</a> </font><br><font color="#888888" face="arial, sans-serif">Melbourne, Australia</font></span>
</div></div>
</div>