sendevent.pl 611 B

12345678910111213141516171819202122
  1. #!/usr/bin/perl
  2. require ESL;
  3. my $con = ESL::ESLconnection->new("localhost", "8021", "ClueCon");
  4. my $e = ESL::ESLevent->new("MESSAGE_WAITING");
  5. #my $e = $con->sendEvent("MESSAGE_WAITING");
  6. $e->addHeader("MWI-Messages-Waiting", "no");
  7. $e->addHeader("MWI-Message-Account", 'sip:1002@dev.bkw.org');
  8. $e->addHeader("MWI-Voice-Message", "0/0 (0/0)");
  9. $con->sendEvent($e);
  10. sleep 3;
  11. my $ee = ESL::ESLevent->new("MESSAGE_WAITING");
  12. $ee->addHeader("MWI-Messages-Waiting", "yes");
  13. $ee->addHeader("MWI-Message-Account", 'sip:1002@dev.bkw.org');
  14. $ee->addHeader("MWI-Voice-Message", "1/1 (1/1)");
  15. $con->sendEvent($ee);