Published on 2005-08-28 16:03:02

The example just allow to play a message to the user and then transfer the call to a specific number. I have setup a default message "Please wait while we transfer your call" so we keep the message optional. I have added another parameter which is the formid, which could be used if you want to link the transfer form to another application ... etc.

The module code is listed below transfer.class.php

/** * VoiceXML Telephone call transfer Module * * @author Ben Yacoub Hatem * @version $Id: transer.class.php,v 1.0 */ class transfer { /** * @access private * @var object */ var $obj; /* * * Transfer a message * * @param number transfer number * @param message message (optional) * @param formid formid (optional) * */ function transfer(&$obj,$params) { $this->obj = &$obj; $number = $params[0]; $message = (trim($params[1])!='')?$params[1]:'Please wait while we transfer your call'; $formid = (trim($params[2])!='')?$params[2]:'transfer'; $this->obj->start_form($formid); $this->obj->start_block(); $page->start_prompt(); $page->write($message); $page->end_prompt(); $this->obj->end_block(); $page->transfer($number,'',false); $this->obj->end_form(); return; } }

Previous Page


Related Entries

Member of the PHP Magazine Network, Copyright (C) 2005-2008 phpmagazine.net All Rights Reserved