mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 05:02:10 +00:00
FSCORE-612 with mods
This commit is contained in:
@@ -3966,10 +3966,10 @@ SWITCH_STANDARD_API(uuid_dump_function)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#define GLOBAL_SETVAR_SYNTAX "<var> <value>"
|
||||
#define GLOBAL_SETVAR_SYNTAX "<var> <value> [<value2>]"
|
||||
SWITCH_STANDARD_API(global_setvar_function)
|
||||
{
|
||||
char *mycmd = NULL, *argv[2] = { 0 };
|
||||
char *mycmd = NULL, *argv[3] = { 0 };
|
||||
int argc = 0;
|
||||
|
||||
if (!zstr(cmd) && (mycmd = strdup(cmd))) {
|
||||
@@ -3977,11 +3977,21 @@ SWITCH_STANDARD_API(global_setvar_function)
|
||||
if (argc > 0 && !zstr(argv[0])) {
|
||||
char *var_name = argv[0];
|
||||
char *var_value = argv[1];
|
||||
char *var_value2 = argv[2];
|
||||
|
||||
if (zstr(var_value)) {
|
||||
var_value = NULL;
|
||||
}
|
||||
switch_core_set_variable(var_name, var_value);
|
||||
|
||||
if (zstr(var_value2)) {
|
||||
var_value2 = NULL;
|
||||
}
|
||||
|
||||
if (var_value2) {
|
||||
switch_core_set_var_conditional(var_name, var_value, var_value2);
|
||||
} else {
|
||||
switch_core_set_variable(var_name, var_value);
|
||||
}
|
||||
stream->write_function(stream, "+OK");
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -3389,6 +3389,29 @@ SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_rtcp_hdr_t(void * jarg1) {
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_T38FaxVersion_set(void * jarg1, unsigned short jarg2) {
|
||||
switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
|
||||
uint16_t arg2 ;
|
||||
|
||||
arg1 = (switch_t38_options_t *)jarg1;
|
||||
arg2 = (uint16_t)jarg2;
|
||||
if (arg1) (arg1)->T38FaxVersion = arg2;
|
||||
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned short SWIGSTDCALL CSharp_switch_t38_options_t_T38FaxVersion_get(void * jarg1) {
|
||||
unsigned short jresult ;
|
||||
switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
|
||||
uint16_t result;
|
||||
|
||||
arg1 = (switch_t38_options_t *)jarg1;
|
||||
result = (uint16_t) ((arg1)->T38FaxVersion);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_t38_options_t_T38MaxBitRate_set(void * jarg1, unsigned long jarg2) {
|
||||
switch_t38_options_t *arg1 = (switch_t38_options_t *) 0 ;
|
||||
uint32_t arg2 ;
|
||||
@@ -6962,6 +6985,22 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_set_variable(char * jarg1, char *
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_set_var_conditional(char * jarg1, char * jarg2, char * jarg3) {
|
||||
int jresult ;
|
||||
char *arg1 = (char *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
char *arg3 = (char *) 0 ;
|
||||
switch_bool_t result;
|
||||
|
||||
arg1 = (char *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
arg3 = (char *)jarg3;
|
||||
result = (switch_bool_t)switch_core_set_var_conditional((char const *)arg1,(char const *)arg2,(char const *)arg3);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_core_dump_variables(void * jarg1) {
|
||||
switch_stream_handle_t *arg1 = (switch_stream_handle_t *) 0 ;
|
||||
|
||||
@@ -26562,6 +26601,18 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_rtp_set_max_missed_packets(void * jarg
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_udptl_mode(void * jarg1) {
|
||||
int jresult ;
|
||||
switch_rtp_t *arg1 = (switch_rtp_t *) 0 ;
|
||||
switch_status_t result;
|
||||
|
||||
arg1 = (switch_rtp_t *)jarg1;
|
||||
result = (switch_status_t)switch_rtp_udptl_mode(arg1);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_set_local_address(void * jarg1, char * jarg2, unsigned short jarg3, void * jarg4) {
|
||||
int jresult ;
|
||||
switch_rtp_t *arg1 = (switch_rtp_t *) 0 ;
|
||||
|
||||
@@ -1308,6 +1308,11 @@ public class freeswitch {
|
||||
freeswitchPINVOKE.switch_core_set_variable(varname, value);
|
||||
}
|
||||
|
||||
public static switch_bool_t switch_core_set_var_conditional(string varname, string value, string val2) {
|
||||
switch_bool_t ret = (switch_bool_t)freeswitchPINVOKE.switch_core_set_var_conditional(varname, value, val2);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static void switch_core_dump_variables(switch_stream_handle stream) {
|
||||
freeswitchPINVOKE.switch_core_dump_variables(switch_stream_handle.getCPtr(stream));
|
||||
}
|
||||
@@ -4110,6 +4115,11 @@ public class freeswitch {
|
||||
freeswitchPINVOKE.switch_rtp_set_max_missed_packets(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), max);
|
||||
}
|
||||
|
||||
public static switch_status_t switch_rtp_udptl_mode(SWIGTYPE_p_switch_rtp rtp_session) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_udptl_mode(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session));
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static switch_status_t switch_rtp_set_local_address(SWIGTYPE_p_switch_rtp rtp_session, string host, ushort port, ref string err) {
|
||||
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_set_local_address(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), host, port, ref err);
|
||||
return ret;
|
||||
@@ -5953,6 +5963,12 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_delete_switch_rtcp_hdr_t")]
|
||||
public static extern void delete_switch_rtcp_hdr_t(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38FaxVersion_set")]
|
||||
public static extern void switch_t38_options_t_T38FaxVersion_set(HandleRef jarg1, ushort jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38FaxVersion_get")]
|
||||
public static extern ushort switch_t38_options_t_T38FaxVersion_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_t38_options_t_T38MaxBitRate_set")]
|
||||
public static extern void switch_t38_options_t_T38MaxBitRate_set(HandleRef jarg1, uint jarg2);
|
||||
|
||||
@@ -6814,6 +6830,9 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_set_variable")]
|
||||
public static extern void switch_core_set_variable(string jarg1, string jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_set_var_conditional")]
|
||||
public static extern int switch_core_set_var_conditional(string jarg1, string jarg2, string jarg3);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_dump_variables")]
|
||||
public static extern void switch_core_dump_variables(HandleRef jarg1);
|
||||
|
||||
@@ -11353,6 +11372,9 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_set_max_missed_packets")]
|
||||
public static extern void switch_rtp_set_max_missed_packets(HandleRef jarg1, uint jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_udptl_mode")]
|
||||
public static extern int switch_rtp_udptl_mode(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_set_local_address")]
|
||||
public static extern int switch_rtp_set_local_address(HandleRef jarg1, string jarg2, ushort jarg3, ref string jarg4);
|
||||
|
||||
@@ -19815,7 +19837,8 @@ namespace FreeSWITCH.Native {
|
||||
namespace FreeSWITCH.Native {
|
||||
|
||||
public enum switch_channel_app_flag_t {
|
||||
CF_APP_TAGGED = (1 << 0)
|
||||
CF_APP_TAGGED = (1 << 0),
|
||||
CF_APP_T38 = (1 << 1)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21622,6 +21645,8 @@ public enum switch_core_session_message_types_t {
|
||||
SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC,
|
||||
SWITCH_MESSAGE_INDICATE_APPLICATION_EXEC_COMPLETE,
|
||||
SWITCH_MESSAGE_INDICATE_PHONE_EVENT,
|
||||
SWITCH_MESSAGE_INDICATE_T38_DESCRIPTION,
|
||||
SWITCH_MESSAGE_INDICATE_UDPTL_MODE,
|
||||
SWITCH_MESSAGE_INVALID
|
||||
}
|
||||
|
||||
@@ -22508,6 +22533,7 @@ public class switch_dtmf_t : IDisposable {
|
||||
namespace FreeSWITCH.Native {
|
||||
|
||||
[System.Flags] public enum switch_eavesdrop_flag_enum_t {
|
||||
ED_NONE = 0,
|
||||
ED_MUX_READ = (1 << 0),
|
||||
ED_MUX_WRITE = (1 << 1),
|
||||
ED_DTMF = (1 << 2)
|
||||
@@ -23952,7 +23978,8 @@ namespace FreeSWITCH.Native {
|
||||
SFF_RFC2833 = (1 << 4),
|
||||
SFF_PROXY_PACKET = (1 << 5),
|
||||
SFF_DYNAMIC = (1 << 6),
|
||||
SFF_ZRTP = (1 << 7)
|
||||
SFF_ZRTP = (1 << 7),
|
||||
SFF_UDPTL_PACKET = (1 << 8)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26182,7 +26209,7 @@ namespace FreeSWITCH.Native {
|
||||
SWITCH_RTP_FLAG_GOOGLEHACK = (1 << 8),
|
||||
SWITCH_RTP_FLAG_VAD = (1 << 9),
|
||||
SWITCH_RTP_FLAG_BREAK = (1 << 10),
|
||||
SWITCH_RTP_FLAG_MINI = (1 << 11),
|
||||
SWITCH_RTP_FLAG_UDPTL = (1 << 11),
|
||||
SWITCH_RTP_FLAG_DATAWAIT = (1 << 12),
|
||||
SWITCH_RTP_FLAG_BUGGY_2833 = (1 << 13),
|
||||
SWITCH_RTP_FLAG_PASS_RFC2833 = (1 << 14),
|
||||
@@ -27962,6 +27989,16 @@ public class switch_t38_options_t : IDisposable {
|
||||
}
|
||||
}
|
||||
|
||||
public ushort T38FaxVersion {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_t38_options_t_T38FaxVersion_set(swigCPtr, value);
|
||||
}
|
||||
get {
|
||||
ushort ret = freeswitchPINVOKE.switch_t38_options_t_T38FaxVersion_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public uint T38MaxBitRate {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_t38_options_t_T38MaxBitRate_set(swigCPtr, value);
|
||||
|
||||
@@ -3331,12 +3331,23 @@ static JSBool js_log(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, j
|
||||
|
||||
static JSBool js_global_set(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
|
||||
{
|
||||
char *var_name = NULL, *val = NULL;
|
||||
char *var_name = NULL, *val = NULL, *val2 = NULL;
|
||||
JSBool tf = JS_TRUE;
|
||||
if (argc > 1) {
|
||||
var_name = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
|
||||
val = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
|
||||
switch_core_set_variable(var_name, val);
|
||||
return JS_TRUE;
|
||||
if (argc == 2) {
|
||||
switch_core_set_variable(var_name, val);
|
||||
*rval = BOOLEAN_TO_JSVAL(JS_TRUE);
|
||||
return JS_TRUE;
|
||||
} else {
|
||||
val2 = JS_GetStringBytes(JS_ValueToString(cx, argv[2]));
|
||||
if (switch_core_set_var_conditional(var_name, val, val2) != SWITCH_TRUE) {
|
||||
tf = JS_FALSE;
|
||||
}
|
||||
*rval = BOOLEAN_TO_JSVAL(tf);
|
||||
return JS_TRUE;
|
||||
}
|
||||
}
|
||||
/* this is so the wrong error message to throw for this one */
|
||||
eval_some_js("~throw new Error(\"var name not supplied!\");", cx, obj, rval);
|
||||
|
||||
Reference in New Issue
Block a user