Below is the dial plan.
Basicly it writes a record to MYSQL, which works fine, until I try to insert the ${CALLFILENAME}. My guess is the Asterisk Parser is not handling the back slashes very well.
Looking for function/marco that will covert the string to a Asterisk friendly string, so then when I do SQL statements dont have to muck around with using \.
So basicly the function would look at a string, if there was a:
--> space ----> Make it \ space
--> commar ----> Make it \ commar
etc
The same issue is why I create ssqlA, ssqlB and ssqlC below. With this function you create, we should be able to drop this, and just have one simple line.
Thanks
James
I have this currently in the dial plan:
exten => _32XX,1,SetVar(CALLFILENAME=/var/spool/asterisk/monitor/32xx/CallTo-${EXTEN:1}-${TIMESTAMP})
exten => _32XX,n,Monitor(gsm,${CALLFILENAME},m)
exten => _32XX,n,Set(ssqlA=INSERT INTO p060_Rev_Tx)
exten => _32XX,n,Set(ssqlB=p060_Type\, p060_Status1\, p060_Text02\, p060_Text03\, p060_Text04\, p060_Text05)
exten => _32XX,n,Set(ssqlC=SELECT \'CALL\'\, \'PENDINGREV\'\, \'${EXTEN:1}\'\, \'${EXTEN:1}\'\, \'${CALLERID}\'\, \'${CALLFILENAME}\';)
exten => _32XX,n,MYSQL(Connect connid [login to view URL] rlm2 rlm2 rlm2)
exten => _32XX,n,MYSQL(Query resultid ${connid} ${ssqlA} (${ssqlB}) ${ssqlC})
exten => _32XX,n,MYSQL(Fetch fetchid ${resultid} aa bb cc)
exten => _32XX,n,MYSQL(Clear ${resultid})
exten => _32XX,n,MYSQL(Disconnect ${connid})
exten => _32XX,n,Noop(OK)
exten => _32XX,n,Dial(ZAP/g4/1111${EXTEN:1})
exten => _32XX,n,Congestion
## Deliverables
Will probably be donating this back to the wiki.
## Platform
Asterisk (
[[login to view URL]][1])
Linux