Re: [asterisk-users] Preferred language for Asterisk AGIs development ?

2009-05-07 Thread Stefan Reuter
Tobias Wolf wrote:
 This be true for AGI, but there is also FastAGI and with it the excellent
 asterisk-java package:
 
 http://asterisk-java.org/
 
 It supports writing AGI Scripts in JAVA, which communicates over TCP with 
 Asterisk. AMI is supported too ...
 
 Last but not least it has a nice Abstraction Layer, the Live API, which gives 
 you some good insight and control of what is going on, inside the asterisk 
 server.

It should be added that using the Java platform with Asterisk-Java for
AGI (and AMI) development also offers an easy way to use a whole variety
of other languages that run on the JVM.
These include Scala, JavaScript, Groovy, Ruby (JRuby), Python (Jython),
PHP (through Quercus) and BeanShell to only name a few.

You may want to have a look at
http://blogs.reucon.com/asterisk-java/2008/02/15/agi_scripts_in_beanshell.html
http://blogs.reucon.com/asterisk-java/2007/11/20/agi_scripts_in_groovy.html
http://blogs.reucon.com/asterisk-java/2008/08/10/outbound_message_delivery_using_agi_and_ami_in_scala.html

=Stefan



signature.asc
Description: OpenPGP digital signature
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Re: [asterisk-users] Preferred language for Asterisk AGIs development ?

2009-05-06 Thread randulo
On Tue, May 5, 2009 at 9:31 PM, Steve Edwards asterisk@sedwards.com wrote:

 I doubt any language is going to replace any other language for all
 future developments.

The day one religion replaces all other religions, it may happen
because languages = religions = distros = platforms = your subjective
belief structures.

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


Re: [asterisk-users] Preferred language for Asterisk AGIs development ?

2009-05-06 Thread Matthew Nicholson
On Tue, 2009-05-05 at 17:00 -0500, Danny Nicholas wrote: 
 Please elaborate;  obviously ?? the dialplan is the simplest route to solve
 any problem.

Dialplan is not the simplest route to solve ANY problem.  It is the
simplest route to solve simple problems.  Writing a while loop in AEL or
lua is much simpler then writing one in dialplan.  Also writing large
complex telephony applications is simpler in AEL or lua (or even AGI)
because they give you better tools to manage complexity than raw
dialplan does.  Performance wise, lua should be faster than Dialplan,
AEL, or AGI.

-- 
Matthew Nicholson
Digium, Inc. | Software Developer


___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


Re: [asterisk-users] Preferred language for Asterisk AGIs development ?

2009-05-06 Thread Danny Nicholas
Where are some good lua references?  I don't think the O'reilly book even
mentions it.

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Matthew
Nicholson
Sent: Wednesday, May 06, 2009 11:31 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Preferred language for Asterisk AGIs
development ?

On Tue, 2009-05-05 at 17:00 -0500, Danny Nicholas wrote: 
 Please elaborate;  obviously ?? the dialplan is the simplest route to
solve
 any problem.

Dialplan is not the simplest route to solve ANY problem.  It is the
simplest route to solve simple problems.  Writing a while loop in AEL or
lua is much simpler then writing one in dialplan.  Also writing large
complex telephony applications is simpler in AEL or lua (or even AGI)
because they give you better tools to manage complexity than raw
dialplan does.  Performance wise, lua should be faster than Dialplan,
AEL, or AGI.

-- 
Matthew Nicholson
Digium, Inc. | Software Developer


___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


[asterisk-users] Preferred language for Asterisk AGIs development ?

2009-05-05 Thread Kashif Naeem
Hello,

We are going to start development for a product based over Asterisk.
According to you, which is the preferred language for AGIs / IVRs
development in Asterisk. I got opinions that Perl is going to be replaced by
PHP for all future developments.

-- 
Kashif Naeem
Business Development Manager
Hadi Telecom
www.haditelecom.com

Cell: +92 (0)345 4226006
Office: +92 (0)42 5692766

Email: kas...@haditelecom.com
MSN: kashif__na...@hotmail.com
Gmail: meet.kas...@gmail.com
Skype: kashif.naeem

302 Y Commercial Area, 2nd Floor DHA Lahore, Pakistan.
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Re: [asterisk-users] Preferred language for Asterisk AGIs development ?

2009-05-05 Thread Kenneth Shaw
Drop Asterisk, move to Freeswitch. Much easier to interact with external
code bases, and it has more than one language interpreter built in
(javascript, lua, etc.).

If you're intent on staying on Asterisk, I would suggest skipping AGI,
and write a client that monitors the state of asterisk via the manager
interface. AGIs are messy in my opinion. There isn't really any best
language for AGIs, as AGIs just communicate with Asterisk via a pipe. So
really, the best language for AGIs are the language you like the best
and/or best fits the application domain/requirements for your project.

