<p dir="ltr">Hi Fuad,<br>
I think you should put the db return value in am avp before using it in the sl_send_reply. <br>
$avp(ip) = $avp(ra=>ip) <br>
Or whatever the syntax is. Make sure that the DB query is returning the required value.</p>
<p dir="ltr">Also I guess just using a 302 is not enough and you need to set the proper contact header in the reply so the calling party make use of it.</p>
<p dir="ltr">Regards,<br>
Sammy </p>
<div class="gmail_quote">On Apr 28, 2016 1:18 PM, "Ahmad Fuad" <<a href="mailto:ahmad.fawad4519@gmail.com">ahmad.fawad4519@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Dear Support,</div><div><br></div><div>Kindly find below my Database Table (kamailio.ext). Column names are "ext" and "ip"</div><div><br></div><div>mysql> select * from ext<br>    -> ;<br>+------+----------------+<br>| ext  | ip             |<br>+------+----------------+<br>|  202 | 192.168.55.157 |<br>|  203 | 192.168.55.158 |<br>|  204 | 192.168.55.159 |<br>+------+----------------+<br>3 rows in set (0.00 sec)</div><div><br></div><div>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</div><div><br></div><div>modparam("sqlops", "sqlcon", "cb=>mysql://root:123456@localhost/kamailio")</div><div><br></div><div><br clear="all"></div><div>sql_query("cb", "select ip from ext where ext=$rU", "ra");</div><div>sl_send_reply("302","$ra");</div><div><br></div><div><br></div><div>PLEASE HELP !!! when we see the traces using wireshark it shows internal error. Thanks</div><div><br></div><div>275.733635441 192.168.55.144 -> 192.168.55.157 SIP 431 Status: 302 Internal Server Error |</div><div><br>-- <br></div><div>Best Regards,<br><br>Ahmad Fuad</div>
</div>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div>