This topic is locked

Dial via TAPI in phprunner

2/7/2011 5:56:35 AM
PHPRunner General questions
S
snuffi01 author

I'm trying to make the browser dial a number stored in the database when the number is pressed (or by pushing a button).
How should i implement the code beneath to be able to dial the number from database via TAPI, the number should go in to the code where the "xxxxxxxxx" is.
$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();