Here's my dialplan:

[initialize-log]

 exten => _X.,1,Noop(Initialize CallLog ${CallersDT} ${CallersTel} ${LOGCONFIRM})
 exten => _X.,n,MYSQL(Connect connid ${HOST} ${USER} ${PASSWORD} ${DATABASE})
 exten => _X.,n,MYSQL(QUERY resultid ${connid} INSERT\ INTO\ tbl_calllog\ SET\ log_start=\'${CallersDT}\'\,\ log_phone=\'${CallersTel}\'\,\ log_confirmation=\'${LOGCONFIRM}\')

 exten => _X.,n,Set(ERROR=1042)
 exten => _X.,n,GotoIf($["${MYSQL_STATUS}" = "-1"]?error,${IVR-EXTEN},1)
 exten => _X.,n,Noop(Successful MYSQL STAT:[${MYSQL_STATUS}] CONNID:[${connid}] RESULTS:[${resultid}])
 exten => _X.,n,MYSQL(Clear ${resultid})
 exten => _X.,n,MYSQL(Disconnect ${connid})
 exten => _X.,n,Return

The problem is I don't know if the record was inserted successfully for certain? I've used this code before and it appears to work. But on this project the record fails to insert.  Me confused...

CLI:

[2009-09-09 09:02:17] VERBOSE[32573] logger.c: == [3388-SIP/8001-08d77ab8] [INITIALIZE LOG]: Initialize CallLog 2009-09-09 11:02:178001 1252512137.1
[2009-09-09 09:02:17] VERBOSE[32573] logger.c: -- Executing [3...@initialize-log:2] MYSQL("SIP/8001-08d77ab8", "Connect connid xx.xx.xx.xx dbuser pass mysqldb") in new stack
[2009-09-09 09:02:17] VERBOSE[32573] logger.c: -- Executing [3...@initialize-log:3] Set("SIP/8001-08d77ab8", "ERROR=1041") in new stack
[2009-09-09 09:02:17] VERBOSE[32573] logger.c: -- Executing [3...@initialize-log:4] GotoIf("SIP/8001-08d77ab8", "0?error|3388|1") in new stack
[2009-09-09 09:02:17] VERBOSE[32573] logger.c: -- Executing [3...@initialize-log:5] MYSQL("SIP/8001-08d77ab8", "QUERY resultid 1 INSERT INTO tbl_calllog SET log_start='2009-09-09 11:02:17', log_phone='8001', log_confirmation='1252512137.1'") in new stack
[2009-09-09 09:02:17] VERBOSE[32573] logger.c: -- Executing [3...@initialize-log:6] Set("SIP/8001-08d77ab8", "ERROR=1042") in new stack
[2009-09-09 09:02:17] VERBOSE[32573] logger.c: -- Executing [3...@initialize-log:7] GotoIf("SIP/8001-08d77ab8", "0?error|3388|1") in new stack
[2009-09-09 09:02:17] VERBOSE[32573] logger.c: -- Executing [3...@initialize-log:8] Verbose("SIP/8001-08d77ab8", "1| == [3388-SIP/8001-08d77ab8] [INITIALIZE LOG]: Initialize CallLog was successful MYSQL STAT:[0] CONNID:[1] RESULTS:[]") in new stack
[2009-09-09 09:02:17] VERBOSE[32573] logger.c: == [3388-SIP/8001-08d77ab8] [INITIALIZE LOG]: Initialize CallLog was successful MYSQL STAT:[0] CONNID:[1] RESULTS:[]
[2009-09-09 09:02:17] VERBOSE[32573] logger.c: -- Executing [3...@initialize-log:9] MYSQL("SIP/8001-08d77ab8", "Clear ") in new stack
[2009-09-09 09:02:17] WARNING[32573] app_addon_sql_mysql.c: Identifier 0, identifier_type 2 not found in identifier list
[2009-09-09 09:02:17] WARNING[32573] app_addon_sql_mysql.c: Invalid result identifier 0 passed in aMYSQL_clear

Bart

<<attachment: bhfisher.vcf>>

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to