[Asterisk-Dev] Request for comments on CTI integration

Nicolas Gudino nicolas at house.com.ar
Wed Jul 14 06:57:03 MST 2004

Hi Sunrise,

Sunrise Ltd wrote:
> Hi
> I have a request for CTI integration with Asterisk and I
> am thinking about a lightweight protocol to send ringing,
> pickup and hangup event notification messages along with
> Caller ID from Asterisk to client devices which are NOT
> phones.
> The client devices will typically be desktops running a
> CTI application that would do stuff like popping up a
> database screen with details on the caller on the other
> end of the user's phone, keep a call log etc etc. The
> important thing here is that this must be totally
> independent from the telephone sets used. It should still
> work if the end user receives a call on his cell phone
> after Asterisk has diverted it there.

Check the Flash Operator Panel, its not exactly the same kind of
program, but very similar. There is a server, writen in perl, that
connects to the manager port to catch up events, and it also listens to
clients (in this case swf flash movies) that displays information about
channel status and also can trigger actions like transfers and hangups.

> I am not a protocol expert, so initially I intend to do
> something very quick and dirty with Python or so.

Me neither, my protocol is awfull, it started as a proof of concept, but
it works for the purpose of the program. The panel can popup webpages
whith the callerid for certain channels also, just like your intended
application. It does not keep a log, but displays timers for ongoing calls.

> What I have in mind is a server daemon running on the
> Asterisk box, listening for connections from clients
> running on remote desktops.

Just like my op_server.pl. ( Check out http://www.asternic.org )

> The client would register with the server for
> authentication and then subscribe to a number of possible
> notification events like
> - incoming call from caller ID
> - outgoing call to caller ID
> - diverted from other extension
> - diverted to other extension
> - transferred incoming from other extension
> - transferred to other extension
> - pickup, hangup and timeout

The op_server catchs up all manager events. In its current incarnation
it can detect and display:

*incomming calls and caller ID,
*outgoing calls with dialed number (sortof, its hard to discern between
outgoing/incoming with just manager events, and the view from the PBX is
different as the perception of the user, if I receive an incomming call
from a zap channel, then it makes an outgoing call to the destination
*parked channels
*meetme conference participants
*users waiting on a queue

> Initially, as a quick and dirty hack, notifications could
> be lodged by way of using an Asterisk application, ie
> ctinotify_app ...
> exten => 1234,1,CTInotify("INCOMING",${CALLERID})
> exten => 1234,2,Dial(...)
> ...
> exten => 1234,10,CTInotify("HANGUP",${CALLERID})
> exten => 1234,11,hangup
> but eventually this should be integrated with the Dial
> command itself so that DIVERT, TRANSFER and PICKUP events
> would also be notifiable and also for onvenience and not
> to have to clutter the dialplan.

Not needed for the op_server as it catchs all manager events and tries
to understand and guess the status of the channels. But its limited to
the events displayed in the manager port. I think that the manager is
enough, no need to modify other applications or the asterisk core.

> A configuration file would be used to allow and disallow
> notifications for various users, something along the lines
> of ...
> ctinotify.conf
> [general]
> port=xxxx
> [client1]
> secret=blah
> host=dynamic
> devices=SIP/xxx,IAX/xxx,Zap/xxx
> events=incoming, outgoing, transfer, divert, pickup,
> hangup, timeout

My configuration parser is more primitive, just a comma separated file.

Take a look at the op_server.pl, much of the work you are trying to do
is already done there.

Nicolas Gudino
House Internet S.R.L.
Buenos Aires - Argentina

More information about the asterisk-dev mailing list