[Freeswitch-dev] Need help in Mod_SMS ChatPlan

Mahdi Moradi freeswitch.moradi at gmail.com
Sat Aug 3 02:02:01 MSD 2013


Hi

mod_sms helloworld script. *mod_sms must be loaded or this will not work.*

-------------------- chatplan

<extension name="sms_test">
      <condition field="destination_number" expression="^(.*)$">
        <action application="lua" data="lua/sms.lua"/>
      </condition>
</extension>


-------------------- sms.lua

freeswitch.consoleLog("info", "chat console\n")

from = 'sip:1002 at 192.168.1.2';
to = '1001 at 192.168.1.2';

-- change *"to*" programmatically

local event = freeswitch.Event("CUSTOM", "SMS::SEND_MESSAGE");
event:addHeader("proto", "sip");
event:addHeader("dest_proto", "sip");
event:addHeader("from", from);
event:addHeader("from_full", from);
event:addHeader("to", to);
event:addHeader("subject", "sip:1001 at 192.168.1.2");
event:addHeader("type", "text/html");
event:addHeader("hint", "the hint");
event:addHeader("replying", "true");
event:addBody("Hello World!");
event:fire();
--freeswitch.consoleLog("info",event:serialize()..'\n');

Moradi


On Mon, Jul 29, 2013 at 7:12 PM, Raymond Chandler <
intralanman at freeswitch.org> wrote:

>  On 07/26/2013 12:24 PM, thomas lee wrote:
>
>  Hi,
>
>       Has anyone manage to get chatplan working?
>
> yes
>
>
>  I only manage to get echo back from server
> and never succeed in sending the message across to other party. Does
> anyone has a sample working chatplan for me to reference?
>
>  assuming that the sending party is sending to the user at domain that the
> receiving party is registered as... then you should only have to use "send"
> as the application name.
>
> -Ray
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20130803/5886b662/attachment-0001.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-dev mailing list