473,545 Members | 1,769 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 15838
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
6612
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
6229
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
18727
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
2647
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
1628
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
7459
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...
0
7393
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
7653
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
7749
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...
0
5965
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
4942
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1871
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
1012
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
695
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...

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.