[SR-Users] How to run MySQL queries in Kamailio

Ahmad Fuad ahmad.fawad4519 at gmail.com
Thu Apr 28 19:17:03 CEST 2016


Dear Support,

Kindly find below my Database Table (kamailio.ext). Column names are "ext"
and "ip"

mysql> select * from ext
    -> ;
+------+----------------+
| ext  | ip             |
+------+----------------+
|  202 | 192.168.55.157 |
|  203 | 192.168.55.158 |
|  204 | 192.168.55.159 |
+------+----------------+
3 rows in set (0.00 sec)

I want to run this type of queries in kamailio. I have tried following
command but no luck so far. Although I have added following line in the
configuration file as well. Thanks

modparam("sqlops", "sqlcon", "cb=>mysql://root:123456@localhost/kamailio")


sql_query("cb", "select ip from ext where ext=$rU", "ra");
sl_send_reply("302","$ra");


PLEASE HELP !!! when we see the traces using wireshark it shows internal
error. Thanks

275.733635441 192.168.55.144 -> 192.168.55.157 SIP 431 Status: 302 Internal
Server Error |

-- 
Best Regards,

Ahmad Fuad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20160428/4484c1f4/attachment.html>


More information about the sr-users mailing list