Re: [asterisk-users] cmd MySQL

2011-02-22 Thread Andrew Thomas
Try rrplacing "MySQL(Query resultid ${conn_id} SELECT/ ramal/ FROM/
colaboradores/ WHERE/ ramal=${EXTEN});"

With "MySQL(Query resultid ${conn_id} SELECT `ramal` FROM
`colaboradores` WHERE `ramal`='${EXTEN}');"



-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Felipe
Figueiredo
Sent: 18 February 2011 17:57
To: asterisk-users@lists.digium.com
Subject: [asterisk-users] cmd MySQL


Hi guys, 


I'm trying to connect Asterisk to the MySQL, but I can't execute it. It
returns an error, as below:


-- Executing [200@teste:2] MYSQL("Console/dsp", "Query resultid 1
SELECT/ ramal/ FROM/ colaboradores/ WHERE/ ramal=200") in new stack
[Feb 18 15:55:13] WARNING[7696]: app_mysql.c:393 aMYSQL_query:
aMYSQL_query: mysql_query failed. Error: You have an error in your SQL
syntax; check the manual that corresponds to your MySQL server version
for the right syntax to use near '/ ramal/ FROM/ colaboradores/ WHERE/
ramal=200' at line 1


Its seems it can connect to mysql




My extension (AEL) is:


MySQL(Connect conn_id localhost root 123456 crm);
MySQL(Query resultid ${conn_id} SELECT/ ramal/ FROM/
colaboradores/ WHERE/ ramal=${EXTEN});
MySQL(Fetch fetchid ${resultid} RAMAL);
MySQL(Clear ${fetchid});
MySQL(Disconnect ${connid});
MySQL(Clear ${connid});
NoOp(${RAMAL});






Where is the error? Thanks!!






The MySQL server is in the same server where Asterisk is running. 


Thanks!!!


 If you have received this communication in error we would appreciate
you advising us either by telephone or return of e-mail. The contents
of this message, and any attachments, are the property of DataVox,
and are intended for the confidential use of the named recipient only.
If you are not the intended recipient, employee or agent responsible
for delivery of this message to the intended recipient, take note that
any dissemination, distribution or copying of this communication and
its attachments is strictly prohibited, and may be subject to civil or
criminal action for which you may be liable.
Every effort has been made to ensure that this e-mail or any attachments
are free from viruses. While the company has taken every reasonable
precaution to minimise this risk, neither company, nor the sender can
accept liability for any damage which you sustain as a result of viruses.
It is recommended that you should carry out your own virus checks
before opening any attachments. 

Registered in England. No. 27459085.



--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[asterisk-users] cmd MySQL

2011-02-18 Thread Felipe Figueiredo
Hi guys,

I'm trying to connect Asterisk to the MySQL, but I can't execute it. It
returns an error, as below:

-- Executing [200@teste:2] MYSQL("Console/dsp", "Query resultid 1 SELECT/
ramal/ FROM/ colaboradores/ WHERE/ ramal=200") in new stack
[Feb 18 15:55:13] WARNING[7696]: app_mysql.c:393 aMYSQL_query: aMYSQL_query:
mysql_query failed. Error: You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right syntax to
use near '/ ramal/ FROM/ colaboradores/ WHERE/ ramal=200' at line 1

Its seems it can connect to mysql


My extension (AEL) is:

MySQL(Connect conn_id localhost root 123456 crm);
MySQL(Query resultid ${conn_id} SELECT/ ramal/ FROM/
colaboradores/ WHERE/ ramal=${EXTEN});
MySQL(Fetch fetchid ${resultid} RAMAL);
MySQL(Clear ${fetchid});
MySQL(Disconnect ${connid});
MySQL(Clear ${connid});
NoOp(${RAMAL});



Where is the error? Thanks!!



The MySQL server is in the same server where Asterisk is running.

Thanks!!!
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] cmd mysql

2007-10-21 Thread Benchev
> I've been using mysql databases more and more.  I've run
> across a couple
> of instances where I've either made a mistake on the ip
> address of the
> mysql database or for whatever reason, mysql wasn't
> running.  In those
> instances, I've noted that the mysql command will hang
> indefinitely
> (I've counted to 40 before killing it).
>
> The offending line is:
>
> exten => s,1,MYSQL(Connect connid 192.168.103.15
> mysqladmin 'x' did)
>
> Is there a way to specify a timeout for the mysql
> command?
>
> I'm not finding anything on Google, voip-info or the
> documents in the
> add-ons directory.  Any help would be appreciated.
>
By experience, after every query sequence you should use
MYSQL(Clear ${resultid}) otherwise they'll become 400.
As it is said into app_addon_sql_mysql.c
"Frees memory and datastructures associated with result
set."

Hope that helps,
Benchev

-

БТК ADSL Старт - неограничен Интернет трафик само за 19.99 лв./мес. с договор 
за 2 години.
Само до 31 октомври, избери БТК ADSL пакет и тествай безплатно за 14 дни!
За повече информация:www.btc.bg
http://www.btc.bg/bg/new_btc_adsl_packs.php


___
--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] cmd mysql

2007-10-21 Thread Doug Lytle
Baji Panchumarti wrote:
> you may be confusing the db server because mysqladmin

I made this name up, it's not the user name that I really use.


>
>  no quotes around the password.
>
I'll test this out, thanks.

Doug


-- 
Ben Franklin quote:

"Those who would give up Essential Liberty to purchase a little Temporary 
Safety, deserve neither Liberty nor Safety."



___
--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] cmd mysql

2007-10-21 Thread Baji Panchumarti
  On 10/21/07, Doug Lytle  wrote:

> Hey everybody,
>
> I've been using mysql databases more and more.  I've run across a couple
> of instances where I've either made a mistake on the ip address of the
> mysql database or for whatever reason, mysql wasn't running.  In those
> instances, I've noted that the mysql command will hang indefinitely
> (I've counted to 40 before killing it).
>
> The offending line is:
>
> exten => s,1,MYSQL(Connect connid 192.168.103.15 mysqladmin 'x'
did)

 there are a couple of things wrong with your MYSQL() call,
 you may be confusing the db server because mysqladmin
 the name of a mysql util, pick another username.

 no quotes around the password.

 Here are my statements, and they don't hang if mysql isn't
 running on the db server, the * console shows a connect
 failed error and continues :

 exten => s,n,Set(db_host=192.168.111.11)
 exten => s,n,MYSQL(Connect db_connid ${db_host} user pass dbname)

> Is there a way to specify a timeout for the mysql command?
>
> I'm not finding anything on Google, voip-info or the documents in the
> add-ons directory.  Any help would be appreciated.

more info here :

http://www.voip-info.org/wiki/index.php?page=Asterisk+cmd+MYSQL

--
___
--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] cmd mysql

2007-10-21 Thread Doug Lytle
Hey everybody,

I've been using mysql databases more and more.  I've run across a couple
of instances where I've either made a mistake on the ip address of the
mysql database or for whatever reason, mysql wasn't running.  In those
instances, I've noted that the mysql command will hang indefinitely
(I've counted to 40 before killing it).

The offending line is:

exten => s,1,MYSQL(Connect connid 192.168.103.15 mysqladmin 'x' did)

Is there a way to specify a timeout for the mysql command?

I'm not finding anything on Google, voip-info or the documents in the
add-ons directory.  Any help would be appreciated.

Thanks,

Doug



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