Reputation: 59
i am trying to make script https://wiki.freeswitch.org/wiki/Mod_sms to get message header from freeswitch and reply them but it is not working
here is script
#!/usr/bin/perl
use warnings;
use strict;
use IO::Handle;
our $message;
our $msg = $ARGV[1];
my $msg_arg1 = (split ' ', $msg, 3)[0];
my $share_reciver = (split ' ', $msg, 3)[1];
my $shared_amount = (split ' ', $msg, 3)[2];
freeswitch::consoleLog("ALERT", message:getHeader("from"));
and here chatplan
<?xml version="1.0" encoding="utf-8"?>
<include>
<context name="default">
<extension name="demo">
<condition field="to" expression="^(.*)$">
<action application="perl" data="message.pl '${from}@s' '${_body}'"/>
</condition>
</extension>
</context>
</include>
here is error 2014-03-20 11:21:53.496377 [ERR] mod_perl.c:72 [require '/usr/local/freeswitch/scripts/message.pl';] syntax error at /usr/local/freeswitch/scripts/message.pl line 10, near "message:" Compilation failed in require at (eval 3) line 1.
author of the https://wiki.freeswitch.org/wiki/Mod_sms#Programming has asked to define interface
i am new in perl how to define interface in perl
how to solve this ?
Upvotes: 0
Views: 343