Hi, this might come out as a simple problem to some people, but I have been trying with so many combination just to get the proper syntax but with no avail.
Here is the deal. I am trying to simulate the following :
exten => 1234,n,MYSQL(Query resultid ${connid} UPDATE test SET IP = 127.0.0.1 WHERE id = 1)
by writing an AGI in .c which will simply print out the following string:
exec MYSQL “Query resultid ${connid} ${query-string}”
to the CLI and ends it with /n. ${query-string} is “UPDATE test SET IP = 127.0.0.1 WHERE id = 1”.
This should execute the application Mysql() with option “Query resultid ${connid} ${query-string}” in asterisk CLI, but I kept getting the following error message:
-- Executing [1234@check-accnt:1] AGI("SIP/support1-08758fa8", "updateip.agi") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/updateip.agi
-- AGI Script Executing Application: (MYSQL) Options: (Query resultid ${connid} ${query-string})
[Jul 16 19:03:14] WARNING[26630]: app_addon_sql_mysql.c:288 aMYSQL_query: aMYSQL_query: missing some arguments
– AGI Script updateip.agi completed, returning 0
Which says that I do not have enough arguement passed. Im pretty much stumped after trying out for hours , so I am hoping someone knowledgable in AGI and Mysql() can point out my mistake
pleasee…