[Home]

Summary:ASTERISK-15850: AGI->wait_for_digit or AGI->exec('Read' do not report digits back on an outgoing call
Reporter:Walter Klomp (xblurone)Labels:
Date Opened:2010-03-21 05:35:18Date Closed:2011-06-07 14:05:24
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_agi
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Hi,

I am using a callback conference solution which makes and outgoing call which points to a perl AGI script (which used to work some versions of asterisk ago). Now I am running the latest SVN (Asterisk SVN-branch-1.6.1-r253347) and neither Read nor wait_for_digit give any digits back on DAHDI channels, or SIP channels.

The same script has worked for a few years from version 1.4 onwards. I can't remember when it stopped working however (sorry).
Comments:By: Leif Madsen (lmadsen) 2010-03-23 09:22:57

Additional information is required here. You'll need to supply information such as debug level logging output from the console (or a log file), the AGI script, and other information required to reproduce this issue.

Also if you can provide the last version the script worked on, that would help narrow down the issue and would considerably speed up the process to move this issue forward.

By: Walter Klomp (xblurone) 2010-03-23 21:24:44

Sorry, I cannot tell you when it worked last, there have been many revisions and i have update many times to fix another issue (random call drops).

The part of the agi script that is relevant is here:
   $input="";
   $count=0;
  while ($input ne "1") {
     $AGI->exec("sendDTMF","$ext|250");
     $AGI->stream_file('to-place-outgoing-call','1') if $input ne "1";
     $AGI->exec("Read","myvar|press-1|1||1|10");
     $myvar = $AGI->get_variable(myvar);
     $input=$myvar if ($myvar);
     $AGI->verbose("received $input ... ",1);
     $count++;
     $AGI->hangup if $count > 5;
  }

By: Walter Klomp (xblurone) 2010-03-23 21:36:29

Here the debug output of a call where i pressed 1 multiple times during the call... nothing happened... Via Dahdi (SIP has the same effect).

[2010-03-24 10:33:03] VERBOSE[20947] res_agi.c: [2010-03-24 10:33:03]     -- Launched AGI Script /var/lib/asterisk/agi-bin/startwebconf.agi
[2010-03-24 10:33:03] DEBUG[20947] channel.c: Set channel SIP/202.42.66.28-00004e56 to write format slin
[2010-03-24 10:33:03] DEBUG[20947] channel.c: Set channel SIP/202.42.66.28-00004e56 to read format slin
[2010-03-24 10:33:03] DEBUG[20947] channel.c: Putting channel SIP/202.42.66.28-00004e56 in 64/64 formats
[2010-03-24 10:33:03] DEBUG[20947] channel.c: Released clone lock on 'Local/6562807512@aglow-fwd-b3ad;1<ZOMBIE>'
[2010-03-24 10:33:03] DEBUG[20947] channel.c: Done Masquerading SIP/202.42.66.28-00004e56 (6)
[2010-03-24 10:33:03] VERBOSE[20947] res_agi.c: [2010-03-24 10:33:03]  startwebconf.agi: Setting up conference 62807512, pin , 62807512
[2010-03-24 10:33:04] DEBUG[20947] rtp.c: Got RTCP report of 108 bytes
[2010-03-24 10:33:05] VERBOSE[20947] res_agi.c: [2010-03-24 10:33:05]     -- AGI Script Executing Application: (sendDTMF) Options: (1|250)
[2010-03-24 10:33:06] DEBUG[20947] channel.c: Set channel SIP/202.42.66.28-00004e56 to write format g729
[2010-03-24 10:33:06] VERBOSE[20947] res_agi.c: [2010-03-24 10:33:06]     -- Playing 'to-place-outgoing-call' (escape_digits=1) (sample_offset 0)
[2010-03-24 10:33:06] DEBUG[20947] rtp.c: Ooh, format changed from unknown to g729
[2010-03-24 10:33:06] DEBUG[20947] rtp.c: Created smoother: format: 256 ms: 20 len: 20
[2010-03-24 10:33:06] DEBUG[20947] channel.c: Scheduling timer at (50 requested / 50 actual) timer ticks per second
[2010-03-24 10:33:07] DEBUG[20947] rtp.c: Got RTCP report of 112 bytes
[2010-03-24 10:33:08] DEBUG[20947] channel.c: Scheduling timer at (0 requested / 0 actual) timer ticks per second
[2010-03-24 10:33:08] DEBUG[20947] channel.c: Scheduling timer at (0 requested / 0 actual) timer ticks per second
[2010-03-24 10:33:08] DEBUG[20947] channel.c: Scheduling timer at (0 requested / 0 actual) timer ticks per second
[2010-03-24 10:33:08] DEBUG[20947] channel.c: Set channel SIP/202.42.66.28-00004e56 to write format slin
[2010-03-24 10:33:08] VERBOSE[20947] res_agi.c: [2010-03-24 10:33:08]     -- AGI Script Executing Application: (Read) Options: (myvar|press-1|1||1|10)
[2010-03-24 10:33:08] VERBOSE[20947] app_read.c: [2010-03-24 10:33:08]     -- Accepting a maximum of 1 digits.
[2010-03-24 10:33:08] DEBUG[20947] channel.c: Set channel SIP/202.42.66.28-00004e56 to write format g729
[2010-03-24 10:33:08] DEBUG[20947] channel.c: Scheduling timer at (50 requested / 50 actual) timer ticks per second
[2010-03-24 10:33:08] VERBOSE[20947] file.c: [2010-03-24 10:33:08]     -- <SIP/202.42.66.28-00004e56> Playing 'press-1.g729' (language 'en')
[2010-03-24 10:33:09] DEBUG[20947] channel.c: Scheduling timer at (0 requested / 0 actual) timer ticks per second
[2010-03-24 10:33:09] DEBUG[20947] channel.c: Scheduling timer at (0 requested / 0 actual) timer ticks per second
[2010-03-24 10:33:09] DEBUG[20947] channel.c: Scheduling timer at (0 requested / 0 actual) timer ticks per second
[2010-03-24 10:33:09] DEBUG[20947] channel.c: Set channel SIP/202.42.66.28-00004e56 to write format slin
[2010-03-24 10:33:14] DEBUG[20947] rtp.c: Got RTCP report of 132 bytes
[2010-03-24 10:33:17] DEBUG[20947] rtp.c: Got RTCP report of 88 bytes
[2010-03-24 10:33:19] VERBOSE[20947] app_read.c: [2010-03-24 10:33:19]     -- User entered nothing.
[2010-03-24 10:33:19] VERBOSE[20947] res_agi.c: [2010-03-24 10:33:19]  startwebconf.agi: received  ...

By: Zstya (zsotya) 2010-04-21 07:52:11

Hello,

I have same problem.

From the agi:
$a = $AGI->wait_for_digit(5000);
$AGI->say_number($a);

Log from the CLI:
AGI Rx << WAIT FOR DIGIT 5000
AGI Tx >> 200 result=1
AGI Rx << SAY NUMBER 1 ""

But it doesn't stop for 5s and I did not pressed 1.
Asterisk version: Asterisk 1.4.21.2~dfsg-3+lenny1

Zsotya

By: Zstya (zsotya) 2010-04-21 08:19:00

xblurone:
I think I have find your problem.
Please check the info from here:
http://www.voip-info.org/wiki/view/Asterisk+cmd+Read

Important part:
Pipe characters ( | ) have been changed to commas in Asterisk 1.6.
In Asterisk 1.4, either pipes OR commas will work. Using commas will ease future upgrades.

I hope it is helped
Zsotya

By: Walter Klomp (xblurone) 2010-04-21 10:05:35

Hi zsotya, this does not apply to my problem... the wait_for_digit does not have any comma separated parameters, and yet, it is still not working.

nobody is actually looking at this and resolving it ?

I don't know enough about the code or have the tools to hack a fix myself, meanwhile I am losing my long-term customers because of they can't answer ivr's in AGI, and I can't roll back because it makes other things even worse...

By: Leif Madsen (lmadsen) 2010-04-21 13:19:04

xblurone: there are many issues in the issue tracker, and there is no guarantee to when issues can or will be resolved. If this is a pressing matter that needs to be resolved urgently there are several capable Asterisk developers able to move this to completion on the asterisk-biz mailing list.

By: Zstya (zsotya) 2010-04-21 14:58:27

xblurone: sorry you right it is other thing.
I did some test and here is a hack what is not nice but working:

#!/usr/bin/perl

use Asterisk::AGI;
my $agi = new Asterisk::AGI;


$agi->exec('Read', 'myvar||5||2|10');

$myvar = $agi->get_variable('myvar');
$myvar = $agi->get_variable('myvar');

if ($myvar) {
 $agi->exec('Swift', "\"This variable is set to $myvar\"");
   $agi->exec('SayDigits', $myvar);
   } else {
     print "This variable could not be retrieved or was empty. HERE IS".$agi->get_variable('myvar');
     $a=$agi->get_variable('myvar');
     print "THE A:".$a;
     }

The important part is, you must double the $myvar = $agi->get_variable('myvar');
Based on this example i hope you can do a workaround until the fix is coming, and keep your customers.

Zsotya

By: Walter Klomp (xblurone) 2010-04-21 20:51:18

Sorry, does not work, Read still does not stop when I enter a digit, and what is returned, is nothing...

By: Walter Klomp (xblurone) 2010-04-21 21:55:50

lmadsen, how would I do that? (sorry if this is a very stupid question). I was under the impression this is a bugtracker, and this clearly is a bug, and it is a pressing one I can't work around... How would asterisk-biz help me here?

If I regress to asterisk-biz, I am having more than one critical bug (mostly sip and stability related) to deal with.

To me this is still a major bug, and as you can see I am not alone in this.

If anybody can tell me their version 1.6.1 or 1.6.2 asterisk where this still works, I'd gladly try to reverse to that version and see if my other issues don't come back.

~ Please help ~

By: Paul Belanger (pabelanger) 2010-04-21 22:46:11

Patience young grasshopper.  Like Leif said, while this is a bug tracker a resource may not be available for some time.  I encourage you to browse the source code and find out why this is causing you a problem.

If this is a critical issue for you, may developers on #asterisk-biz would be willing to help, however there may be a cost associated.

By: Leif Madsen (lmadsen) 2010-04-22 09:22:42

As stated by pabelanger, the open source issues tracker has many issues currently open, and if your issue is as critical as you've stated, then you may need to utilize the asterisk-biz mailing list to hire a developer to resolve your issue quickly.

Otherwise, this issue will be worked on as time and resources permit.

By: Tilghman Lesher (tilghman) 2010-05-04 17:26:47

What's not clear from any of your debugging information is whether your channel is answered or not.  The only way that I'm able to reproduce this is by not answering the call prior to invoking WAIT FOR DIGIT.  However, DTMF requires that the call be answered first.

It may have changed recently that we're no longer automatically answering calls, but you should have been explicitly answering the call anyway.



By: Walter Klomp (xblurone) 2010-05-04 20:25:45

Hi, I have found something perculiar. If in the "call" file I set up the direct channel, i.e. Channel: SIP/xxxxx@yyyy or Channel: DAHDI/r1/xxxxxx  it works all fine.

If in the "call" file I use Local/xxxxxx@zzzz and then the asterisk dials from there either DAHDI or SIP, it does not work.

My script does a $AGI->Answer in any case, also, to be sure I moved the answer to the dialplan before the agi script was called.

Now my suspicion lies not in the AGI handling, but in the way asterisk handles Local calls. In the local call itself I do not answer of course, answer would be handled in whatever I call.

Of course, dialing the SIP or DAHDI directly solves the problem for now, but the reason I want to use Channel: Local/xxxxx is that I then also can include my local registered channels if they want to be included in the conference...

By: Tilghman Lesher (tilghman) 2010-05-05 13:37:21

xblurone:  please verify that you're running the latest 1.6.1 SVN (or the latest release), as this issue may have already been fixed.

By: Walter Klomp (xblurone) 2010-05-05 20:17:56

I switched to the latest release (as per last week), but it is confirmed having something to do with the Local channel which is called from the callback call file...

By: Leif Madsen (lmadsen) 2010-05-10 10:50:53

I'm not sure if this was asked or not (I couldn't find it anyways) but are you calling the Local channel with /n ?

e.g. Dial(Local/xxxxx@yyyyyy/n)

Perhaps the Local channel being optimized out is causing an issue?

By: Walter Klomp (xblurone) 2010-05-10 10:53:32

Nope, dialing it without the /n flag... It's called from the /var/spool/asterisk/outgoing/call file...

Should I put it there?

By: Leif Madsen (lmadsen) 2010-05-10 11:33:28

Yes, please try with /n

By: Tilghman Lesher (tilghman) 2010-05-18 13:36:27

xblurone:  does using the 'n' flag solve the issue for you?

By: Tilghman Lesher (tilghman) 2010-05-24 13:35:18

As we have no response, assuming the /n option fixed it.