hi
I want to restrict invite when regiest unsuccessful even the invite request have right authentication. actually,i just want to only one person can call to pstn,others cant call even have sipid and password.now i has set by modparam("registrar", "max_contacts", 10).but cant restrict the invite by the sipphone no need regiestion.
so plz help,many thx.
On Tue, 8 Jan 2008, liu york wrote:
Are you authenticating INVITEs differently than you are authenticating registrations? In other words, are the authentication realm and required credentials different for your proxy_challenge() than they are for your www_challenge() for handling REGISTER requests?
If they are, it seems that all you should have to do is do a lookup() and see if it fails. Presumably, you are doing a save() into your registrar/usrloc only on valid REGISTER challenges?
i.e.
if(is_method("INVITE")) { if(!lookup("location")) { sl_send_reply("403", "Forbidden -- REGISTER invalid."); exit; } }
-- Alex Balashov Evariste Systems Web : http://www.evaristesys.com/ Tel : +1-678-954-0670 Direct : +1-678-954-0671
Also, the 'max_contacts' setting controls the number of concurrent contact URIs that the registrar can hold for registered clients. For instance, if a user has two phones in two different places, a setting of 2 or greater will allow them both to be reachable in a non-mutually exclusive way.
It has nothing to do with limiting calls to the PSTN.
If you want to limit concurrent calls to the PSTN, you are going to have to use an AVP or a custom database interaction or an outboard script called from the route plan in order to flag a call as being open or closed, and reject subsequent calls if one is already in progress. This stands to be mostly reliable, although it will have trouble if OpenSER dies in the middle of an open call and never detects the BYE or CANCEL corresponding to it, although using a persistent database entry that stores the Call-ID (GUID) can even let you get around that to some extent.
-- Alex Balashov Evariste Systems Web : http://www.evaristesys.com/ Tel : +1-678-954-0670 Direct : +1-678-954-0671