This is an example about how to use perl library (YateMessage.pm) into Yate.
git-svn-id: http://yate.null.ro/svn/yate/trunk@58 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
204380b4e0
commit
a1c85dd6d3
|
@ -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();
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue