SMS Incoming to CURL

Hello all
I need help for my problem.
I use asterisk for integration with my home domotic.
I want integration with new machine and use the control with HTTP
Now i have configuration the asterisk, and all work
But when use the space in the SMS have the problem
For example if i send this SMS
PIPPOPLUTOPAPERINO work and i have the link correct
If i send this
PIPPO PLUTO PAPERINO dont work
This is the command in extension.conf

exten => sms,n,Set(result=${CURL(http://192.168.1.200/action.php?bnumber=${CALLERID(num)}&smstext=${BASE64_DECODE(${SMS_BASE64})}&nowdata=${STRFTIME(${EPOCH},%Y-%m-%d)}&nowhour=${STRFTIME(${EPOCH},%H:%M:%S)})})

Thanks
Luca

Space isn’t valid in a URL. It needs to be replaced by %20, or, because it is part of a form, a “+”. I think there is a URIENCODE function for the former, but note that the &s and =s must not be encoded.

Also note that is a violation of HTTP semantics to use a GET for something that has side effects. GETs can be satisfied from caches, although, in practice I think people no longer do this for form URLs. The side effect, here, is the sending of the SMS. You might, of course, be at the mercy of a service that violates the semantics.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.