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

2016-10-10 Thread Jonathan H
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:

AGI Tx >> 200 result=0 endpos=6784
AGI Rx << STREAM FILE
/home/DefaultPrompts/en_GB/female/wx/low "0" 0
--  Playing
'/home/DefaultPrompts/en_GB/female/wx/low.alaw' (escape_digits=0)
(sample_offset 0) (language 'en_GB')
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


Re: [asterisk-users] asterisk-users Digest, Vol 147, Issue 5

2016-10-10 Thread Victor Villarreal
Hi all ! Thanks for your feedback and sory for the delay. Respond:


> Date: Mon, 3 Oct 2016 21:05:55 -0300
> From: Marcelo Terres 
>
> I think that you need the dev files too. In Debian 8, the package is
> libmysqlclient-dev.
>
> But Debian 8 uses libmysqlclient-18. Where did you get the 20 ?
>
> Regards,
>
> Marcelo H. Terres 

Hi Marcelo,

My idea was to install a new PBX to one of my clients, but with the latest
mySQL version.

I follow these instructions: http://dev.mysql.com/downloads/repo/apt/

The libmysqlclient-dev package is installed, but from the mysql repo. It's
version 20.



@Tzafir, thanks for your reply. I respond you inline...

> Date: Wed, 5 Oct 2016 17:13:41 +0300
> From: Tzafrir Cohen 
>
> For the record, we ubild both asterisk 11 (last version: 11.21.2) and 13
> (13.11.2) for Debian Stable using the distro-provided MySQL packages.

Ok, I take note of this. My idea is install Asterisk-11 from source instead
of use a "distribution package".
It's not the first time I compile Asterisk (in fact I work with Asterisk
from v1.4 in production
on many mission critical projects with greats results). But this time I
decided to use the latest mysql version
and face a problem that exceed my knowledge scope :-(

> Is Are there any mysql-related module loaded?
>
> Start with e.g.
>
>  ldd /usr/lib/asterisk/module/cdr_mysql.so

No, there is no mysql-related module compiled or loaded. Only ODBC:

sistemas@nodo1:~$ ls -lh /usr/lib64/asterisk/modules/ | grep mysql

sistemas@nodo1:~$ ls -lh /usr/lib64/asterisk/modules/ | grep odbc
-rwxr-xr-x 1 root root 331K oct  3 17:36 cdr_adaptive_odbc.so
-rwxr-xr-x 1 root root 265K oct  3 17:36 cdr_odbc.so
-rwxr-xr-x 1 root root 339K oct  3 17:36 cel_odbc.so
-rwxr-xr-x 1 root root 382K oct  3 17:36 func_odbc.so
-rwxr-xr-x 1 root root 325K oct  3 17:36 res_config_odbc.so
-rwxr-xr-x 1 root root 350K oct  3 17:36 res_odbc.so

It's like the compile script don't found my v20 libmysqlclient package
installed.
What is the routine responsible for this job?

Asterisk here in this server, was compiled with a libmysqlclient v18, but I
unistalled this package now
because Asterisk-11 compiled with v18 and connected to a v5.7 mySQL
instance, return an Asterisk crash on libmysqlclient.so module.

If it's don't possible to compile Asterisk-11 against libmysqlclient-20, I
will have to downgrade my mySQL-5.7 instance back to 5.5 Debian version :(

Any idea?

Thanks in advance and best regards.

-- 
GnuPG Key ID: 0x39BCA9D8
https://www.github.com/mefhigoseth
...:::[ God Rulz ! ]:::...
-- 
_
-- 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