On Tue, 2009-05-05 at 11:52 +0500, Kashif Naeem wrote:
 Hello,
  
 We are going to start development for a product based over Asterisk.
 According to you, which is the preferred language for AGIs / IVRs
 development in Asterisk. I got opinions that Perl is going to
 be replaced by PHP for all future developments.
 
 
 
 -- 
 Kashif Naeem
 Business Development Manager
 Hadi Telecom
 www.haditelecom.com
 
 Cell: +92 (0)345 4226006
 Office: +92 (0)42 5692766

 Email: kas...@haditelecom.com
 MSN: kashif__na...@hotmail.com
 Gmail: meet.kas...@gmail.com
 Skype: kashif.naeem
 
 302 Y Commercial Area, 2nd Floor DHA Lahore, Pakistan.
 ___
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 
 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
Kenneth Shaw
ExpiTrans, Inc.
129 W. Wilson St., Suite 204
Costa Mesa, CA 92627
tel: 949.650.4600
fax: 949.642.6044
k...@expitrans.com


___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


Re: [asterisk-users] Preferred language for Asterisk AGIs development ?

2009-05-05 Thread Abdul Basit
On Tue, May 5, 2009 at 1:34 PM, Kenneth Shaw k...@expitrans.com wrote:

 Drop Asterisk, move to Freeswitch. Much easier to interact with external
 code bases, and it has more than one language interpreter built in
 (javascript, lua, etc.).


agreed but FS is newer and under test environment.


 If you're intent on staying on Asterisk, I would suggest skipping AGI,
 and write a client that monitors the state of asterisk via the manager
 interface. AGIs are messy in my opinion. There isn't really any best
 language for AGIs, as AGIs just communicate with Asterisk via a pipe. So
 really, the best language for AGIs are the language you like the best
 and/or best fits the application domain/requirements for your project.


AMI is good way for developing interactive applications.

I wrote the php code for asterisk that was two page long and wasim baig sb
wrote the same stuff in 1/2 page line of code using python with
implementation of python libraries.

yeee!



 On Tue, 2009-05-05 at 11:52 +0500, Kashif Naeem wrote:
  Hello,
 
  We are going to start development for a product based over Asterisk.
  According to you, which is the preferred language for AGIs / IVRs
  development in Asterisk. I got opinions that Perl is going to
  be replaced by PHP for all future developments.
 
 
 
  --
  Kashif Naeem
  Business Development Manager
  Hadi Telecom
  www.haditelecom.com
 
  Cell: +92 (0)345 4226006
  Office: +92 (0)42 5692766
 
  Email: kas...@haditelecom.com
  MSN: kashif__na...@hotmail.com
  Gmail: meet.kas...@gmail.com
  Skype: kashif.naeem
 
  302 Y Commercial Area, 2nd Floor DHA Lahore, Pakistan.
  ___
  -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 
  asterisk-users mailing list
  To UNSUBSCRIBE or update options visit:
 http://lists.digium.com/mailman/listinfo/asterisk-users
 --
 Kenneth Shaw
 ExpiTrans, Inc.
 129 W. Wilson St., Suite 204
 Costa Mesa, CA 92627
 tel: 949.650.4600
 fax: 949.642.6044
 k...@expitrans.com


 ___
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --

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




-- 
Regards,

Abdul Basit | Manager Support | +92-321-416-4196 | +92-42-588-7833 |
www.convergence.pk
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Re: [asterisk-users] Preferred language for Asterisk AGIs development ?

2009-05-05 Thread Tobias Wolf
Kenneth Shaw schrieb:
 Drop Asterisk, move to Freeswitch. Much easier to interact with external
 code bases, and it has more than one language interpreter built in
 (javascript, lua, etc.).
 
 If you're intent on staying on Asterisk, I would suggest skipping AGI,
 and write a client that monitors the state of asterisk via the manager
 interface. AGIs are messy in my opinion. There isn't really any best
 language for AGIs, as AGIs just communicate with Asterisk via a pipe. 

This be true for AGI, but there is also FastAGI and with it the excellent
asterisk-java package:

http://asterisk-java.org/

It supports writing AGI Scripts in JAVA, which communicates over TCP with 
Asterisk. AMI is supported too ...

Last but not least it has a nice Abstraction Layer, the Live API, which gives 
you some good insight and control of what is going on, inside the asterisk 
server.

I think it is definitly worth a try ;)

Kind Regards,

Tobias Wolf

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


Re: [asterisk-users] Preferred language for Asterisk AGIs development ?

2009-05-05 Thread Atis Lezdins
On Tue, May 5, 2009 at 9:52 AM, Kashif Naeem kas...@haditelecom.com wrote:
 Hello,

 We are going to start development for a product based over Asterisk.
 According to you, which is the preferred language for AGIs / IVRs
 development in Asterisk. I got opinions that Perl is going to be replaced by
 PHP for all future developments.

