Re: [asterisk-users] asterisk, phpagi and singleton

2008-10-07 Thread Giedrius Augys
2008/10/6 Steve Edwards [EMAIL PROTECTED]

 On Mon, 6 Oct 2008, Alex Balashov wrote:

  Giedrius Augys wrote:
 
  What tools and programming (scripting) language do you use for FastAGI?
 
  Whatever languages FastAGI APIs are available for.  You are pretty much
  limited to languages whose interpreter lends itself to invocation as a
  standalone daemon, which may or may not exclude PHP and other languages
  designed to be web scripting languages and whose state is expected to be
  determined in terms of serial HTTP requests.
 
  I use Perl, personally:

 While not an interpreted scripting language, I would use C :)

 Thanks in advance,
 
 Steve Edwards  [EMAIL PROTECTED]  Voice: +1-760-468-3867 PST
 Newline Fax: +1-760-731-3000

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

 AstriCon 2008 - September 22 - 25 Phoenix, Arizona
 Register Now: http://www.astricon.net

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



Steve,

Do you use CAGI for fast AGI ?

-- 
Pagarbiai  / Best Regards,
Giedrius Augys
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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

Re: [asterisk-users] asterisk, phpagi and singleton

2008-10-06 Thread Giedrius Augys
2008/10/6 Alex Balashov [EMAIL PROTECTED]

 I think the problem is that every [Dead]AGI call is still a distinct
 invocation of the script, even if the interpreter stays loaded as an ELF
 module or whatnot.

 A good solution to this problem would be to use a FastAGI service,
 wherein a daemon runs persistently with a reusable DB handle.  Calls to
 AGI can connect to that using a service mode of operation rather than
 invoking a local script.

 Giedrius Augys wrote:

  Hello,
 
 I've this situation: 300+ simultaneous calls and dialplan like this:
  exten = _X.,1,Answer()
  exten = _X.,2,DEADAGI(check_status.php)
  exten = _X.,3,Dial(SIP/other/${NUMBER})
  exten = _X.,4,Hangup
 
  exten = h,1,DEADAGI(cdr.php)
 
  When project is running , I had  a lot of defunct php scripts (I've
  exceed mysql connection limits and so on, deadagi help a bit). The
  scripts check_status.php and cdr.php connects to database to
  retrieve/store data. So one call - 2 connections to database. So I want
  to do like this: 100 simultaneous calls , make 200 queries per one mysql
  connection. WEB developers uses singleton to avoid this issue. Maybe
  somebody has experience with singleton and phpagi.
  thanks...
 
  --
  Pagarbiai  / Best Regards,
  Giedrius Augys
 
 
  
 
  ___
  -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 
  AstriCon 2008 - September 22 - 25 Phoenix, Arizona
  Register Now: http://www.astricon.net
 
  asterisk-users mailing list
  To UNSUBSCRIBE or update options visit:
 http://lists.digium.com/mailman/listinfo/asterisk-users


 --
 Alex Balashov
 Evariste Systems
 Web: http://www.evaristesys.com/
 Tel: (+1) (678) 954-0670
 Direct : (+1) (678) 954-0671
 Mobile : (+1) (706) 338-8599

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

 AstriCon 2008 - September 22 - 25 Phoenix, Arizona
 Register Now: http://www.astricon.net

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


What tools and programming (scripting) language do you use for FastAGI?
Thanks
-- 
Pagarbiai  / Best Regards,
Giedrius Augys
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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

Re: [asterisk-users] asterisk, phpagi and singleton

2008-10-06 Thread Alex Balashov
Giedrius Augys wrote:

 What tools and programming (scripting) language do you use for FastAGI?

Whatever languages FastAGI APIs are available for.  You are pretty much 
limited to languages whose interpreter lends itself to invocation as a 
standalone daemon, which may or may not exclude PHP and other languages 
designed to be web scripting languages and whose state is expected to be 
determined in terms of serial HTTP requests.

I use Perl, personally:

http://search.cpan.org/~jaywhy/Asterisk-FastAGI-0.02/lib/Asterisk/FastAGI.pm

-- Alex

-- 
Alex Balashov
Evariste Systems
Web: http://www.evaristesys.com/
Tel: (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599

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

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] asterisk, phpagi and singleton

2008-10-06 Thread Steve Edwards
On Mon, 6 Oct 2008, Alex Balashov wrote:

 Giedrius Augys wrote:

 What tools and programming (scripting) language do you use for FastAGI?

 Whatever languages FastAGI APIs are available for.  You are pretty much
 limited to languages whose interpreter lends itself to invocation as a
 standalone daemon, which may or may not exclude PHP and other languages
 designed to be web scripting languages and whose state is expected to be
 determined in terms of serial HTTP requests.

 I use Perl, personally:

While not an interpreted scripting language, I would use C :)

Thanks in advance,

Steve Edwards  [EMAIL PROTECTED]  Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000

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

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] asterisk, phpagi and singleton

2008-10-05 Thread Philipp Kempgen
Giedrius Augys schrieb:

I've this situation: 300+ simultaneous calls and dialplan like this:
 exten = _X.,1,Answer()
 exten = _X.,2,DEADAGI(check_status.php)
 exten = _X.,3,Dial(SIP/other/${NUMBER})
 exten = _X.,4,Hangup
 
 exten = h,1,DEADAGI(cdr.php)
 
 When project is running , I had  a lot of defunct php scripts (I've exceed
 mysql connection limits and so on, deadagi help a bit). The scripts
 check_status.php and cdr.php connects to database to retrieve/store data. So
 one call - 2 connections to database. So I want to do like this: 100
 simultaneous calls , make 200 queries per one mysql connection.

In this scenario it doesn't matter how many simultaneous calls
you have. What matters is calls per second.

   Philipp Kempgen

-- 
http://www.das-asterisk-buch.de  -  http://www.the-asterisk-book.com
Amooma GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
-- 

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

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] asterisk, phpagi and singleton

2008-10-05 Thread Steve Edwards
On Sun, 5 Oct 2008, Giedrius Augys wrote:

   I've this situation: 300+ simultaneous calls and dialplan like this:
 exten = _X.,1,Answer()
 exten = _X.,2,DEADAGI(check_status.php)
 exten = _X.,3,Dial(SIP/other/${NUMBER})
 exten = _X.,4,Hangup

 exten = h,1,DEADAGI(cdr.php)

 When project is running , I had  a lot of defunct php scripts (I've exceed
 mysql connection limits and so on, deadagi help a bit). The scripts
 check_status.php and cdr.php connects to database to retrieve/store data. So
 one call - 2 connections to database. So I want to do like this: 100
 simultaneous calls , make 200 queries per one mysql connection. WEB
 developers uses singleton to avoid this issue. Maybe somebody has experience
 with singleton and phpagi.
 thanks...

I'm not a php weenie, but whatever is the cause of your defunct 
processes should be resolved or you are always going to have issues. I'd 
look for open channels, open database connections, improper child process 
handling or improper signal handling.

The first invocation of deadagi() appears to be inappropriate and 
misleading. The channel is not dead at this point. If you were having 
problems when callers hang up, you may not be handling signals correctly.

You can raise the number of connections allowed by MySQL, but this is a 
band-aid, not the solution. I'm guessing you don't need xxx simultaneous 
connections to the database.

fastagi() would allow you to have a single[ton] connection to the 
database. You can run the fastagi daemon on the Asterisk server, the 
MySQL server or any other server.

In the off chance the above is your literal dialplan, you should use n 
instead of numbered priorities.

Thanks in advance,

Steve Edwards  [EMAIL PROTECTED]  Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000

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

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] asterisk, phpagi and singleton

2008-10-05 Thread Alex Balashov
I think the problem is that every [Dead]AGI call is still a distinct 
invocation of the script, even if the interpreter stays loaded as an ELF 
module or whatnot.

A good solution to this problem would be to use a FastAGI service, 
wherein a daemon runs persistently with a reusable DB handle.  Calls to 
AGI can connect to that using a service mode of operation rather than 
invoking a local script.

Giedrius Augys wrote:

 Hello,
 
I've this situation: 300+ simultaneous calls and dialplan like this:
 exten = _X.,1,Answer()
 exten = _X.,2,DEADAGI(check_status.php)
 exten = _X.,3,Dial(SIP/other/${NUMBER})
 exten = _X.,4,Hangup
 
 exten = h,1,DEADAGI(cdr.php)
 
 When project is running , I had  a lot of defunct php scripts (I've 
 exceed mysql connection limits and so on, deadagi help a bit). The 
 scripts check_status.php and cdr.php connects to database to 
 retrieve/store data. So one call - 2 connections to database. So I want 
 to do like this: 100 simultaneous calls , make 200 queries per one mysql 
 connection. WEB developers uses singleton to avoid this issue. Maybe 
 somebody has experience with singleton and phpagi.
 thanks...
 
 -- 
 Pagarbiai  / Best Regards,
 Giedrius Augys
 
 
 
 
 ___
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 
 AstriCon 2008 - September 22 - 25 Phoenix, Arizona
 Register Now: http://www.astricon.net
 
 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


-- 
Alex Balashov
Evariste Systems
Web: http://www.evaristesys.com/
Tel: (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599

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

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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