[Asterisk-Users] Updates/Inserts AND MYSQL(Clear ...)

Tristan tristan at telemaque.fr
Thu Jun 15 05:10:50 MST 2006


Hi List,

Just a little question about the MYSQL(Clear ) function,
Do I need to clear the resultid after an update or an Insert query ?

Because I don't want to overload mysql ...

I'm doing this actually and I have troubles I don't understand....
resultid is set in the following macro and everytime I try to clear  it 
I get errors from app_addon_sql_mysql...


Here is the macro and the output:

[macro-hangup]
exten => s,1,MYSQL(Connect connid host user pass db)
exten => s,2,MYSQL(Query resultid ${connid} UPDATE\ `sometable`\ SET\ 
`end_date`=\NOW()\ WHERE\ `uniqid`=\'${UNIQUEID}\'\ LIMIT\ 1)
exten => s,3,GotoIf(${resultid}?4:5)
exten => s,4,MYSQL(Clear ${resultid})
exten => s,5,MYSQL(Query resultid ${connid} UPDATE\ `someothertable`\ 
SET\ `end_date`=\NOW()\ WHERE\ `uniqid`=\'${UNIQUEID}\'\ LIMIT\ 1)
exten => s,6,GotoIf(${resultid}?7:8)
exten => s,7,MYSQL(Clear ${resultid})
exten => s,8,GotoIf(${connid}?10:11)
exten => s,9,MYSQL(Disconnect ${connid})

------------------------------------Ast 
Output--------------------------------

    -- Executing Macro("Zap/49-1", "hangup") in new stack
    -- Executing MYSQL("Zap/49-1", "Connect connid host user pass db") 
in new stack
    -- Executing MYSQL("Zap/49-1", "Query resultid 24 UPDATE `sometable` 
SET `end_date`=NOW() WHERE `uniqid`='1150372171.37' LIMIT 1") in new stack
    -- Executing GotoIf("Zap/49-1", "25?4:5") in new stack
    -- Goto (macro-hangup,s,4)
    -- Executing MYSQL("Zap/49-1", "Clear 25") in new stack
Jun 15 13:50:16 WARNING[11358]: app_addon_sql_mysql.c:115 
find_identifier: Identifier 25, identifier_type 2 not found in 
identifier list
Jun 15 13:50:16 WARNING[11358]: app_addon_sql_mysql.c:348 aMYSQL_clear: 
Invalid result identifier 25 passed in aMYSQL_clear
    -- Executing MYSQL("Zap/49-1", "Query resultid 25 UPDATE 
`someothertable` SET `end_date`=NOW() WHERE `uniqid`='1150372171.37' 
LIMIT 1") in new stack
    -- Executing GotoIf("Zap/49-1", "25?8:9") in new stack
    -- Goto (macro-hangup,s,8)
    -- Executing MYSQL("Zap/49-1", "Clear 25") in new stack
Jun 15 13:50:16 WARNING[11358]: app_addon_sql_mysql.c:115 
find_identifier: Identifier 25, identifier_type 2 not found in 
identifier list
Jun 15 13:50:16 WARNING[11358]: app_addon_sql_mysql.c:348 aMYSQL_clear: 
Invalid result identifier 25 passed in aMYSQL_clear
    -- Executing GotoIf("Zap/49-1", "25?10:11") in new stack
    -- Goto (macro-hangup,s,10)
    -- Executing MYSQL("Zap/49-1", "Disconnect 25") in new stack
    -- Hungup 'Zap/49-1'





More information about the asterisk-users mailing list