Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] AGI: How to break out of AGI when stream_file escape_digits are detected in middle of long sequence of


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
lardconcepts at gmail.com
Guest





PostPosted: Mon Oct 10, 2016 4:48 pm    Post subject: [asterisk-users] AGI: How to break out of AGI when stream_fi Reply with quote

For reasons best known to myself, I call a python agi (PYST2 - love
it!) which streams a series of very short files in quick succession.

Like this:

escape_digits = str("0")
agi.stream_file(promptFile,escape_digits)

and this is what I see on the AGI debug:

<Local/s@root-00000061;2>AGI Tx >> 200 result=0 endpos=6784
<Local/s@root-00000061;2>AGI Rx << STREAM FILE
/home/DefaultPrompts/en_GB/female/wx/low "0" 0
-- <Local/s@root-00000061;2> Playing
'/home/DefaultPrompts/en_GB/female/wx/low.alaw' (escape_digits=0)
(sample_offset 0) (language 'en_GB')
<Local/s@root-00000061;2>AGI Tx >> 200 result=48 endpos=1440

The FIRST line is a file that finished normally, with result=0, the
LAST line is a file that was interrupted, and receives result=48 from
asterisk.

Yes, zero stops the file playing, but it just goes onto the next file.

So, how do I get that variable? It doesn't become available in python,
and trying to get it via either

agi.env[result']
agi.get_variable('result')

just makes python choke and the AGI quits. That would be fine if it
was a result of result being 48!

I feel like I'm going slightly bonkers here because it's something so
obvious, and yet I've googled so hard over this!

Thanks.

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

Join the Asterisk Community at the 13th AstriCon, September 27-29, 2016
http://www.asterisk.org/community/astricon-user-conference

New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services