FS-11178: [core] return switch_status_t from switch_ivr_intercept_session

This commit is contained in:
Joshua Young 2018-05-31 18:24:32 -04:00 committed by Muteesa Fred
parent fe8c1be575
commit afcb1f8d51
4 changed files with 90 additions and 17 deletions

View File

@ -909,7 +909,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_phrase_macro_event(switch_core_sessio
#define switch_ivr_phrase_macro(session, macro_name, data, lang, args) switch_ivr_phrase_macro_event(session, macro_name, data, NULL, lang, args)
SWITCH_DECLARE(void) switch_ivr_delay_echo(switch_core_session_t *session, uint32_t delay_ms);
SWITCH_DECLARE(switch_status_t) switch_ivr_find_bridged_uuid(const char *uuid, char *b_uuid, switch_size_t blen);
SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session, const char *uuid, switch_bool_t bleg);
SWITCH_DECLARE(switch_status_t) switch_ivr_intercept_session(switch_core_session_t *session, const char *uuid, switch_bool_t bleg);
SWITCH_DECLARE(void) switch_ivr_park_session(switch_core_session_t *session);
SWITCH_DECLARE(switch_status_t) switch_ivr_wait_for_answer(switch_core_session_t *session, switch_core_session_t *peer_session);

View File

@ -20023,10 +20023,10 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_find_parameter(char * jarg1, char *
SWIGEXPORT int SWIGSTDCALL CSharp_switch_true(char * jarg1) {
int jresult ;
char *arg1 = (char *) 0 ;
int result;
switch_bool_t result;
arg1 = (char *)jarg1;
result = (int)switch_true((char const *)arg1);
result = (switch_bool_t)switch_true((char const *)arg1);
jresult = result;
return jresult;
}
@ -34833,6 +34833,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_pass_callee_id(void * jarg1, vo
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_var_false(void * jarg1, char * jarg2) {
int jresult ;
switch_channel_t *arg1 = (switch_channel_t *) 0 ;
char *arg2 = (char *) 0 ;
int result;
arg1 = (switch_channel_t *)jarg1;
arg2 = (char *)jarg2;
result = (int)switch_channel_var_false(arg1,(char const *)arg2);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_channel_var_true(void * jarg1, char * jarg2) {
int jresult ;
switch_channel_t *arg1 = (switch_channel_t *) 0 ;
@ -40954,15 +40968,19 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_find_bridged_uuid(char * jarg1, cha
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_ivr_intercept_session(void * jarg1, char * jarg2, int jarg3) {
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_intercept_session(void * jarg1, char * jarg2, int jarg3) {
int jresult ;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
char *arg2 = (char *) 0 ;
switch_bool_t arg3 ;
switch_status_t result;
arg1 = (switch_core_session_t *)jarg1;
arg2 = (char *)jarg2;
arg3 = (switch_bool_t)jarg3;
switch_ivr_intercept_session(arg1,(char const *)arg2,arg3);
result = (switch_status_t)switch_ivr_intercept_session(arg1,(char const *)arg2,arg3);
jresult = result;
return jresult;
}
@ -41935,6 +41953,35 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_name_get(void *
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_alias_set(void * jarg1, char * jarg2) {
switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ;
char *arg2 = (char *) 0 ;
arg1 = (switch_srtp_crypto_suite_s *)jarg1;
arg2 = (char *)jarg2;
{
if (arg2) {
arg1->alias = (char const *) (new char[strlen((const char *)arg2)+1]);
strcpy((char *)arg1->alias, (const char *)arg2);
} else {
arg1->alias = 0;
}
}
}
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_alias_get(void * jarg1) {
char * jresult ;
switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ;
char *result = 0 ;
arg1 = (switch_srtp_crypto_suite_s *)jarg1;
result = (char *) ((arg1)->alias);
jresult = SWIG_csharp_string_callback((const char *)result);
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_switch_srtp_crypto_suite_t_type_set(void * jarg1, int jarg2) {
switch_srtp_crypto_suite_s *arg1 = (switch_srtp_crypto_suite_s *) 0 ;
switch_rtp_crypto_key_type_t arg2 ;

View File

@ -4019,8 +4019,8 @@ else
return ret;
}
public static int switch_true(string expr) {
int ret = freeswitchPINVOKE.switch_true(expr);
public static switch_bool_t switch_true(string expr) {
switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_true(expr);
return ret;
}
@ -4842,6 +4842,11 @@ else
return ret;
}
public static int switch_channel_var_false(SWIGTYPE_p_switch_channel channel, string variable) {
int ret = freeswitchPINVOKE.switch_channel_var_false(SWIGTYPE_p_switch_channel.getCPtr(channel), variable);
return ret;
}
public static int switch_channel_var_true(SWIGTYPE_p_switch_channel channel, string variable) {
int ret = freeswitchPINVOKE.switch_channel_var_true(SWIGTYPE_p_switch_channel.getCPtr(channel), variable);
return ret;
@ -6397,8 +6402,9 @@ else
return ret;
}
public static void switch_ivr_intercept_session(SWIGTYPE_p_switch_core_session session, string uuid, switch_bool_t bleg) {
freeswitchPINVOKE.switch_ivr_intercept_session(SWIGTYPE_p_switch_core_session.getCPtr(session), uuid, (int)bleg);
public static switch_status_t switch_ivr_intercept_session(SWIGTYPE_p_switch_core_session session, string uuid, switch_bool_t bleg) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_intercept_session(SWIGTYPE_p_switch_core_session.getCPtr(session), uuid, (int)bleg);
return ret;
}
public static void switch_ivr_park_session(SWIGTYPE_p_switch_core_session session) {
@ -16707,6 +16713,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_pass_callee_id")]
public static extern int switch_channel_pass_callee_id(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_var_false")]
public static extern int switch_channel_var_false(HandleRef jarg1, string jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_var_true")]
public static extern int switch_channel_var_true(HandleRef jarg1, string jarg2);
@ -18022,7 +18031,7 @@ class freeswitchPINVOKE {
public static extern int switch_ivr_find_bridged_uuid(string jarg1, string jarg2, HandleRef jarg3);
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_intercept_session")]
public static extern void switch_ivr_intercept_session(HandleRef jarg1, string jarg2, int jarg3);
public static extern int switch_ivr_intercept_session(HandleRef jarg1, string jarg2, int jarg3);
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_park_session")]
public static extern void switch_ivr_park_session(HandleRef jarg1);
@ -18225,6 +18234,12 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_name_get")]
public static extern string switch_srtp_crypto_suite_t_name_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_alias_set")]
public static extern void switch_srtp_crypto_suite_t_alias_set(HandleRef jarg1, string jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_alias_get")]
public static extern string switch_srtp_crypto_suite_t_alias_get(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_srtp_crypto_suite_t_type_set")]
public static extern void switch_srtp_crypto_suite_t_type_set(HandleRef jarg1, int jarg2);
@ -43150,6 +43165,16 @@ public class switch_srtp_crypto_suite_t : IDisposable {
}
}
public string alias {
set {
freeswitchPINVOKE.switch_srtp_crypto_suite_t_alias_set(swigCPtr, value);
}
get {
string ret = freeswitchPINVOKE.switch_srtp_crypto_suite_t_alias_get(swigCPtr);
return ret;
}
}
public switch_rtp_crypto_key_type_t type {
set {
freeswitchPINVOKE.switch_srtp_crypto_suite_t_type_set(swigCPtr, (int)value);

View File

@ -2204,25 +2204,26 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_find_bridged_uuid(const char *uuid, c
}
SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session, const char *uuid, switch_bool_t bleg)
SWITCH_DECLARE(switch_status_t) switch_ivr_intercept_session(switch_core_session_t *session, const char *uuid, switch_bool_t bleg)
{
switch_core_session_t *rsession, *bsession = NULL;
switch_channel_t *channel, *rchannel, *bchannel = NULL;
const char *buuid, *var;
char brto[SWITCH_UUID_FORMATTED_LENGTH + 1] = "";
switch_status_t status = SWITCH_STATUS_FALSE;
if (bleg) {
if (switch_ivr_find_bridged_uuid(uuid, brto, sizeof(brto)) == SWITCH_STATUS_SUCCESS) {
uuid = switch_core_session_strdup(session, brto);
} else {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "no uuid bridged to %s\n", uuid);
return;
return status;
}
}
if (zstr(uuid) || !(rsession = switch_core_session_locate(uuid))) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "no uuid %s\n", uuid);
return;
return status;
}
channel = switch_core_session_get_channel(session);
@ -2236,14 +2237,14 @@ SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session
if ((var = switch_channel_get_variable(channel, "intercept_unbridged_only")) && switch_true(var)) {
if ((switch_channel_test_flag(rchannel, CF_BRIDGED))) {
switch_core_session_rwunlock(rsession);
return;
return status;
}
}
if ((var = switch_channel_get_variable(channel, "intercept_unanswered_only")) && switch_true(var)) {
if ((switch_channel_test_flag(rchannel, CF_ANSWERED))) {
switch_core_session_rwunlock(rsession);
return;
return status;
}
}
@ -2275,7 +2276,7 @@ SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session
}
switch_channel_set_flag(rchannel, CF_INTERCEPTED);
switch_ivr_uuid_bridge(switch_core_session_get_uuid(session), uuid);
status = switch_ivr_uuid_bridge(switch_core_session_get_uuid(session), uuid);
switch_core_session_rwunlock(rsession);
if (bsession) {
@ -2283,7 +2284,7 @@ SWITCH_DECLARE(void) switch_ivr_intercept_session(switch_core_session_t *session
switch_core_session_rwunlock(bsession);
}
return status;
}