Merge branch 'master' of git@git.freeswitch.org:freeswitch

This commit is contained in:
Joao Mesquita 2010-12-21 23:41:42 -03:00
commit 48ed9c2c5d
7 changed files with 68 additions and 16 deletions

View File

@ -622,7 +622,7 @@ SWITCH_DECLARE(unsigned int) switch_separate_string(_In_ char *buf, char delim,
SWITCH_DECLARE(unsigned int) switch_separate_string_string(char *buf, char *delim, _Post_count_(return) char **array, unsigned int arraylen); SWITCH_DECLARE(unsigned int) switch_separate_string_string(char *buf, char *delim, _Post_count_(return) char **array, unsigned int arraylen);
SWITCH_DECLARE(switch_bool_t) switch_is_number(const char *str); SWITCH_DECLARE(switch_bool_t) switch_is_number(const char *str);
SWITCH_DECLARE(char *) switch_strip_spaces(const char *str); SWITCH_DECLARE(char *) switch_strip_spaces(char *str, switch_bool_t dup);
SWITCH_DECLARE(char *) switch_strip_whitespace(const char *str); SWITCH_DECLARE(char *) switch_strip_whitespace(const char *str);
SWITCH_DECLARE(char *) switch_strip_commas(char *in, char *out, switch_size_t len); SWITCH_DECLARE(char *) switch_strip_commas(char *in, char *out, switch_size_t len);
SWITCH_DECLARE(char *) switch_strip_nonnumerics(char *in, char *out, switch_size_t len); SWITCH_DECLARE(char *) switch_strip_nonnumerics(char *in, char *out, switch_size_t len);

View File

@ -1428,8 +1428,8 @@ SWITCH_STANDARD_API(cond_function)
int a_is_num, b_is_num; int a_is_num, b_is_num;
*expr++ = '\0'; *expr++ = '\0';
b = expr; b = expr;
s_a = switch_strip_spaces(a); s_a = switch_strip_spaces(a, SWITCH_TRUE);
s_b = switch_strip_spaces(b); s_b = switch_strip_spaces(b, SWITCH_TRUE);
a_is_num = switch_is_number(s_a); a_is_num = switch_is_number(s_a);
b_is_num = switch_is_number(s_b); b_is_num = switch_is_number(s_b);

View File

@ -1065,6 +1065,7 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
if (exptime && v_event && *v_event) { if (exptime && v_event && *v_event) {
char *exp_var; char *exp_var;
char *allow_multireg = NULL; char *allow_multireg = NULL;
int force_connectile = 0;
allow_multireg = switch_event_get_header(*v_event, "sip-allow-multiple-registrations"); allow_multireg = switch_event_get_header(*v_event, "sip-allow-multiple-registrations");
if (allow_multireg && switch_false(allow_multireg)) { if (allow_multireg && switch_false(allow_multireg)) {
@ -1081,8 +1082,13 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
to_user = force_user; to_user = force_user;
} }
if ((v_contact_str = switch_event_get_header(*v_event, "sip-force-contact"))) { if (profile->rport_level == 3 && sip->sip_user_agent &&
if (!strcasecmp(v_contact_str, "NDLB-connectile-dysfunction-2.0")) { sip->sip_user_agent->g_string && !strncasecmp(sip->sip_user_agent->g_string, "Polycom", 7)) {
force_connectile = 1;
}
if ((v_contact_str = switch_event_get_header(*v_event, "sip-force-contact")) || force_connectile) {
if ((!strcasecmp(v_contact_str, "NDLB-connectile-dysfunction-2.0")) || force_connectile) {
char *path_encoded; char *path_encoded;
size_t path_encoded_len; size_t path_encoded_len;
char my_contact_str[1024]; char my_contact_str[1024];

View File

@ -12726,13 +12726,15 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_is_number(char * jarg1) {
} }
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_strip_spaces(char * jarg1) { SWIGEXPORT char * SWIGSTDCALL CSharp_switch_strip_spaces(char * jarg1, int jarg2) {
char * jresult ; char * jresult ;
char *arg1 = (char *) 0 ; char *arg1 = (char *) 0 ;
switch_bool_t arg2 ;
char *result = 0 ; char *result = 0 ;
arg1 = (char *)jarg1; arg1 = (char *)jarg1;
result = (char *)switch_strip_spaces((char const *)arg1); arg2 = (switch_bool_t)jarg2;
result = (char *)switch_strip_spaces(arg1,arg2);
jresult = SWIG_csharp_string_callback((const char *)result); jresult = SWIG_csharp_string_callback((const char *)result);
return jresult; return jresult;
} }
@ -23624,6 +23626,16 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_set_caller_extension(void * ja
} }
SWIGEXPORT void SWIGSTDCALL CSharp_switch_channel_sort_cid(void * jarg1, int jarg2) {
switch_channel_t *arg1 = (switch_channel_t *) 0 ;
switch_bool_t arg2 ;
arg1 = (switch_channel_t *)jarg1;
arg2 = (switch_bool_t)jarg2;
switch_channel_sort_cid(arg1,arg2);
}
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_channel_get_caller_extension(void * jarg1) { SWIGEXPORT void * SWIGSTDCALL CSharp_switch_channel_get_caller_extension(void * jarg1) {
void * jresult ; void * jresult ;
switch_channel_t *arg1 = (switch_channel_t *) 0 ; switch_channel_t *arg1 = (switch_channel_t *) 0 ;
@ -29013,6 +29025,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_activate_jitter_buffer(void * jarg1
} }
SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_debug_jitter_buffer(void * jarg1, char * jarg2) {
int jresult ;
switch_rtp_t *arg1 = (switch_rtp_t *) 0 ;
char *arg2 = (char *) 0 ;
switch_status_t result;
arg1 = (switch_rtp_t *)jarg1;
arg2 = (char *)jarg2;
result = (switch_status_t)switch_rtp_debug_jitter_buffer(arg1,(char const *)arg2);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_deactivate_jitter_buffer(void * jarg1) { SWIGEXPORT int SWIGSTDCALL CSharp_switch_rtp_deactivate_jitter_buffer(void * jarg1) {
int jresult ; int jresult ;
switch_rtp_t *arg1 = (switch_rtp_t *) 0 ; switch_rtp_t *arg1 = (switch_rtp_t *) 0 ;

View File

@ -2867,8 +2867,8 @@ public class freeswitch {
return ret; return ret;
} }
public static string switch_strip_spaces(string str) { public static string switch_strip_spaces(string str, switch_bool_t dup) {
string ret = freeswitchPINVOKE.switch_strip_spaces(str); string ret = freeswitchPINVOKE.switch_strip_spaces(str, (int)dup);
return ret; return ret;
} }
@ -3318,6 +3318,10 @@ public class freeswitch {
freeswitchPINVOKE.switch_channel_set_caller_extension(SWIGTYPE_p_switch_channel.getCPtr(channel), switch_caller_extension.getCPtr(caller_extension)); freeswitchPINVOKE.switch_channel_set_caller_extension(SWIGTYPE_p_switch_channel.getCPtr(channel), switch_caller_extension.getCPtr(caller_extension));
} }
public static void switch_channel_sort_cid(SWIGTYPE_p_switch_channel channel, switch_bool_t arg1) {
freeswitchPINVOKE.switch_channel_sort_cid(SWIGTYPE_p_switch_channel.getCPtr(channel), (int)arg1);
}
public static switch_caller_extension switch_channel_get_caller_extension(SWIGTYPE_p_switch_channel channel) { public static switch_caller_extension switch_channel_get_caller_extension(SWIGTYPE_p_switch_channel channel) {
IntPtr cPtr = freeswitchPINVOKE.switch_channel_get_caller_extension(SWIGTYPE_p_switch_channel.getCPtr(channel)); IntPtr cPtr = freeswitchPINVOKE.switch_channel_get_caller_extension(SWIGTYPE_p_switch_channel.getCPtr(channel));
switch_caller_extension ret = (cPtr == IntPtr.Zero) ? null : new switch_caller_extension(cPtr, false); switch_caller_extension ret = (cPtr == IntPtr.Zero) ? null : new switch_caller_extension(cPtr, false);
@ -4635,6 +4639,11 @@ public class freeswitch {
return ret; return ret;
} }
public static switch_status_t switch_rtp_debug_jitter_buffer(SWIGTYPE_p_switch_rtp rtp_session, string name) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_debug_jitter_buffer(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), name);
return ret;
}
public static switch_status_t switch_rtp_deactivate_jitter_buffer(SWIGTYPE_p_switch_rtp rtp_session) { public static switch_status_t switch_rtp_deactivate_jitter_buffer(SWIGTYPE_p_switch_rtp rtp_session) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_deactivate_jitter_buffer(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session)); switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_deactivate_jitter_buffer(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session));
return ret; return ret;
@ -8647,7 +8656,7 @@ class freeswitchPINVOKE {
public static extern int switch_is_number(string jarg1); public static extern int switch_is_number(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_strip_spaces")] [DllImport("mod_managed", EntryPoint="CSharp_switch_strip_spaces")]
public static extern string switch_strip_spaces(string jarg1); public static extern string switch_strip_spaces(string jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_strip_whitespace")] [DllImport("mod_managed", EntryPoint="CSharp_switch_strip_whitespace")]
public static extern string switch_strip_whitespace(string jarg1); public static extern string switch_strip_whitespace(string jarg1);
@ -11313,6 +11322,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_set_caller_extension")] [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_set_caller_extension")]
public static extern void switch_channel_set_caller_extension(HandleRef jarg1, HandleRef jarg2); public static extern void switch_channel_set_caller_extension(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_sort_cid")]
public static extern void switch_channel_sort_cid(HandleRef jarg1, int jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_channel_get_caller_extension")] [DllImport("mod_managed", EntryPoint="CSharp_switch_channel_get_caller_extension")]
public static extern IntPtr switch_channel_get_caller_extension(HandleRef jarg1); public static extern IntPtr switch_channel_get_caller_extension(HandleRef jarg1);
@ -12441,6 +12453,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_activate_jitter_buffer")] [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_activate_jitter_buffer")]
public static extern int switch_rtp_activate_jitter_buffer(HandleRef jarg1, uint jarg2, uint jarg3, uint jarg4, uint jarg5); public static extern int switch_rtp_activate_jitter_buffer(HandleRef jarg1, uint jarg2, uint jarg3, uint jarg4, uint jarg5);
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_debug_jitter_buffer")]
public static extern int switch_rtp_debug_jitter_buffer(HandleRef jarg1, string jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_deactivate_jitter_buffer")] [DllImport("mod_managed", EntryPoint="CSharp_switch_rtp_deactivate_jitter_buffer")]
public static extern int switch_rtp_deactivate_jitter_buffer(HandleRef jarg1); public static extern int switch_rtp_deactivate_jitter_buffer(HandleRef jarg1);
@ -21509,6 +21524,7 @@ public enum switch_channel_flag_t {
CF_BRIDGE_NOWRITE, CF_BRIDGE_NOWRITE,
CF_RECOVERED, CF_RECOVERED,
CF_JITTERBUFFER, CF_JITTERBUFFER,
CF_DIALPLAN,
CF_FLAG_MAX CF_FLAG_MAX
} }

View File

@ -9732,17 +9732,17 @@ XS(SWIG_init) {
SWIG_TypeClientData(SWIGTYPE_p_IVRMenu, (void*) "freeswitch::IVRMenu"); SWIG_TypeClientData(SWIGTYPE_p_IVRMenu, (void*) "freeswitch::IVRMenu");
SWIG_TypeClientData(SWIGTYPE_p_API, (void*) "freeswitch::API"); SWIG_TypeClientData(SWIGTYPE_p_API, (void*) "freeswitch::API");
SWIG_TypeClientData(SWIGTYPE_p_input_callback_state, (void*) "freeswitch::input_callback_state_t"); SWIG_TypeClientData(SWIGTYPE_p_input_callback_state, (void*) "freeswitch::input_callback_state_t");
/*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { /*@SWIG:/usr/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "S_HUP", TRUE | 0x2 | GV_ADDMULTI); SV *sv = get_sv((char*) SWIG_prefix "S_HUP", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_HUP))); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_HUP)));
SvREADONLY_on(sv); SvREADONLY_on(sv);
} while(0) /*@SWIG@*/; } while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { /*@SWIG:/usr/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "S_FREE", TRUE | 0x2 | GV_ADDMULTI); SV *sv = get_sv((char*) SWIG_prefix "S_FREE", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_FREE))); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_FREE)));
SvREADONLY_on(sv); SvREADONLY_on(sv);
} while(0) /*@SWIG@*/; } while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do { /*@SWIG:/usr/local/share/swig/1.3.35/perl5/perltypemaps.swg,64,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "S_RDLOCK", TRUE | 0x2 | GV_ADDMULTI); SV *sv = get_sv((char*) SWIG_prefix "S_RDLOCK", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_RDLOCK))); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_RDLOCK)));
SvREADONLY_on(sv); SvREADONLY_on(sv);

View File

@ -831,9 +831,9 @@ SWITCH_DECLARE(char *) switch_strip_whitespace(const char *str)
return s; return s;
} }
SWITCH_DECLARE(char *) switch_strip_spaces(const char *str) SWITCH_DECLARE(char *) switch_strip_spaces(char *str, switch_bool_t dup)
{ {
const char *sp = str; char *sp = str;
char *p, *s = NULL; char *p, *s = NULL;
if (!sp) if (!sp)
@ -843,7 +843,11 @@ SWITCH_DECLARE(char *) switch_strip_spaces(const char *str)
sp++; sp++;
} }
s = strdup(sp); if (dup) {
s = strdup(sp);
} else {
s = sp;
}
if (!s) if (!s)
return NULL; return NULL;