Re: [asterisk-users] DECT USB dongle - an Asterisk channel?

2009-06-05 Thread Olivier
2009/6/4 John Todd jt...@digium.com


 Michael Graves bounced this to me this morning - it looks interesting
 as a possible device for which an Asterisk channel driver could be
 written:


 http://www.redorbit.com/news/technology/1699391/rtx_releases_dectcatiq_20_usb_dongle/index.html?source=r_technology



Great !
Do you think this dongle is on sale somewhere for integrators or end users
(ie small quantities) ?
Reading this press release, I thought it's still a component targeted to
vendors.

Regards
___
-- 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] Phones dropping registration, but asterisk thinks phones are still registered

2009-06-05 Thread Olivier
How many phones are concerned ?
___
-- 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] Friday June 5th @12 Noon EDT: Sipgate invades the USA, more HD Voice, Video chat

2009-06-05 Thread randulo
Already Friday, the week went by in a Flash.

If you haven't yet registered for a free Sipgate DID, I suggest you go
do so. If you are in, or interested in the business, Sipgate has a few
tricks up their sleeves and you should be aware of them. Someone from
Sipgate will be joining the conference, which begins at

12 Noon EDT (9AM PDT, 10 Mountain, 11 Central, 5PM UK, 6 Central Europe)

ZipDX has a G.722 conference bridge available to VoIP Users Conference
members. See the site for numbers and instructions.

Sessions and info site: http://vuc.me

We are also testing a Flash video chat that will be available at the
same time as the conference. It shows up to 12 people at the moment.
Be sure to have your audio muted on the video page if you use it.

Video: http://vuc.me/video

That page will open at the same time as the wideband bridge, at 11:45 AM EDT.

You can test the video chat any time by going to http://tinychat.com/geek.

IRC #voip-users-conference on Freenode.net anytime day or night

PSTN (724) 444-7444  DTMF 22622# 1#
SIP: 7463#2262...@proxy.ideasip.com or connect to ts.x2z.eu
SIP G.722 200...@login.zipdx.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] CPU usage vs compiler flags

2009-06-05 Thread Tzafrir Cohen
On Thu, Jun 04, 2009 at 02:11:45PM -0500, Miguel Molina wrote:

 You were right. Almost one day with the server nearly overloaded (it's a 
 24/7 call center) taught me the lesson: don't try to debug directly on 
 production machines, use instead a separate testing one with a copy of 
 the configuration if possible. Thanks to God for the spare CPU power 
 that was available. Never thought that disabling the optimizations were 
 going to impact the overall performance of asterisk that much.

For the cases you have to, and in cases you can afford a short downtime,
here's a small trick to borrow some debugging time on the production
system:

  http://svn.digium.com/svn/asterisk/trunk/contrib/scripts/live_ast

(In Asterisk as of 1.6.2, IIRC)

In an Asteirsk source tree somewhere on the production system (not the
one you normally use. Maybe use a copy of that one)

  wget http://svn.digium.com/svn/asterisk/trunk/contrib/scripts/live_ast
  chmod +x live_ast
  ./live_ast conf-file
  # edit live/live.conf . Unrem the following two:
  #LIVE_AST_CONFIGURE_PARAMS=--enable-dev-mode
  #LIVE_AST_FOR_SYSTEM=yes
  ./live_ast configure
  ./live_ast install
  ./live_ast samples

Now you get a separate instance of Asterisk under ./live/ -
./live/usr/sbin/asterisk and ./live/usr/lib/modules/asterisk/ . You also
get ./live/asterisk which is a wrapper script that behaves exactly like
the Asetrisk binary (command-line wise, that is) so you can use it in
your scripts or directly. See the magic in
./live/etc/asterisk/asterisk.conf

So if you don't have important users at night (ahem) just shut down the
standard Asterisk instance and switch to that instance for testing.
Switching back should be likewise simple.

-- 
   Tzafrir Cohen
icq#16849755  jabber:tzafrir.co...@xorcom.com
+972-50-7952406   mailto:tzafrir.co...@xorcom.com
http://www.xorcom.com  iax:gu...@local.xorcom.com/tzafrir

___
-- 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] Help with inbound dialplan

2009-06-05 Thread Alex Samad
Hi

I am trying to setup asterisk at home, I have 1 in bound VSP (I have a
register cmd setup for that in asterisk).  At home I have a cordless
phone with 2 line capability - I currently have 2 spa3102's in place to
handle the 2 lines ( I am in the process of buying tdm410 to handle to
handle this and the backup pstn line).

I also have 2 laptops setup with soft sip phones.

What I would like to see happen is when an inbound call comes, I would
like to ring 1 line on the cordless phones - because it sounds really
weird when both the lines ring at the same time. and I would like to see
both the laptops ring if they are connected.

this is what I am looking at using

exten = s,1,Dial(SIP/SPA3102bSIP/laptopSIP/tlaptop,20,j)
exten = s,n,VoiceMail(v...@spa3102,u)
exten = s,n,Hangup
exten = s,102,Dial(SIP/SPA3102aSIP/laptopSIP/tlaptop,20,j)
exten = s,n,VoiceMail(v...@spa3102,u)
exten = s,n,Hangup
exten = s,203,VoiceMail(v...@spa3102,b)


SPA3102b is line 2, SPA3102b is line 1 on the cordless and laptop 
tlaptop are the laptop SIP definitions.

one problem that happens is that when somebody is making a call on line2
(SPA3102b) outbound, asterisk will still send an inbound call to the
SPA3102b because of call waiting.  Is there some way of avoiding this -
seems silly to me 


Is this the way to do ?

or is there some way to create a gobalvar which is a dynamic dial string,
but I can't figure out how to modify a gobalvar on registration ?

Thanks

Alex



signature.asc
Description: 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] Question about core CDR system for multilpe servers

2009-06-05 Thread Christian Victor
Danny Nicholas schrieb:
 -Original Message-
 From: asterisk-users-boun...@lists.digium.com
 [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Miguel Molina
 Sent: Thursday, June 04, 2009 11:01 AM
 To: Asterisk Users Mailing List - Non-Commercial Discussion
 Subject: Re: [asterisk-users] Question about core CDR system for multilpe
 servers

 Gustavo A Gonzalez escribió:
   
 Hi all! I’m not sure if it is the correct place but, I’ve five boxes
 
 running
   
 asterisk and each one with his own cdr mysql database. What Im looking for
 is to get a core CDR system that holds information stored on each asterisk
 server. Have you any suggestion/process to accomplish that?. Thanks!!!

 Gustavo A. González

   
 
 Well, this sounds fairly simple. Can you do it by configuring each 
 asterisk server (cdr_mysql.conf) to connect to the same MySQL core 
 database server. Inside it, you can have each server CDR in a separate 
 database, or in a single database for all of them using different table 
 names. How to configure it, depends on performance inside the MySQL 
 server, and how do you want to store the information. Maybe is not a 
 good idea to have all the CDRs on the same database if the tables are 
 going to be too big. But having all of them in a single database server, 
 shouldn't be a problem.

 Cheers,

   
 This all sounds very nice and do-able, but doesn't this sound like a
 
 high-odds scenario for creating a single point-of-failure especially 
if the

5 machines are all creating a high volume of calls?

True - so use a MySQL cluster instead.

Chris

___
-- 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] PHP/AGI/SetVar Issue

