Re: [Kamailio-Users] Registrar: Save modified contact / set the q value

2010-03-30 Thread Alex Balashov

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?


--
Alex Balashov - Principal
Evariste Systems LLC

Tel: +1 678-954-0670
Direct : +1 678-954-0671
Web: http://www.evaristesys.com/

___
Kamailio (OpenSER) - Users mailing list
Users@lists.kamailio.org
http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
http://lists.openser-project.org/cgi-bin/mailman/listinfo/users


Re: [Kamailio-Users] Registrar: Save modified contact / set the q value

2010-03-30 Thread NeoTel Lists
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-boun...@lists.kamailio.org [mailto:users-boun...@lists.kamailio.org] 
Im Auftrag von Alex Balashov
Gesendet: Dienstag, 30. März 2010 17:58
An: users@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?


-- 
Alex Balashov - Principal
Evariste Systems LLC

Tel: +1 678-954-0670
Direct : +1 678-954-0671
Web: http://www.evaristesys.com/

___
Kamailio (OpenSER) - Users mailing list
Users@lists.kamailio.org
http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
http://lists.openser-project.org/cgi-bin/mailman/listinfo/users

___
Kamailio (OpenSER) - Users mailing list
Users@lists.kamailio.org
http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
http://lists.openser-project.org/cgi-bin/mailman/listinfo/users


Re: [Kamailio-Users] Registrar: Save modified contact / set the q value

2010-03-30 Thread Daniel-Constantin Mierla



On 3/30/10 5:58 PM, Alex Balashov wrote:

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?


this is slightly different thing, that is intended for forwarded 
requests, patching the contact address, which becomes effecting before 
forwarding.


For save in location, still the contact from header is used, since most 
of the phones won't accept requests not matching their registered 
contact address.


In the first version, in location was saved the ip and port of NAT box 
as contact address, but phones rejected calls. Now, the contact address 
from REGISTER is saved and along with it the source ip and port in 
received column.


Cheers,
Daniel


--
Daniel-Constantin Mierla * http://www.asipto.com/ * 
http://twitter.com/miconda * 
http://www.linkedin.com/in/danielconstantinmierla


___
Kamailio (OpenSER) - Users mailing list
Users@lists.kamailio.org
http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
http://lists.openser-project.org/cgi-bin/mailman/listinfo/users


Re: [Kamailio-Users] Registrar: Save modified contact / set the q value

2010-03-30 Thread Daniel-Constantin Mierla



On 3/30/10 7:14 PM, Alex Balashov wrote:

On 03/30/2010 01:10 PM, Daniel-Constantin Mierla wrote:



On 3/30/10 5:58 PM, Alex Balashov wrote:

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?


this is slightly different thing, that is intended for forwarded
requests, patching the contact address, which becomes effecting before
forwarding.

For save in location, still the contact from header is used, since most
of the phones won't accept requests not matching their registered
contact address.

In the first version, in location was saved the ip and port of NAT box
as contact address, but phones rejected calls. Now, the contact address
from REGISTER is saved and along with it the source ip and port in
received column.


Yes, but if NAT flag is set, then RURI will contain the received 
ip:port in the domain portion upon lookup(), right?


No, r-uri is the contact address from REGISTER.

  Otherwise, how do you get far-end NAT traversal for incoming calls 
(to the registrants) to work?


dst_uri field is set to received ip:port, so the nat box is used as 
outbound proxy.


Cheers,
Daniel

--
Daniel-Constantin Mierla * http://www.asipto.com/ * 
http://twitter.com/miconda * 
http://www.linkedin.com/in/danielconstantinmierla


___
Kamailio (OpenSER) - Users mailing list
Users@lists.kamailio.org
http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
http://lists.openser-project.org/cgi-bin/mailman/listinfo/users


Re: [Kamailio-Users] Registrar: Save modified contact / set the q value

2010-03-30 Thread Alex Balashov

On 03/30/2010 01:17 PM, Daniel-Constantin Mierla wrote:


No, r-uri is the contact address from REGISTER.


Otherwise, how do you get far-end NAT traversal for incoming calls (to
the registrants) to work?


dst_uri field is set to received ip:port, so the nat box is used as
outbound proxy.


Hmm.  I guess I have been doing it wrong for a long time on 1.x by 
using fix_nated_contact() on REGISTER processing where NAT is 
detected, instead of fix_nated_register() and separation into contact 
and received as you describe.  But in my case it works...


--
Alex Balashov - Principal
Evariste Systems LLC

Tel: +1 678-954-0670
Direct : +1 678-954-0671
Web: http://www.evaristesys.com/

___
Kamailio (OpenSER) - Users mailing list
Users@lists.kamailio.org
http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
http://lists.openser-project.org/cgi-bin/mailman/listinfo/users


Re: [Kamailio-Users] Registrar: Save modified contact / set the q value

2010-03-30 Thread Ovidiu Sas
If you need this in 1.5, try to fix the contact header and then
forward the REGISTER back to yourself.
The loopback REGISTER should have the fixed Contact header and now you
can call save().
You will need to tweak a a little bit the config to get everything
right into the usrloc (the loopback REGISTER will come from the server
IP) and it might work.

Regards,
Ovidiu Sas

On Tue, Mar 30, 2010 at 11:36 AM, NeoTel Lists mailingli...@neotel.at wrote:
 Hello Everybody!

 Is there any way to save(domain, 0x02) the contact after it has been changed
 somehow in Kamailio = 1.5?
 Do I have to upgrade to 3.0 and use msg_apply_changes() before save()?

 Or: Can I set the to be saved q value somehow?

 br
 Walter

 ___
 Kamailio (OpenSER) - Users mailing list
 Users@lists.kamailio.org
 http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
 http://lists.openser-project.org/cgi-bin/mailman/listinfo/users


___
Kamailio (OpenSER) - Users mailing list
Users@lists.kamailio.org
http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
http://lists.openser-project.org/cgi-bin/mailman/listinfo/users