# Ruby and TAPI

**URL:** <https://www.ruby-forum.com/t/ruby-and-tapi/77761>\
**Category:** Ruby\
**Created:** [November 30, 2006, 11:04am UTC](https://www.ruby-forum.com/t/ruby-and-tapi/77761 "2006-11-30T11:04:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ther](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/977dab/32.png) [@ther](https://www.ruby-forum.com/u/ther)\
**Post date:** [November 30, 2006, 11:04am UTC](https://www.ruby-forum.com/t/ruby-and-tapi/77761/1 "2006-11-30T11:04:16Z")

</div>

Has anybody been succesfull combining Windows Telephone API (TAPI) with  
ruby. What I need is start a ruby program on call and receive a caller  
number.

I need to know if this has been done with ruby so I can further decide  
on environment to use with application I will propose.

by

TheR

---

<div class="post-metadata">

**Author:** ![ther](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/977dab/32.png) [@ther](https://www.ruby-forum.com/u/ther)\
**Post date:** [November 30, 2006, 2:55pm UTC](https://www.ruby-forum.com/t/ruby-and-tapi/77761/2 "2006-11-30T14:55:57Z")

</div>

Damjan R. wrote:

> Has anybody been succesfull combining Windows Telephone API (TAPI) with  
> ruby. What I need is start a ruby program on call and receive a caller  
> number.
> 
> I need to know if this has been done with ruby so I can further decide  
> on environment to use with application I will propose.

Hi, I’ve not done this but I have written several applications a few  
years ago to make use of tapi from vb6. TAPI calls are just like normal  
win32 calls, and most of the work is with dealing with the returned  
structures, creating an object model and responding to call backs. All  
of these things are quite simple in ruby, and a full tapi implementation  
in a vb6 dll project is about 4000 lines, so with ruby I doubt there  
would be a problem.

## However, it is still a considerable amount of work and I think it would be wise to investigate if there is an existing off the shelf com library that you can call from ruby with win32ole, or a .NET library that you can call with .net bridge, as this would provide the object model for you.

_Jeremy W._

---

<div class="post-metadata">

**Author:** ![ther](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/977dab/32.png) [@ther](https://www.ruby-forum.com/u/ther)\
**Post date:** [November 30, 2006, 8:16pm UTC](https://www.ruby-forum.com/t/ruby-and-tapi/77761/3 "2006-11-30T20:16:59Z")

</div>

Don’t know if you are looking to develop a CTI-type application or just  
control a computer’s modem, but if it’s the former and the phone system  
is TSAPI compliant as well I created a Ruby TSAPI library for such a  
purpose ([http://tsapi.rubyforge.org](http://tsapi.rubyforge.org)).

---

<div class="post-metadata">

**Author:** ![ther](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/977dab/32.png) [@ther](https://www.ruby-forum.com/u/ther)\
**Post date:** [December 1, 2006, 8:43am UTC](https://www.ruby-forum.com/t/ruby-and-tapi/77761/4 "2006-12-01T08:43:52Z")

</div>

Greg Kujawa wrote:

> Don’t know if you are looking to develop a CTI-type application or just  
> control a computer’s modem, but if it’s the former and the phone system  
> is TSAPI compliant as well I created a Ruby TSAPI library for such a  
> purpose ([http://tsapi.rubyforge.org](http://tsapi.rubyforge.org)).

I have an ISDN phone connected to computers RS232 interface and a TAPI  
driver. What I would like to achive is when phone rings I could get a  
caller number which would than be processed further.

by

TheR

---

<div class="post-metadata">

**Author:** ![ther](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/977dab/32.png) [@ther](https://www.ruby-forum.com/u/ther)\
**Post date:** [December 1, 2006, 3:46pm UTC](https://www.ruby-forum.com/t/ruby-and-tapi/77761/5 "2006-12-01T15:46:11Z")

</div>

I assume you are referring to a Windows host machine. If so then check  
this URL → [http://www.programurl.com/software/tapi.htm](http://www.programurl.com/software/tapi.htm). If I were you  
I’d find a easy to use COM download and use that to grab the incoming  
ANI.
