Max length for db_host in res_mysql.conf

Hi,

I am trying to use a AWS RDS for Asterisk real time. Asterisk gives an error of

[2024-03-18 08:28:27] ERROR[3472][C-00000001]: res_config_mysql.c:1362 mysql_reconnect: MySQL RealTime: Failed to connect database server asterisk_realtime on foobar123-telecom.c3ejlgrmq44c.us-east-1.rds.amaz (err 2005). Check debug for more info

I see in addons/res_config_mysql.h that the limit is set to 50


struct mysql_conn {
        AST_RWLIST_ENTRY(mysql_conn) list;
        ast_mutex_t     lock;
        MYSQL       handle;
        char        host[50];
        char        name[50];
        char        user[50];
        char        pass[50];
        char        sock[50];
        char        charset[50];
        int         port;
        int         connected;
        time_t      connect_time;
        enum requirements requirements;
        char        unique_name[0];
};

Is there any reason not to patch asterisk and increase that amount to say 75? @jcolp since I assume this will affect others what the likelihood of a patch to increase it be accepted?

TIA.

Probably high?

And any reason why it was limited to 50? I want to make sure I am not re-inventing the wheel. Also can you advise on how a patch would be submitted these days? it’s been a while…

Any reason would be in the git history of the module itself. It predates me.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.