Skip to content

Commit

Permalink
usrloc DB schema: Extend location.contact from CHAR(255) to TEXT
Browse files Browse the repository at this point in the history
This extension is especially useful with RFC 8599 (SIP Push
Notifications), which may lead to sizeable Contact header URIs, often
reaching 300+ bytes in size.

Credits to John Quick for the suggestion!

(cherry picked from commit ec09a18)
  • Loading branch information
liviuchircu committed Aug 17, 2021
1 parent c266e8c commit 73c5ce1
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 10 deletions.
4 changes: 1 addition & 3 deletions db/schema/location.xml
Expand Up @@ -47,9 +47,7 @@

<column id="contact">
<name>contact</name>
<type>string</type>
<size>&hf_len;</size>
<default/>
<type>text</type>
<description>Contact header field value provides a URI whoses meaning depends on the type of request or response it is in.</description>
</column>

Expand Down
2 changes: 1 addition & 1 deletion scripts/db_berkeley/opensips/location
Expand Up @@ -7,4 +7,4 @@ METADATA_READONLY
METADATA_LOGFLAGS
0
METADATA_DEFAULTS
NIL|''|NULL|''|NULL|NULL|NIL|1.0|'Default-Call-ID'|13|'1900-01-01 00:00:01'|0|NULL|''|NULL|NULL|NULL|NULL|NULL
NIL|''|NULL|NIL|NULL|NULL|NIL|1.0|'Default-Call-ID'|13|'1900-01-01 00:00:01'|0|NULL|''|NULL|NULL|NULL|NULL|NULL
2 changes: 1 addition & 1 deletion scripts/mysql/usrloc-create.sql
Expand Up @@ -3,7 +3,7 @@ CREATE TABLE location (
contact_id BIGINT(10) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
username CHAR(64) DEFAULT '' NOT NULL,
domain CHAR(64) DEFAULT NULL,
contact CHAR(255) DEFAULT '' NOT NULL,
contact TEXT NOT NULL,
received CHAR(255) DEFAULT NULL,
path CHAR(255) DEFAULT NULL,
expires INT(10) UNSIGNED NOT NULL,
Expand Down
2 changes: 1 addition & 1 deletion scripts/oracle/usrloc-create.sql
Expand Up @@ -3,7 +3,7 @@ CREATE TABLE location (
contact_id BIGINT(10) PRIMARY KEY,
username VARCHAR2(64) DEFAULT '',
domain VARCHAR2(64) DEFAULT NULL,
contact VARCHAR2(255) DEFAULT '',
contact CLOB,
received VARCHAR2(255) DEFAULT NULL,
path VARCHAR2(255) DEFAULT NULL,
expires NUMBER(10),
Expand Down
2 changes: 1 addition & 1 deletion scripts/pi_http/pi_framework.xml
Expand Up @@ -1045,7 +1045,7 @@
<column><field>contact_id</field><type>DB_BIGINT</type></column>
<column><field>username</field><type>DB_STR</type></column>
<column><field>domain</field><type>DB_STR</type></column>
<column><field>contact</field><type>DB_STR</type></column>
<column><field>contact</field><type>DB_BLOB</type></column>
<column><field>received</field><type>DB_STR</type></column>
<column><field>path</field><type>DB_STR</type></column>
<column><field>expires</field><type>DB_INT</type></column>
Expand Down
2 changes: 1 addition & 1 deletion scripts/pi_http/usrloc-table
Expand Up @@ -5,7 +5,7 @@
<column><field>contact_id</field><type>DB_BIGINT</type></column>
<column><field>username</field><type>DB_STR</type></column>
<column><field>domain</field><type>DB_STR</type></column>
<column><field>contact</field><type>DB_STR</type></column>
<column><field>contact</field><type>DB_BLOB</type></column>
<column><field>received</field><type>DB_STR</type></column>
<column><field>path</field><type>DB_STR</type></column>
<column><field>expires</field><type>DB_INT</type></column>
Expand Down
2 changes: 1 addition & 1 deletion scripts/postgres/usrloc-create.sql
Expand Up @@ -3,7 +3,7 @@ CREATE TABLE location (
contact_id BIGSERIAL PRIMARY KEY NOT NULL,
username VARCHAR(64) DEFAULT '' NOT NULL,
domain VARCHAR(64) DEFAULT NULL,
contact VARCHAR(255) DEFAULT '' NOT NULL,
contact TEXT NOT NULL,
received VARCHAR(255) DEFAULT NULL,
path VARCHAR(255) DEFAULT NULL,
expires INTEGER NOT NULL,
Expand Down
2 changes: 1 addition & 1 deletion scripts/sqlite/usrloc-create.sql
Expand Up @@ -3,7 +3,7 @@ CREATE TABLE location (
contact_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
username CHAR(64) DEFAULT '' NOT NULL,
domain CHAR(64) DEFAULT NULL,
contact CHAR(255) DEFAULT '' NOT NULL,
contact TEXT NOT NULL,
received CHAR(255) DEFAULT NULL,
path CHAR(255) DEFAULT NULL,
expires INTEGER NOT NULL,
Expand Down

0 comments on commit 73c5ce1

Please sign in to comment.