Skip to content

Commit

Permalink
Removed wrong "NOT NULL" constraint over the contact DB fields
Browse files Browse the repository at this point in the history
The code actually handles the case of NULL callee / caller contacts, so DB must allow NULL values.
  • Loading branch information
bogdan-iancu committed Jun 3, 2016
1 parent 5819b0f commit 399ebd1
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions db/schema/dialog.xml
Expand Up @@ -134,13 +134,15 @@
<name>caller_contact</name>
<type>string</type>
<size>&uri_len;</size>
<null/>
<description>Caller's contact uri.</description>
</column>

<column>
<name>callee_contact</name>
<type>string</type>
<size>&uri_len;</size>
<null/>
<description>Callee's contact uri.</description>
</column>

Expand Down
2 changes: 1 addition & 1 deletion scripts/dbtext/opensips/dialog
@@ -1 +1 @@
dlg_id(long) callid(string) from_uri(string) from_tag(string) to_uri(string) to_tag(string) mangled_from_uri(string,null) mangled_to_uri(string,null) caller_cseq(string) callee_cseq(string) caller_ping_cseq(int) callee_ping_cseq(int) caller_route_set(string,null) callee_route_set(string,null) caller_contact(string) callee_contact(string) caller_sock(string) callee_sock(string) state(int) start_time(int) timeout(int) vars(blob,null) profiles(string,null) script_flags(int) module_flags(int) flags(int)
dlg_id(long) callid(string) from_uri(string) from_tag(string) to_uri(string) to_tag(string) mangled_from_uri(string,null) mangled_to_uri(string,null) caller_cseq(string) callee_cseq(string) caller_ping_cseq(int) callee_ping_cseq(int) caller_route_set(string,null) callee_route_set(string,null) caller_contact(string,null) callee_contact(string,null) caller_sock(string) callee_sock(string) state(int) start_time(int) timeout(int) vars(blob,null) profiles(string,null) script_flags(int) module_flags(int) flags(int)
4 changes: 2 additions & 2 deletions scripts/mysql/dialog-create.sql
Expand Up @@ -14,8 +14,8 @@ CREATE TABLE dialog (
callee_ping_cseq INT(11) UNSIGNED NOT NULL,
caller_route_set TEXT(512),
callee_route_set TEXT(512),
caller_contact CHAR(128) NOT NULL,
callee_contact CHAR(128) NOT NULL,
caller_contact CHAR(128),
callee_contact CHAR(128),
caller_sock CHAR(64) NOT NULL,
callee_sock CHAR(64) NOT NULL,
state INT(10) UNSIGNED NOT NULL,
Expand Down
4 changes: 2 additions & 2 deletions scripts/postgres/dialog-create.sql
Expand Up @@ -14,8 +14,8 @@ CREATE TABLE dialog (
callee_ping_cseq INTEGER NOT NULL,
caller_route_set TEXT,
callee_route_set TEXT,
caller_contact VARCHAR(128) NOT NULL,
callee_contact VARCHAR(128) NOT NULL,
caller_contact VARCHAR(128),
callee_contact VARCHAR(128),
caller_sock VARCHAR(64) NOT NULL,
callee_sock VARCHAR(64) NOT NULL,
state INTEGER NOT NULL,
Expand Down
4 changes: 2 additions & 2 deletions scripts/sqlite/dialog-create.sql
Expand Up @@ -14,8 +14,8 @@ CREATE TABLE dialog (
callee_ping_cseq INTEGER NOT NULL,
caller_route_set TEXT(512),
callee_route_set TEXT(512),
caller_contact CHAR(128) NOT NULL,
callee_contact CHAR(128) NOT NULL,
caller_contact CHAR(128),
callee_contact CHAR(128),
caller_sock CHAR(64) NOT NULL,
callee_sock CHAR(64) NOT NULL,
state INTEGER NOT NULL,
Expand Down

0 comments on commit 399ebd1

Please sign in to comment.