Just use the language You write the rest of system. If it's web
application, and You use PHP, You can use existing codebase of Your
project :)

Just be careful with this: asterisk and web server are usually run in
separate processes, so having common cache is troublesome unless You
check internally for effective uid and call sudo internally.

Regards,
Atis


-- 
Atis Lezdins,
VoIP Project Manager / Developer,
IQ Labs Inc,
a...@iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


Re: [asterisk-users] Preferred language for Asterisk AGIs development ?

2009-05-05 Thread Jeff LaCoursiere


On Tue, 5 May 2009, Kashif Naeem wrote:

 Hello,

 We are going to start development for a product based over Asterisk.
 According to you, which is the preferred language for AGIs / IVRs
 development in Asterisk. I got opinions that Perl is going to be replaced by
 PHP for all future developments.


C.

j

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


Re: [asterisk-users] Preferred language for Asterisk AGIs development ?

2009-05-05 Thread Steve Edwards
On Tue, 5 May 2009, Kashif Naeem wrote:

 We are going to start development for a product based over Asterisk. 
 According to you, which is the preferred language for AGIs / IVRs 
 development in Asterisk. I got opinions that Perl is going to be 
 replaced by PHP for all future developments.

My personal bias is C. I know it best and it performs best. I can execute 
xx to xxx AGIs written in C before you can load your interpreter (PHP or 
Perl) and parse.

You should go with the language you know best. If it isn't C, learn it :)

I doubt any language is going to replace any other language for all 
future developments. Languages are like tools. If all you know is 
hammer then every problem looks like nail. If you learn about 
screwdriver then you may discover a better way to open a sticking 
window.

Thanks in advance,

Steve Edwards  sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


Re: [asterisk-users] Preferred language for Asterisk AGIs development ?

2009-05-05 Thread Steve Edwards
Un-top-posting...

 On Tue, 2009-05-05 at 11:52 +0500, Kashif Naeem wrote:

 We are going to start development for a product based over Asterisk. 
 According to you, which is the preferred language for AGIs / IVRs 
 development in Asterisk. I got opinions that Perl is going to be 
 replaced by PHP for all future developments.

On Tue, 5 May 2009, Kenneth Shaw wrote:

 If you're intent on staying on Asterisk, I would suggest skipping AGI, 
 and write a client that monitors the state of asterisk via the manager 
 interface.

AGI and AMI are 2 different solutions to 2 different classes of problems. 
It may even make sense to use AMI in an AGI. I've never had the need.

AGI is executed in the context of a call. AMI is completely external to 
a call.

Think of AGI as dialplan on steroids and AMI as SNMP.

 AGIs are messy in my opinion.

AGIs are very clean in my opinion.

AGIs solve a large body of problems. An AGI is executed when requested by 
your dialplan. It does something and then it exits. If the caller hangs 
up, your AGI is notified (via signal) and can do something about it. If 
your AGI crashes, it only affects that single call. If you have 2 
simultaneous calls, you have 2 separate AGI in separate processes and 
memory spaces.

AMI implies writing a daemon that must be running all the time. Almost by 
definition, it should be multi-threaded or event driven so it can handle 
multiple simultaneous calls. If the daemon crashes, it will probably 
adversely impact all calls.

AGI and AMI are only 2 tools at your disposal. In terms of ease of 
implementation, I'd define the available set of tools and rank them in 
this order when considering how to solve a problem:

) Dialplan
) AGI
) AMI
) Asterisk applications

The list would be inverted if you consider complexity (skills needed to 
write) or risk (impact of a bug).

 There isn't really any best language for AGIs, as AGIs just 
 communicate with Asterisk via a pipe. So really, the best language for 
 AGIs are the language you like the best and/or best fits the application 
 domain/requirements for your project.

As Bill Clinton would say it depends on how you define best.

What is appropriate for 10 calls per day may be different than 10,000 
calls per day.

Thanks in advance,

Steve Edwards  sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


Re: [asterisk-users] Preferred language for Asterisk AGIs development ?

2009-05-05 Thread Steve Edwards
On Tue, 5 May 2009, Abdul Basit wrote:

 I wrote the php code for asterisk that was two page long and wasim baig sb
 wrote the same stuff in 1/2 page line of code using python with
 implementation of python libraries.

 yeee!

If I wrote it in a single very long line of C would you be even happier?

I guess it depends on the metrics you use to judge a solution :)

Thanks in advance,

Steve Edwards  sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


Re: [asterisk-users] Preferred language for Asterisk AGIs development ?

