Any solution for ODBC disconnections in Asterisk?

719 views
Skip to first unread message

Charlie Chandra

unread,
Jun 8, 2015, 2:05:46 PM6/8/15
to gce-dis...@googlegroups.com
Hi,

I have configured my Asterisk real time using ODBC. I am using MySQL as data base. I am getting these below messages on Asterisk CLI frequently and immediately my server console is disconnecting:

res_odbc.c:1412 _ast_odbc_request_obj2: SetConnectAttr (Txn isolation) returned an error: HY000: [MySQL][ODBC 5.2(w) Driver]Lost connection to MySQL server during query
[Jun 8 11:32:17] WARNING[3940][C-00000021]: res_config_odbc.c:118 custom_prepare: SQL Prepare failed![SELECT * FROM sipusers WHERE name = ? AND host = ?]
[Jun 8 11:32:17] WARNING[3940][C-00000021]: res_odbc.c:762 ast_odbc_sanity_check: Connection is down attempting to reconnect...

I searched a lot in internet and I didn't find the solution anywhere including this all these forums. Maximum users are posted this query. But, there is no solution has given.

Is there any solutions for this issue? Is it really a bug in Asterisk?

Can any body help me to solve this problem or advise me?

Thanks in advance.
Chandra.

Kamran (Google Cloud Support)

unread,
Jun 8, 2015, 2:53:00 PM6/8/15
to gce-dis...@googlegroups.com, charlie....@gmail.com

Before I can help on this issue, provide me with more information about your project:

- Where has your Asterisk been installed? on a GCE VM instance?
- Is your MySQL server is a Google Cloud SQL instance or it is installed on a GCE VM instance?


Sincerely,

Charlie Chandra

unread,
Jun 8, 2015, 4:58:00 PM6/8/15
to gce-dis...@googlegroups.com
Hello Kumran,

Thanks for your reply. Please find my below answers:

* Yes. I installed Asterisk in GCE VM innstance only.
* MySQL server is not a Google cloud SQL instance. MySQL server is installed on GCE VM instance. Both Asterisk and MySQL servers are installed in same GCE VM instance only.

If you need any other information, please let me know.

Thank you.
Chandra.

Kamran (Google Cloud Support)

unread,
Jun 8, 2015, 6:05:47 PM6/8/15
to gce-dis...@googlegroups.com, charlie....@gmail.com

Hi Charlie,

 

As this issue might be caused by lack of enough computing resources, make sure your GCE VM instance type meets the minimum hardware requirements for your applications. In this case, if you want to upgrade your VM machine type [1], you can delete the VM instance but keep its disks and then create a more powerful VM instance using the existing boot disk as described in the article [2].


To delete a VM instance but keeping its disks, you can use the following ‘gcloud’ command [3]:


$ gcloud compute instances delete NAME --keep-disks all


This can also be done through the Developers Console with unchecking the 'Delete boot disk when instance is deleted' option under VM instance properties before deleting the instance.


If this is not the case, then I recommend you look for help from Asterisk and MySQL support experts as this is not a GCE issue.


Sincerely,

[1] https://cloud.google.com/compute/docs/machine-types

[2] https://cloud.google.com/compute/docs/disks/persistent-disks#usingrootpd

[3] https://cloud.google.com/sdk/gcloud/reference/compute/instances/delete

Reply all
Reply to author
Forward
0 new messages