Hi all,
I'm using PHP to connect to a TAPI phone.
To create a call, I do the following (it works fine):
Now, I'm trying to receive events.
First, I created the following class:
Then I do the following:
And then I add the following at the end of my script:
But I'm not receiving any event. I'm doing anything wrong? Can someone point me in the rigth direction?
Thanks
I'm using PHP to connect to a TAPI phone.
To create a call, I do the following (it works fine):
Code:
$tapi = new COM("TAPI.TAPI.1");
$res = $tapi->Initialize();
$objCollAddresses = $tapi->Addresses;
for($i = 1; $i <= $objCollAddresses->Count; $i++)
{
if(strpos($objCrtAddress->AddressName, IP_OFFICE_PHONE) !== false)
{
$gobjAddress = $objCollAddresses->Item($i);
}
}
if($gobjAddress != null)
{
$NewCall = $gobjAddress->CreateCall("xxxxxxxxx", LINEADDRESSTYPE_PHONENUMBER, LINEMEDIAMODE_INTERACTIVEVOICE);
$NewCall->connect(false);
sleep(50);
$NewCall->Disconnect(DC_NORMAL);
}
$res = $tapi->Shutdown();
First, I created the following class:
Code:
class ITTAPIEventNotification
{
var $terminated = false;
function Event($TapiEvent, $pEvent)
{
print "ITTAPIEventNotification::Event CALLED!\n";
$this->terminated = true;
}
}
Code:
$events = new ITTAPIEventNotification(); $res = com_event_sink($tapi, $events, "Event"); $tapi->EventFilter = 0x1FFFF; // all events
Code:
while(!$events->terminated)
{
print ".";
com_message_pump(4000);
}
Thanks
Comment