Re: [Asterisk-Users] Programming the Manager API

2006-03-22 Thread Moises Silva
were using a Manager Proxy, i guess you should programm a proxy as
well, it will simplify things

AsterisManager - Manager Proxy -- Multiple Clients of Manager

On 3/21/06, Douglas Garstang [EMAIL PROTECTED] wrote:
 That's way too much Java for me. I'm lost already.

 -Original Message-
 From: El Flynn [mailto:[EMAIL PROTECTED]
 Sent: Tue 3/21/2006 10:20 PM
 To: Asterisk Users Mailing List - Non-Commercial Discussion
 Cc:
 Subject: Re: [Asterisk-Users] Programming the Manager API



 Douglas Garstang wrote:
  Yikes. Java. Yuck. I'll stick with Python... Thanks anyway.
  I just worked it out... you can supply an actionid to the request 
 to know what reply to look for, although it will still be tricky filtering 
 out the noise.
 

 Well, with the Asterisk java code it's pretty much cut and dried. 
 Take a look at
 some of the examples and you'll be surprised how quickly you can come 
 up with a
 workable app. It's as easy as:

 if (event instanceof NewChannelEvent) {
 /* Change icon color from green to red */
 }
 else if (event instanceof HangupEvent) {
 /* Change the icon color from red to green */
 }

 The filtering bit is kind of done for you there so you won't have 
 to muck
 around with parsing what is thrown back at you by *.

 Although you might want to download the source code and see how that 
 parsing is
 done.

 Flynn


 ___
 --Bandwidth and Colocation provided by Easynews.com --

 Asterisk-Users mailing list
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users



 ___
 --Bandwidth and Colocation provided by Easynews.com --

 Asterisk-Users mailing list
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users





--
Su nombre es GNU/Linux, no solamente Linux, mas info en http://www.gnu.org;
___
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] Programming the Manager API

2006-03-22 Thread Michael Collins
 That's way too much Java for me. I'm lost already.
 

Doug,

I'm a Perl guy myself, so I think in terms of Perl and CPAN.  I'm sure
Python has its own version of CPAN where people upload modules for other
programmers to use.  CPAN has a Perl module:
POE::Component::Client::Asterisk::Manager

It's an encapsulation layer using POE (Perl Object Environment - an easy
way to do real event-based programming in Perl).  Does Python have
something similar?  I know Python is way heavy on OOP and OOP is great
for event-based programming.

Just curious if someone out there might have already solved this problem
and created a Python module that you could borrow...

-MC
___
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Programming the Manager API

2006-03-22 Thread Stefan Reuter
Michael Collins wrote:
 Just curious if someone out there might have already solved this problem
 and created a Python module that you could borrow...

A python package is available from
http://py-asterisk.berlios.de/py-asterisk.php. It doesn't seem to be
activly maintained but it might serve as a starting point.

=Stefan


signature.asc
Description: OpenPGP digital signature
___
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[Asterisk-Users] Programming the Manager API

2006-03-21 Thread Douglas Garstang
I just started poking around with writing a python module to interface to the 
Manager API, and it suddenly hit me... how the heck are you supposed to program 
this thing?
 
All the events seem to be dumped to all the open connections. If I send a 
command, such as a login, there seems to me to be no way to determine which 
response are intended for me, and which may be intended for another open 
session. There's no reference number, or anything which indicates who events 
are for. This would seem to make it pretty much impossible to program at 
all.
 
Anyone done this???
 
Doug.
 
 
 
 
 
___
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Programming the Manager API

2006-03-21 Thread El Flynn

Douglas Garstang wrote:

I just started poking around with writing a python module to interface to the 
Manager API, and it suddenly hit me... how the heck are you supposed to program 
this thing?
 
All the events seem to be dumped to all the open connections. If I send a command, such as a login, there seems to me to be no way to determine which response are intended for me, and which may be intended for another open session. There's no reference number, or anything which indicates who events are for. This would seem to make it pretty much impossible to program at all.
 
Anyone done this???
 
Doug.
 


There's a Java packaged that contains numerous classes allowing you to interact 
with Asterisk. It interacts via the FastAGI protocol as well as the Asterisk 
Manager API.


Check it out at http://asterisk-java.sourceforge.net/

Flynn


___
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] Programming the Manager API

2006-03-21 Thread Douglas Garstang
Yikes. Java. Yuck. I'll stick with Python... Thanks anyway.
I just worked it out... you can supply an actionid to the request to know what 
reply to look for, although it will still be tricky filtering out the noise.
 
Doug.

-Original Message- 
From: El Flynn [mailto:[EMAIL PROTECTED] 
Sent: Tue 3/21/2006 10:05 PM 
To: Asterisk Users Mailing List - Non-Commercial Discussion 
Cc: 
Subject: Re: [Asterisk-Users] Programming the Manager API



Douglas Garstang wrote:
 I just started poking around with writing a python module to 
interface to the Manager API, and it suddenly hit me... how the heck are you 
supposed to program this thing?
 
 All the events seem to be dumped to all the open connections. If I 
send a command, such as a login, there seems to me to be no way to determine 
which response are intended for me, and which may be intended for another open 
session. There's no reference number, or anything which indicates who events 
are for. This would seem to make it pretty much impossible to program at 
all.
 
 Anyone done this???
 
 Doug.
 

There's a Java packaged that contains numerous classes allowing you to 
interact
with Asterisk. It interacts via the FastAGI protocol as well as the 
Asterisk
Manager API.

Check it out at http://asterisk-java.sourceforge.net/

Flynn


___
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


winmail.dat___
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Programming the Manager API

2006-03-21 Thread El Flynn

Douglas Garstang wrote:

Yikes. Java. Yuck. I'll stick with Python... Thanks anyway.
I just worked it out... you can supply an actionid to the request to know what 
reply to look for, although it will still be tricky filtering out the noise.
 


Well, with the Asterisk java code it's pretty much cut and dried. Take a look at 
some of the examples and you'll be surprised how quickly you can come up with a 
workable app. It's as easy as:


if (event instanceof NewChannelEvent) {
/* Change icon color from green to red */
}
else if (event instanceof HangupEvent) {
/* Change the icon color from red to green */
}

The filtering bit is kind of done for you there so you won't have to muck 
around with parsing what is thrown back at you by *.


Although you might want to download the source code and see how that parsing is 
done.


Flynn


___
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [Asterisk-Users] Programming the Manager API

2006-03-21 Thread Douglas Garstang
That's way too much Java for me. I'm lost already.

-Original Message- 
From: El Flynn [mailto:[EMAIL PROTECTED] 
Sent: Tue 3/21/2006 10:20 PM 
To: Asterisk Users Mailing List - Non-Commercial Discussion 
Cc: 
Subject: Re: [Asterisk-Users] Programming the Manager API



Douglas Garstang wrote:
 Yikes. Java. Yuck. I'll stick with Python... Thanks anyway.
 I just worked it out... you can supply an actionid to the request to 
know what reply to look for, although it will still be tricky filtering out the 
noise.
 

Well, with the Asterisk java code it's pretty much cut and dried. Take 
a look at
some of the examples and you'll be surprised how quickly you can come 
up with a
workable app. It's as easy as:

if (event instanceof NewChannelEvent) {
/* Change icon color from green to red */
}
else if (event instanceof HangupEvent) {
/* Change the icon color from red to green */
}

The filtering bit is kind of done for you there so you won't have to 
muck
around with parsing what is thrown back at you by *.

Although you might want to download the source code and see how that 
parsing is
done.

Flynn


___
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


___
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users