Hello Guys,
Is there any chance to modify at running time (in a register event) the max_contacts parameter? I am running OpenSER version 1.4 .
Regards,
Rafael Rincon rrincon@ipcomnetwork.com +13054772902 x 111
Thanks a lot !!!
Rafael Rincon rrincon@ipcomnetwork.com +13054772902 x 111
On Sep 13, 2011, at 7:17 AM, Juha Heinanen wrote:
Rafael Rincon writes:
Is there any chance to modify at running time (in a register event) the max_contacts parameter? I am running OpenSER version 1.4 .
please check archives before posting. this issue was discussed recently.
-- juha
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
On 9/13/11 4:43 PM, Rafael Rincon wrote:
Hello Guys,
Is there any chance to modify at running time (in a register event) the max_contacts parameter? I am running OpenSER version 1.4 .
if you refer to registrar module parameter max_contacts, no it is not possible. Are you looking to change its value globally or you want it more like per user value?
Cheers, Daniel
Hello Daniel,
per user basis will be great!
Rafael Rincon rrincon@ipcomnetwork.com +13054772902 x 111
On Sep 13, 2011, at 11:00 AM, Daniel-Constantin Mierla wrote:
Hello,
On 9/13/11 4:43 PM, Rafael Rincon wrote:
Hello Guys,
Is there any chance to modify at running time (in a register event) the max_contacts parameter? I am running OpenSER version 1.4 .
if you refer to registrar module parameter max_contacts, no it is not possible. Are you looking to change its value globally or you want it more like per user value?
Cheers, Daniel
-- Daniel-Constantin Mierla -- http://www.asipto.com Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat http://linkedin.com/in/miconda -- http://twitter.com/miconda
Hello,
On 9/13/11 5:04 PM, Rafael Rincon wrote:
Hello Daniel,
per user basis will be great!
changing global value at runtime is possible in 3.1 via config parameter reload framework.
For a per user value, you can script it in config, but starting with version 1.5, using pseudo-variable class $ul(...): http://kamailio.org/docs/modules/1.5.x/registrar.html#id3057709
It should look like (well, config for 3.1, but should be valid for :
# Check if maximum registered contacts per aor exceeded - limit value in $avp(max_regs) if (reg_fetch_contacts("location", "$tu", "reg")) { $var(i) = 0; $var(found) = 0; if($ulc(reg=>count)>0 && is_present_hf("Contact")) { $var(contact) = $(ct{tobody.uri}); while($var(found) == 0 && $var(i) < $ulc(reg=>count)) { if($var(contact)==$(ulc(reg=>addr)[$var(i)])) $var(found) = 1; else $var(i) = $var(i) + 1; } } if ($var(found) == 0 && is_present_hf("Contact")) { # - check against max val if($ulc(reg=>count)>=$avp(max_regs)) { # too many registrations sl_send_reply("403", "Too Many Registrations"); exit; } } }
The idea is: fetch the contacts and iterate through it to match the address. If there is no match, then it is a new contact and check against the limit.
Hope it helps!
Cheers, Daniel
Rafael Rincon rrincon@ipcomnetwork.com +13054772902 x 111
On Sep 13, 2011, at 11:00 AM, Daniel-Constantin Mierla wrote:
Hello,
On 9/13/11 4:43 PM, Rafael Rincon wrote:
Hello Guys,
Is there any chance to modify at running time (in a register event) the max_contacts parameter? I am running OpenSER version 1.4 .
if you refer to registrar module parameter max_contacts, no it is not possible. Are you looking to change its value globally or you want it more like per user value?
Cheers, Daniel
-- Daniel-Constantin Mierla -- http://www.asipto.com Kamailio Advanced Training, Oct 10-13, Berlin: http://asipto.com/u/kat http://linkedin.com/in/miconda -- http://twitter.com/miconda
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
On 9/13/11 5:25 PM, Olle E. Johansson wrote:
13 sep 2011 kl. 17:21 skrev Daniel-Constantin Mierla:
if($var(contact)==$(ulc(reg=>addr)[$var(i)]))
Is this a reliable way to compare URI's in Kamailio? Didn't someone implement a function that did this in an improved way?
works in most of the cases (since we all in SIP use e164-formatted usernames :-D and don't bother much with other transports than UDP) -- it is string case insensitive comparison...
But you are right, someone implemented at some point cmp_uri() which is available in siputils module:
http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=commit;h=781c13d...
Using it results in better and RFC compliant matching :-)
Cheers, Daniel