From fc7081c68719a4424d39195701440f4be6df98e5 Mon Sep 17 00:00:00 2001 From: paulc Date: Sun, 3 Aug 2008 20:49:31 +0000 Subject: [PATCH] Use IVR name as default for registered class name. git-svn-id: http://voip.null.ro/svn/yate@2134 acf43c95-373e-0410-b603-e72c3f656dc1 --- share/scripts/libyateivr.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/share/scripts/libyateivr.php b/share/scripts/libyateivr.php index b6014e2e..bb2badf8 100644 --- a/share/scripts/libyateivr.php +++ b/share/scripts/libyateivr.php @@ -538,10 +538,10 @@ class IVR /** * Register an IVR by its class name * @param $ivrname Name of the IVR to register - * @param $classname Name of the class to instantiate + * @param $classname Name of the class to instantiate, defaults to name of IVR * @return True if registered, false if invalid class or IVR already registered */ - static function Register($ivrname, $classname) + static function Register($ivrname, $classname = null) { global $yate_ivr_register; @@ -550,6 +550,8 @@ class IVR Yate::Output("IVR: Already registered IVR '$ivrname'"); return false; } + if ($classname === null) + $classname = $ivrname; if (!class_exists($classname)) { Yate::Output("IVR: Inexistent class '$classname' for IVR '$ivrname'"); return false;