<div dir="ltr"><div><div><br></div>Ok, thanks.<br><br></div>I did<br><div><br>if (is_method("REGISTER")) # WebRTC (accepts anything for now)<br>{<br> <br> $avp(aor) = "sip:" + $tU + "@" + $si + ":5092";<br>
if (!save("location","","$avp(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]: 10.10.1.120 has been registered [tU:61370000000/si:10.10.1.120]<br></div><div><br></div><div>But,<br>balancer=# SELECT username,contact from location;<br>
username | contact <br>-------------+-----------------------------------------------------------------------<br> 61370000000 | sips:61370000000@df7jal23ls0d.invalid;rtcweb-breaker=no;transport=wss<br>
</div><div><br><br></div><div>Contact is still the original. Any idea?<br><br><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 19, 2014 at 5:04 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>
The save() function[1] only accepts a pseudovariable, not a format as parameter. And the way you build the $avp(aor) is not a valid syntax. You should have something like:<br>
<br>
$avp(aor) = "sip:" + $tU + "@" + $si + ":5092";<br>
<br>
[1] <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><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:00 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>
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>
-------------+----------------<u></u>------------------------------<u></u>-------------------------<br>
61370000000 | <a href="mailto:sips%3A61370000000@10.10.1.120" target="_blank">sips:61370000000@10.10.1.120</a><br></div>
<mailto:<a href="mailto:sips%253A61370000000@10.10.1.120" target="_blank">sips%3A61370000000@10.<u></u>10.1.120</a>><div class=""><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 <<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>
Do you only want to change the Contact info that is stored in<br>
OpenSIPS database or change the Contact header in the REGISTER message?<br>
The code you pasted changes only the info in the location table. If<br>
you want to change the header, you can remove it and add a 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/sipmsgops#<u></u>__id249696</a><div class=""><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 <<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-<u></u>solutions.com</a>><div class="">
<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></div>
if (!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.10.<u></u>1.120:5090</a>><br>
<http://sip:61370000000@10.10.<u></u>__1.120:5090<div class=""><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>
But doesn't work.<br>
<br>
Any suggestion?<br>
<br>
<br>
<br>
--<br>
"Efficiency is doing things right; effectiveness is 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> <<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>><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><div class=""><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></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>