mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 21:22:09 +00:00
don't segfault when -nonat is used and nat_map reinit is called
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16253 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -112,6 +112,11 @@ SWITCH_STANDARD_API(nat_map_function)
|
||||
if (!cmd) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!switch_nat_is_initialized()) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "nat_map API called while NAT not initialized\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
mydata = strdup(cmd);
|
||||
switch_assert(mydata);
|
||||
|
||||
@@ -2399,6 +2399,66 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_switch_directories_storage_dir_get(void * j
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_directories_recordings_dir_set(void * jarg1, char * jarg2) {
|
||||
switch_directories *arg1 = (switch_directories *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
|
||||
arg1 = (switch_directories *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
{
|
||||
if (arg1->recordings_dir) delete [] arg1->recordings_dir;
|
||||
if (arg2) {
|
||||
arg1->recordings_dir = (char *) (new char[strlen((const char *)arg2)+1]);
|
||||
strcpy((char *)arg1->recordings_dir, (const char *)arg2);
|
||||
} else {
|
||||
arg1->recordings_dir = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_directories_recordings_dir_get(void * jarg1) {
|
||||
char * jresult ;
|
||||
switch_directories *arg1 = (switch_directories *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (switch_directories *)jarg1;
|
||||
result = (char *) ((arg1)->recordings_dir);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void SWIGSTDCALL CSharp_switch_directories_sounds_dir_set(void * jarg1, char * jarg2) {
|
||||
switch_directories *arg1 = (switch_directories *) 0 ;
|
||||
char *arg2 = (char *) 0 ;
|
||||
|
||||
arg1 = (switch_directories *)jarg1;
|
||||
arg2 = (char *)jarg2;
|
||||
{
|
||||
if (arg1->sounds_dir) delete [] arg1->sounds_dir;
|
||||
if (arg2) {
|
||||
arg1->sounds_dir = (char *) (new char[strlen((const char *)arg2)+1]);
|
||||
strcpy((char *)arg1->sounds_dir, (const char *)arg2);
|
||||
} else {
|
||||
arg1->sounds_dir = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_directories_sounds_dir_get(void * jarg1) {
|
||||
char * jresult ;
|
||||
switch_directories *arg1 = (switch_directories *) 0 ;
|
||||
char *result = 0 ;
|
||||
|
||||
arg1 = (switch_directories *)jarg1;
|
||||
result = (char *) ((arg1)->sounds_dir);
|
||||
jresult = SWIG_csharp_string_callback((const char *)result);
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_directories() {
|
||||
void * jresult ;
|
||||
switch_directories *result = 0 ;
|
||||
|
||||
@@ -5490,6 +5490,18 @@ class freeswitchPINVOKE {
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_directories_storage_dir_get")]
|
||||
public static extern string switch_directories_storage_dir_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_directories_recordings_dir_set")]
|
||||
public static extern void switch_directories_recordings_dir_set(HandleRef jarg1, string jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_directories_recordings_dir_get")]
|
||||
public static extern string switch_directories_recordings_dir_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_directories_sounds_dir_set")]
|
||||
public static extern void switch_directories_sounds_dir_set(HandleRef jarg1, string jarg2);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_switch_directories_sounds_dir_get")]
|
||||
public static extern string switch_directories_sounds_dir_get(HandleRef jarg1);
|
||||
|
||||
[DllImport("mod_managed", EntryPoint="CSharp_new_switch_directories")]
|
||||
public static extern IntPtr new_switch_directories();
|
||||
|
||||
@@ -21594,6 +21606,26 @@ public class switch_directories : IDisposable {
|
||||
}
|
||||
}
|
||||
|
||||
public string recordings_dir {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_directories_recordings_dir_set(swigCPtr, value);
|
||||
}
|
||||
get {
|
||||
string ret = freeswitchPINVOKE.switch_directories_recordings_dir_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public string sounds_dir {
|
||||
set {
|
||||
freeswitchPINVOKE.switch_directories_sounds_dir_set(swigCPtr, value);
|
||||
}
|
||||
get {
|
||||
string ret = freeswitchPINVOKE.switch_directories_sounds_dir_get(swigCPtr);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
public switch_directories() : this(freeswitchPINVOKE.new_switch_directories(), true) {
|
||||
}
|
||||
|
||||
@@ -22473,6 +22505,7 @@ public enum switch_event_types_t {
|
||||
SWITCH_EVENT_RECORD_STOP,
|
||||
SWITCH_EVENT_CALL_UPDATE,
|
||||
SWITCH_EVENT_FAILURE,
|
||||
SWITCH_EVENT_SOCKET_DATA,
|
||||
SWITCH_EVENT_ALL
|
||||
}
|
||||
|
||||
@@ -26256,7 +26289,8 @@ public enum switch_session_ctl_t {
|
||||
SCSC_CANCEL_SHUTDOWN,
|
||||
SCSC_SEND_SIGHUP,
|
||||
SCSC_DEBUG_LEVEL,
|
||||
SCSC_FLUSH_DB_HANDLES
|
||||
SCSC_FLUSH_DB_HANDLES,
|
||||
SCSC_SHUTDOWN_NOW
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user