[SR-Users] Session authorization just before initiate it

Klaus Darilion klaus.mailinglists at pernau.at
Fri Jul 1 23:32:49 CEST 2011


Hi Roberto!

The best location of applying such a "policy" function depends on
several things:

First, you need to have all the data you are requiring. E.g. if you want
to check if a certain user is allowed to call a certain phone number you
usually need to do first:
- authenticate the user
- normalize destination (e.g. bring phone number into E164 format or
apply alias lookups).

Then, before proceeding any further, you might check the policy using a
SQL query. Be sure to SQL escape the date you provide for the SQL lookup
to prevent SQL injection (see "transfomations").

In above case, the SQL query should be before calling lookup().

In case of presence functions you should apply policies before handling
the presence requests.

regards
klaus

Am 01.07.2011 19:23, schrieb Roberto Fichera:
> Hi All in the list,
> 
> I'm new to Kamailio but I'm actually able to quickly setup a server, including
> also the SIP presence, looking at the example I found at
> 
> http://kb.asipto.com/kamailio:presence:k31-made-simple
> 
> which explain very well how to do it. I also made some changes in the final
> setup and everything seems working well, I can have audio/video/chat session
> including the presence status of any user.
> 
> Now I would like to improve my testing setup so that for each
> call request Kamailio receive, I would like to perform some SQL lookup for
> deciding if the conversation might be established or not.
> About the SQL lookup I read about the SQLOPS module, it seems really easy
> to use, but I don't know where to put such check before the INVITE.
> 
> Could someone give me some hints?
> 
> P.S: Indeed, I need to read some good documentation about how to code a
> Kamailio config file. Any URL to suggest?
> 
> Thanks in advance,
> Roberto Fichera.
> 
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users



More information about the sr-users mailing list