2009-06-05 Thread Philipp Kempgen
Peder schrieb:

 Here is the part from the agi that sets the variables:
 
 echo ' EXEC SetVar ISLOCALCONTEXT='.$row['context'].'';
 echo ' EXEC SetVar ISLOCALDID='.$row['did'].'';
 
 If I run it is as, ISLOCALCONTEXT gets set, but not ISLOCALDID:
 
  -- Executing NoOp(SIP/-081d2c38, CONTEXT2) in new stack
  -- Executing NoOp(SIP/-081d2c38, ) in new stack
 
 If I flip their order in the agi, then ISLOCALDID gets set, but not
 ISLOCALCONTEXT:
 
  -- Executing NoOp(SIP/-081d8d78, ) in new stack
  -- Executing NoOp(SIP/-081d8d78, ) in new stack
 
 Any idea what I am missing?  Only the first exec setvar gets run and the
 other one appears to just be ignored.  I just want to be able to set 2-3
 variables and then return to the dialplan.  Please note that I do not want
 to use phpagi so don't tell me to use that, I want to figure out why it
 doesn't work this way.

Send a newline (\n) after each command.
Remove the blank ( ) before the commands.
And maybe use SET VARIABLE instead of EXEC SetVar.


Philipp Kempgen
-- 
AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
Videos of the AMOOCON VoIP conference 2009 -  http://www.amoocon.de
-- 

___
-- 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] PHP/AGI/SetVar Issue

2009-06-05 Thread Philipp Kempgen
Steve Edwards schrieb:
 On Thu, 4 Jun 2009, Peder wrote:
 
 Is there a limitation to the number of variables you can set from a PHP 
 agi script?
 
 Not that I've found yet :)
 
 One of my AGIs sets almost 600 channel variables.

Wow that's a lot. Why would you do that?

 echo ' EXEC SetVar ISLOCALCONTEXT='.$row['context'].'';
 echo ' EXEC SetVar ISLOCALDID='.$row['did'].'';
 
 You are violating the AGI protocol. First, you have to read the AGI 
 environment. Then, for every request, you must read the response.

I don't think that it really matters. At least in PHP I haven't
seen any problems even if you don't read anything (provided you
don't care about the AGI environment and responses).
Maybe PHP slurps the input into a buffer which will be garbage
collected if you don't use it.


Philipp Kempgen
-- 
AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
Videos of the AMOOCON VoIP conference 2009 -  http://www.amoocon.de
-- 

___
-- 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] broken pipe in perl agi

2009-06-05 Thread Danny Nicholas
You're on the right track, Steve but that didn't do it either.  Here is the
Perl snippet:
use strict;
use warnings;
my $towatch = $ARGV[0];
my $a=0;
my $retval=undef;
# show hints will get hint information from the dialplan
while ($a1) {
   my $cmda = '/usr/sbin/asterisk -rx core show hints|';
     Get Trunk Information 
   my %lines;
   my $lineseq=0;
   $SIG{'PIPE'} = 'IGNORE';
   open (my $trunk_info,$cmda) or print STDOUT Broken pipe\n;
   if ($trunk_info) {
  while ($trunk_info) {
 if ($_ =~ /internal/) {
if ($_ =~ /$towatch/) {
   $lines{$lineseq} = $_;
   $lineseq++;
   }
}
 }
  close $trunk_info;
  }
   sleep 2;

   for (my $i=0;$i=$lineseq;$i++) {
  if ($lines{$i}) {
 my $c = unpack(x74 a16, $lines{$i});
 $c =~ s/\s//gx;
 $retval=1;
 print STDOUT SET VARIABLE LINESTAT \$c\ \r\n;
 STDIN;
 }
  }
   $a++;
   }
# if /var/run/asterisk.ctl is not mod 777, no result so we return a dummy
Idle
if (! $retval) {
   my $c = Idle;
   print STDOUT SET VARIABLE LINESTAT \$c\ \r\n;
   STDIN;
   }
exit;

If there is an active call on the extension, it works.  If not, the broken
pipe message is returned.

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Steve Edwards
Sent: Thursday, June 04, 2009 6:37 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] broken pipe in perl agi

On Thu, 4 Jun 2009, Danny Nicholas wrote:

 Here's what I got from agi debug:
 agi debug
 AGI Debugging Enabled
 *CLI AGI Tx  agi_request: hintcheck.agi

[snip]

 AGI Rx  SET VARIABLE LINESTAT=Idle
 AGI Tx  200 result=1
 [Jun  4 13:33:42] ERROR[28261]: utils.c:979 ast_carefulwrite: write()
 returned error: Broken pipe

I'm guessing you're not reading the last 200 result=1 before exiting or 
closing the pipe.

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


___
-- 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] broken pipe in perl agi

2009-06-05 Thread Elliot Otchet
FYI - It works fine under perl 5.8.8 on RHEL5.2 w/ Asterisk 1.4.24.1

You might want to check your perl modules to see if they're up to date.

Regards,

Elliot

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Danny Nicholas
Sent: Friday, June 05, 2009 9:43 AM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: Re: [asterisk-users] broken pipe in perl agi

You're on the right track, Steve but that didn't do it either.  Here is the
Perl snippet:
use strict;
use warnings;
my $towatch = $ARGV[0];
my $a=0;
my $retval=undef;
# show hints will get hint information from the dialplan
while ($a1) {
   my $cmda = '/usr/sbin/asterisk -rx core show hints|';
     Get Trunk Information 
   my %lines;
   my $lineseq=0;
   $SIG{'PIPE'} = 'IGNORE';
   open (my $trunk_info,$cmda) or print STDOUT Broken pipe\n;
   if ($trunk_info) {
  while ($trunk_info) {
 if ($_ =~ /internal/) {
if ($_ =~ /$towatch/) {
   $lines{$lineseq} = $_;
   $lineseq++;
   }
}
 }
  close $trunk_info;
  }
   sleep 2;

   for (my $i=0;$i=$lineseq;$i++) {
  if ($lines{$i}) {
 my $c = unpack(x74 a16, $lines{$i});
 $c =~ s/\s//gx;
 $retval=1;
 print STDOUT SET VARIABLE LINESTAT \$c\ \r\n;
 STDIN;
 }
  }
   $a++;
   }
