Exec DSET isn't a very scaleable way to do this.. why not use avp_db_query in avpops instead?<div><br><br><div class="gmail_quote">On Wed, Feb 24, 2010 at 12:44 PM, Phillip Jones <span dir="ltr"><<a href="mailto:pjintheusa@gmail.com">pjintheusa@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi there,<br><br>I am new to opensips - and I am trying to convert a script currently working in SER. I am almost done - but have one last issue that is getting the better of me. This is the script part:<br>
<br>exec_dset('<br>
<br> AQUERY="CALL Routing(\"$$SIP_USER\", \"$$SIP_SRCIP\", \"$$SIP_RURI\", \"$$SIP_ORURI\", False);";<br> AURI=`mysql -Broot -pxxxxxxx -e "$$AQUERY" opensips`;<br>
<br> echo $$AQUERY > /tmp/AQUERY.txt<br> echo $$AURI> /tmp/AURI.txt<br><br> if [ ! -z "$$AURI" ] ; then<br> <br> printf ("$$AURI"); <br>
fi;<br> <br> exit;<br> <br> echo > dev/null<br> <br> ');<br><br>AURI contains "+-----------------------------------+ | DestinationURI | +-----------------------------------+ | sip:121255555666@64.55.55.555:5060 | +-----------------------------------+" which kind of makes sense.<br>
<br>Opensips falls over with error: ERROR:core:parse_uri: bad uri - which also makes sense.<br><br>If I use printf ("sip:121255555666@64.55.55.555:5060"); then every thing works nicely.<br><br>What I am missing here? If this worked in SER - what has changed - a config in MySQL??<br>
<br>Any help would be much appreciated. I think I could use REGEX here to extract the uri, but I not familiar with the syntax in opensips.<br><br><br><br>Thanks<br><font color="#888888"><br><br>pj<br>
</font><br>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>