1 | изначальная версия редактировать | |
Пожалуйста помогите с проблемой. Астериск не подключается к Mysql из диалплана. версия астериска
srv-aster-01*CLI> core show version
Asterisk 1.8.19.0 built by root @ srv-aster-01 on a x86_64 running Linux on 2012-12-17 12:52:07 UTC
srv-aster-01*CLI> module show like app_mysql.so
Module Description Use Count
app_mysql.so Simple Mysql Interface 0
1 modules loaded
Вот extensions.conf
exten => 30,1,MYSQL(Connect connid 127.0.0.1 asteriskpbx **** subsbs)
exten => 30,n,MYSQL(Query resultid ${connid} SELECT\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1)
exten => 30,n,MYSQL(Fetch fetchid ${resultid} test1)
exten => 30,n,NoOp(Status ${MYSQL_STATUS})
exten => 30,n,NoOp(Result fetch ${test1})
exten => 30,n,NoOp(Result query ${resultid})
exten => 30,n,MYSQL(Clear ${resultid})
exten => 30,n,MYSQL(Disconnect ${connid})
exten => 30,n,NoOp(Status ${MYSQL_STATUS})
exten => 30,n,NoOp(Result fetch ${test1})
exten => 30,n,NoOp(Result query ${resultid})
Вот вывод CLI
== Using SIP RTP CoS mark 5
-- Executing [30@out:1] MYSQL("SIP/100-00000011", "Connect connid 127.0.0.1 asteriskpbx frogs-pNKJaswMd subsbs") in new stack
-- Executing [30@out:2] MYSQL("SIP/100-00000011", "Query resultid 7 SELECT\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1") in new stack
-- Executing [30@out:3] MYSQL("SIP/100-00000011", "Fetch fetchid test1") in new stack
-- Executing [30@out:4] NoOp("SIP/100-00000011", "Status -1") in new stack
-- Executing [30@out:5] NoOp("SIP/100-00000011", "Result fetch ") in new stack
-- Executing [30@out:6] NoOp("SIP/100-00000011", "Result query ") in new stack
-- Executing [30@out:7] MYSQL("SIP/100-00000011", "Clear ") in new stack
-- Executing [30@out:8] MYSQL("SIP/100-00000011", "Disconnect 7") in new stack
-- Executing [30@out:9] NoOp("SIP/100-00000011", "Status 0") in new stack``
-- Executing [30@out:10] NoOp("SIP/100-00000011", "Result fetch ") in new stack
-- Executing [30@out:11] NoOp("SIP/100-00000011", "Result query ") in new stack
-- Auto fallthrough, channel 'SIP/100-00000011' status is 'UNKNOWN'
При этом я могу залогиниться в Mysql от этого пользователя:
asteriskpbx@srv-aster-01 etc]$ mysql -h 127.0.0.1 -u asteriskpbx -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 280
Server version: 5.5.39 MySQL Community Server (GPL) by Remi
2 | No.2 Revision редактировать |
Пожалуйста помогите с проблемой. Астериск не подключается к Mysql из диалплана.
версия астерискаВерсия астериска:
srv-aster-01*CLI> core show version
Asterisk 1.8.19.0 built by root @ srv-aster-01 on a x86_64 running Linux on 2012-12-17 12:52:07 UTC
srv-aster-01*CLI> module show like app_mysql.so
Module Description Use Count
app_mysql.so Simple Mysql Interface 0
1 modules loaded
Вот extensions.conf
exten => 30,1,MYSQL(Connect connid 127.0.0.1 asteriskpbx **** subsbs)
exten => 30,n,MYSQL(Query resultid ${connid} SELECT\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1)
exten => 30,n,MYSQL(Fetch fetchid ${resultid} test1)
exten => 30,n,NoOp(Status ${MYSQL_STATUS})
exten => 30,n,NoOp(Result fetch ${test1})
exten => 30,n,NoOp(Result query ${resultid})
exten => 30,n,MYSQL(Clear ${resultid})
exten => 30,n,MYSQL(Disconnect ${connid})
exten => 30,n,NoOp(Status ${MYSQL_STATUS})
exten => 30,n,NoOp(Result fetch ${test1})
exten => 30,n,NoOp(Result query ${resultid})
Вот вывод CLI
== Using SIP RTP CoS mark 5
-- Executing [30@out:1] MYSQL("SIP/100-00000011", "Connect connid 127.0.0.1 asteriskpbx frogs-pNKJaswMd subsbs") in new stack
-- Executing [30@out:2] MYSQL("SIP/100-00000011", "Query resultid 7 SELECT\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1") in new stack
-- Executing [30@out:3] MYSQL("SIP/100-00000011", "Fetch fetchid test1") in new stack
-- Executing [30@out:4] NoOp("SIP/100-00000011", "Status -1") in new stack
-- Executing [30@out:5] NoOp("SIP/100-00000011", "Result fetch ") in new stack
-- Executing [30@out:6] NoOp("SIP/100-00000011", "Result query ") in new stack
-- Executing [30@out:7] MYSQL("SIP/100-00000011", "Clear ") in new stack
-- Executing [30@out:8] MYSQL("SIP/100-00000011", "Disconnect 7") in new stack
-- Executing [30@out:9] NoOp("SIP/100-00000011", "Status 0") in new stack``
-- Executing [30@out:10] NoOp("SIP/100-00000011", "Result fetch ") in new stack
-- Executing [30@out:11] NoOp("SIP/100-00000011", "Result query ") in new stack
-- Auto fallthrough, channel 'SIP/100-00000011' status is 'UNKNOWN'
При этом я могу залогиниться в Mysql от этого пользователя:
asteriskpbx@srv-aster-01 etc]$ mysql -h 127.0.0.1 -u asteriskpbx -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 280
Server version: 5.5.39 MySQL Community Server (GPL) by Remi
3 | No.3 Revision редактировать |
Пожалуйста помогите с проблемой. Астериск не подключается к Mysql из диалплана. Версия астериска:
srv-aster-01*CLI> core show version
Asterisk 1.8.19.0 built by root @ srv-aster-01 on a x86_64 running Linux on 2012-12-17 12:52:07 UTC
srv-aster-01*CLI> module show like app_mysql.so
Module Description Use Count
app_mysql.so Simple Mysql Interface 0
1 modules loaded
Вот extensions.conf
exten => 30,1,MYSQL(Connect connid 127.0.0.1 asteriskpbx **** subsbs)
exten => 30,n,MYSQL(Query resultid ${connid} SELECT\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1)
exten => 30,n,MYSQL(Fetch fetchid ${resultid} test1)
exten => 30,n,NoOp(Status ${MYSQL_STATUS})
exten => 30,n,NoOp(Result fetch ${test1})
exten => 30,n,NoOp(Result query ${resultid})
exten => 30,n,MYSQL(Clear ${resultid})
exten => 30,n,MYSQL(Disconnect ${connid})
exten => 30,n,NoOp(Status ${MYSQL_STATUS})
exten => 30,n,NoOp(Result fetch ${test1})
exten => 30,n,NoOp(Result query ${resultid})
Вот вывод CLI
== Using SIP RTP CoS mark 5
-- Executing [30@out:1] MYSQL("SIP/100-00000011", "Connect connid 127.0.0.1 asteriskpbx frogs-pNKJaswMd subsbs") in new stack
-- Executing [30@out:2] MYSQL("SIP/100-00000011", "Query resultid 7 SELECT\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1") in new stack
-- Executing [30@out:3] MYSQL("SIP/100-00000011", "Fetch fetchid test1") in new stack
-- Executing [30@out:4] NoOp("SIP/100-00000011", "Status -1") in new stack
-- Executing [30@out:5] NoOp("SIP/100-00000011", "Result fetch ") in new stack
-- Executing [30@out:6] NoOp("SIP/100-00000011", "Result query ") in new stack
-- Executing [30@out:7] MYSQL("SIP/100-00000011", "Clear ") in new stack
-- Executing [30@out:8] MYSQL("SIP/100-00000011", "Disconnect 7") in new stack
-- Executing [30@out:9] NoOp("SIP/100-00000011", "Status 0") in new stack``
-- Executing [30@out:10] NoOp("SIP/100-00000011", "Result fetch ") in new stack
-- Executing [30@out:11] NoOp("SIP/100-00000011", "Result query ") in new stack
-- Auto fallthrough, channel 'SIP/100-00000011' status is 'UNKNOWN'
При этом я могу залогиниться в Mysql от этого пользователя:
asteriskpbx@srv-aster-01 etc]$ mysql -h 127.0.0.1 -u asteriskpbx -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 280
Server version: 5.5.39 MySQL Community Server (GPL) by Remi
mysql> SELECT subscribermsisdn FROM subsbs.debts where id=1; +-------------------+ | subscribermsisdn | +-------------------+ | 375259090552 | +-------------------+ 1 row in set (0.00 sec)
4 | No.4 Revision редактировать |
Пожалуйста помогите с проблемой. Астериск не подключается к Mysql из диалплана. Версия астериска:
srv-aster-01*CLI> core show version
Asterisk 1.8.19.0 built by root @ srv-aster-01 on a x86_64 running Linux on 2012-12-17 12:52:07 UTC
srv-aster-01*CLI> module show like app_mysql.so
Module Description Use Count
app_mysql.so Simple Mysql Interface 0
1 modules loaded
Вот extensions.conf
exten => 30,1,MYSQL(Connect connid 127.0.0.1 asteriskpbx **** subsbs)
exten => 30,n,MYSQL(Query resultid ${connid} SELECT\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1)
exten => 30,n,MYSQL(Fetch fetchid ${resultid} test1)
exten => 30,n,NoOp(Status ${MYSQL_STATUS})
exten => 30,n,NoOp(Result fetch ${test1})
exten => 30,n,NoOp(Result query ${resultid})
exten => 30,n,MYSQL(Clear ${resultid})
exten => 30,n,MYSQL(Disconnect ${connid})
exten => 30,n,NoOp(Status ${MYSQL_STATUS})
exten => 30,n,NoOp(Result fetch ${test1})
exten => 30,n,NoOp(Result query ${resultid})
Вот вывод CLI
== Using SIP RTP CoS mark 5
-- Executing [30@out:1] MYSQL("SIP/100-00000011", "Connect connid 127.0.0.1 asteriskpbx frogs-pNKJaswMd subsbs") in new stack
-- Executing [30@out:2] MYSQL("SIP/100-00000011", "Query resultid 7 SELECT\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1") in new stack
-- Executing [30@out:3] MYSQL("SIP/100-00000011", "Fetch fetchid test1") in new stack
-- Executing [30@out:4] NoOp("SIP/100-00000011", "Status -1") in new stack
-- Executing [30@out:5] NoOp("SIP/100-00000011", "Result fetch ") in new stack
-- Executing [30@out:6] NoOp("SIP/100-00000011", "Result query ") in new stack
-- Executing [30@out:7] MYSQL("SIP/100-00000011", "Clear ") in new stack
-- Executing [30@out:8] MYSQL("SIP/100-00000011", "Disconnect 7") in new stack
-- Executing [30@out:9] NoOp("SIP/100-00000011", "Status 0") in new stack``
-- Executing [30@out:10] NoOp("SIP/100-00000011", "Result fetch ") in new stack
-- Executing [30@out:11] NoOp("SIP/100-00000011", "Result query ") in new stack
-- Auto fallthrough, channel 'SIP/100-00000011' status is 'UNKNOWN'
При этом я могу залогиниться в Mysql от этого пользователя:
asteriskpbx@srv-aster-01 etc]$ mysql -h 127.0.0.1 -u asteriskpbx -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 280
Server version: 5.5.39 MySQL Community Server (GPL) by Remi
Remi
mysql> SELECT subscribermsisdn subscriber_msisdn FROM subsbs.debts where id=1;
+-------------------+
| subscribermsisdn subscriber_msisdn |
+-------------------+
| 375259090552 |
+-------------------+
1 row in set (0.00 sec)
5 | No.5 Revision редактировать |
Пожалуйста помогите с проблемой. Астериск не подключается к Mysql из диалплана. Версия астериска:
srv-aster-01*CLI> core show version
Asterisk 1.8.19.0 built by root @ srv-aster-01 on a x86_64 running Linux on 2012-12-17 12:52:07 UTC
srv-aster-01*CLI> module show like app_mysql.so
Module Description Use Count
app_mysql.so Simple Mysql Interface 0
1 modules loaded
Вот extensions.conf
exten => 30,1,MYSQL(Connect connid 127.0.0.1 asteriskpbx **** subsbs)
exten => 30,n,MYSQL(Query resultid ${connid} SELECT\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1)
exten => 30,n,MYSQL(Fetch fetchid ${resultid} test1)
exten => 30,n,NoOp(Status ${MYSQL_STATUS})
exten => 30,n,NoOp(Result fetch ${test1})
exten => 30,n,NoOp(Result query ${resultid})
exten => 30,n,MYSQL(Clear ${resultid})
exten => 30,n,MYSQL(Disconnect ${connid})
exten => 30,n,NoOp(Status ${MYSQL_STATUS})
exten => 30,n,NoOp(Result fetch ${test1})
exten => 30,n,NoOp(Result query ${resultid})
Вот вывод CLI
== Using SIP RTP CoS mark 5
-- Executing [30@out:1] MYSQL("SIP/100-00000011", "Connect connid 127.0.0.1 asteriskpbx frogs-pNKJaswMd subsbs") in new stack
-- Executing [30@out:2] MYSQL("SIP/100-00000011", "Query resultid 7 SELECT\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1") in new stack
-- Executing [30@out:3] MYSQL("SIP/100-00000011", "Fetch fetchid test1") in new stack
-- Executing [30@out:4] NoOp("SIP/100-00000011", "Status -1") in new stack
-- Executing [30@out:5] NoOp("SIP/100-00000011", "Result fetch ") in new stack
-- Executing [30@out:6] NoOp("SIP/100-00000011", "Result query ") in new stack
-- Executing [30@out:7] MYSQL("SIP/100-00000011", "Clear ") in new stack
-- Executing [30@out:8] MYSQL("SIP/100-00000011", "Disconnect 7") in new stack
-- Executing [30@out:9] NoOp("SIP/100-00000011", "Status 0") in new stack``
-- Executing [30@out:10] NoOp("SIP/100-00000011", "Result fetch ") in new stack
-- Executing [30@out:11] NoOp("SIP/100-00000011", "Result query ") in new stack
-- Auto fallthrough, channel 'SIP/100-00000011' status is 'UNKNOWN'
При этом я могу залогиниться в Mysql от этого пользователя:
asteriskpbx@srv-aster-01 etc]$ mysql -h 127.0.0.1 -u asteriskpbx -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 280
Server version: 5.5.39 MySQL Community Server (GPL) by Remi
mysql> SELECT subscriber_msisdn FROM subsbs.debts where id=1;
+-------------------+
| subscriber_msisdn |
+-------------------+
| 375259090552 333 |
+-------------------+
1 row in set (0.00 sec)
6 | No.6 Revision редактировать |
Пожалуйста помогите с проблемой. Астериск не подключается к Mysql из диалплана. Версия астериска:
srv-aster-01*CLI> core show version
Asterisk 1.8.19.0 built by root @ srv-aster-01 on a x86_64 running Linux on 2012-12-17 12:52:07 UTC
srv-aster-01*CLI> module show like app_mysql.so
Module Description Use Count
app_mysql.so Simple Mysql Interface 0
1 modules loaded
Вот extensions.conf
exten => 30,1,MYSQL(Connect connid 127.0.0.1 asteriskpbx **** subsbs)
exten => 30,n,MYSQL(Query resultid ${connid} SELECT\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1)
exten => 30,n,MYSQL(Fetch fetchid ${resultid} test1)
exten => 30,n,NoOp(Status ${MYSQL_STATUS})
exten => 30,n,NoOp(Result fetch ${test1})
exten => 30,n,NoOp(Result query ${resultid})
exten => 30,n,MYSQL(Clear ${resultid})
exten => 30,n,MYSQL(Disconnect ${connid})
exten => 30,n,NoOp(Status ${MYSQL_STATUS})
exten => 30,n,NoOp(Result fetch ${test1})
exten => 30,n,NoOp(Result query ${resultid})
Вот вывод CLI
== Using SIP RTP CoS mark 5
-- Executing [30@out:1] MYSQL("SIP/100-00000011", "Connect connid 127.0.0.1 asteriskpbx frogs-pNKJaswMd subsbs") in new stack
-- Executing [30@out:2] MYSQL("SIP/100-00000011", "Query resultid 7 SELECT\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1") in new stack
-- Executing [30@out:3] MYSQL("SIP/100-00000011", "Fetch fetchid test1") in new stack
-- Executing [30@out:4] NoOp("SIP/100-00000011", "Status -1") in new stack
-- Executing [30@out:5] NoOp("SIP/100-00000011", "Result fetch ") in new stack
-- Executing [30@out:6] NoOp("SIP/100-00000011", "Result query ") in new stack
-- Executing [30@out:7] MYSQL("SIP/100-00000011", "Clear ") in new stack
-- Executing [30@out:8] MYSQL("SIP/100-00000011", "Disconnect 7") in new stack
-- Executing [30@out:9] NoOp("SIP/100-00000011", "Status 0") in new stack``
-- Executing [30@out:10] NoOp("SIP/100-00000011", "Result fetch ") in new stack
-- Executing [30@out:11] NoOp("SIP/100-00000011", "Result query ") in new stack
-- Auto fallthrough, channel 'SIP/100-00000011' status is 'UNKNOWN'
При этом я могу залогиниться в Mysql от этого пользователя:
asteriskpbx@srv-aster-01 etc]$ mysql -h 127.0.0.1 -u asteriskpbx -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 280
Server version: 5.5.39 MySQL Community Server (GPL) by Remi
mysql> SELECT subscriber_msisdn FROM subsbs.debts where id=1;
+-------------------+
| subscriber_msisdn |
+-------------------+
| 333 |
+-------------------+
1 row in set (0.00 sec)
Включил дебаг из которого видно что ошибка в синтаксисе SQL запроса:
== Using SIP RTP CoS mark 5
-- Executing [30@out:1] MYSQL("SIP/100-00000003", "Connect connid 127.0.0.1 asteriskpbx frogs-pNKJaswMd subsbs") in new stack
-- Executing [30@out:2] MYSQL("SIP/100-00000003", "Query resultid 1 SELECT\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1") in new stack
[Sep 5 13:15:00] WARNING[40574]: app_mysql.c:395 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 '\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1' at line 1
-- Executing [30@out:3] MYSQL("SIP/100-00000003", "Fetch fetchid test1") in new stack
[Sep 5 13:15:00] WARNING[40574]: app_mysql.c:496 aMYSQL_fetch: aMYSQL_fetch: missing some arguments
-- Executing [30@out:4] NoOp("SIP/100-00000003", "Status -1") in new stack
-- Executing [30@out:5] NoOp("SIP/100-00000003", "Result fetch ") in new stack
-- Executing [30@out:6] NoOp("SIP/100-00000003", "Result query ") in new stack
-- Executing [30@out:7] MYSQL("SIP/100-00000003", "Clear ") in new stack
[Sep 5 13:15:00] WARNING[40574]: app_mysql.c:194 find_identifier: Identifier 0, identifier_type 2 not found in identifier list
[Sep 5 13:15:00] WARNING[40574]: app_mysql.c:510 aMYSQL_clear: Invalid result identifier 0 passed in aMYSQL_clear
-- Executing [30@out:8] MYSQL("SIP/100-00000003", "Disconnect 1") in new stack
-- Executing [30@out:9] NoOp("SIP/100-00000003", "Status 0") in new stack
-- Executing [30@out:10] NoOp("SIP/100-00000003", "Result fetch ") in new stack
-- Executing [30@out:11] NoOp("SIP/100-00000003", "Result query ") in new stack
Переделал запрос в диалплане на
exten => 30,n,MYSQL(Query resultid ${connid} SELECT subscriber_msisdn FROM subsbs.debts where id=1)
и всё заработало! Причина в том что начиная с версии 1.8 поддерживаются нормальные sql запросы, без слэшей.
7 | No.7 Revision редактировать |
Пожалуйста помогите с проблемой. Астериск не подключается к Mysql из диалплана. Версия астериска:
srv-aster-01*CLI> core show version
Asterisk 1.8.19.0 built by root @ srv-aster-01 on a x86_64 running Linux on 2012-12-17 12:52:07 UTC
srv-aster-01*CLI> module show like app_mysql.so
Module Description Use Count
app_mysql.so Simple Mysql Interface 0
1 modules loaded
Вот extensions.conf
exten => 30,1,MYSQL(Connect connid 127.0.0.1 asteriskpbx **** subsbs)
exten => 30,n,MYSQL(Query resultid ${connid} SELECT\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1)
exten => 30,n,MYSQL(Fetch fetchid ${resultid} test1)
exten => 30,n,NoOp(Status ${MYSQL_STATUS})
exten => 30,n,NoOp(Result fetch ${test1})
exten => 30,n,NoOp(Result query ${resultid})
exten => 30,n,MYSQL(Clear ${resultid})
exten => 30,n,MYSQL(Disconnect ${connid})
exten => 30,n,NoOp(Status ${MYSQL_STATUS})
exten => 30,n,NoOp(Result fetch ${test1})
exten => 30,n,NoOp(Result query ${resultid})
Вот вывод CLI
== Using SIP RTP CoS mark 5
-- Executing [30@out:1] MYSQL("SIP/100-00000011", "Connect connid 127.0.0.1 asteriskpbx frogs-pNKJaswMd subsbs") in new stack
-- Executing [30@out:2] MYSQL("SIP/100-00000011", "Query resultid 7 SELECT\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1") in new stack
-- Executing [30@out:3] MYSQL("SIP/100-00000011", "Fetch fetchid test1") in new stack
-- Executing [30@out:4] NoOp("SIP/100-00000011", "Status -1") in new stack
-- Executing [30@out:5] NoOp("SIP/100-00000011", "Result fetch ") in new stack
-- Executing [30@out:6] NoOp("SIP/100-00000011", "Result query ") in new stack
-- Executing [30@out:7] MYSQL("SIP/100-00000011", "Clear ") in new stack
-- Executing [30@out:8] MYSQL("SIP/100-00000011", "Disconnect 7") in new stack
-- Executing [30@out:9] NoOp("SIP/100-00000011", "Status 0") in new stack``
-- Executing [30@out:10] NoOp("SIP/100-00000011", "Result fetch ") in new stack
-- Executing [30@out:11] NoOp("SIP/100-00000011", "Result query ") in new stack
-- Auto fallthrough, channel 'SIP/100-00000011' status is 'UNKNOWN'
При этом я могу залогиниться в Mysql от этого пользователя:
asteriskpbx@srv-aster-01 etc]$ mysql -h 127.0.0.1 -u asteriskpbx -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 280
Server version: 5.5.39 MySQL Community Server (GPL) by Remi
mysql> SELECT subscriber_msisdn FROM subsbs.debts where id=1;
+-------------------+
| subscriber_msisdn |
+-------------------+
| 333 |
+-------------------+
1 row in set (0.00 sec)
Включил дебаг из которого видно что ошибка в синтаксисе SQL запроса:
== Using SIP RTP CoS mark 5
-- Executing [30@out:1] MYSQL("SIP/100-00000003", "Connect connid 127.0.0.1 asteriskpbx frogs-pNKJaswMd subsbs") in new stack
-- Executing [30@out:2] MYSQL("SIP/100-00000003", "Query resultid 1 SELECT\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1") in new stack
[Sep 5 13:15:00] WARNING[40574]: app_mysql.c:395 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 '\ subscriber_msisdn\ from\ subsbs.debts \ where\ id=1' at line 1
-- Executing [30@out:3] MYSQL("SIP/100-00000003", "Fetch fetchid test1") in new stack
[Sep 5 13:15:00] WARNING[40574]: app_mysql.c:496 aMYSQL_fetch: aMYSQL_fetch: missing some arguments
-- Executing [30@out:4] NoOp("SIP/100-00000003", "Status -1") in new stack
-- Executing [30@out:5] NoOp("SIP/100-00000003", "Result fetch ") in new stack
-- Executing [30@out:6] NoOp("SIP/100-00000003", "Result query ") in new stack
-- Executing [30@out:7] MYSQL("SIP/100-00000003", "Clear ") in new stack
[Sep 5 13:15:00] WARNING[40574]: app_mysql.c:194 find_identifier: Identifier 0, identifier_type 2 not found in identifier list
[Sep 5 13:15:00] WARNING[40574]: app_mysql.c:510 aMYSQL_clear: Invalid result identifier 0 passed in aMYSQL_clear
-- Executing [30@out:8] MYSQL("SIP/100-00000003", "Disconnect 1") in new stack
-- Executing [30@out:9] NoOp("SIP/100-00000003", "Status 0") in new stack
-- Executing [30@out:10] NoOp("SIP/100-00000003", "Result fetch ") in new stack
-- Executing [30@out:11] NoOp("SIP/100-00000003", "Result query ") in new stack
Переделал запрос в диалплане на
exten => 30,n,MYSQL(Query resultid ${connid} SELECT subscriber_msisdn FROM subsbs.debts where id=1)
и всё заработало! Причина в том что начиная с версии 1.8 поддерживаются нормальные sql запросы, без слэшей.
Проект компании "АТС Дизайн"
Asterisk® и Digium® являются зарегистрированными торговыми марками компании
Digium, Inc., США.
IP АТС Asterisk распространяется под лицензией
GNU GPL.