Compare commits
4 Commits
e86298a282
...
21dc0357d7
Author | SHA1 | Date |
---|---|---|
Bhavin Moradiya | 21dc0357d7 | |
Aron Podrigal | 5cb74797fe | |
Bhavin Moradiya | 30ee3200ce | |
bmoradiy | 2a10e4efa1 |
|
@ -1641,6 +1641,7 @@ typedef enum {
|
|||
CF_VIDEO_READ_TAPPED,
|
||||
CF_VIDEO_WRITE_TAPPED,
|
||||
CF_DEVICES_CHANGED,
|
||||
CF_LATE_OFFER,
|
||||
/* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
|
||||
/* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */
|
||||
CF_FLAG_MAX
|
||||
|
|
|
@ -106,6 +106,22 @@ char * pgsql_handle_get_error(switch_pgsql_handle_t *handle)
|
|||
return err_str;
|
||||
}
|
||||
|
||||
void pgsql_handle_set_error_if_not_set(switch_pgsql_handle_t *handle, char **err)
|
||||
{
|
||||
char *err_str;
|
||||
|
||||
if (err && !(*err)) {
|
||||
err_str = pgsql_handle_get_error(handle);
|
||||
|
||||
if (zstr(err_str)) {
|
||||
switch_safe_free(err_str);
|
||||
err_str = strdup((char *)"SQL ERROR!");
|
||||
}
|
||||
|
||||
*err = err_str;
|
||||
}
|
||||
}
|
||||
|
||||
static int db_is_up(switch_pgsql_handle_t *handle)
|
||||
{
|
||||
int ret = 0;
|
||||
|
@ -553,8 +569,15 @@ switch_status_t pgsql_handle_exec_detailed(const char *file, const char *func, i
|
|||
goto error;
|
||||
}
|
||||
|
||||
return pgsql_finish_results(handle);
|
||||
if (pgsql_finish_results(handle) != SWITCH_STATUS_SUCCESS) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
|
||||
error:
|
||||
pgsql_handle_set_error_if_not_set(handle, err);
|
||||
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
|
@ -630,6 +653,7 @@ done:
|
|||
|
||||
pgsql_free_result(&result);
|
||||
if (pgsql_finish_results(handle) != SWITCH_STATUS_SUCCESS) {
|
||||
pgsql_handle_set_error_if_not_set(handle, err);
|
||||
sstatus = SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
|
@ -638,6 +662,7 @@ done:
|
|||
error:
|
||||
|
||||
pgsql_free_result(&result);
|
||||
pgsql_handle_set_error_if_not_set(handle, err);
|
||||
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
@ -1050,6 +1075,8 @@ switch_status_t pgsql_handle_callback_exec_detailed(const char *file, const char
|
|||
return SWITCH_STATUS_SUCCESS;
|
||||
error:
|
||||
|
||||
pgsql_handle_set_error_if_not_set(handle, err);
|
||||
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -7496,6 +7496,10 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
|
|||
if (r_sdp) {
|
||||
switch_channel_set_variable(channel, SWITCH_R_SDP_VARIABLE, r_sdp);
|
||||
|
||||
if (ss_state == nua_callstate_ready && status == 200) {
|
||||
switch_channel_set_flag(tech_pvt->channel, CF_LATE_OFFER);
|
||||
}
|
||||
|
||||
if (!(profile->mndlb & SM_NDLB_ALLOW_NONDUP_SDP) || (!zstr(tech_pvt->mparams.remote_sdp_str) && !strcmp(tech_pvt->mparams.remote_sdp_str, r_sdp))) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Duplicate SDP\n%s\n", r_sdp);
|
||||
is_dup_sdp = 1;
|
||||
|
|
|
@ -1731,8 +1731,12 @@ SWITCH_DECLARE(int) switch_core_session_check_incoming_crypto(switch_core_sessio
|
|||
}
|
||||
switch_channel_set_variable(session->channel, varname, vval);
|
||||
|
||||
switch_core_media_build_crypto(session->media_handle, type, crypto_tag, ctype, SWITCH_RTP_CRYPTO_SEND, 1, use_alias);
|
||||
switch_rtp_add_crypto_key(engine->rtp_session, SWITCH_RTP_CRYPTO_SEND, atoi(crypto), &engine->ssec[engine->crypto_type]);
|
||||
if (!switch_channel_test_flag(session->channel, CF_LATE_OFFER) || !switch_true(switch_channel_get_variable(session->channel, "disable_crypto_rekeying_on_late_offer"))) {
|
||||
switch_core_media_build_crypto(session->media_handle, type, crypto_tag, ctype, SWITCH_RTP_CRYPTO_SEND, 1, use_alias);
|
||||
switch_rtp_add_crypto_key(engine->rtp_session, SWITCH_RTP_CRYPTO_SEND, atoi(crypto), &engine->ssec[engine->crypto_type]);
|
||||
}
|
||||
switch_channel_clear_flag(session->channel, CF_LATE_OFFER);
|
||||
|
||||
}
|
||||
|
||||
if (a && b && !strncasecmp(a, b, 23)) {
|
||||
|
|
Loading…
Reference in New Issue