Hang up queue operator call leg when incoming call is picked up.

git-svn-id: http://voip.null.ro/svn/yate@2452 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2009-01-22 16:32:59 +00:00
parent fe3181bbb4
commit 686a7d4dee
1 changed files with 9 additions and 1 deletions

View File

@ -25,7 +25,7 @@ Yate::Init();
Yate::SetLocal("id",$ourcallid);
Yate::SetLocal("disconnected","true");
Yate::Install("call.answered",40,"targetid",$ourcallid);
Yate::Install("call.answered",40);
Yate::Install("chan.disconnected",20,"id",$ourcallid);
/* The main loop. We pick events and handle them */
@ -58,6 +58,14 @@ for (;;) {
$m->Dispatch();
break;
case "call.answered":
if ($ev->GetValue("id") == $partycallid) {
// call was picked up from queue
$ev->Acknowledge();
Yate::SetLocal("reason","pickup");
exit();
}
if ($ev->GetValue("targetid") != $ourcallid)
break;
$ev->params["targetid"] = $partycallid;
$ev->Acknowledge();
$m = new Yate("chan.connect");