Hi List

# ----- registrar params -----
modparam("registrar", "method_filtering", 1)
# modparam("registrar", "append_branches", 0)
modparam("registrar", "max_contacts", 10)
modparam("registrar", "max_expires", 3600)
modparam("registrar", "gruu_enabled", 0)
modparam("registrar", "retry_after", 30)
modparam("registrar", "xavp_cfg", "reg")

== snipp ==
# Handle SIP registrations
route[REGISTRAR] {

        # We are authenticated.

        # Create an AOR based on the auth_username for the location service.
        $var(saveuri) = "sip:" + $aU + "@" + $rd;

        # Set max_contacts limit via registration module reg xavp.

        if ($avp(debug) > 0) {
                xlog("L_INFO", "$cfg(route): Setting max_contacts to 
$avp(max_contacts) for $var(saveuri)\n");
        }
        $xavp(reg=>max_contacts) = $avp(max_contacts);

        # Save Location!

        $var(result) = save("location","0x00","$var(saveuri)");
        if ($var(result) == -2) {
                xlog("L_ERR", "$cfg(route): Too many contacts for 
$var(saveuri)\n");
                sl_reply_error();
        }
        if ($var(result) == -1) {
                xlog("L_ERR", "$cfg(route): Error saving location 
$var(saveuri)\n");
                sl_reply_error();
        }
        if ($var(result) == 1) {
                xlog("L_INFO", "$cfg(route): Contact $var(saveuri) inserted\n");
        }
        if ($var(result) == 2) {
                xlog("L_INFO", "$cfg(route): Contact $var(saveuri) updated\n");
        }
        if ($var(result) == 3) {
                xlog("L_INFO", "$cfg(route): Contact $var(saveuri) deleted\n");
        }
        if ($var(result) == 4) {
                xlog("L_INFO", "$cfg(route): Contact $var(saveuri) returend\n");
        }
        exit;
}
== snapp ==

$avp(max_contacts) is set to 1
Still, multiple registrations are possible for the $aU in question.

What am I doing wrong?

Mit freundlichen Grüssen

-Benoît Panizzon-
-- 
I m p r o W a r e   A G    -    Leiter Commerce Kunden
______________________________________________________

Zurlindenstrasse 29             Tel  +41 61 826 93 00
CH-4133 Pratteln                Fax  +41 61 826 93 01
Schweiz                         Web  http://www.imp.ch
______________________________________________________

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

Reply via email to