MYSQL(Nextresult resultid ${connid}) after MySQL(Fetch fetchid ${resultid} pass) helped to resolve this.<br>you should  always get all results sp produce otherwise mysql returns error.<br><br><div class="gmail_quote">On Tue, May 17, 2011 at 4:36 PM, Borin <span dir="ltr">&lt;<a href="mailto:katerin.borin@gmail.com">katerin.borin@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Guys,<br>I am getting an error when executing another mysql query in dialplan after calling stored procedure.<br>
If calling the procedure from mysql cli it gives a result like:<br>
mysql&gt; call call_control(78236721,1000,1233);<br>
+------+<br>
| pass |<br>
+------+<br>
|    1 |<br>
+------+<br>So I need asterisk to recognize this pass and take some actions based on what the pass value is.<br>Dialplan looks like this:<br><br>MYSQL(Connect connid ${DBDefaultHost} ${DBuser} ${DBpass} ${DBname}) <br>MySQL(Query resultid ${connid} CALL call_control(78236721,1000,1233))<br>

MySQL(Fetch fetchid ${resultid} pass)<br>MYSQL(clear ${resultid})<br>MySQL(Query resultid ${connid} SELECT/INSERT whatever from table)<br><br>So, it gives me this pass value correct, but if I execute some other query INSERT or SELECT after clearing the result, it gives me an error<br>

[May 17 16:16:13] WARNING[19572]: app_addon_sql_mysql.c:374 
aMYSQL_query: aMYSQL_query: mysql_query failed. Error: Commands out of 
sync; you can&#39;t run this command now<br>The error disappears if I reconnect to mysql after calling the stored procedure but it seams not right to me to connect to mysql 2 times for 1 call. <br><br>Did anyone have the same issue?<br>

 
<br>
</blockquote></div><br>