Created
April 27, 2012 15:28
-
-
Save areski/2510165 to your computer and use it in GitHub Desktop.
Add accountcode to core.db in table channels
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/switch_core_sqldb.c b/src/switch_core_sqldb.c | |
index d436c60..6ec8792 100644 | |
--- a/src/switch_core_sqldb.c | |
+++ b/src/switch_core_sqldb.c | |
@@ -1254,14 +1254,15 @@ static void core_event_handler(switch_event_t *event) | |
break; | |
} | |
case SWITCH_EVENT_CHANNEL_CREATE: | |
- new_sql() = switch_mprintf("insert into channels (uuid,direction,created,created_epoch, name,state,callstate,dialplan,context,hostname) " | |
- "values('%q','%q','%q','%ld','%q','%q','%q','%q','%q','%q')", | |
+ new_sql() = switch_mprintf("insert into channels (uuid,direction,created,created_epoch, name,state,accountcode,callstate,dialplan,context,hostname) " | |
+ "values('%q','%q','%q','%ld','%q','%q','%q','%q','%q','%q','%q')", | |
switch_event_get_header_nil(event, "unique-id"), | |
switch_event_get_header_nil(event, "call-direction"), | |
switch_event_get_header_nil(event, "event-date-local"), | |
(long) switch_epoch_time_now(NULL), | |
switch_event_get_header_nil(event, "channel-name"), | |
switch_event_get_header_nil(event, "channel-state"), | |
+ switch_event_get_header_nil(event, "variable_accountcode"), | |
switch_event_get_header_nil(event, "channel-call-state"), | |
switch_event_get_header_nil(event, "caller-dialplan"), | |
switch_event_get_header_nil(event, "caller-context"), switch_core_get_switchname() | |
@@ -1606,6 +1607,7 @@ static char create_channels_sql[] = | |
" cid_name VARCHAR(1024),\n" | |
" cid_num VARCHAR(256),\n" | |
" ip_addr VARCHAR(256),\n" | |
+ " accountcode VARCHAR(128),\n" | |
" dest VARCHAR(1024),\n" | |
" application VARCHAR(128),\n" | |
" application_data VARCHAR(4096),\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment