[Serusers] How long does exec_msg wait for result??

Andres andres at telesip.net
Fri Aug 13 03:22:29 CEST 2004


Hi,

In our ser.cfg we do a database query to determine if the dialed number 
is a valid subscriber, if the user dialed a wrong number then it is sent 
to an IVR prompt.  This works well most of the time, but every now an 
then we see calls that were dialed properly yet they where transfered to 
the prompt.  I would like to know how long exec_msg waits for the query 
result and if it is tunable.  The database is on the same host as ser so 
the result should be very fast, yet I am unsure as to why it is failing 
to query the subscriber table many times a day.

MySQL is set for 1000 connections and I am not seeing a problem here.  
Any other MySQL things to look at?

Here is the code snippet:

#Now check to see if Dialed Number is Valid for one of our Subs
     if (method == "INVITE"){
                if (!exec_msg('
                QUERY="select username from subscriber where 
username=\"$SIP_OUSER\"";
                RESULT=`mysql -uXXX -pXXX -e "$QUERY" ser`;
                if [ -z "$RESULT" ];
                then exit 1; fi ;'))
                {# User Does Not Exist
                     rewriteuser("9993");
                     log(1, "Wrong Number IVR Prompt\n");
                     route(6);
                     break;
                };
     };

Our estimates indicate this fails about 5% of the time.  Any ideas?

-- 
Andres
Network Admin
http://www.telesip.net





More information about the sr-users mailing list