From 11d518fea5f6aa551c0038361f718cd780146f7f Mon Sep 17 00:00:00 2001 From: Brian West Date: Fri, 17 Apr 2009 16:00:08 +0000 Subject: [PATCH] adding sendevent example for esl perl git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13079 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/esl/perl/sendevent.pl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 libs/esl/perl/sendevent.pl diff --git a/libs/esl/perl/sendevent.pl b/libs/esl/perl/sendevent.pl new file mode 100644 index 0000000000..0dc9a7045c --- /dev/null +++ b/libs/esl/perl/sendevent.pl @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +require ESL; + +my $con = ESL::ESLconnection->new("localhost", "8021", "ClueCon"); +my $e = ESL::ESLevent->new("MESSAGE_WAITING"); + +#my $e = $con->sendEvent("MESSAGE_WAITING"); + +$e->addHeader("MWI-Messages-Waiting", "no"); +$e->addHeader("MWI-Message-Account", 'sip:1002@dev.bkw.org'); +$e->addHeader("MWI-Voice-Message", "0/0 (0/0)"); +$con->sendEvent($e); + +sleep 3; +my $ee = ESL::ESLevent->new("MESSAGE_WAITING"); + +$ee->addHeader("MWI-Messages-Waiting", "yes"); +$ee->addHeader("MWI-Message-Account", 'sip:1002@dev.bkw.org'); +$ee->addHeader("MWI-Voice-Message", "1/1 (1/1)"); +$con->sendEvent($ee); +