freeswitch icon indicating copy to clipboard operation
freeswitch copied to clipboard

mod_sms: add originate event to send a message directly to dialplan

Open wmasilva opened this issue 3 years ago • 1 comments

With the event "SMS::SEND_MESSAGE" is only possible to send message directly to endpoint, the message don't hit chatpan.xml rules.

This changes add a new event, "SMS::ORIGINATE_MESSAGE", to be able to send messages directly to be process in chatplan.xml from a esl script. The message can be then delivery to the endpoint using the chatplan actions.

lua esl example:

local event = ESL.ESLevent("CUSTOM", "SMS::ORIGINATE_MESSAGE");
event:addHeader("dest_proto", "GLOBAL");
event:addHeader("from", "Antonio Silva");
event:addHeader("to", "[email protected]");
event:addHeader("context", "outgoing");
event:addHeader("type", "text/plain");
event:addBody("envio programado");
con:sendEvent(event);

wmasilva avatar Jun 08 '22 10:06 wmasilva

Unit-tests failed: https://public-artifacts.signalwire.cloud/drone/signalwire/freeswitch/515/artifacts.html

signalwire-ci[bot] avatar Jun 08 '22 10:06 signalwire-ci[bot]