Find Jobs
Hire Freelancers

Asterisk PBX String manipulation

$30-5000 USD

Closed
Posted almost 18 years ago

$30-5000 USD

Paid on delivery
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
Project ID: 3701593

About the project

1 proposal
Remote project
Active 18 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
1 freelancer is bidding on average $425 USD for this job
User Avatar
See private message.
$425 USD in 2 days
5.0 (4 reviews)
4.4
4.4

About the client

Flag of AUSTRALIA
Australia
5.0
43
Member since Jul 12, 2006

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.