2009-05-05 Thread Abdul Basit
On Wed, May 6, 2009 at 1:51 AM, Steve Edwards asterisk@sedwards.comwrote:

 On Tue, 5 May 2009, Abdul Basit wrote:

  I wrote the php code for asterisk that was two page long and wasim baig
 sb
  wrote the same stuff in 1/2 page line of code using python with
  implementation of python libraries.
 
  yeee!

 If I wrote it in a single very long line of C would you be even happier?

 I guess it depends on the metrics you use to judge a solution :)


yap!



 Thanks in advance,
 
 Steve Edwards  sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
 Newline Fax: +1-760-731-3000

 ___
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --

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




-- 
Regards,

Abdul Basit | Manager Support | +92-321-416-4196 | +92-42-588-7833 |
www.convergence.pk
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Re: [asterisk-users] Preferred language for Asterisk AGIs development ?

2009-05-05 Thread Matthew Nicholson
On Tue, 2009-05-05 at 12:41 -0700, Steve Edwards wrote:

 AGI and AMI are only 2 tools at your disposal. In terms of ease of 
 implementation, I'd define the available set of tools and rank them in 
 this order when considering how to solve a problem:
 
 ) Dialplan

) pbx_lua
) AEL

 ) AGI
 ) AMI
 ) Asterisk applications

I would add AEL and pbx_lua to the list above.

-- 
Matthew Nicholson
Digium, Inc. | Software Developer


___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


Re: [asterisk-users] Preferred language for Asterisk AGIs development ?

2009-05-05 Thread Danny Nicholas
Please elaborate;  obviously ?? the dialplan is the simplest route to solve
any problem.  Pbx_lua and ael are the next logical extensions to
dialplan(?),  AGI can be simple custom code in PHP, Perl, C, etc. , AMI is
like AGI but using Manager interface and Asterisk Applications is tweaking,
patching or rewriting the native C code??

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Matthew
Nicholson
Sent: Tuesday, May 05, 2009 4:51 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Preferred language for Asterisk AGIs
development ?

On Tue, 2009-05-05 at 12:41 -0700, Steve Edwards wrote:

 AGI and AMI are only 2 tools at your disposal. In terms of ease of 
 implementation, I'd define the available set of tools and rank them in 
 this order when considering how to solve a problem:
 
 ) Dialplan

) pbx_lua
) AEL

 ) AGI
 ) AMI
 ) Asterisk applications

I would add AEL and pbx_lua to the list above.

-- 
Matthew Nicholson
Digium, Inc. | Software Developer


___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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


Re: [asterisk-users] Preferred language for Asterisk AGIs development ?

2009-05-05 Thread Steve Edwards
 [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Matthew 
 Nicholson Sent: Tuesday, May 05, 2009 4:51 PM

 On Tue, 2009-05-05 at 12:41 -0700, Steve Edwards wrote:

 AGI and AMI are only 2 tools at your disposal. In terms of ease of 
 implementation, I'd define the available set of tools and rank them in 
 this order when considering how to solve a problem:

 ) Dialplan

 ) pbx_lua
 ) AEL

 ) AGI
 ) AMI
 ) Asterisk applications

 I would add AEL and pbx_lua to the list above.

On Tue, 5 May 2009, Danny Nicholas wrote:

 Please elaborate;  obviously ?? the dialplan is the simplest route to 
 solve any problem.

Up to a point. I think of AGIs as little black boxes that hide complexity 
and allow the dialplan to remain simple and robust.

 Pbx_lua and ael are the next logical extensions to dialplan(?)

My guess would be AEL then lua, but it's just a guess. I'm starting to use 
AEL in 1.2 -- syntax checking sux and inconsistencies abound. I'm hoping 
AEL has gotten better.

 AGI can be simple custom code in PHP, Perl, C, etc. AMI is like AGI but 
 using Manager interface...

AMI is not like AGI.

They have similarities -- AGI talks to Asterisk via a pipe, AMI talks via 
a socket. Both can be written in any language. (Actually, both are just 
protocols, so using them as nouns is just a shorthand for a process 
conforming to the [AGI|AMI] protocol.

But, they are different tools for a different set of problems. AGI focuses 
on a channel but can interact with Asterisk as a whole. AMI focuses on 
Asterisk as a whole, but can interact with a channel. AGI executes in 
response to a action in the dialplan (calling AGI()) and it's lifespan 
is (usually) a subset of the lifespan of a channel. AMI executes either as 
a daemon or in response to a process external to Asterisk -- like a web 
page or a program executed from cron.

I've never used AMI for anything other than simple stuff like please 
reload or how many channels are active so I could be all wet here.

 and Asterisk Applications is tweaking, patching or rewriting the native 
 C code??

Yes. This is where it gets fun -- a simple programming error can crash 
Asterisk -- taking all in-flight calls with it. If you're contemplating 
solving your problem with an application, contemplate adding another 0 
or 2 to your development and maintenance costs :)

Thanks in advance,

Steve Edwards  sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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