[OpenSIPS-Users] Change Contact info in REGISTER messages

Miguel Oyarzo miguelaustro at gmail.com
Thu Jun 19 09:00:01 CEST 2014


Hi Razvan,

Thanks for your reply.
That was a good question. I want to change the contact in database.

Would like to get something like
balancer=# SELECT username,contact from location;
  username   |
contact
-------------+-----------------------------------------------------------------------
 61370000000 | sips:61370000000 at 10.10.1.120

I was thinking in something like  ' $avp(aor)="sip:$tU@$si:5092"  '
but the variables $tU@$si doesn't like to be expanded in save().

I must be dynamic (not hard-code)

Any idea how to do it?



On Thu, Jun 19, 2014 at 4:39 PM, Răzvan Crainea <razvan at opensips.org> wrote:

> Hi, Miguel!
>
> Do you only want to change the Contact info that is stored in OpenSIPS
> database or change the Contact header in the REGISTER message?
> 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:
>
> remove_hf("Contact");
> append_hf("Contact: <sip:$tU@$si:5092>\r\n");
>
> See [1] for more details.
>
> [1] http://www.opensips.org/html/docs/modules/devel/sipmsgops#id249696
>
> Best regards,
>
> Razvan Crainea
> OpenSIPS Core Developer
> http://www.opensips-solutions.com
>
>
> On 06/19/2014 09:10 AM, Miguel Oyarzo wrote:
>
>>
>> Hi,
>>
>> How can I change the Contact info in REGISTER messages?
>>
>> I have tried
>> if (is_method("REGISTER"))
>> {
>>
>> if (!save("location","","sip:61370000000 at 10.10.1.120:5090
>> <http://sip:61370000000@10.10.1.120:5090>")) { .... }
>>
>> - and -
>> $avp(aor)="sip:$tU@$si:5092";
>> if (!save("location","f","$avp(aor))") { ... }
>>
>> }
>>
>> But doesn't work.
>>
>> Any suggestion?
>>
>>
>>
>> --
>> "Efficiency is doing things right; effectiveness is doing the right
>> things(Peter Drucker)"
>>
>>
>> Miguel Oyarzo
>> DevOps & VoIP Engineer
>> Linux User: # 483188 - counter.li.org <http://counter.li.org>
>> http://au.linkedin.com/in/mikeaustralia
>> Melbourne, Australia
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



-- 
"Efficiency is doing things right; effectiveness is doing the right things
(Peter Drucker)"

Miguel Oyarzo
DevOps & VoIP Engineer
Linux User: # 483188 - counter.li.org
http://au.linkedin.com/in/mikeaustralia
Melbourne, Australia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140619/ec0e0cde/attachment-0001.htm>


More information about the Users mailing list