Merge branch 'master' of ssh://git.freeswitch.org:222/freeswitch
This commit is contained in:
commit
9aa5c5b9b1
|
@ -168,6 +168,7 @@ EndProject
|
|||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libaprutil", "libs\win32\apr-util\libaprutil.2008.vcproj", "{F057DA7F-79E5-4B00-845C-EF446EF055E3}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{F6C55D93-B927-4483-BB69-15AEF3DD2DFF} = {F6C55D93-B927-4483-BB69-15AEF3DD2DFF}
|
||||
{155844C3-EC5F-407F-97A4-A2DDADED9B2F} = {155844C3-EC5F-407F-97A4-A2DDADED9B2F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iksemel", "libs\win32\iksemel\iksemel.2008.vcproj", "{E727E8F6-935D-46FE-8B0E-37834748A0E3}"
|
||||
|
|
|
@ -452,8 +452,7 @@ ftdm_status_t get_calling_num(ftdm_channel_t *ftdmchan, CgPtyNmb *cgPtyNmb);
|
|||
ftdm_status_t get_calling_num2(ftdm_channel_t *ftdmchan, CgPtyNmb *cgPtyNmb);
|
||||
ftdm_status_t get_called_num(ftdm_channel_t *ftdmchan, CdPtyNmb *cdPtyNmb);
|
||||
ftdm_status_t get_redir_num(ftdm_channel_t *ftdmchan, RedirNmb *redirNmb);
|
||||
ftdm_status_t get_calling_name_from_display(ftdm_channel_t *ftdmchan, Display *display);
|
||||
ftdm_status_t get_calling_name_from_usr_usr(ftdm_channel_t *ftdmchan, UsrUsr *usrUsr);
|
||||
ftdm_status_t get_calling_name(ftdm_channel_t *ftdmchan, ConEvnt *conEvnt);
|
||||
ftdm_status_t get_calling_subaddr(ftdm_channel_t *ftdmchan, CgPtySad *cgPtySad);
|
||||
ftdm_status_t get_prog_ind_ie(ftdm_channel_t *ftdmchan, ProgInd *progInd);
|
||||
ftdm_status_t get_facility_ie(ftdm_channel_t *ftdmchan, FacilityStr *facilityStr);
|
||||
|
|
|
@ -135,11 +135,8 @@ void sngisdn_process_con_ind (sngisdn_event_data_t *sngisdn_event)
|
|||
get_calling_subaddr(ftdmchan, &conEvnt->cgPtySad);
|
||||
get_prog_ind_ie(ftdmchan, &conEvnt->progInd);
|
||||
get_facility_ie(ftdmchan, &conEvnt->facilityStr);
|
||||
get_calling_name(ftdmchan, conEvnt);
|
||||
|
||||
if (get_calling_name_from_display(ftdmchan, &conEvnt->display) != FTDM_SUCCESS) {
|
||||
get_calling_name_from_usr_usr(ftdmchan, &conEvnt->usrUsr);
|
||||
}
|
||||
|
||||
ftdm_log_chan(sngisdn_info->ftdmchan, FTDM_LOG_INFO, "Incoming call: Called No:[%s] Calling No:[%s]\n", ftdmchan->caller_data.dnis.digits, ftdmchan->caller_data.cid_num.digits);
|
||||
|
||||
if (conEvnt->bearCap[0].eh.pres) {
|
||||
|
|
|
@ -45,6 +45,9 @@ SNGISDN_STR2ENUM(ftdm_str2ftdm_sngisdn_progind_loc, ftdm_sngisdn_progind_loc2str
|
|||
|
||||
static uint8_t get_trillium_val(ftdm2trillium_t *vals, uint8_t ftdm_val, uint8_t default_val);
|
||||
static uint8_t get_ftdm_val(ftdm2trillium_t *vals, uint8_t trillium_val, uint8_t default_val);
|
||||
ftdm_status_t get_calling_name_from_usr_usr(ftdm_channel_t *ftdmchan, UsrUsr *usrUsr);
|
||||
ftdm_status_t get_calling_name_from_display(ftdm_channel_t *ftdmchan, Display *display);
|
||||
ftdm_status_t get_calling_name_from_ntDisplay(ftdm_channel_t *ftdmchan, NtDisplay *display);
|
||||
|
||||
extern ftdm_sngisdn_data_t g_sngisdn_data;
|
||||
|
||||
|
@ -355,6 +358,20 @@ ftdm_status_t get_calling_name_from_display(ftdm_channel_t *ftdmchan, Display *d
|
|||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
ftdm_status_t get_calling_name_from_ntDisplay(ftdm_channel_t *ftdmchan, NtDisplay *display)
|
||||
{
|
||||
ftdm_caller_data_t *caller_data = &ftdmchan->caller_data;
|
||||
if (display->eh.pres != PRSNT_NODEF) {
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
if (display->dispInfo.pres != PRSNT_NODEF) {
|
||||
return FTDM_FAIL;
|
||||
}
|
||||
|
||||
ftdm_copy_string(caller_data->cid_name, (const char*)display->dispInfo.val, display->dispInfo.len+1);
|
||||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
ftdm_status_t get_calling_name_from_usr_usr(ftdm_channel_t *ftdmchan, UsrUsr *usrUsr)
|
||||
{
|
||||
ftdm_caller_data_t *caller_data = &ftdmchan->caller_data;
|
||||
|
@ -374,6 +391,24 @@ ftdm_status_t get_calling_name_from_usr_usr(ftdm_channel_t *ftdmchan, UsrUsr *us
|
|||
return FTDM_SUCCESS;
|
||||
}
|
||||
|
||||
ftdm_status_t get_calling_name(ftdm_channel_t *ftdmchan, ConEvnt *conEvnt)
|
||||
{
|
||||
ftdm_status_t status = FTDM_FAIL;
|
||||
sngisdn_span_data_t *signal_data = (sngisdn_span_data_t*) ftdmchan->span->signal_data;
|
||||
|
||||
if (signal_data->switchtype == SNGISDN_SWITCH_DMS100) {
|
||||
status = get_calling_name_from_ntDisplay(ftdmchan, &conEvnt->ntDisplay[0]);
|
||||
} else {
|
||||
status = get_calling_name_from_display(ftdmchan, &conEvnt->display);
|
||||
|
||||
}
|
||||
if (status != FTDM_SUCCESS) {
|
||||
status = get_calling_name_from_usr_usr(ftdmchan, &conEvnt->usrUsr);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
ftdm_status_t get_calling_subaddr(ftdm_channel_t *ftdmchan, CgPtySad *cgPtySad)
|
||||
{
|
||||
char subaddress[100];
|
||||
|
@ -694,12 +729,22 @@ ftdm_status_t set_calling_name(ftdm_channel_t *ftdmchan, ConEvnt *conEvnt)
|
|||
/* follow through */
|
||||
case SNGISDN_SWITCH_5ESS:
|
||||
case SNGISDN_SWITCH_4ESS:
|
||||
case SNGISDN_SWITCH_DMS100:
|
||||
conEvnt->display.eh.pres = PRSNT_NODEF;
|
||||
conEvnt->display.dispInfo.pres = PRSNT_NODEF;
|
||||
conEvnt->display.dispInfo.len = len;
|
||||
memcpy(conEvnt->display.dispInfo.val, caller_data->cid_name, len);
|
||||
break;
|
||||
case SNGISDN_SWITCH_DMS100:
|
||||
conEvnt->ntDisplay[0].eh.pres = PRSNT_NODEF;
|
||||
conEvnt->ntDisplay[0].dispTypeNt.pres = PRSNT_NODEF;
|
||||
conEvnt->ntDisplay[0].dispTypeNt.val = 0x01; /* Calling Party Name */
|
||||
conEvnt->ntDisplay[0].assocInfo.pres = PRSNT_NODEF;
|
||||
conEvnt->ntDisplay[0].assocInfo.val = 0x03; /* Included */
|
||||
conEvnt->ntDisplay[0].eh.pres = PRSNT_NODEF;
|
||||
conEvnt->ntDisplay[0].eh.pres = PRSNT_NODEF;
|
||||
conEvnt->ntDisplay[0].dispInfo.pres = PRSNT_NODEF;
|
||||
conEvnt->ntDisplay[0].dispInfo.len = len;
|
||||
memcpy(conEvnt->ntDisplay[0].dispInfo.val, caller_data->cid_name, len);
|
||||
break;
|
||||
case SNGISDN_SWITCH_QSIG:
|
||||
/* It seems like QSIG does not support Caller ID Name */
|
||||
break;
|
||||
|
|
|
@ -584,11 +584,18 @@ uint32_t sngisdn_decode_ie(char *str, uint32_t *str_len, uint8_t current_codeset
|
|||
break;
|
||||
case PROT_Q931_IE_DISPLAY:
|
||||
{
|
||||
uint8_t displayStrOct=2, j;
|
||||
uint8_t j, displayType, assocInfo;
|
||||
char displayStr[82];
|
||||
uint8_t displayNtEnabled = 0;
|
||||
uint8_t displayStrOct = 2;
|
||||
|
||||
memset(displayStr, 0, sizeof(displayStr));
|
||||
|
||||
if(get_bits(OCTET(3),8,8)) {
|
||||
displayType = get_bits(OCTET(3),1,4);
|
||||
assocInfo = get_bits(OCTET(3),5,7);
|
||||
|
||||
displayNtEnabled = 1;
|
||||
displayStrOct++;
|
||||
}
|
||||
j = 0;
|
||||
|
@ -599,8 +606,15 @@ uint32_t sngisdn_decode_ie(char *str, uint32_t *str_len, uint8_t current_codeset
|
|||
displayStr[j++]=ia5[get_bits(OCTET(displayStrOct),1,4)][get_bits(OCTET(displayStrOct),5,8)];
|
||||
}
|
||||
displayStr[j]='\0';
|
||||
*str_len+= sprintf(&str[*str_len], "%s(l:%d)\n",
|
||||
displayStr, len);
|
||||
if (displayNtEnabled) {
|
||||
*str_len+= sprintf(&str[*str_len], "%s(l:%d) type:%s(%d) info:%s(%d)\n",
|
||||
displayStr, len,
|
||||
get_code_2_str(displayType, dcodQ931DisplayTypeTable), displayType,
|
||||
get_code_2_str(assocInfo, dcodQ931AssocInfoTable), assocInfo);
|
||||
} else {
|
||||
*str_len+= sprintf(&str[*str_len], "%s(l:%d)\n",
|
||||
displayStr, len);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PROT_Q931_IE_RESTART_IND:
|
||||
|
|
|
@ -578,5 +578,17 @@ struct code2str dcodQ931TypeOfSubaddressTable[] = {
|
|||
{ -1, "Invalid"},
|
||||
};
|
||||
|
||||
#endif /* __FTMOD_SANGOMA_ISDN_TRACE_H__ */
|
||||
struct code2str dcodQ931DisplayTypeTable[] = {
|
||||
{ 0x00, "Calling Party Name"},
|
||||
{ 0x01, "Connected Party Name"},
|
||||
{ 0x05, "Original Called Party Name"},
|
||||
{ -1, "Invalid"},
|
||||
};
|
||||
|
||||
struct code2str dcodQ931AssocInfoTable[] = {
|
||||
{ 0x00, "Requested"},
|
||||
{ 0x03, "Included"},
|
||||
{ -1, "Invalid"},
|
||||
};
|
||||
|
||||
#endif /* __FTMOD_SANGOMA_ISDN_TRACE_H__ */
|
||||
|
|
|
@ -221,7 +221,7 @@ struct switch_runtime {
|
|||
switch_mutex_t *throttle_mutex;
|
||||
switch_mutex_t *session_hash_mutex;
|
||||
switch_mutex_t *global_mutex;
|
||||
switch_mutex_t *global_var_mutex;
|
||||
switch_thread_rwlock_t *global_var_rwlock;
|
||||
uint32_t sps_total;
|
||||
int32_t sps;
|
||||
int32_t sps_last;
|
||||
|
|
|
@ -4358,7 +4358,10 @@ static switch_call_cause_t sofia_outgoing_channel(switch_core_session_t *session
|
|||
if (tech_pvt->local_url) {
|
||||
switch_channel_set_variable(nchannel, "sip_local_url", tech_pvt->local_url);
|
||||
if (profile->pres_type) {
|
||||
switch_channel_set_variable(nchannel, "presence_id", tech_pvt->local_url);
|
||||
const char *presence_id = switch_channel_get_variable(nchannel, "presence_id");
|
||||
if (zstr(presence_id)) {
|
||||
switch_channel_set_variable(nchannel, "presence_id", tech_pvt->local_url);
|
||||
}
|
||||
}
|
||||
}
|
||||
switch_channel_set_variable(nchannel, "sip_destination_url", tech_pvt->dest);
|
||||
|
|
|
@ -317,8 +317,8 @@ typedef enum {
|
|||
TFLAG_MAX
|
||||
} TFLAGS;
|
||||
|
||||
#define SOFIA_MAX_MSG_QUEUE 26
|
||||
#define SOFIA_MSG_QUEUE_SIZE 20
|
||||
#define SOFIA_MAX_MSG_QUEUE 51
|
||||
#define SOFIA_MSG_QUEUE_SIZE 2000
|
||||
|
||||
struct mod_sofia_globals {
|
||||
switch_memory_pool_t *pool;
|
||||
|
|
|
@ -7501,13 +7501,15 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
|
|||
}
|
||||
|
||||
if (profile->pres_type) {
|
||||
const char *user = switch_str_nil(sip->sip_from->a_url->url_user);
|
||||
const char *host = switch_str_nil(sip->sip_from->a_url->url_host);
|
||||
|
||||
char *tmp = switch_mprintf("%s@%s", user, host);
|
||||
switch_assert(tmp);
|
||||
switch_channel_set_variable(channel, "presence_id", tmp);
|
||||
free(tmp);
|
||||
const char *presence_id = switch_channel_get_variable(channel, "presence_id");
|
||||
if (zstr(presence_id)) {
|
||||
const char *user = switch_str_nil(sip->sip_from->a_url->url_user);
|
||||
const char *host = switch_str_nil(sip->sip_from->a_url->url_host);
|
||||
char *tmp = switch_mprintf("%s@%s", user, host);
|
||||
switch_assert(tmp);
|
||||
switch_channel_set_variable(channel, "presence_id", tmp);
|
||||
free(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -219,6 +219,7 @@ SWITCH_DECLARE(void) switch_channel_perform_set_callstate(switch_channel_t *chan
|
|||
|
||||
if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_CALLSTATE) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Original-Channel-Call-State", switch_channel_callstate2str(o_callstate));
|
||||
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Call-State-Number", "%d", callstate);
|
||||
switch_channel_event_set_data(channel, event);
|
||||
switch_event_fire(&event);
|
||||
}
|
||||
|
|
|
@ -304,9 +304,9 @@ SWITCH_DECLARE(const char *) switch_core_get_switchname(void)
|
|||
SWITCH_DECLARE(char *) switch_core_get_variable(const char *varname)
|
||||
{
|
||||
char *val;
|
||||
switch_mutex_lock(runtime.global_var_mutex);
|
||||
switch_thread_rwlock_rdlock(runtime.global_var_rwlock);
|
||||
val = (char *) switch_event_get_header(runtime.global_vars, varname);
|
||||
switch_mutex_unlock(runtime.global_var_mutex);
|
||||
switch_thread_rwlock_unlock(runtime.global_var_rwlock);
|
||||
return val;
|
||||
}
|
||||
|
||||
|
@ -314,11 +314,11 @@ SWITCH_DECLARE(char *) switch_core_get_variable_dup(const char *varname)
|
|||
{
|
||||
char *val = NULL, *v;
|
||||
|
||||
switch_mutex_lock(runtime.global_var_mutex);
|
||||
switch_thread_rwlock_rdlock(runtime.global_var_rwlock);
|
||||
if ((v = (char *) switch_event_get_header(runtime.global_vars, varname))) {
|
||||
val = strdup(v);
|
||||
}
|
||||
switch_mutex_unlock(runtime.global_var_mutex);
|
||||
switch_thread_rwlock_unlock(runtime.global_var_rwlock);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
@ -327,21 +327,21 @@ SWITCH_DECLARE(char *) switch_core_get_variable_pdup(const char *varname, switch
|
|||
{
|
||||
char *val = NULL, *v;
|
||||
|
||||
switch_mutex_lock(runtime.global_var_mutex);
|
||||
switch_thread_rwlock_rdlock(runtime.global_var_rwlock);
|
||||
if ((v = (char *) switch_event_get_header(runtime.global_vars, varname))) {
|
||||
val = switch_core_strdup(pool, v);
|
||||
}
|
||||
switch_mutex_unlock(runtime.global_var_mutex);
|
||||
switch_thread_rwlock_unlock(runtime.global_var_rwlock);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static void switch_core_unset_variables(void)
|
||||
{
|
||||
switch_mutex_lock(runtime.global_var_mutex);
|
||||
switch_thread_rwlock_wrlock(runtime.global_var_rwlock);
|
||||
switch_event_destroy(&runtime.global_vars);
|
||||
switch_event_create_plain(&runtime.global_vars, SWITCH_EVENT_CHANNEL_DATA);
|
||||
switch_mutex_unlock(runtime.global_var_mutex);
|
||||
switch_thread_rwlock_unlock(runtime.global_var_rwlock);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_set_variable(const char *varname, const char *value)
|
||||
|
@ -349,7 +349,7 @@ SWITCH_DECLARE(void) switch_core_set_variable(const char *varname, const char *v
|
|||
char *val;
|
||||
|
||||
if (varname) {
|
||||
switch_mutex_lock(runtime.global_var_mutex);
|
||||
switch_thread_rwlock_wrlock(runtime.global_var_rwlock);
|
||||
val = (char *) switch_event_get_header(runtime.global_vars, varname);
|
||||
if (val) {
|
||||
switch_event_del_header(runtime.global_vars, varname);
|
||||
|
@ -361,7 +361,7 @@ SWITCH_DECLARE(void) switch_core_set_variable(const char *varname, const char *v
|
|||
} else {
|
||||
switch_event_del_header(runtime.global_vars, varname);
|
||||
}
|
||||
switch_mutex_unlock(runtime.global_var_mutex);
|
||||
switch_thread_rwlock_unlock(runtime.global_var_rwlock);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -370,17 +370,17 @@ SWITCH_DECLARE(switch_bool_t) switch_core_set_var_conditional(const char *varnam
|
|||
char *val;
|
||||
|
||||
if (varname) {
|
||||
switch_mutex_lock(runtime.global_var_mutex);
|
||||
switch_thread_rwlock_wrlock(runtime.global_var_rwlock);
|
||||
val = (char *) switch_event_get_header(runtime.global_vars, varname);
|
||||
|
||||
if (val) {
|
||||
if (!val2 || strcmp(val, val2) != 0) {
|
||||
switch_mutex_unlock(runtime.global_var_mutex);
|
||||
switch_thread_rwlock_unlock(runtime.global_var_rwlock);
|
||||
return SWITCH_FALSE;
|
||||
}
|
||||
switch_event_del_header(runtime.global_vars, varname);
|
||||
} else if (!zstr(val2)) {
|
||||
switch_mutex_unlock(runtime.global_var_mutex);
|
||||
switch_thread_rwlock_unlock(runtime.global_var_rwlock);
|
||||
return SWITCH_FALSE;
|
||||
}
|
||||
|
||||
|
@ -391,7 +391,7 @@ SWITCH_DECLARE(switch_bool_t) switch_core_set_var_conditional(const char *varnam
|
|||
} else {
|
||||
switch_event_del_header(runtime.global_vars, varname);
|
||||
}
|
||||
switch_mutex_unlock(runtime.global_var_mutex);
|
||||
switch_thread_rwlock_unlock(runtime.global_var_rwlock);
|
||||
}
|
||||
return SWITCH_TRUE;
|
||||
}
|
||||
|
@ -1400,7 +1400,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(switch_core_flag_t flags, switc
|
|||
|
||||
switch_mutex_init(&runtime.session_hash_mutex, SWITCH_MUTEX_NESTED, runtime.memory_pool);
|
||||
switch_mutex_init(&runtime.global_mutex, SWITCH_MUTEX_NESTED, runtime.memory_pool);
|
||||
switch_mutex_init(&runtime.global_var_mutex, SWITCH_MUTEX_NESTED, runtime.memory_pool);
|
||||
|
||||
switch_thread_rwlock_create(&runtime.global_var_rwlock, runtime.memory_pool);
|
||||
switch_core_set_globals();
|
||||
switch_core_session_init(runtime.memory_pool);
|
||||
switch_event_create_plain(&runtime.global_vars, SWITCH_EVENT_CHANNEL_DATA);
|
||||
|
|
|
@ -964,6 +964,12 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread,
|
|||
|
||||
switch_mutex_lock(sql_manager.cond_mutex);
|
||||
|
||||
|
||||
switch_cache_db_execute_sql(sql_manager.event_db, "PRAGMA synchronous=OFF;", NULL);
|
||||
switch_cache_db_execute_sql(sql_manager.event_db, "PRAGMA count_changes=OFF;", NULL);
|
||||
switch_cache_db_execute_sql(sql_manager.event_db, "PRAGMA temp_store=MEMORY;", NULL);
|
||||
switch_cache_db_execute_sql(sql_manager.event_db, "PRAGMA journal_mode=OFF;", NULL);
|
||||
|
||||
while (sql_manager.thread_running == 1) {
|
||||
if (save_sql || switch_queue_trypop(sql_manager.sql_queue[0], &pop) == SWITCH_STATUS_SUCCESS ||
|
||||
switch_queue_trypop(sql_manager.sql_queue[1], &pop) == SWITCH_STATUS_SUCCESS) {
|
||||
|
@ -1055,6 +1061,8 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread,
|
|||
#ifdef DEBUG_SQL
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "DONE\n");
|
||||
#endif
|
||||
|
||||
|
||||
iterations = 0;
|
||||
trans = 0;
|
||||
len = 0;
|
||||
|
@ -1062,6 +1070,8 @@ static void *SWITCH_THREAD_FUNC switch_core_sql_thread(switch_thread_t *thread,
|
|||
lc = 0;
|
||||
if (do_sleep) {
|
||||
switch_yield(200000);
|
||||
} else {
|
||||
switch_yield(1000);
|
||||
}
|
||||
wrote = 1;
|
||||
}
|
||||
|
@ -1228,6 +1238,7 @@ static void core_event_handler(switch_event_t *event)
|
|||
);
|
||||
break;
|
||||
case SWITCH_EVENT_CODEC:
|
||||
|
||||
new_sql() =
|
||||
switch_mprintf
|
||||
("update channels set read_codec='%q',read_rate='%q',read_bit_rate='%q',write_codec='%q',write_rate='%q',write_bit_rate='%q' where uuid='%q' and hostname='%q'",
|
||||
|
@ -1322,9 +1333,18 @@ static void core_event_handler(switch_event_t *event)
|
|||
break;
|
||||
case SWITCH_EVENT_CHANNEL_CALLSTATE:
|
||||
{
|
||||
new_sql() = switch_mprintf("update channels set callstate='%q' where uuid='%q' and hostname='%q'",
|
||||
switch_event_get_header_nil(event, "channel-call-state"),
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_switchname());
|
||||
char *num = switch_event_get_header_nil(event, "channel-call-state-number");
|
||||
switch_channel_callstate_t callstate = CCS_DOWN;
|
||||
|
||||
if (num) {
|
||||
callstate = atoi(num);
|
||||
}
|
||||
|
||||
if (callstate != CCS_DOWN && callstate != CCS_HANGUP) {
|
||||
new_sql() = switch_mprintf("update channels set callstate='%q' where uuid='%q' and hostname='%q'",
|
||||
switch_event_get_header_nil(event, "channel-call-state"),
|
||||
switch_event_get_header_nil(event, "unique-id"), switch_core_get_switchname());
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
@ -1338,8 +1358,10 @@ static void core_event_handler(switch_event_t *event)
|
|||
}
|
||||
|
||||
switch (state_i) {
|
||||
case CS_NEW:
|
||||
case CS_HANGUP:
|
||||
case CS_DESTROY:
|
||||
case CS_REPORTING:
|
||||
break;
|
||||
case CS_ROUTING:
|
||||
if ((extra_cols = parse_presence_data_cols(event))) {
|
||||
|
@ -1802,8 +1824,9 @@ switch_status_t switch_core_sqldb_start(switch_memory_pool_t *pool, switch_bool_
|
|||
switch_cache_db_execute_sql(dbh, "drop table tasks", NULL);
|
||||
switch_cache_db_execute_sql(dbh, "PRAGMA synchronous=OFF;", NULL);
|
||||
switch_cache_db_execute_sql(dbh, "PRAGMA count_changes=OFF;", NULL);
|
||||
switch_cache_db_execute_sql(dbh, "PRAGMA cache_size=8000", NULL);
|
||||
switch_cache_db_execute_sql(dbh, "PRAGMA default_cache_size=8000", NULL);
|
||||
switch_cache_db_execute_sql(dbh, "PRAGMA temp_store=MEMORY;", NULL);
|
||||
switch_cache_db_execute_sql(dbh, "PRAGMA journal_mode=OFF;", NULL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue