freeswitch
freeswitch copied to clipboard
mod_sms: add originate event to send a message directly to dialplan
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);
Unit-tests failed: https://public-artifacts.signalwire.cloud/drone/signalwire/freeswitch/515/artifacts.html