TAPI events in PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lgrave
    New Member
    • Jun 2010
    • 4

    TAPI events in PHP

    Hi all,

    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();
    Now, I'm trying to receive events.

    First, I created the following class:
    Code:
    class ITTAPIEventNotification
    {
    	var $terminated = false;
    	function Event($TapiEvent, $pEvent)
    	{
    		print "ITTAPIEventNotification::Event CALLED!\n";
    		$this->terminated = true;
    	}
    }
    Then I do the following:
    Code:
    $events = new ITTAPIEventNotification();
    $res = com_event_sink($tapi, $events, "Event");
    $tapi->EventFilter = 0x1FFFF; // all events
    And then I add the following at the end of my script:
    Code:
    while(!$events->terminated)
    {
    	print ".";
    	com_message_pump(4000);
    }
    But I'm not receiving any event. I'm doing anything wrong? Can someone point me in the rigth direction?

    Thanks
  • lgrave
    New Member
    • Jun 2010
    • 4

    #2
    Anyone knows if the parameter sinkinterface in com_event_sink that I should use is "Event"?

    Comment

    • mpcaddy
      New Member
      • Dec 2013
      • 2

      #3
      Did you ever work this out? I am trying to do the same, and haven't got any further.

      Comment

      • lgrave
        New Member
        • Jun 2010
        • 4

        #4
        Hi mpcaddy, sorry to inform you, but my conclusion back in 2010 was that this is impossible to do in PHP. I had to switch to C++ and implement everything using TAPI3.
        By the way, TAPI&TAPI3 is a outdated microsoft technology, a complete nightmare! Run away from this if you can!

        Comment

        • mpcaddy
          New Member
          • Dec 2013
          • 2

          #5
          Originally posted by lgrave
          By the way, TAPI&TAPI3 is a outdated microsoft technology, a complete nightmare! Run away from this if you can!
          Yeah I wanted to run away from it, the only problem being is the phone system I want to interface with (Samsung OfficeServ 7200) the only way for receiving the information is through TAPI provided via their OpenTSP driver through their OfficeServ Link software. So I am kind of stuck with it unfortunately.

          Comment

          • lgrave
            New Member
            • Jun 2010
            • 4

            #6
            Originally posted by mpcaddy
            Yeah I wanted to run away from it, the only problem being is the phone system I want to interface with (Samsung OfficeServ 7200) the only way for receiving the information is through TAPI provided via their OpenTSP driver through their OfficeServ Link software. So I am kind of stuck with it unfortunately.
            Enjoy :) https://github.com/lgrave/TapiAdapter

            Comment

            • wkinght
              New Member
              • Apr 2016
              • 1

              #7
              Hello @lgrave,
              First off, I would like to say thank you for making your hard work open source. But am yet to enjoy it tho :), I just can't seem to get the TapiAdapter.exe to run. It just exits everytime I run it. Is there something I need to do before running TapiAdapter.exe . It took me a while to get it to compile, but now frustration is setting in. Am hoping its something little am missing.
              Any help is greatly appreciated.
              Thanks!

              Comment

              Working...