Hey,


Could you try replacing the @-sign in the username with: %40  (percent-forty)?


// Samuel


From: sr-users <sr-users-bounces@lists.kamailio.org> on behalf of Floimair Florian <f.floimair@commend.com>
Sent: Monday, November 27, 2017 3:33:21 PM
To: Kamailio (SER) - Users Mailing List
Subject: [SR-Users] URL problems connecting to external (Azure) MySQL database
 

Hi!

 

I’m having troubles connecting Kamailio to an external MySQL database (on Microsoft Azure Cloud).

Initially creating the database with kamctl worked fine, but accessing it at runtime via db_url fails.

 

A somewhat unusual thing about the connection to a MySQL database on Azure is that the username contains an ‘@’ character.

This leads me to believe that this case is somewhat unhandled when parsing the database URI.

 

Trying to connect to something like

 

modparam("sipcapture", "db_url", "mysql://user@clouddb:password@clouddb.mysql.database.azure.com/db")

 

Results in errors starting Kamailio

 

ERROR: db_mysql [km_my_con.c:124]: db_mysql_new_connection(): driver error: Unknown MySQL server host 'clouddb' (-2)

ERROR: <core> [db.c:318]: db_do_init2(): could not add connection to the pool

ERROR: sipcapture [sipcapture.c:1146]: child_init(): unable to connect to database [mysql://user@clouddb:password@clouddb.mysql.database.azure.com/db] from capture_mode param.

Is there a trick on how to achieve a connection in this case like some sort of escape character probably?

 

 

Mit freundlichen Grüßen

Florian Floimair (IMS) 1568