# if /var/run/asterisk.ctl is not mod 777, no result so we return a dummy
Idle
if (! $retval) {
   my $c = Idle;
   print STDOUT SET VARIABLE LINESTAT \$c\ \r\n;
   STDIN;
   }
exit;

If there is an active call on the extension, it works.  If not, the broken
pipe message is returned.

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Steve Edwards
Sent: Thursday, June 04, 2009 6:37 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] broken pipe in perl agi

On Thu, 4 Jun 2009, Danny Nicholas wrote:

 Here's what I got from agi debug:
 agi debug
 AGI Debugging Enabled
 *CLI AGI Tx  agi_request: hintcheck.agi

[snip]

 AGI Rx  SET VARIABLE LINESTAT=Idle
 AGI Tx  200 result=1
 [Jun  4 13:33:42] ERROR[28261]: utils.c:979 ast_carefulwrite: write()
 returned error: Broken pipe

I'm guessing you're not reading the last 200 result=1 before exiting or
closing the pipe.

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


___
-- 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

This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 
immediately and delete the original message.

___
-- 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] broken pipe in perl agi

2009-06-05 Thread Elliot Otchet
Scratch that - my bad.  I had a modified version responding.

Nothing like starting a Friday off on the wrong foot.  At least it is happy 
hour somewhere.

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Elliot Otchet
Sent: Friday, June 05, 2009 9:59 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] broken pipe in perl agi

FYI - It works fine under perl 5.8.8 on RHEL5.2 w/ Asterisk 1.4.24.1

You might want to check your perl modules to see if they're up to date.

Regards,

Elliot

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Danny Nicholas
Sent: Friday, June 05, 2009 9:43 AM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: Re: [asterisk-users] broken pipe in perl agi

You're on the right track, Steve but that didn't do it either.  Here is the
Perl snippet:
use strict;
use warnings;
my $towatch = $ARGV[0];
my $a=0;
my $retval=undef;
# show hints will get hint information from the dialplan
while ($a1) {
   my $cmda = '/usr/sbin/asterisk -rx core show hints|';
     Get Trunk Information 
   my %lines;
   my $lineseq=0;
   $SIG{'PIPE'} = 'IGNORE';
   open (my $trunk_info,$cmda) or print STDOUT Broken pipe\n;
   if ($trunk_info) {
  while ($trunk_info) {
 if ($_ =~ /internal/) {
if ($_ =~ /$towatch/) {
   $lines{$lineseq} = $_;
   $lineseq++;
   }
}
 }
  close $trunk_info;
  }
   sleep 2;

   for (my $i=0;$i=$lineseq;$i++) {
  if ($lines{$i}) {
 my $c = unpack(x74 a16, $lines{$i});
 $c =~ s/\s//gx;
 $retval=1;
 print STDOUT SET VARIABLE LINESTAT \$c\ \r\n;
 STDIN;
 }
  }
   $a++;
   }
# if /var/run/asterisk.ctl is not mod 777, no result so we return a dummy
Idle
if (! $retval) {
   my $c = Idle;
   print STDOUT SET VARIABLE LINESTAT \$c\ \r\n;
   STDIN;
   }
exit;

If there is an active call on the extension, it works.  If not, the broken
pipe message is returned.

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Steve Edwards
Sent: Thursday, June 04, 2009 6:37 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] broken pipe in perl agi

On Thu, 4 Jun 2009, Danny Nicholas wrote:

 Here's what I got from agi debug:
 agi debug
 AGI Debugging Enabled
 *CLI AGI Tx  agi_request: hintcheck.agi

[snip]

 AGI Rx  SET VARIABLE LINESTAT=Idle
 AGI Tx  200 result=1
 [Jun  4 13:33:42] ERROR[28261]: utils.c:979 ast_carefulwrite: write()
 returned error: Broken pipe

I'm guessing you're not reading the last 200 result=1 before exiting or
closing the pipe.

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


___
-- 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

This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 
immediately and delete the original message.

___
-- 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

This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 

Re: [asterisk-users] Phones dropping registration, but asterisk thinks phones are still registered

2009-06-05 Thread James Lamanna
Oliver wrote:

 How many phones are concerned ?

The box currently has about 380 active phone registrations.

Thanks.

Please CC me directly as well because I'm on digest mode.

-- James

___
-- 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] Help with inbound dialplan

2009-06-05 Thread Danny Nicholas
If you set call-limit=1 on the spa3102b user, the outgoing call will
congest the line and not allow Asterisk to go out to the call waiting.

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Alex Samad
Sent: Friday, June 05, 2009 5:56 AM
To: asterisk-users@lists.digium.com
Subject: [asterisk-users] Help with inbound dialplan

Hi

I am trying to setup asterisk at home, I have 1 in bound VSP (I have a
register cmd setup for that in asterisk).  At home I have a cordless
phone with 2 line capability - I currently have 2 spa3102's in place to
handle the 2 lines ( I am in the process of buying tdm410 to handle to
handle this and the backup pstn line).

I also have 2 laptops setup with soft sip phones.

What I would like to see happen is when an inbound call comes, I would
like to ring 1 line on the cordless phones - because it sounds really
weird when both the lines ring at the same time. and I would like to see
both the laptops ring if they are connected.

this is what I am looking at using

exten = s,1,Dial(SIP/SPA3102bSIP/laptopSIP/tlaptop,20,j)
exten = s,n,VoiceMail(v...@spa3102,u)
exten = s,n,Hangup
exten = s,102,Dial(SIP/SPA3102aSIP/laptopSIP/tlaptop,20,j)
exten = s,n,VoiceMail(v...@spa3102,u)
exten = s,n,Hangup
exten = s,203,VoiceMail(v...@spa3102,b)


SPA3102b is line 2, SPA3102b is line 1 on the cordless and laptop 
tlaptop are the laptop SIP definitions.

one problem that happens is that when somebody is making a call on line2
(SPA3102b) outbound, asterisk will still send an inbound call to the
SPA3102b because of call waiting.  Is there some way of avoiding this -
seems silly to me 


Is this the way to do ?

or is there some way to create a gobalvar which is a dynamic dial string,
but I can't figure out how to modify a gobalvar on registration ?

Thanks

Alex



___
-- 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] PHP/AGI/SetVar Issue

2009-06-05 Thread Peder
I've tried all of that and it still doesn't work right.  I'm sure it's
something dumb, but I just can't figure it out.  I've even made it simpler:

echo 'SET VARIABLE ISLOCALCONTEXT CONTEXT3\n';
echo 'SET VARIABLE ISLOCALDID \n';

