This is an example about how to use perl library (YateMessage.pm) into Yate.

git-svn-id: http://voip.null.ro/svn/yate@58 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
diana 2004-09-21 11:35:16 +00:00
parent 4eb83c3a5e
commit 075e0f66fb
1 changed files with 38 additions and 0 deletions

38
scripts/noroute.pl Executable file
View File

@ -0,0 +1,38 @@
#!/usr/bin/perl
#######################################################
#
# noroute.pl is an demo script module for Yate using YateMessage.pm
# Copyright Anthony Minessale II <anthmct@yahoo.com>
# This Module is released under the GNU Public License
# If you find this software useful, donations are welcome
# at paypal:jillkm3@yahoo.com
#
$|=1;
use lib 'scripts/';
use YateMessage;
use Data::Dumper;
sub demo($) {
my $message = shift;
printf STDERR "hello time is %s and binded is %s i'll return undef so the next module gets a chance....\n",
$message->param("time"),$message->header("binded");
return ("true");
# print STDERR $message->reply(false);
# print $message->reply(false);
# return undef;
}
sub demo2($) {
my $message = shift;
printf STDERR "hello again time is %s and binded is %s I'll return false to put and end to it.\n",
$message->param("time"),$message->header("binded");
return ("true","tone/dial");
}
my $message = new YateMessage();
$message->install("engine.timer",\&demo);
$message->install("route",\&demo2);
$message->listen();