Hello,
i am using Kamailio for SIP Presence server.
When ever the Presence PUBLISH is received on kamailio, kamailio is sending
200 OK with out Expires IE.
I want Kamailio to send Expires IE with 200 OK.
How do i modify it. Can you please help me in this regard.
Thank u
MGSK
When attempting to create the extra modules tables using "kamdbctl create" using the PGSQL DBENGINE the create fails when kamdbctl tries to set the permissions on the sequences that are to be created with the table.
Example output (dr_gateways):
```
# kamdbctl create
INFO: creating database kamailio_alexia ...
INFO: Core Kamailio tables succesfully created.
INFO: creating presence tables into kamailio_alexia ...
INFO: Presence tables succesfully created.
INFO: creating extra tables into kamailio_alexia ...
ERROR: relation "dr_gateways_id_seq" does not exist
ERROR: relation "dr_gateways_id_seq" does not exist
ERROR: Grant privileges to extra tables failed!
```
Example output (dr_rules)
```
# kamdbctl create
INFO: creating database kamailio_alexia ...
INFO: Core Kamailio tables succesfully created.
INFO: creating presence tables into kamailio_alexia ...
INFO: Presence tables succesfully created.
INFO: creating extra tables into kamailio_alexia ...
ERROR: relation "dr_rules_id_seq" does not exist
ERROR: relation "dr_rules_id_seq" does not exist
ERROR: Grant privileges to extra tables failed!
```
This appears to be related to to primary key being being different in these two tables compared to what kamdbctl expects.
drouting-create.sql
```
# cat drouting-create.sql
CREATE TABLE dr_gateways (
gwid SERIAL PRIMARY KEY NOT NULL,
type INTEGER DEFAULT 0 NOT NULL,
address VARCHAR(128) NOT NULL,
strip INTEGER DEFAULT 0 NOT NULL,
pri_prefix VARCHAR(64) DEFAULT NULL,
attrs VARCHAR(255) DEFAULT NULL,
description VARCHAR(128) DEFAULT '' NOT NULL
);
INSERT INTO version (table_name, table_version) values ('dr_gateways','3');
CREATE TABLE dr_rules (
ruleid SERIAL PRIMARY KEY NOT NULL,
groupid VARCHAR(255) NOT NULL,
prefix VARCHAR(64) NOT NULL,
timerec VARCHAR(255) NOT NULL,
priority INTEGER DEFAULT 0 NOT NULL,
routeid VARCHAR(64) NOT NULL,
gwlist VARCHAR(255) NOT NULL,
description VARCHAR(128) DEFAULT '' NOT NULL
);
INSERT INTO version (table_name, table_version) values ('dr_rules','3');
CREATE TABLE dr_gw_lists (
id SERIAL PRIMARY KEY NOT NULL,
gwlist VARCHAR(255) NOT NULL,
description VARCHAR(128) DEFAULT '' NOT NULL
);
INSERT INTO version (table_name, table_version) values ('dr_gw_lists','1');
CREATE TABLE dr_groups (
id SERIAL PRIMARY KEY NOT NULL,
username VARCHAR(64) NOT NULL,
domain VARCHAR(128) DEFAULT '' NOT NULL,
groupid INTEGER DEFAULT 0 NOT NULL,
description VARCHAR(128) DEFAULT '' NOT NULL
);
INSERT INTO version (table_name, table_version) values ('dr_groups','2');
```
Then in kamdbctl.pgsql we see the following section for granting permissions and this is where it appears to fail:
kamdbctl.pgsql
```
241 for TABLE in $EXTRA_TABLES; do
242 sql_query "$1" "GRANT ALL PRIVILEGES ON TABLE $TABLE TO $DBRWUSER;"
243 sql_query "$1" "GRANT SELECT ON TABLE $TABLE TO $DBROUSER;"
244 if [ $TABLE != "route_tree" ] ; then
245 sql_query "$1" "GRANT ALL PRIVILEGES ON TABLE "$TABLE"_id_seq TO $DBRWUSER;"
246 sql_query "$1" "GRANT SELECT ON TABLE "$TABLE"_id_seq TO $DBROUSER;"
247 fi
248 if [ $? -ne 0 ] ; then
249 merr "Grant privileges to extra tables failed!"
250 exit 1
251 fi
252 done
```
Here it clearly expects the primary key of each table to be called "id", and thus the associated sequences created will be ${TABLE}_id_seq, however in this case these fail as the primary keys for these two tables are named differently.
If I modify the primary keys for the dr_gateways and dr_rules tables to be "id", then kamdbctl is able to complete creating the tables.
Looking at the drouting module documentation it appears that the module expects these primary keys to be called "gwid" and "ruleid".
Can someone take a look please.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1256
Module: kamailio
Branch: 5.0
Commit: 445adb0482a95f47dce518ecb403cbb1aa7cd1ac
URL: https://github.com/kamailio/kamailio/commit/445adb0482a95f47dce518ecb403cbb…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-09-29T18:26:08+02:00
kamctl: do not set privileges on drouting tables without id for pgsql
- reported by #1256
(cherry picked from commit 711917153a4be290fd7e405c2c5578fe42ef9aff)
---
Modified: utils/kamctl/kamdbctl.pgsql
---
Diff: https://github.com/kamailio/kamailio/commit/445adb0482a95f47dce518ecb403cbb…
Patch: https://github.com/kamailio/kamailio/commit/445adb0482a95f47dce518ecb403cbb…
---
diff --git a/utils/kamctl/kamdbctl.pgsql b/utils/kamctl/kamdbctl.pgsql
index 059b6faa82..c41354ffc6 100644
--- a/utils/kamctl/kamdbctl.pgsql
+++ b/utils/kamctl/kamdbctl.pgsql
@@ -241,9 +241,9 @@ done
for TABLE in $EXTRA_TABLES; do
sql_query "$1" "GRANT ALL PRIVILEGES ON TABLE $TABLE TO $DBRWUSER;"
sql_query "$1" "GRANT SELECT ON TABLE $TABLE TO $DBROUSER;"
- if [ $TABLE != "route_tree" ] ; then
+ if [ $TABLE != "route_tree" ] && [ $TABLE != "dr_gateways" ] && [ $TABLE != "dr_rules" ] ; then
sql_query "$1" "GRANT ALL PRIVILEGES ON TABLE "$TABLE"_id_seq TO $DBRWUSER;"
- sql_query "$1" "GRANT SELECT ON TABLE "$TABLE"_id_seq TO $DBROUSER;"
+ sql_query "$1" "GRANT SELECT ON TABLE "$TABLE"_id_seq TO $DBROUSER;"
fi
if [ $? -ne 0 ] ; then
merr "Grant privileges to extra tables failed!"
Module: kamailio
Branch: master
Commit: 711917153a4be290fd7e405c2c5578fe42ef9aff
URL: https://github.com/kamailio/kamailio/commit/711917153a4be290fd7e405c2c5578f…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-09-29T18:21:53+02:00
kamctl: do not set privileges on drouting tables without id for pgsql
- reported by #1256
---
Modified: utils/kamctl/kamdbctl.pgsql
---
Diff: https://github.com/kamailio/kamailio/commit/711917153a4be290fd7e405c2c5578f…
Patch: https://github.com/kamailio/kamailio/commit/711917153a4be290fd7e405c2c5578f…
---
diff --git a/utils/kamctl/kamdbctl.pgsql b/utils/kamctl/kamdbctl.pgsql
index 059b6faa82..c41354ffc6 100644
--- a/utils/kamctl/kamdbctl.pgsql
+++ b/utils/kamctl/kamdbctl.pgsql
@@ -241,9 +241,9 @@ done
for TABLE in $EXTRA_TABLES; do
sql_query "$1" "GRANT ALL PRIVILEGES ON TABLE $TABLE TO $DBRWUSER;"
sql_query "$1" "GRANT SELECT ON TABLE $TABLE TO $DBROUSER;"
- if [ $TABLE != "route_tree" ] ; then
+ if [ $TABLE != "route_tree" ] && [ $TABLE != "dr_gateways" ] && [ $TABLE != "dr_rules" ] ; then
sql_query "$1" "GRANT ALL PRIVILEGES ON TABLE "$TABLE"_id_seq TO $DBRWUSER;"
- sql_query "$1" "GRANT SELECT ON TABLE "$TABLE"_id_seq TO $DBROUSER;"
+ sql_query "$1" "GRANT SELECT ON TABLE "$TABLE"_id_seq TO $DBROUSER;"
fi
if [ $? -ne 0 ] ; then
merr "Grant privileges to extra tables failed!"