and this produces the following:

-- Executing NoOp(SIP/-081cf2d8, CONTEXT3nSET) in new stack
-- Executing NoOp(SIP/-081cf2d8, ) in new stack

FYI, I am reading the environment variables when the program starts, I just
didn't include that chunk of code as I didn't think it was relevant.  I am
not however reading response codes from *, as I don't really care what they
are.  If I HAVE to read them, then I will, but I am not right now.  


-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Philipp
Kempgen
Sent: Friday, June 05, 2009 7:15 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] PHP/AGI/SetVar Issue

Steve Edwards schrieb:
 On Thu, 4 Jun 2009, Peder wrote:
 
 Is there a limitation to the number of variables you can set from a PHP 
 agi script?
 
 Not that I've found yet :)
 
 One of my AGIs sets almost 600 channel variables.

Wow that's a lot. Why would you do that?

 echo ' EXEC SetVar ISLOCALCONTEXT='.$row['context'].'';
 echo ' EXEC SetVar ISLOCALDID='.$row['did'].'';
 
 You are violating the AGI protocol. First, you have to read the AGI 
 environment. Then, for every request, you must read the response.

I don't think that it really matters. At least in PHP I haven't
seen any problems even if you don't read anything (provided you
don't care about the AGI environment and responses).
Maybe PHP slurps the input into a buffer which will be garbage
collected if you don't use it.


Philipp Kempgen
-- 
AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
Videos of the AMOOCON VoIP conference 2009 -  http://www.amoocon.de
-- 

___
-- 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] PHP/AGI/SetVar Issue

2009-06-05 Thread Peder
Of course I just figured it out.  If I send a print with \n, it works now.
Not really sure why though:

echo 'SET VARIABLE ISLOCALCONTEXT CONTEXT3';
print \n;
echo 'SET VARIABLE ISLOCALDID ';
print \n;

-- Executing NoOp(SIP/-081777c0, CONTEXT3) in new stack
-- Executing NoOp(SIP/-081777c0, ) in new stack

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Philipp
Kempgen
Sent: Friday, June 05, 2009 6:51 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] PHP/AGI/SetVar Issue

Peder schrieb:

 Here is the part from the agi that sets the variables:
 
 echo ' EXEC SetVar ISLOCALCONTEXT='.$row['context'].'';
 echo ' EXEC SetVar ISLOCALDID='.$row['did'].'';
 
 If I run it is as, ISLOCALCONTEXT gets set, but not ISLOCALDID:
 
  -- Executing NoOp(SIP/-081d2c38, CONTEXT2) in new stack
  -- Executing NoOp(SIP/-081d2c38, ) in new stack
 
 If I flip their order in the agi, then ISLOCALDID gets set, but not
 ISLOCALCONTEXT:
 
  -- Executing NoOp(SIP/-081d8d78, ) in new stack
  -- Executing NoOp(SIP/-081d8d78, ) in new stack
 
 Any idea what I am missing?  Only the first exec setvar gets run and the
 other one appears to just be ignored.  I just want to be able to set 2-3
 variables and then return to the dialplan.  Please note that I do not want
 to use phpagi so don't tell me to use that, I want to figure out why it
 doesn't work this way.

Send a newline (\n) after each command.
Remove the blank ( ) before the commands.
And maybe use SET VARIABLE instead of EXEC SetVar.


Philipp Kempgen
-- 
AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
Videos of the AMOOCON VoIP conference 2009 -  http://www.amoocon.de
-- 

___
-- 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] PHP/AGI/SetVar Issue

2009-06-05 Thread Jeff LaCoursiere


On Fri, 5 Jun 2009, Peder wrote:

 I've tried all of that and it still doesn't work right.  I'm sure it's
 something dumb, but I just can't figure it out.  I've even made it simpler:

 echo 'SET VARIABLE ISLOCALCONTEXT CONTEXT3\n';
 echo 'SET VARIABLE ISLOCALDID \n';

 and this produces the following:

-- Executing NoOp(SIP/-081cf2d8, CONTEXT3nSET) in new stack
-- Executing NoOp(SIP/-081cf2d8, ) in new stack

 FYI, I am reading the environment variables when the program starts, I just
 didn't include that chunk of code as I didn't think it was relevant.  I am
 not however reading response codes from *, as I don't really care what they
 are.  If I HAVE to read them, then I will, but I am not right now.

You have to read them.  Throw the data away afterwards, but that is what 
is blocking the send of the next command.  This is why you are being 
advised to use a library.

j



 -Original Message-
 From: asterisk-users-boun...@lists.digium.com
 [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Philipp
 Kempgen
 Sent: Friday, June 05, 2009 7:15 AM
 To: Asterisk Users Mailing List - Non-Commercial Discussion
 Subject: Re: [asterisk-users] PHP/AGI/SetVar Issue

 Steve Edwards schrieb:
 On Thu, 4 Jun 2009, Peder wrote:

 Is there a limitation to the number of variables you can set from a PHP
 agi script?

 Not that I've found yet :)

 One of my AGIs sets almost 600 channel variables.

 Wow that's a lot. Why would you do that?

 echo ' EXEC SetVar ISLOCALCONTEXT='.$row['context'].'';
 echo ' EXEC SetVar ISLOCALDID='.$row['did'].'';

 You are violating the AGI protocol. First, you have to read the AGI
 environment. Then, for every request, you must read the response.

 I don't think that it really matters. At least in PHP I haven't
 seen any problems even if you don't read anything (provided you
 don't care about the AGI environment and responses).
 Maybe PHP slurps the input into a buffer which will be garbage
 collected if you don't use it.


Philipp Kempgen
 -- 
 AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
 Gesch?ftsf?hrer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
 Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
 Videos of the AMOOCON VoIP conference 2009 -  http://www.amoocon.de
 -- 

 ___
 -- 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


___
-- 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] PHP/AGI/SetVar Issue

2009-06-05 Thread Danny Nicholas
The \n tells * that end-of-line has been reached.  The documentation I read
suggests \r\n, but that is perhaps redundant.

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Peder
Sent: Friday, June 05, 2009 11:15 AM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: Re: [asterisk-users] PHP/AGI/SetVar Issue

Of course I just figured it out.  If I send a print with \n, it works now.
Not really sure why though:

echo 'SET VARIABLE ISLOCALCONTEXT CONTEXT3';
print \n;
echo 'SET VARIABLE ISLOCALDID ';
print \n;

-- Executing NoOp(SIP/-081777c0, CONTEXT3) in new stack
-- Executing NoOp(SIP/-081777c0, ) in new stack

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Philipp
Kempgen
Sent: Friday, June 05, 2009 6:51 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] PHP/AGI/SetVar Issue

Peder schrieb:

 Here is the part from the agi that sets the variables:
 
 echo ' EXEC SetVar ISLOCALCONTEXT='.$row['context'].'';
 echo ' EXEC SetVar ISLOCALDID='.$row['did'].'';
 
 If I run it is as, ISLOCALCONTEXT gets set, but not ISLOCALDID:
 
  -- Executing NoOp(SIP/-081d2c38, CONTEXT2) in new stack
  -- Executing NoOp(SIP/-081d2c38, ) in new stack
 
 If I flip their order in the agi, then ISLOCALDID gets set, but not
 ISLOCALCONTEXT:
 
  -- Executing NoOp(SIP/-081d8d78, ) in new stack
  -- Executing NoOp(SIP/-081d8d78, ) in new stack
 
 Any idea what I am missing?  Only the first exec setvar gets run and the
 other one appears to just be ignored.  I just want to be able to set 2-3
 variables and then return to the dialplan.  Please note that I do not want
 to use phpagi so don't tell me to use that, I want to figure out why it
 doesn't work this way.

Send a newline (\n) after each command.
Remove the blank ( ) before the commands.
And maybe use SET VARIABLE instead of EXEC SetVar.


Philipp Kempgen
-- 
AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
Videos of the AMOOCON VoIP conference 2009 -  http://www.amoocon.de
-- 

___
-- 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


___
-- 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] PHP/AGI/SetVar Issue

2009-06-05 Thread Peder
I found that in php, it has to be in s, not ''s.  \n works but '\n' does
not.

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Danny Nicholas
Sent: Friday, June 05, 2009 11:20 AM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: Re: [asterisk-users] PHP/AGI/SetVar Issue

The \n tells * that end-of-line has been reached.  The documentation I read
suggests \r\n, but that is perhaps redundant.

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Peder
Sent: Friday, June 05, 2009 11:15 AM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: Re: [asterisk-users] PHP/AGI/SetVar Issue

Of course I just figured it out.  If I send a print with \n, it works now.
Not really sure why though:

echo 'SET VARIABLE ISLOCALCONTEXT CONTEXT3';
print \n;
echo 'SET VARIABLE ISLOCALDID ';
print \n;

-- Executing NoOp(SIP/-081777c0, CONTEXT3) in new stack
-- Executing NoOp(SIP/-081777c0, ) in new stack

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Philipp
Kempgen
Sent: Friday, June 05, 2009 6:51 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] PHP/AGI/SetVar Issue

Peder schrieb:

 Here is the part from the agi that sets the variables:
 
 echo ' EXEC SetVar ISLOCALCONTEXT='.$row['context'].'';
 echo ' EXEC SetVar ISLOCALDID='.$row['did'].'';
 
 If I run it is as, ISLOCALCONTEXT gets set, but not ISLOCALDID:
 
  -- Executing NoOp(SIP/-081d2c38, CONTEXT2) in new stack
  -- Executing NoOp(SIP/-081d2c38, ) in new stack
 
 If I flip their order in the agi, then ISLOCALDID gets set, but not
 ISLOCALCONTEXT:
 
  -- Executing NoOp(SIP/-081d8d78, ) in new stack
  -- Executing NoOp(SIP/-081d8d78, ) in new stack
 
 Any idea what I am missing?  Only the first exec setvar gets run and the
 other one appears to just be ignored.  I just want to be able to set 2-3
 variables and then return to the dialplan.  Please note that I do not want
 to use phpagi so don't tell me to use that, I want to figure out why it
 doesn't work this way.

Send a newline (\n) after each command.
Remove the blank ( ) before the commands.
And maybe use SET VARIABLE instead of EXEC SetVar.


Philipp Kempgen
-- 
AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
Videos of the AMOOCON VoIP conference 2009 -  http://www.amoocon.de
-- 

___
-- 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


___
-- 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] PHP/AGI/SetVar Issue

2009-06-05 Thread Philipp Kempgen
Peder schrieb:
 Of course I just figured it out.  If I send a print with \n, it works now.
 Not really sure why though:

Because a newline is required. :-)
http://svn.digium.com/svn/asterisk/branches/1.4/agi/agi-test.agi

 
 echo 'SET VARIABLE ISLOCALCONTEXT CONTEXT3';
 print \n;
 echo 'SET VARIABLE ISLOCALDID ';
 print \n;
 
 -- Executing NoOp(SIP/-081777c0, CONTEXT3) in new stack
 -- Executing NoOp(SIP/-081777c0, ) in new stack
 
 -Original Message-
 From: asterisk-users-boun...@lists.digium.com
 [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Philipp
 Kempgen
 Sent: Friday, June 05, 2009 6:51 AM
 To: Asterisk Users Mailing List - Non-Commercial Discussion
 Subject: Re: [asterisk-users] PHP/AGI/SetVar Issue
 
 Peder schrieb:
 
 Here is the part from the agi that sets the variables:
 
 echo ' EXEC SetVar ISLOCALCONTEXT='.$row['context'].'';
 echo ' EXEC SetVar ISLOCALDID='.$row['did'].'';
 
 If I run it is as, ISLOCALCONTEXT gets set, but not ISLOCALDID:
 
  -- Executing NoOp(SIP/-081d2c38, CONTEXT2) in new stack
  -- Executing NoOp(SIP/-081d2c38, ) in new stack
 
 If I flip their order in the agi, then ISLOCALDID gets set, but not
 ISLOCALCONTEXT:
 
  -- Executing NoOp(SIP/-081d8d78, ) in new stack
  -- Executing NoOp(SIP/-081d8d78, ) in new stack
 
 Any idea what I am missing?  Only the first exec setvar gets run and the
 other one appears to just be ignored.  I just want to be able to set 2-3
 variables and then return to the dialplan.  Please note that I do not want
 to use phpagi so don't tell me to use that, I want to figure out why it
 doesn't work this way.
 
 Send a newline (\n) after each command.
 Remove the blank ( ) before the commands.
 And maybe use SET VARIABLE instead of EXEC SetVar.


Philipp Kempgen
-- 
AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
Videos of the AMOOCON VoIP conference 2009 -  http://www.amoocon.de
-- 

___
-- 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] PHP/AGI/SetVar Issue

2009-06-05 Thread Philipp Kempgen
Peder schrieb:
 I've tried all of that and it still doesn't work right.  I'm sure it's
 something dumb, but I just can't figure it out.  I've even made it simpler:
 
 echo 'SET VARIABLE ISLOCALCONTEXT CONTEXT3\n';
 echo 'SET VARIABLE ISLOCALDID \n';
 
 and this produces the following:
 
 -- Executing NoOp(SIP/-081cf2d8, CONTEXT3nSET) in new stack
 -- Executing NoOp(SIP/-081cf2d8, ) in new stack

