Skip Menu |

This queue is for tickets about the asterisk-perl CPAN distribution.

Report information
The Basics
Id: 88603
Status: new
Priority: 0/
Queue: asterisk-perl

People
Owner: Nobody in particular
Requestors: pause.perl.org_ [...] t_jeremykister.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.03
Fixed in: (no value)



Subject: GoSub feature
Asterisk::AGI does not appear to have implemented the GOSUB feature. As per ASTERISK-12114, $agi->exec(gosub) is not proper; we are to use a native $agi->gosub(..). The attached patch implements a local gosub() which seems to work with Asterisk 11.5, however, a console notice regarding "Abnormal AGI exit" is printed. Looking into that.
Subject: agi.pm.diff
--- AGI.pm.orig 2013-09-11 02:04:40.000000000 -0400 +++ AGI.pm 2013-09-11 02:42:51.000000000 -0400 @@ -568,6 +568,32 @@ return $result; } +=item $AGI->gosub($context,$extension,$priority,$arg); + +Executes AGI Command "GOSUB @args" + +Jump to a particular context, extension, and priority, saving the return address. + +Example: $AGI->gosub('extensions','s',1,'MyArgument'); + +Returns: 0, or -1 if the given context, extension, or priority is invalid. + +=cut + +sub gosub { + my ($self, $context, $extension, $priority, $arg) = @_; + + my $result = undef; + + if ($self->execute("GOSUB $context $extension $priority $arg")) { + my $tempresult = $self->_lastresponse(); + if ($tempresult =~ /\((.*)\)/) { + $result = $1; + } + } + return $result; +} + =item $AGI->hangup($channel) Executes AGI Command "HANGUP $channel"
Subject: GoSub feature WITH PATCH
Show quoted text
> Asterisk 11.5, however, a console notice regarding "Abnormal AGI exit" > is printed. Looking into that.
The notice on the console was just me neglecting to put a Return at the end of the context. mea culpa.
Subject: GoSub feature WITH PATCH
On Wed Sep 11 03:05:34 2013, JKISTER wrote: Show quoted text
> The attached patch implements a local gosub() which seems to work with > Asterisk 11.5,
Also note that I'm not positive about the return value being correct. I just copied it from get_variable.