Use Setparam instead of assigning to params, clarify required priority.

git-svn-id: http://voip.null.ro/svn/yate@1883 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2008-04-09 15:23:53 +00:00
parent 09153fa1ac
commit ccc0cf7506
1 changed files with 6 additions and 6 deletions

View File

@ -2,10 +2,10 @@
<?
/* Sample PBX assistant for the Yate PHP interface
To use add in regexroute.conf
^NNN$=external/nochan/pbxassist.php;real_callto=real/resource/to/call
You will also need a priority= in extmodule.conf [general] lower than 100
You will also need a priority= in extmodule.conf [general] in range 50-85
*/
require_once("libyate.php");
@ -31,12 +31,12 @@ function onDisconnect(&$ev,$reason)
if ($reason == "busy") {
$m = new Yate("call.execute");
$m->id = $ev->id;
$m->params["id"] = $ourcallid;
$m->params["callto"] = "tone/info";
$m->SetParam("id",$ourcallid);
$m->SetParam("callto","tone/info");
$m->Dispatch();
// Also send progressing so the tone goes through in early media
$m = new Yate("call.progress");
$m->params["targetid"] = $ourcallid;
$m->SetParam("targetid",$ourcallid);
$m->Dispatch();
return true;
}
@ -65,7 +65,7 @@ while ($ourcallid) {
$callto = $ev->GetValue("real_callto");
if ($ourcallid && $callto) {
// Put back the real callto and let the message flow
$ev->params["callto"] = $callto;
$ev->SetParam("callto",$callto);
Yate::Install("chan.hangup",75,"id",$ourcallid);
Yate::Install("chan.disconnected",75,"id",$ourcallid);
onStartup($ev);