PHP evaluates escape sequences (like \n) in string literals in
double  quotes but not in single '' quotes.

Any of the alternatives in following should work:

echo SET VARIABLE ISLOCALCONTEXT CONTEXT3\n;
echo SET VARIABLE ISLOCALDID \n;

or

echo 'SET VARIABLE ISLOCALCONTEXT CONTEXT3',\n;
echo 'SET VARIABLE ISLOCALDID ',\n;

or

echo 'SET VARIABLE ISLOCALCONTEXT CONTEXT3';
echo \n;
echo 'SET VARIABLE ISLOCALDID ';
echo \n;


Philipp Kempgen
-- 
AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
Videos of the AMOOCON VoIP conference 2009 -  http://www.amoocon.de
-- 

___
-- 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] PHP/AGI/SetVar Issue

2009-06-05 Thread Steve Edwards
On Fri, 5 Jun 2009, Philipp Kempgen wrote:

 Steve Edwards schrieb:

 One of my AGIs sets almost 600 channel variables.

 Wow that's a lot. Why would you do that?

Why? That's always a tough question :)

It's a survey system. Ask a question, record (voice or DTMF) a response, 
maybe branch based on a single DTMF.

All the steps are stored in the database.

When a call comes in, an AGI looks up the steps for the DNIS and loads all 
the variables of the form:

STEP-01-DATA -- name of variable, branch targets, etc
STEP-01-MAX-LENGTH
STEP-01-MIN-LENGTH
STEP-01-PROMPT -- path to a wav file
STEP-01-TYPE -- types are BRANCH, DTMF, END, PROMPT, VOICE, etc.
.
.
.
STEP-xx-DATA
STEP-xx-PROMPT
STEP-xx-MAX-LENGTH
STEP-xx-MIN-LENGTH
STEP-xx-TYPE

(There's actually 8 variables per step. One customer has 75 steps. Thus, 
600 channel variables.)

Each type is handled by a separate AGI.

The dialplan (in AEL) just loops through the indexes. A switch statement 
determines which AGI is invoked. A branch just changes the index. I never 
touch the database again until call completion.

All the control logic is in the database.

If a customer wants to add or delete a step, it's just a simple update to 
the database. If a customer wants to add a new type (SSN?), it's just a 
new AGI.

It seems to be very flexible, easy to maintain and extend -- so far :)

The system was just put into production on Monday.

If I can talk the client into it, I want to add a LABEL type so I can 
branch to a label instead of a step number -- shades of BASIC :)

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] PHP/AGI/SetVar Issue

2009-06-05 Thread Philipp Kempgen
Steve Edwards schrieb:
 On Fri, 5 Jun 2009, Philipp Kempgen wrote:
 Steve Edwards schrieb:

 One of my AGIs sets almost 600 channel variables.

 Wow that's a lot. Why would you do that?
 
 Why? That's always a tough question :)
 
 It's a survey system. Ask a question, record (voice or DTMF) a response, 
 maybe branch based on a single DTMF.
 
 All the steps are stored in the database.
 
 When a call comes in, an AGI looks up the steps for the DNIS and loads all 
 the variables of the form:
 
   STEP-01-DATA -- name of variable, branch targets, etc
   STEP-01-TYPE -- types are BRANCH, DTMF, END, PROMPT, VOICE, etc.
   .
   STEP-xx-DATA
   STEP-xx-TYPE
 
 (There's actually 8 variables per step. One customer has 75 steps. Thus, 
 600 channel variables.)

 The dialplan (in AEL) just loops through the indexes. A switch statement 
 determines which AGI is invoked. A branch just changes the index. I never 
 touch the database again until call completion.

That's an interesting idea!
Thanks for the explanation.


Philipp Kempgen
-- 
AMOOMA GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
Asterisk: http://the-asterisk-book.com - http://das-asterisk-buch.de
Videos of the AMOOCON VoIP conference 2009 -  http://www.amoocon.de
-- 

___
-- 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] PHP/AGI/SetVar Issue

2009-06-05 Thread Steve Edwards
On Fri, 5 Jun 2009, Peder wrote:

 Of course I just figured it out.  If I send a print with \n, it works 
 now. Not really sure why though:

Because you are communicating with another process (Asterisk) over a pair 
of pipes. One you write to, one you read from.

If you don't terminate your request, how will Asterisk know where the 
end is?

 echo 'SET VARIABLE ISLOCALCONTEXT CONTEXT3';
 print \n;
 echo 'SET VARIABLE ISLOCALDID ';
 print \n;

This is still wrong.

If you violate the protocol (not reading the AGI environment, not flushing 
stdout if your language does not do it automagically for you, not reading 
the response to each request, printing ANYTHING to stdout), your AGI will 
not work correctly.

If it does work correctly now, it will not at some time in the future.

The following C snippet (not using a library for illustration only):

 printf(STREAM FILE \hit\ \\\n);
 fflush(stdout);

 printf(STREAM FILE \hit\ \\\n);
 fflush(stdout);

 printf(STREAM FILE \hit\ \\\n);
 fflush(stdout);

 printf(STREAM FILE \hit\ \\\n);
 fflush(stdout);

 printf(STREAM FILE \hit\ \\\n);
 fflush(stdout);

does not work at all.

If I slow C down like this:

 printf(STREAM FILE \hit\ \\\n);
 fflush(stdout);
 for (a = 0; a  3000; ++a) for (b = 0; b  3000; ++b) c = a * b;

 printf(STREAM FILE \hit\ \\\n);
 fflush(stdout);
 for (a = 0; a  3000; ++a) for (b = 0; b  3000; ++b) c = a * b;

 printf(STREAM FILE \hit\ \\\n);
 fflush(stdout);
 for (a = 0; a  3000; ++a) for (b = 0; b  3000; ++b) c = a * b;

 printf(STREAM FILE \hit\ \\\n);
 fflush(stdout);
 for (a = 0; a  3000; ++a) for (b = 0; b  3000; ++b) c = a * b;

 printf(STREAM FILE \hit\ \\\n);
 fflush(stdout);
 for (a = 0; a  3000; ++a) for (b = 0; b  3000; ++b) c = a * b;

it works on my very slow 500MHz AMD Geode test system. Unfortunately, it 
completely fails on my somewhat faster 2.3GHz AMD Phenom 8650 Triple-Core 
Processor.

If I follow the protocol:

 printf(STREAM FILE \hit\ \\\n);
 fflush(stdout);
 fgets(response, sizeof(response), stdin);

 printf(STREAM FILE \hit\ \\\n);
 fflush(stdout);
 fgets(response, sizeof(response), stdin);

 printf(STREAM FILE \hit\ \\\n);
 fflush(stdout);
 fgets(response, sizeof(response), stdin);

 printf(STREAM FILE \hit\ \\\n);
 fflush(stdout);
 fgets(response, sizeof(response), stdin);

 printf(STREAM FILE \hit\ \\\n);
 fflush(stdout);
 fgets(response, sizeof(response), stdin);

