<div dir="ltr"><div><div><div><br></div>Hi Razvan,<br><br></div>Thanks for your reply. <br>That was a good question. I want to change the contact in database.<br><br></div><div>Would like to get something like<br>balancer=# SELECT username,contact from location;<br>
  username   |                                contact                                <br>-------------+-----------------------------------------------------------------------<br> 61370000000 | <a href="mailto:sips%3A61370000000@10.10.1.120">sips:61370000000@10.10.1.120</a><br>
<br></div><div>I was thinking in something like  &#39; $avp(aor)=&quot;sip:$tU@$si:5092&quot;  &#39;<br></div><div>but the variables $tU@$si doesn&#39;t like to be expanded in save().<br></div><div><br></div><div>I must be dynamic (not hard-code)<br>
</div><div><br></div><div>Any idea how to do it? <br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 19, 2014 at 4:39 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>
Do you only want to change the Contact info that is stored in 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 you want to change the header, you can remove it and add a new one. 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] <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>
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.<u></u>com</a><div class=""><br>
<br>
On 06/19/2014 09:10 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,<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>
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></div>
&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;&quot;)) { .... }<div class=""><br>
- and -<br>
$avp(aor)=&quot;sip:$tU@$si:5092&quot;;<br>
if (!save(&quot;location&quot;,&quot;f&quot;,&quot;$avp(<u></u>aor))&quot;) { ... }<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></div>
things(Peter Drucker)&quot;<div class=""><br>
<br>
Miguel Oyarzo<br>
DevOps &amp; VoIP Engineer<br></div>
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>
</blockquote>
<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>
</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>