Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Submitted By: David Roberge (xittel)
Assigned to: Nobody/Anonymous (nobody)
Summary: Bug: opensipsctl script with Postgres
I am using OpenSIPS 1.4.4 with Postgres 8.3 and I am running into two problems with the opensipsctl script.
1. It seems that Postgres does not support the CONCAT SQL function. I had to remove all CONCAT function calls from the script and replace them with || operators in order to use the script properly.
2. I also encountered a problem when adding subscribers via the opensipsctl script. Before adding new subscriber, the script checks that no alias with the same name as the new subscriber exists in the DB. However, the script seems to be written with MySql in mind. The check_db_alias() function does not process the output of psql properly and thinks that an alias already exists.
The script thinks that the last line of the output of psql contains the number of returned records. It thus set the $CNT variable to the value of the last line of the output. However, the last line is a blank line. Since the $CNT variable is set to blank, it is therefore != 0. The $ALIAS_DB_EXISTS variable is set to 1 and the script thinks that an alias exists even thought it does not. This prevents the addition of new subscribers into the DB.