it works everywhere, every time.

As I and others have suggested, stand on the shoulders of others -- please 
use an established library. You will save time and hair. And your code 
will be easier to write and maintain:

agi_stream_file(hit, );
agi_stream_file(hit, );
agi_stream_file(hit, );
agi_stream_file(hit, );
agi_stream_file(hit, );

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] How run AsyncAGI commands in background

2009-06-05 Thread Jose Arias
I'm sorry,
in my last email, where I said redial, I mean redirect.
Thanks
Jose
2009/6/5 Jose Arias cyr2...@gmail.com

 Hi all,
 I have an external application commanding asterisk by AMI and AsyncAGI. I
 also have a dialplan like this:

 ; AsyncAGI extensions
 exten = _8.,1,Noop(entering in AGI loop at 8 ${EXTEN});
 exten = _8.,n,AGI(agi:async);
 exten = _8.,n,Hangup();

 ; Meetme extensions
 exten = _1.,1,Noop(Conference ${EXTEN} ${CONTEXT});
 exten = _1.,n,Set(MEETME_RECORDINGFILE=${EXTEN:}-${UNIQUEID:})
 exten = _1.,n,MixMonitor(${MEETME_RECORDINGFILE}.wav)
 exten = _1.,n,Meetme(${EXTEN},qdx);
 exten = _1.,n,Hangup();

 It works fine:

 Incoming channels are sent to meetme by an external application, which
 receives events by AMI and decides what meetme to use, making a redirect
 action to it by AMI. Every channel falling in a meetme (dynamically
 created) is recorded by the MixMonitor application.

 But there's a little problem:

 I don't need to record all calls but only those ones are switable of be
 recorded (by some kind of external rules). As it's a waste of cpu and space
 to record everything and then to discard almost all of them but some few
 ones, I tought to use AsyncAGI to recording only some calls by sending an
 AsyncAGI EXE MixMonitor command instead of the dial plan approach.

 To do that, the external application, instead of making the redial to
 meetme, it must make the redial to an AsyncAGI extension, then it must make
 the AGI EXE MixMonitor action, and finally it must make the original
 redirect to meetme.

 But it doesn't work :-(

 When the application reachs the third step (redial to meetme while the
 channel is still into the AGI loop, after having sent it the AGI EXE
 MixMonitor action) the MixMonitor AGI action is stopped automatically and
 the recording ends.

 Therefore, does anyone know how to manage that an AsyncAGI action to remain
 running in background even if the channel is redirected out of AGI?

 Thanks in advanced
 Jose


___
-- 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] How run AsyncAGI commands in background

2009-06-05 Thread Jose Arias
Hi all,
I have an external application commanding asterisk by AMI and AsyncAGI. I
also have a dialplan like this:

; AsyncAGI extensions
exten = _8.,1,Noop(entering in AGI loop at 8 ${EXTEN});
exten = _8.,n,AGI(agi:async);
exten = _8.,n,Hangup();

; Meetme extensions
exten = _1.,1,Noop(Conference ${EXTEN} ${CONTEXT});
exten = _1.,n,Set(MEETME_RECORDINGFILE=${EXTEN:}-${UNIQUEID:})
exten = _1.,n,MixMonitor(${MEETME_RECORDINGFILE}.wav)
exten = _1.,n,Meetme(${EXTEN},qdx);
exten = _1.,n,Hangup();

It works fine:

Incoming channels are sent to meetme by an external application, which
receives events by AMI and decides what meetme to use, making a redirect
action to it by AMI. Every channel falling in a meetme (dynamically
created) is recorded by the MixMonitor application.

But there's a little problem:

I don't need to record all calls but only those ones are switable of be
recorded (by some kind of external rules). As it's a waste of cpu and space
to record everything and then to discard almost all of them but some few
ones, I tought to use AsyncAGI to recording only some calls by sending an
AsyncAGI EXE MixMonitor command instead of the dial plan approach.

To do that, the external application, instead of making the redial to
meetme, it must make the redial to an AsyncAGI extension, then it must make
the AGI EXE MixMonitor action, and finally it must make the original
redirect to meetme.

But it doesn't work :-(

When the application reachs the third step (redial to meetme while the
channel is still into the AGI loop, after having sent it the AGI EXE
MixMonitor action) the MixMonitor AGI action is stopped automatically and
the recording ends.

Therefore, does anyone know how to manage that an AsyncAGI action to remain
running in background even if the channel is redirected out of AGI?

Thanks in advanced
Jose
___
-- 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] PHP/AGI/SetVar Issue

2009-06-05 Thread David Backeberg
On Fri, Jun 5, 2009 at 3:13 PM, Steve Edwards asterisk@sedwards.com wrote:
 All the steps are stored in the database.

 When a call comes in, an AGI looks up the steps for the DNIS and loads all
 the variables of the form:

        STEP-01-DATA -- name of variable, branch targets, etc
        STEP-01-MAX-LENGTH
        STEP-01-MIN-LENGTH
        STEP-01-PROMPT -- path to a wav file
        STEP-01-TYPE -- types are BRANCH, DTMF, END, PROMPT, VOICE, etc.
                .
                .
                .
        STEP-xx-DATA
        STEP-xx-PROMPT
        STEP-xx-MAX-LENGTH
        STEP-xx-MIN-LENGTH
        STEP-xx-TYPE

 (There's actually 8 variables per step. One customer has 75 steps. Thus,
 600 channel variables.)

 Each type is handled by a separate AGI.

Very clever and flexible. Thanks for sharing that.

___
-- 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] Asterisk 1.2.33, Asterisk 1.4.25.1, Asterisk 1.6.0.10, and Asterisk 1.6.1.1 Now Available

2009-06-05 Thread Asterisk Development Team
The Asterisk Development Team has released Asterisk versions 1.2.33, 1.4.25.1,
1.6.0.10, and 1.6.1.1. The released versions are available at
http://downloads.asterisk.org/pub/telephony/asterisk/

This release fixes a REGAUTH loop related to security issue AST-2009-001.
Asterisk release 1.2.33 also addresses a small compile time error in chan_spy.

For more information about the security issue, please see:

http://downloads.asterisk.org/pub/security/AST-2009-001.html

For a summary of the changes in this release, please see the release summary:

