Hello all.<br>
I am trying to use app_mysql. <br>
It works for selects and functions, but does not want to work with procedures.<br>
Pls have a look:<br>
<br>
Calling function:<br>
<br>
CREATE FUNCTION f_1(a VARCHAR(20)) RETURNS INTEGER RETURN (SELECT count(*) from peer where name = a);<br>
<br>
Result:<br>
<br>
-- Executing Macro("IAX2/100-3", "local|100") in new stack<br>
-- Executing MYSQL("IAX2/100-3", "Connect connid localhost asterisk asterisk pbx_manager_new") in new stack<br>
-- Executing Set("IAX2/100-3", "QUERY=SELECT f_1('100')") in new stack<br>
-- Executing MYSQL("IAX2/100-3", "Query resultid 1 SELECT f_1('100')") in new stack<br>
-- Executing MYSQL("IAX2/100-3", "Fetch fetchid 2 vm_active") in new stack<br>
Jan 21 00:26:15 WARNING[31631]: app_addon_sql_mysql.c:318 aMYSQL_fetch: ast_MYSQL_fetch: numFields=1<br>
-- Executing NoOp("IAX2/100-3", "Voicemail active: 1") in new stack<br>
-- Executing MYSQL("IAX2/100-3", "Clear 2") in new stack<br>
-- Executing MYSQL("IAX2/100-3", "Disconnect 1") in new stack<br>
-- Executing Hangup("IAX2/100-3", "") in new stack<br>
== Spawn extension (macro-local, s, 8) exited non-zero on 'IAX2/100-3' in macro 'local'<br>
== Spawn extension (users, 123, 1) exited non-zero on 'IAX2/100-3'<br>
-- Hungup 'IAX2/100-3'<br>
<br>
So it found 1 peer.<br>
<br>
Now trying to call a procedure:<br>
<br>
CREATE PROCEDURE p_pbxuser_user_data1(IN _name VARCHAR(20))<br>
BEGIN <br>
SELECT <br>
vm_active<br>
FROM peer,voicemail,pbxuser WHERE <a href="http://peer.name">peer.name</a> = _name
AND voicemail.mailbox = _name and pbxuser.peer_name = _name;<br>
<br>
Result:<br>
<br>
-- Executing Macro("IAX2/100-5", "local|100") in new stack<br>
-- Executing MYSQL("IAX2/100-5", "Connect connid localhost asterisk asterisk pbx_manager_new") in new stack<br>
-- Executing Set("IAX2/100-5", "QUERY=call p_pbxuser_user_data1('100')") in new stack<br>
-- Executing MYSQL("IAX2/100-5", "Query resultid 1 call p_pbxuser_user_data1('100')") in new stack<br>
-- Executing MYSQL("IAX2/100-5", "Fetch fetchid vm_active") in new stack<br>
Jan 21 00:28:46 WARNING[31696]: app_addon_sql_mysql.c:115
find_identifier: Identifier 0, identifier_type 2 not found in
identifier list<br>
Jan 21 00:28:46 WARNING[31696]: app_addon_sql_mysql.c:330 aMYSQL_fetch: aMYSQL_fetch: Invalid result identifier 0 passed<br>
-- Executing NoOp("IAX2/100-5", "Voicemail active: ") in new stack<br>
-- Executing MYSQL("IAX2/100-5", "Clear ") in new stack<br>
Jan 21 00:28:46 WARNING[31696]: app_addon_sql_mysql.c:115
find_identifier: Identifier 0, identifier_type 2 not found in
identifier list<br>
Jan 21 00:28:46 WARNING[31696]: app_addon_sql_mysql.c:348 aMYSQL_clear: Invalid result identifier 0 passed in aMYSQL_clear<br>
-- Executing MYSQL("IAX2/100-5", "Disconnect 1") in new stack<br>
-- Executing Hangup("IAX2/100-5", "") in new stack<br>
== Spawn extension (macro-local, s, 8) exited non-zero on 'IAX2/100-5' in macro 'local'<br>
== Spawn extension (users, 123, 1) exited non-zero on 'IAX2/100-5'<br>
-- Hungup 'IAX2/100-5'<br>
<br>
<br>
Not found. But when I call from MySQL CLI it works:<br>
<br>
mysql> call p_pbxuser_user_data1('100');<br>
+-----------+<br>
| vm_active |<br>
+-----------+<br>
| 1 |<br>
+-----------+<br>
1 row in set (0.00 sec)<br>
<br>
Query OK, 0 rows affected (0.00 sec)<br>
<br>
Any ideas? <br>