Asterisk PBX String manipulation

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


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.



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 [url removed, login to view] 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 (

[[url removed, login to view]][1])


Квалификация: Техника, Linux, MySQL, PHP, Архитектура ПО, Тестирование ПО

Показать больше asterisk string manipulation, asterisk exten manipulation, manipulation pbx, to string, string the, string manipulation c, string i, string 2, m string, clear a string in c, call james, using asterisk, zap, PBX, linux cc++, Asterisk PBX, asterisk linux, php select insert sql, clear linux, issue asterisk

О работодателе:
( 43 отзыв(-а, -ов) ) Australia

ID проекта: #3701593

1 фрилансер в среднем готов выполнить эту работу за $425


See private message.

$425 USD за 2 дней(-я)
(4 отзывов(-а))