473,695 Members | 2,799 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

TAPI

Hello,
Has anyone got any examples of TAPI code in c#?
Thanks
John
Nov 15 '05 #1
1 15872
ron_leg
1 New Member
I hope this helps. I haven't figured out how to hangup AND how to capture events (dialed a busy line or fax) from the modem yet. If you do please let me know.

This works if the modem is hooked up to the server. I am having problems writing this into .NET 2.0 web page as a javascript so the modem on the client machine will dial instead.

// you must referrence C:\windows\syst em32\tapi3.dll in your project

<asp:Label ID="lblModem" runat="server" Text="Label">
THIS DISPLAYS ALL YOU AVAILABLE MODEMS
</asp:Label>
<asp:TextBox ID="txtModem" runat="server">
CHANGE YOUR MODEM NAME YOU ARE GOING TO USE HERE
</asp:TextBox>
<asp:TextBox ID="txtPhoneNum ber" runat="server">
CHANGE THE PHONE NUMBER YOU WANT TO DIAL
</asp:TextBox>



<%--TAPI_Phone.aspx--------------------------------------------------------------------%>



<%@ Page Language="C#" AutoEventWireup ="true" CodeFile="TAPI_ Phone.aspx.cs" Inherits="TAPI_ Phone" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<script runat="server">
</script>
<title>TAPI_Pho ne Test Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Label ID="lblModem" runat="server" Text="Label"></asp:Label>
<asp:TextBox ID="txtModem" runat="server"> BCM V.92 56K Modem</asp:TextBox>
<asp:TextBox ID="txtPhoneNum ber" runat="server"> 5551212</asp:TextBox>
</form>
</body>
</html>




//TAPI_Phone.aspx .cs-------------------------------------------------------------------------


using System;
using System.Data;
using System.Configur ation;
using System.Collecti ons;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Web.UI.H tmlControls;
using System.Threadin g;
// you must referrence C:\windows\syst em32\tapi3.dll in your project
using TAPI3Lib;

public partial class TAPI_Phone : System.Web.UI.P age
{
uint ui;
string sModemName = "";
TAPI3Lib.TAPICl ass pTAPI = new TAPI3Lib.TAPICl ass();
//ITAddressPtr pAddress;
TAPI3Lib.ITAddr ess pAddress;
//IEnumAddressPtr pEnumAddress;
TAPI3Lib.IEnumA ddress pEnumAddress;
//ITBasicCallCont rolPtr pCall;
TAPI3Lib.ITBasi cCallControl pCall;
const int LINEADDRESSTYPE _PHONENUMBER = 1;
const int TAPIMEDIATYPE_A UDIO = 8;

protected void Page_Load(objec t sender, EventArgs e)
{
pTAPI.Initializ e();
pEnumAddress = pTAPI.Enumerate Addresses();
lblModem.Text = "";
while (txtModem.Text != sModemName)
{
pEnumAddress.Ne xt(1, out pAddress, ref ui);
sModemName = pAddress.Addres sName.ToString( );
lblModem.Text = lblModem.Text + "<li>" + sModemName;
}
If the line was found, then make a call
pCall = pAddress.Create Call(txtPhoneNu mber.Text,
LINEADDRESSTYPE _PHONENUMBER,
TAPIMEDIATYPE_A UDIO);
// Make the call
pCall.Connect(t rue);
// Wait a while - do something here while the call is ongoing
//Thread.Sleep(50 00); // wait 5 seconds
// Hangup
pCall.Disconnec t(DISCONNECT_CO DE.DC_NORMAL);
// Shutdown TAPI
pTAPI.Shutdown( );
}
}
Jul 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6614
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
3202
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 a long list of pop ups for past calls The TAPI dialer is required becasue the interface to the...
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
7816
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
6235
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
4062
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 know why??
7
18731
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 resources. As a point of reference the C++ app has been running quite well for over a year. Anyway, I...
1
2657
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
1637
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 want to use TAPI to send messages. Quick help will be appreciated!
0
8631
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8572
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9115
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8847
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8825
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7661
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4340
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2272
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1976
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.