[SR-Users] MYSQL and various

Laura red_dra at plugit.net
Mon Jul 30 09:50:04 CEST 2018


Dear list,

on my kamailio 4.4.7 i use interactions with MYSQL.

For example .. i use it for some black list control and other like this..


         sql_query("cb", "select id from blacklist where cli='$var(g2)' 
and (ippeer = '$si' or ippeer = 'ALL')", "rabl");
         if($dbr(rabl=>rows)>0){
                 sql_result_free("rabl");
                 sl_send_reply("403","Forbidden blacklist");
                 exit;
         }
         sql_result_free("rabl");


I was wonder what was the best method to prevent the query going on if 
mysql don't respond for high load or other situation..

If Mysql is not able to reply to the query tight now the call continue 
over the configuration... what is the best way to prevent this and for 
examples drop it with  a standard SIP 503 error.

I have search on docs.. but i haven't found any valid way.


Thanks

Laura




More information about the sr-users mailing list