[Serusers] lookup of sip_hf_from in location table

Chris Crawford crawford_c at pannaway.com
Wed May 12 20:15:06 CEST 2004


Hello.
 
Currently before allowing an invite, a lookup("location") is performed
which looks up the Request URI in the location table and identifies the
contacts.  I would like to lookup the source caller's contacts in the
location table as well.  Here is an instance that would require that:
 
1-       We create a user and allow them to register for a period of
time.
2-       The management system removes the user from ser, using serctl
rm, so location and other subscriber information is removed. 
3-       The UA still thinks it is registered, so it will post INVITEs,
as the action on the server did not trigger an event on the client (this
is normal).  
4-       When not in authentication mode, the proxy allows it to request
and INVITE as the lookup( "location" ) is only for the Request-URI.
 
How do I force a lookup for the source caller in the location table, so
that if the location entry is not there for the source caller it returns
a 403, triggering a reREGISTER on the UA?  I wrote the conditional below
and it seems to work, but it seems a bit 'dirty'. There must be some
other API for this... ?
 
if( exec_msg('
         FROMUSER=`/opt/tools/parseuser $SIP_HF_FROM`;
         QUERY="select contact from location
         where username=\"$FROMUSER\"";
         CONTACT=`mysql  -Bsuser -pheslo -e "$QUERY" ser`;
         if [ -z "$CONTACT" ] ; then
                 exit 0 ;
         else
                 exit 1 ;
         fi ; ') )
 
Do you have any other suggestions?
 
Cheers and thanks ahead of time,
 
Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20040512/77a7d869/attachment.htm>


More information about the sr-users mailing list