[Freeswitch-users] send message via python script using ESL library

Youssef ELOUAM youssef.elouam at outlook.com
Mon Apr 27 08:42:41 UTC 2020


Hi everyone,

I am trying to send SMS via python script but not working, I followed the script in confluence

from ESL import *

con = ESLconnection("127.0.0.1", "8021", "ClueCon")

if con.connected():
    event = ESLevent("CUSTOM", "SMS::SEND_MESSAGE")

    event.addHeader("to", "1000 at 192.168.1.6")
    event.addHeader("from", "5000 at 192.168.1.6")
    event.addHeader("dest_proto", "sip")

    print(event.serialize("plain"))
    event.addBody("message contents")
    con.sendEvent(event)


as result of print command I get :


Event-Name: CUSTOM

Event-Subclass: SMS%3A%3ASEND_MESSAGE

to: 1000%40192.168.1.6

from: 5000%40192.168.1.6

dest_proto: sip

but no message received in 1000 extension.


Youssef ELOUAM
https://www.linkedin.com/in/elouam/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20200427/63b803cb/attachment-0001.html>


More information about the FreeSWITCH-users mailing list