473,549 Members | 2,723 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TAPI events in PHP

4 New Member
Hi all,

I'm using PHP to connect to a TAPI phone.
To create a call, I do the following (it works fine):
Expand|Select|Wrap|Line Numbers
  1. $tapi = new COM("TAPI.TAPI.1");
  2. $res = $tapi->Initialize();
  3. $objCollAddresses = $tapi->Addresses;
  4. for($i = 1; $i <= $objCollAddresses->Count; $i++)
  5. {
  6.     if(strpos($objCrtAddress->AddressName, IP_OFFICE_PHONE) !== false)
  7.     {
  8.         $gobjAddress = $objCollAddresses->Item($i);
  9.     }
  10. }
  11. if($gobjAddress != null)
  12. {
  13.      $NewCall = $gobjAddress->CreateCall("xxxxxxxxx", LINEADDRESSTYPE_PHONENUMBER, LINEMEDIAMODE_INTERACTIVEVOICE);
  14.      $NewCall->connect(false);
  15.      sleep(50);
  16.      $NewCall->Disconnect(DC_NORMAL);
  17. }
  18. $res = $tapi->Shutdown();
Now, I'm trying to receive events.

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

Thanks
Jun 9 '10 #1
6 9340
lgrave
4 New Member
Anyone knows if the parameter sinkinterface in com_event_sink that I should use is "Event"?
Jun 11 '10 #2
mpcaddy
2 New Member
Did you ever work this out? I am trying to do the same, and haven't got any further.
Dec 28 '13 #3
lgrave
4 New Member
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!
Dec 29 '13 #4
mpcaddy
2 New Member
@lgrave
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.
Dec 30 '13 #5
lgrave
4 New Member
@mpcaddy
Enjoy :) https://github.com/lgrave/TapiAdapter
Jan 2 '14 #6
wkinght
1 New Member
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!
Apr 19 '16 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
6613
by: futureofphp | last post by:
Hi, Just out of curiosity, Can I use TAPI (Telephone API) in PHP. Create an answering machine that can answer calls and respond, also detect DTMF tones using TAPI? I havent heard of such a thing being possible. TAPI 3.0 is COM based can PHP access it?
0
3197
by: Damon | last post by:
I am using the following code (primarily wizard created) to dial a phone number on an access form via the on double click event. Application.Run "utility.wlib_AutoDial", stDialStr I want to close the phone dialer application automatically after the call is placed (maybe after 5 or 10 seconds), any suggestions? Right now it stays open with...
5
1857
by: David | last post by:
Hello. Where can I find some examples of using TAPI in C#? And is there any site or newsgroup for TAPI?
11
7804
by: BizTalk Architect | last post by:
Hello, I am days into this problem and I cant make heads or tails of it. Please post suggestions, I dont care how crazy they sound. Scenario: I have a TAPI C# application. (TAPI 3.0)
1
6230
by: ahmed fat-hi | last post by:
hi every body to make a call using TAPI i do the following: 1- initiate connectiion 2- Select an Address 3- make a call when i make a call i execute the function ITAddress::CreateCall the first parameter it takes is the distination address (BSTR bstrAddressToCall)
3
4056
by: perspolis | last post by:
Hi all thanks in advance to read my post. I created a TAPI application and in this application I monitor the digits that user enter by phone.. it works well when I call from a phone but it dosen't work when I call from a mobile.it can't detect digits from mobile..I mean the MONITORDIGIT event dosen't fire when I call from mobile. I don't...
7
18729
by: StevenVibert | last post by:
I'm rewriting a C++ TAPI app I wrote a while ago in C#. Everything works fine for the first call. Unfortunately, all subsequent calls are completely ignored by TAPI until I restart the app again. I remember running into this same problem with my original C++ code and it was being caused by my failure to release all call related tapi...
1
2650
by: Dr.Sameh Ali | last post by:
I am trying to build IVR system using c# . i know that .net wrapper for tapi does not work well. but it seems that many made it work. So my question: Is there any hope to find a working code that may show how to start in tapi and utilizing Text to speach engines to respond to call? Any hints will be appreciated. Dr.Sameh Ali
0
1629
jackb
by: jackb | last post by:
Hi there. Is there any solution such that I could connect to some TAPI access number using TAPI in .NET, and then could send messages? E.g. consider SprintPCS; I could send message to any number by sending email to <number>@messaging.sprintpcs.com but this method ends up with some messages not delivered or delivered incomplete. Thats why I...
0
7450
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7720
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7957
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7470
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6043
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3500
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1941
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1059
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.