http://svn.asterisk.org/svn/asterisk/tags/1.2.33/asterisk-1.2.33-summary.txt
http://svn.asterisk.org/svn/asterisk/tags/1.4.25.1/asterisk-1.4.25.1-summary.txt
http://svn.asterisk.org/svn/asterisk/tags/1.6.0.10/asterisk-1.6.0.10-summary.txt
http://svn.asterisk.org/svn/asterisk/tags/1.6.1.1/asterisk-1.6.1.1-summary.txt

For a full list of changes in this release, please see the ChangeLog:

http://svn.asterisk.org/svn/asterisk/tags/1.2.33/ChangeLog
http://svn.asterisk.org/svn/asterisk/tags/1.4.25.1/ChangeLog
http://svn.asterisk.org/svn/asterisk/tags/1.6.0.10/ChangeLog
http://svn.asterisk.org/svn/asterisk/tags/1.6.1.1/ChangeLog

Thank you for your continued support of Asterisk!

___
-- 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] broken pipe in perl agi

2009-06-05 Thread Steve Edwards
On Fri, 5 Jun 2009, Danny Nicholas wrote:

 You're on the right track, Steve but that didn't do it either.  Here is 
 the Perl snippet:

 use strict;
 use warnings;
 my $towatch = $ARGV[0];
 my $a=0;
 my $retval=undef;
 # show hints will get hint information from the dialplan
 while ($a1) {
   my $cmda = '/usr/sbin/asterisk -rx core show hints|';
     Get Trunk Information 
   my %lines;
   my $lineseq=0;
   $SIG{'PIPE'} = 'IGNORE';
   open (my $trunk_info,$cmda) or print STDOUT Broken pipe\n;
   if ($trunk_info) {
  while ($trunk_info) {
 if ($_ =~ /internal/) {
if ($_ =~ /$towatch/) {
   $lines{$lineseq} = $_;
   $lineseq++;
   }
}
 }
  close $trunk_info;
  }
   sleep 2;

   for (my $i=0;$i=$lineseq;$i++) {
  if ($lines{$i}) {
 my $c = unpack(x74 a16, $lines{$i});
 $c =~ s/\s//gx;
 $retval=1;
 print STDOUT SET VARIABLE LINESTAT \$c\ \r\n;
 STDIN;
 }
  }
   $a++;
   }
 # if /var/run/asterisk.ctl is not mod 777, no result so we return a dummy
 Idle
 if (! $retval) {
   my $c = Idle;
   print STDOUT SET VARIABLE LINESTAT \$c\ \r\n;
   STDIN;
   }
 exit;

 If there is an active call on the extension, it works.  If not, the 
 broken pipe message is returned.

I'm still thinking its a protocol issue.

I couldn't replicate the error on my 1.2 box. I don't use hints, so I read 
hint data from a file.

I noticed:

0) You don't use an AGI library

1) You don't turn off I/O buffering

2) You aren't reading the AGI environment

3) You have a sleep in between your 2 loops

4) You have a while loop on $a I don't think is needed

5) You could read Asterisk's output from show hints and process it in a 
single loop

6) \r is not needed

7) A space before the request terminator is not needed

I'm not much of a Perl weenie, but I made some changes you're welcome to 
use or discard :)

#!/usr/bin/perl

use strict;
use warnings;

# define variables
# show hints will get hint information from the dialplan
 my $cmda = '/usr/sbin/asterisk -rx show hints|';
# read hint data from a file for testing
#   my $cmda = 'cat /home/sedwards/hints|';
 my $towatch = $ARGV[0];

# turn off I/O buffering
 $| = 1;

# read the AGI environment
 while   (STDIN)
 {
 chomp($_);
 last if 0 == length($_);
 }

# assume idle
 print STDOUT SET VARIABLE LINESTAT \Idle\\n;
 STDIN;

# get trunk information
 $SIG{'PIPE'} = 'IGNORE';
 open (my $trunk_info, $cmda) or exit;
 while   ($trunk_info)
 {
 if  (($_ =~ /internal/)
($_ =~ /$towatch/))
 {
 my $c = unpack(x74 a16, $_);
 $c =~ s/\s//gx;
 print STDOUT SET VARIABLE LINESTAT \$c\\n;
 STDIN;
 }
 }
 close $trunk_info;

# (end of hintcheck.agi)

OT, but I think I'm liking AMI more than rx in the new code I'm writing.

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] How run AsyncAGI commands in background

2009-06-05 Thread Moises Silva
On Fri, Jun 5, 2009 at 4:32 PM, Jose Ariascyr2...@gmail.com wrote:
 I'm sorry,
 in my last email, where I said redial, I mean redirect.
 Thanks
 Jose
 2009/6/5 Jose Arias cyr2...@gmail.com

 Hi all,
 I have an external application commanding asterisk by AMI and AsyncAGI. I
 also have a dialplan like this:
 ; AsyncAGI extensions
 exten = _8.,1,Noop(entering in AGI loop at 8 ${EXTEN});
 exten = _8.,n,AGI(agi:async);
 exten = _8.,n,Hangup();

 ; Meetme extensions
 exten = _1.,1,Noop(Conference ${EXTEN} ${CONTEXT});
 exten = _1.,n,Set(MEETME_RECORDINGFILE=${EXTEN:}-${UNIQUEID:})
 exten = _1.,n,MixMonitor(${MEETME_RECORDINGFILE}.wav)
 exten = _1.,n,Meetme(${EXTEN},qdx);
 exten = _1.,n,Hangup();

 It works fine:

 Incoming channels are sent to meetme by an external application, which
 receives events by AMI and decides what meetme to use, making a redirect
 action to it by AMI. Every channel falling in a meetme (dynamically
 created) is recorded by the MixMonitor application.

 But there's a little problem:

 I don't need to record all calls but only those ones are switable of be
 recorded (by some kind of external rules). As it's a waste of cpu and space
 to record everything and then to discard almost all of them but some few
 ones, I tought to use AsyncAGI to recording only some calls by sending an
 AsyncAGI EXE MixMonitor command instead of the dial plan approach.

 To do that, the external application, instead of making the redial to
 meetme, it must make the redial to an AsyncAGI extension, then it must make
 the AGI EXE MixMonitor action, and finally it must make the original
 redirect to meetme.

 But it doesn't work :-(

 When the application reachs the third step (redial to meetme while the
 channel is still into the AGI loop, after having sent it the AGI EXE
 MixMonitor action) the MixMonitor AGI action is stopped automatically and
 the recording ends.

 Therefore, does anyone know how to manage that an AsyncAGI action to
 remain running in background even if the channel is redirected out of AGI?

 Thanks in advanced
 Jose



version of Asterisk?

-- 
Moises Silva
Software Developer
Sangoma Technologies Inc. | 50 McIntosh Drive, Suite 120, Markham ON
L3R 9T3 Canada
t. 1 905 474 1990 x 128 | e. m...@sangoma.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