Hello,
for <= 1.5 is not easy to get to it, unless you use db mode only and
play directly to database.
In 3.0+ you can change the contact header and then use msg_apply_changes():
then do save to location.
Cheers,
Daniel
On 3/30/10 7:03 PM, NeoTel Lists wrote:
Again sorry, too much trial&error makes a lot of
noise ...
if (avp_subst("$(avp(contact))",
"/;phone-context=q([01]\.[0-9]+)(.*>)?([^>]*)/\2\3;q=\1/i")) {
# just to have it handy int that var(Q)
$var(Q) = $(avp(contact){s.select,1,>}{param.value,q});
remove_hf("Contact");
append_hf("Contact: $(avp(contact))\r\n"); # must not add q= twice
}
-> Same result: q=-1 in Database.
-----Ursprüngliche Nachricht-----
Von: users-bounces(a)lists.kamailio.org [mailto:users-bounces@lists.kamailio.org] Im
Auftrag von NeoTel Lists
Gesendet: Dienstag, 30. März 2010 18:56
An: Alex Balashov; users(a)lists.kamailio.org
Betreff: Re: [Kamailio-Users] Registrar: Save modified contact / set the qvalue
Sorry for being unclear: I meant: Modify the contact in the script, then do save().
E.g.
$(avp(contact)) = $ct;
# Those Patton can't send the q value ... Misuse their ;phone-context param
if (avp_subst("$(avp(contact))",
"/;phone-context=q([01]\.[0-9])(.*>)?([^>]*)/\2\3;q=\1/i")) {
# just to have it handy int that var(Q)
$var(Q) = $(avp(contact){s.select,1,>}{param.value,q});
remove_hf("Contact");
append_hf("Contact: $(avp(contact));q=$var(Q)r\n");
# subst() does the same, also not save()ed
}
...
setbflag(1);
fix_nated_register();
save("contactimpl_nat", "0x02");
Br
Walter
-----Ursprüngliche Nachricht-----
Von: users-bounces(a)lists.kamailio.org [mailto:users-bounces@lists.kamailio.org] Im
Auftrag von Alex Balashov
Gesendet: Dienstag, 30. März 2010 17:58
An: users(a)lists.kamailio.org
Betreff: Re: [Kamailio-Users] Registrar: Save modified contact / set the q value
On 03/30/2010 11:36 AM, NeoTel Lists wrote:
Hello Everybody!
Is there any way to save(domain, 0x02) the contact after it has been
changed somehow in Kamailio<= 1.5?
If it were not possible, how would nathelper:fix_nated_contact() work?