<div dir="ltr"><div><div><br></div>Ok, thanks.<br><br></div>I did<br><div><br>if (is_method(&quot;REGISTER&quot;)) # WebRTC  (accepts anything for now)<br>{<br>     <br>        $avp(aor) = &quot;sip:&quot; + $tU + &quot;@&quot; + $si + &quot;:5092&quot;;<br>
        if (!save(&quot;location&quot;,&quot;&quot;,&quot;$avp(aor)&quot;)) {<br>                sl_reply_error();<br>                xlog(&quot;Location could not be saved&quot;);<br>        }<br>                xlog(&quot;$si has been registered  [tU:$tU/si:$si]&quot;);<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">&lt;<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a>&gt;</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) = &quot;sip:&quot; + $tU + &quot;@&quot; + $si + &quot;:5092&quot;;<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>
&lt;mailto:<a href="mailto:sips%253A61370000000@10.10.1.120" target="_blank">sips%3A61370000000@10.<u></u>10.1.120</a>&gt;<div class=""><br>
<br>
I was thinking in something like  &#39; $avp(aor)=&quot;sip:$tU@$si:5092&quot;  &#39;<br>
but the variables $tU@$si doesn&#39;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 &lt;<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a><br></div><div class="">
&lt;mailto:<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a>&gt;&gt; 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(&quot;Contact&quot;);<br>
    append_hf(&quot;Contact: &lt;sip:$tU@$si:5092&gt;\r\n&quot;);<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>
    &lt;<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>&gt;<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 &lt;<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-<u></u>solutions.com</a>&gt;<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(&quot;REGISTER&quot;))<br>
        {<br>
<br></div>
        if (!save(&quot;location&quot;,&quot;&quot;,&quot;<a href="http://sip:__61370000000@10.10.1.120:5090" target="_blank">sip:__<u></u>61370000000@10.10.1.120:5090</a><br>
        &lt;<a href="http://sip:61370000000@10.10.1.120:5090" target="_blank">http://sip:61370000000@10.10.<u></u>1.120:5090</a>&gt;<br>
        &lt;http://sip:61370000000@10.10.<u></u>__1.120:5090<div class=""><br>
        &lt;<a href="http://sip:61370000000@10.10.1.120:5090" target="_blank">http://sip:61370000000@10.10.<u></u>1.120:5090</a>&gt;&gt;&quot;)) { .... }<br>
<br>
        - and -<br>
        $avp(aor)=&quot;sip:$tU@$si:5092&quot;;<br></div>
        if (!save(&quot;location&quot;,&quot;f&quot;,&quot;$avp(__<u></u>aor))&quot;) { ... }<div class=""><br>
<br>
        }<br>
<br>
        But doesn&#39;t work.<br>
<br>
        Any suggestion?<br>
<br>
<br>
<br>
        --<br>
        &quot;Efficiency is doing things right; effectiveness is doing the right<br>
        things(Peter Drucker)&quot;<br>
<br>
<br>
        Miguel Oyarzo<br>
        DevOps &amp; VoIP Engineer<br>
        Linux User: # 483188 - <a href="http://counter.li.org" target="_blank">counter.li.org</a> &lt;<a href="http://counter.li.org" target="_blank">http://counter.li.org</a>&gt;<br></div>
        &lt;<a href="http://counter.li.org" target="_blank">http://counter.li.org</a>&gt;<br>
        <a href="http://au.linkedin.com/in/__mikeaustralia" target="_blank">http://au.linkedin.com/in/__<u></u>mikeaustralia</a><br>
        &lt;<a href="http://au.linkedin.com/in/mikeaustralia" target="_blank">http://au.linkedin.com/in/<u></u>mikeaustralia</a>&gt;<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> &lt;mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.<u></u>org</a>&gt;<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>
        &lt;<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>&gt;<br>
<br>
<br>
    ______________________________<u></u>___________________<br>
    Users mailing list<br>
    <a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a> &lt;mailto:<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.<u></u>org</a>&gt;<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>
    &lt;<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>&gt;<br>
<br>
<br>
<br>
<br>
--<br>
&quot;Efficiency is doing things right; effectiveness is doing the right<br>
things(Peter Drucker)&quot;<br>
<br>
Miguel Oyarzo<br>
DevOps &amp; VoIP Engineer<br>
Linux User: # 483188 - <a href="http://counter.li.org" target="_blank">counter.li.org</a> &lt;<a href="http://counter.li.org" target="_blank">http://counter.li.org</a>&gt;<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)">&quot;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>&quot;<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 &amp; 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>