Hi Sergiu,

You can use the flags on the save() function from the registrar module
https://www.kamailio.org/docs/modules/5.1.x/modules/registrar.html#registrar.f.save

  • 0x04 - store and maintain one contact per AoR. If there are other contact addresses for AoR not matching current registration, remove them. This mode ensures one contact per AoR (user).


  • On Tue, 16 Apr 2019, at 7:33 AM, Sergiu Pojoga wrote:
    Hi ppl,

    Say we want to allow 1 contact per AOR.
    modparam("registrar", "max_contacts", 1)

    Say some UA looses connection before de-registering, then comes back shortly after (before Contact expires) and tries to register with a different Contact, but gets rejected with error "test_max_contacts(): too many contacts for AOR".

    What's the approach to handle this situation? I'd like the registrar to accept and save that AoR based on the latest registration. Similar to how Asterisk's single-contact stack `chan_sip` works - whoever was the latest to register successfully gets to be the winner.

    Thanks,
    --Sergiu
    _______________________________________________
    Kamailio (SER) - Users Mailing List
    sr-users@lists.kamailio.org
    https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users