Made the menu a little more informative when recording a greeting.

git-svn-id: http://voip.null.ro/svn/yate@4782 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2011-12-20 13:38:05 +00:00
parent bebaa990b1
commit d4644c7ece
1 changed files with 19 additions and 2 deletions

View File

@ -16,6 +16,8 @@ require_once("libvoicemail.php");
/* Always the first action to do */
Yate::Init();
/* Uncomment next line to get output in console */
//Yate::Output(true);
/* Uncomment next line to get debugging messages */
//Yate::Debug(true);
@ -106,7 +108,9 @@ function setState($newstate)
if ($newstate == $state)
return;
switch ($newstate) {
$st = strpos($newstate,",");
$st = ($st !== false) ? substr($newstate,0,$st) : $newstate;
switch ($st) {
case "user":
promptUser();
$m = new Yate("chan.attach");
@ -151,6 +155,14 @@ function setState($newstate)
$m->params["notify"] = $ourcallid;
$m->Dispatch();
break;
default:
if (substr($st,0,5) == "play:") {
$m = new Yate("chan.attach");
$m->params["source"] = "wave/play/$vm_base/" . substr($st,5) . ".slin";
$m->params["consumer"] = "wave/record/-";
$m->params["notify"] = $ourcallid;
$m->Dispatch();
}
}
$state = $newstate;
}
@ -221,6 +233,11 @@ function gotNotify($reason)
if ($reason == "replaced")
return;
$st = strpos($state,",");
if ($st !== false) {
setState(substr($state,$st+1));
return;
}
switch ($state) {
case "goodbye":
setState("");
@ -272,7 +289,7 @@ function navigate($text)
listenTo($current+1);
break;
case "1":
setState("record");
setState("play:record,play:beep,record");
break;
case "2":
setState("play");