This commit is contained in:
Anthony Minessale
2016-10-12 18:00:13 -05:00
parent 550d85210c
commit 9b8a5edd3d
32 changed files with 765 additions and 150 deletions
@@ -1700,8 +1700,7 @@ switch_status_t conference_text_thread_callback(switch_core_session_t *session,
inuse = switch_buffer_inuse(member->text_buffer);
if (zstr(member->text_framedata) && inuse && (switch_channel_test_flag(channel, CF_TEXT_IDLE) || switch_test_flag(frame, SFF_TEXT_LINE_BREAK))) {
int bytes = 0, ok = 0;
char *p;
int bytes = 0;//, ok = 0;
if (inuse + 1 > member->text_framesize) {
void *tmp = malloc(inuse + 1024);
@@ -1718,7 +1717,8 @@ switch_status_t conference_text_thread_callback(switch_core_session_t *session,
bytes = switch_buffer_read(member->text_buffer, member->text_framedata, inuse);
*(member->text_framedata + bytes) = '\0';
/*
for(p = member->text_framedata; p && *p; p++) {
if (*p > 32 && *p < 127) {
ok++;
@@ -1728,7 +1728,7 @@ switch_status_t conference_text_thread_callback(switch_core_session_t *session,
if (!ok) {
member->text_framedata[0] = '\0';
}
*/
}
switch_mutex_unlock(member->text_mutex);
@@ -2326,7 +2326,7 @@ SWITCH_STANDARD_APP(conference_function)
switch_core_session_set_video_read_callback(session, conference_video_thread_callback, (void *)&member);
switch_core_session_set_text_read_callback(session, conference_text_thread_callback, (void *)&member);
if (switch_channel_test_flag(channel, CF_VIDEO_ONLY)) {
if (switch_channel_test_flag(channel, CF_VIDEO_ONLY) || !switch_channel_test_flag(channel, CF_AUDIO)) {
while(conference_utils_member_test_flag((&member), MFLAG_RUNNING) && switch_channel_ready(channel)) {
switch_yield(100000);
}
@@ -3603,7 +3603,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_conference_load)
}
SWITCH_ADD_API(api_interface, "conference", "Conference module commands", conference_api_main, p);
SWITCH_ADD_APP(app_interface, mod_conference_app_name, mod_conference_app_name, NULL, conference_function, NULL, SAF_NONE);
SWITCH_ADD_APP(app_interface, mod_conference_app_name, mod_conference_app_name, NULL, conference_function, NULL, SAF_SUPPORT_TEXT_ONLY);
SWITCH_ADD_APP(app_interface, "conference_set_auto_outcall", "conference_set_auto_outcall", NULL, conference_auto_function, NULL, SAF_NONE);
SWITCH_ADD_CHAT(chat_interface, CONF_CHAT_PROTO, chat_send);
@@ -6301,7 +6301,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
SWITCH_ADD_APP(app_interface, "stop_tone_detect", "stop detecting tones", "Stop detecting tones", stop_fax_detect_session_function, "", SAF_NONE);
SWITCH_ADD_APP(app_interface, "fax_detect", "Detect faxes", "Detect fax send tone", fax_detect_session_function, "", SAF_MEDIA_TAP);
SWITCH_ADD_APP(app_interface, "tone_detect", "Detect tones", "Detect tones", tone_detect_session_function, "", SAF_MEDIA_TAP);
SWITCH_ADD_APP(app_interface, "echo", "Echo", "Perform an echo test against the calling channel", echo_function, "", SAF_NONE);
SWITCH_ADD_APP(app_interface, "echo", "Echo", "Perform an echo test against the calling channel", echo_function, "", SAF_SUPPORT_TEXT_ONLY);
SWITCH_ADD_APP(app_interface, "park", "Park", "Park", park_function, "", SAF_SUPPORT_NOMEDIA);
SWITCH_ADD_APP(app_interface, "park_state", "Park State", "Park State", park_state_function, "", SAF_NONE);
SWITCH_ADD_APP(app_interface, "gentones", "Generate Tones", "Generate tones to the channel", gentones_function, "<tgml_script>[|<loops>]", SAF_NONE);
@@ -6335,7 +6335,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_dptools_load)
SWITCH_ADD_APP(app_interface, "clear_speech_cache", "Clear Speech Handle Cache", "Clear Speech Handle Cache", clear_speech_cache_function, "",
SAF_NONE);
SWITCH_ADD_APP(app_interface, "bridge", "Bridge Audio", "Bridge the audio between two sessions", audio_bridge_function, "<channel_url>",
SAF_SUPPORT_NOMEDIA);
SAF_SUPPORT_NOMEDIA|SAF_SUPPORT_TEXT_ONLY);
SWITCH_ADD_APP(app_interface, "system", "Execute a system command", "Execute a system command", system_session_function, "<command>",
SAF_SUPPORT_NOMEDIA | SAF_ZOMBIE_EXEC);
SWITCH_ADD_APP(app_interface, "bgsystem", "Execute a system command in the background", "Execute a background system command", bgsystem_session_function, "<command>",
@@ -135,6 +135,12 @@ static void put_text_msg(void *user_data, const uint8_t *msg, int len)
}
switch_core_session_rwunlock(other_session);
} else if (switch_channel_test_flag(channel, CF_QUEUE_TEXT_EVENTS)) {
if (switch_event_dup(&clone, event) == SWITCH_STATUS_SUCCESS) {
switch_core_session_queue_event(pvt->session, &clone);
}
}
switch_event_fire(&event);
+58 -3
View File
@@ -924,6 +924,62 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session)
static switch_status_t sofia_read_text_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id)
{
switch_status_t status;
if (switch_channel_test_flag(switch_core_session_get_channel(session), CF_MSRP)) {
switch_msrp_session_t *msrp_session = switch_core_media_get_msrp_session(session);
switch_frame_t *rframe = &msrp_session->frame;
msrp_msg_t *msrp_msg = switch_msrp_session_pop_msg(msrp_session);
rframe->flags = 0;
#if 0
if (msrp_msg && msrp_msg->method == MSRP_METHOD_SEND) { /*echo back*/
char *p;
p = msrp_msg->headers[MSRP_H_TO_PATH];
msrp_msg->headers[MSRP_H_TO_PATH] = msrp_msg->headers[MSRP_H_FROM_PATH];
msrp_msg->headers[MSRP_H_FROM_PATH] = p;
switch_msrp_send(msrp_session, msrp_msg);
}
#endif
rframe->data = msrp_session->frame_data;
rframe->buflen = sizeof(msrp_session->frame_data);
if (msrp_msg && msrp_msg->method == MSRP_METHOD_SEND && !switch_stristr("?OTRv3?", msrp_msg->payload) &&
(switch_stristr("text/plain", msrp_msg->payload) ||
switch_stristr("text/html", msrp_msg->payload))) {
rframe->datalen = msrp_msg->payload_bytes;
rframe->packetlen = msrp_msg->payload_bytes;
memcpy(rframe->data, msrp_msg->payload, msrp_msg->payload_bytes);
rframe->m = 1;
*frame = rframe;
if (msrp_msg->headers[MSRP_H_CONTENT_TYPE] && !strcasecmp(msrp_msg->headers[MSRP_H_CONTENT_TYPE], "message/cpim")) {
char *stripped_text = switch_html_strip((char *)rframe->data);
memcpy(rframe->data, stripped_text, strlen(stripped_text)+1);
rframe->datalen = strlen(stripped_text)+1;
free(stripped_text);
}
switch_safe_free(msrp_msg);
msrp_msg = NULL;
status = SWITCH_STATUS_SUCCESS;
} else {
rframe->datalen = 2;
rframe->flags = SFF_CNG;
*frame = rframe;
status = SWITCH_STATUS_SUCCESS;
}
return status;
}
return switch_core_media_read_frame(session, frame, flags, stream_id, SWITCH_MEDIA_TYPE_TEXT);
}
@@ -935,11 +991,10 @@ static switch_status_t sofia_write_text_frame(switch_core_session_t *session, sw
if (frame && msrp_session) {
switch_msrp_msg_t msrp_msg = { 0 };
msrp_msg.headers[MSRP_H_CONTENT_TYPE] = "message/cpim";
// msrp_msg.headers[MSRP_H_CONTENT_TYPE] = "text/plain";
//msrp_msg.headers[MSRP_H_CONTENT_TYPE] = "message/cpim";
msrp_msg.headers[MSRP_H_CONTENT_TYPE] = "text/plain";
msrp_msg.payload = frame->data;
msrp_msg.payload_bytes = frame->datalen;
return switch_msrp_send(msrp_session, &msrp_msg);
}
+4 -4
View File
@@ -8098,9 +8098,9 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
} else {
uint8_t match = 0;
if (tech_pvt->mparams.num_codecs) {
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_TYPE_RESPONSE);
}
match = sofia_media_negotiate_sdp(session, r_sdp, SDP_TYPE_RESPONSE);
sofia_set_flag_locked(tech_pvt, TFLAG_ANS);
@@ -8129,7 +8129,7 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
goto done;
}
}
switch_channel_set_variable(channel, SWITCH_ENDPOINT_DISPOSITION_VARIABLE, "NO CODECS");
switch_channel_hangup(channel, SWITCH_CAUSE_INCOMPATIBLE_DESTINATION);
}
@@ -126,6 +126,10 @@ public class CoreSession {
return freeswitchJNI.CoreSession_answer(swigCPtr, this);
}
public int print(String txt) {
return freeswitchJNI.CoreSession_print(swigCPtr, this, txt);
}
public int preAnswer() {
return freeswitchJNI.CoreSession_preAnswer(swigCPtr, this);
}
@@ -113,6 +113,7 @@ public class freeswitchJNI {
public final static native String CoreSession_voice_name_get(long jarg1, CoreSession jarg1_);
public final static native int CoreSession_insertFile(long jarg1, CoreSession jarg1_, String jarg2, String jarg3, int jarg4);
public final static native int CoreSession_answer(long jarg1, CoreSession jarg1_);
public final static native int CoreSession_print(long jarg1, CoreSession jarg1_, String jarg2);
public final static native int CoreSession_preAnswer(long jarg1, CoreSession jarg1_);
public final static native void CoreSession_hangup(long jarg1, CoreSession jarg1_, String jarg2);
public final static native void CoreSession_hangupState(long jarg1, CoreSession jarg1_);
@@ -2166,6 +2166,28 @@ SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1answ
}
SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1print(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) {
jint jresult = 0 ;
CoreSession *arg1 = (CoreSession *) 0 ;
char *arg2 = (char *) 0 ;
int result;
(void)jenv;
(void)jcls;
(void)jarg1_;
arg1 = *(CoreSession **)&jarg1;
arg2 = 0;
if (jarg2) {
arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
if (!arg2) return 0;
}
result = (int)(arg1)->print(arg2);
jresult = (jint)result;
if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
return jresult;
}
SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1preAnswer(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
jint jresult = 0 ;
CoreSession *arg1 = (CoreSession *) 0 ;
@@ -47,6 +47,8 @@ void Session::destroy(const char *err)
switch_safe_free(cb_function);
switch_safe_free(cb_arg);
unsetInputCallback();
CoreSession::destroy();
@@ -240,6 +242,7 @@ void Session::unsetInputCallback(void)
switch_safe_free(cb_arg);
args.input_callback = NULL;
ap = NULL;
switch_channel_clear_flag_recursive(channel, CF_QUEUE_TEXT_EVENTS);
}
void Session::setInputCallback(char *cbfunc, char *funcargs)
@@ -262,6 +265,9 @@ void Session::setInputCallback(char *cbfunc, char *funcargs)
args.input_callback = dtmf_callback;
ap = &args;
switch_channel_set_flag_recursive(channel, CF_QUEUE_TEXT_EVENTS);
}
switch_status_t Session::run_dtmf_callback(void *input, switch_input_type_t itype)
+1 -1
View File
@@ -688,7 +688,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_lua_load)
SWITCH_ADD_API(api_interface, "luarun", "run a script", luarun_api_function, "<script>");
SWITCH_ADD_API(api_interface, "lua", "run a script as an api function", lua_api_function, "<script>");
SWITCH_ADD_APP(app_interface, "lua", "Launch LUA ivr", "Run a lua ivr on a channel", lua_function, "<script>",
SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC);
SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC | SAF_ZOMBIE_EXEC | SAF_SUPPORT_TEXT_ONLY);
SWITCH_ADD_DIALPLAN(dp_interface, "LUA", lua_dialplan_hunt);
SWITCH_ADD_CHAT_APP(chat_app_interface, "lua", "execute a lua script", "execute a lua script", lua_chat_function, "<script>", SCAF_NONE);
@@ -4967,6 +4967,33 @@ fail:
}
static int _wrap_CoreSession_print(lua_State* L) {
int SWIG_arg = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
char *arg2 = (char *) 0 ;
int result;
SWIG_check_num_args("CoreSession::print",2,2)
if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("CoreSession::print",1,"CoreSession *");
if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("CoreSession::print",2,"char *");
if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
SWIG_fail_ptr("CoreSession_print",1,SWIGTYPE_p_CoreSession);
}
arg2 = (char *)lua_tostring(L, 2);
result = (int)(arg1)->print(arg2);
lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
return SWIG_arg;
if(0) SWIG_fail;
fail:
lua_error(L);
return SWIG_arg;
}
static int _wrap_CoreSession_preAnswer(lua_State* L) {
int SWIG_arg = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
@@ -6579,6 +6606,7 @@ delete arg1;
static swig_lua_method swig_CoreSession_methods[] = {
{"insertFile", _wrap_CoreSession_insertFile},
{"answer", _wrap_CoreSession_answer},
{"print", _wrap_CoreSession_print},
{"preAnswer", _wrap_CoreSession_preAnswer},
{"hangup", _wrap_CoreSession_hangup},
{"hangupState", _wrap_CoreSession_hangupState},
@@ -18192,6 +18192,36 @@ result = (char *)("\r\n #%&+:;<=>?@[\\]^`{|}\"");
}
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_get_hex_bytes(void * jarg1, void * jarg2, char * jarg3, void * jarg4) {
char * jresult ;
switch_byte_t *arg1 = (switch_byte_t *) 0 ;
switch_size_t arg2 ;
char *arg3 = (char *) 0 ;
switch_size_t arg4 ;
switch_size_t *argp2 ;
switch_size_t *argp4 ;
char *result = 0 ;
arg1 = (switch_byte_t *)jarg1;
argp2 = (switch_size_t *)jarg2;
if (!argp2) {
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0);
return 0;
}
arg2 = *argp2;
arg3 = (char *)jarg3;
argp4 = (switch_size_t *)jarg4;
if (!argp4) {
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "Attempt to dereference null switch_size_t", 0);
return 0;
}
arg4 = *argp4;
result = (char *)switch_get_hex_bytes(arg1,arg2,arg3,arg4);
jresult = SWIG_csharp_string_callback((const char *)result);
return jresult;
}
SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_round_to_step(unsigned long jarg1, unsigned long jarg2) {
unsigned long jresult ;
uint32_t arg1 ;
@@ -20858,6 +20888,18 @@ SWIGEXPORT void SWIGSTDCALL CSharp_switch_getcputime(void * jarg1) {
}
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_html_strip(char * jarg1) {
char * jresult ;
char *arg1 = (char *) 0 ;
char *result = 0 ;
arg1 = (char *)jarg1;
result = (char *)switch_html_strip((char const *)arg1);
jresult = SWIG_csharp_string_callback((const char *)result);
return jresult;
}
SWIGEXPORT void SWIGSTDCALL CSharp_profile_node_t_var_set(void * jarg1, char * jarg2) {
profile_node_s *arg1 = (profile_node_s *) 0 ;
char *arg2 = (char *) 0 ;
@@ -47299,6 +47341,20 @@ SWIGEXPORT int SWIGSTDCALL CSharp_CoreSession_Answer(void * jarg1) {
}
SWIGEXPORT int SWIGSTDCALL CSharp_CoreSession_print(void * jarg1, char * jarg2) {
int jresult ;
CoreSession *arg1 = (CoreSession *) 0 ;
char *arg2 = (char *) 0 ;
int result;
arg1 = (CoreSession *)jarg1;
arg2 = (char *)jarg2;
result = (int)(arg1)->print(arg2);
jresult = result;
return jresult;
}
SWIGEXPORT int SWIGSTDCALL CSharp_CoreSession_preAnswer(void * jarg1) {
int jresult ;
CoreSession *arg1 = (CoreSession *) 0 ;
+35 -1
View File
@@ -303,6 +303,11 @@ public class CoreSession : IDisposable {
return ret;
}
public int print(string txt) {
int ret = freeswitchPINVOKE.CoreSession_print(swigCPtr, txt);
return ret;
}
public int preAnswer() {
int ret = freeswitchPINVOKE.CoreSession_preAnswer(swigCPtr);
return ret;
@@ -3745,6 +3750,12 @@ else
return ret;
}
public static string switch_get_hex_bytes(SWIGTYPE_p_unsigned_char buf, SWIGTYPE_p_switch_size_t datalen, string new_buf, SWIGTYPE_p_switch_size_t new_datalen) {
string ret = freeswitchPINVOKE.switch_get_hex_bytes(SWIGTYPE_p_unsigned_char.getCPtr(buf), SWIGTYPE_p_switch_size_t.getCPtr(datalen), new_buf, SWIGTYPE_p_switch_size_t.getCPtr(new_datalen));
if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
public static uint switch_round_to_step(uint num, uint step) {
uint ret = freeswitchPINVOKE.switch_round_to_step(num, step);
return ret;
@@ -4439,6 +4450,11 @@ else
freeswitchPINVOKE.switch_getcputime(switch_cputime.getCPtr(t));
}
public static string switch_html_strip(string str) {
string ret = freeswitchPINVOKE.switch_html_strip(str);
return ret;
}
public static switch_caller_extension switch_caller_extension_new(SWIGTYPE_p_switch_core_session session, string extension_name, string extension_number) {
IntPtr cPtr = freeswitchPINVOKE.switch_caller_extension_new(SWIGTYPE_p_switch_core_session.getCPtr(session), extension_name, extension_number);
switch_caller_extension ret = (cPtr == IntPtr.Zero) ? null : new switch_caller_extension(cPtr, false);
@@ -12416,6 +12432,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_URL_UNSAFE_get")]
public static extern string SWITCH_URL_UNSAFE_get();
[DllImport("mod_managed", EntryPoint="CSharp_switch_get_hex_bytes")]
public static extern string switch_get_hex_bytes(HandleRef jarg1, HandleRef jarg2, string jarg3, HandleRef jarg4);
[DllImport("mod_managed", EntryPoint="CSharp_switch_round_to_step")]
public static extern uint switch_round_to_step(uint jarg1, uint jarg2);
@@ -12980,6 +12999,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_switch_getcputime")]
public static extern void switch_getcputime(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_html_strip")]
public static extern string switch_html_strip(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_profile_node_t_var_set")]
public static extern void profile_node_t_var_set(HandleRef jarg1, string jarg2);
@@ -19355,6 +19377,9 @@ class freeswitchPINVOKE {
[DllImport("mod_managed", EntryPoint="CSharp_CoreSession_Answer")]
public static extern int CoreSession_Answer(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_CoreSession_print")]
public static extern int CoreSession_print(HandleRef jarg1, string jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_CoreSession_preAnswer")]
public static extern int CoreSession_preAnswer(HandleRef jarg1);
@@ -27112,7 +27137,8 @@ namespace FreeSWITCH.Native {
SAF_ROUTING_EXEC = (1 << 1),
SAF_MEDIA_TAP = (1 << 2),
SAF_ZOMBIE_EXEC = (1 << 3),
SAF_NO_LOOPBACK = (1 << 4)
SAF_NO_LOOPBACK = (1 << 4),
SAF_SUPPORT_TEXT_ONLY = (1 << 5)
}
}
@@ -29780,7 +29806,15 @@ public enum switch_channel_flag_t {
CF_TEXT_ECHO,
CF_TEXT_ACTIVE,
CF_TEXT_IDLE,
CF_TEXT_LINE_BASED,
CF_QUEUE_TEXT_EVENTS,
CF_MSRP,
CF_MSRPS,
CF_WANT_MSRP,
CF_WANT_MSRPS,
CF_RTT,
CF_WANT_RTT,
CF_AUDIO,
CF_FLAG_MAX
}
+1
View File
@@ -418,6 +418,7 @@ sub DESTROY {
*swig_voice_name_set = *freeswitchc::CoreSession_voice_name_set;
*insertFile = *freeswitchc::CoreSession_insertFile;
*answer = *freeswitchc::CoreSession_answer;
*print = *freeswitchc::CoreSession_print;
*preAnswer = *freeswitchc::CoreSession_preAnswer;
*hangup = *freeswitchc::CoreSession_hangup;
*hangupState = *freeswitchc::CoreSession_hangupState;
@@ -5941,6 +5941,45 @@ XS(_wrap_CoreSession_answer) {
}
XS(_wrap_CoreSession_print) {
{
CoreSession *arg1 = (CoreSession *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
int argvi = 0;
int result;
dXSARGS;
if ((items < 2) || (items > 2)) {
SWIG_croak("Usage: CoreSession_print(self,txt);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_print" "', argument " "1"" of type '" "CoreSession *""'");
}
arg1 = reinterpret_cast< CoreSession * >(argp1);
res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_print" "', argument " "2"" of type '" "char *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
result = (int)(arg1)->print(arg2);
ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
XSRETURN(argvi);
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
SWIG_croak_null();
}
}
XS(_wrap_CoreSession_preAnswer) {
{
CoreSession *arg1 = (CoreSession *) 0 ;
@@ -10267,6 +10306,7 @@ static swig_command_info swig_commands[] = {
{"freeswitchc::CoreSession_voice_name_get", _wrap_CoreSession_voice_name_get},
{"freeswitchc::CoreSession_insertFile", _wrap_CoreSession_insertFile},
{"freeswitchc::CoreSession_answer", _wrap_CoreSession_answer},
{"freeswitchc::CoreSession_print", _wrap_CoreSession_print},
{"freeswitchc::CoreSession_preAnswer", _wrap_CoreSession_preAnswer},
{"freeswitchc::CoreSession_hangup", _wrap_CoreSession_hangup},
{"freeswitchc::CoreSession_hangupState", _wrap_CoreSession_hangupState},
@@ -317,6 +317,7 @@ class CoreSession(_object):
if _newclass:voice_name = _swig_property(_freeswitch.CoreSession_voice_name_get, _freeswitch.CoreSession_voice_name_set)
def insertFile(self, *args): return _freeswitch.CoreSession_insertFile(self, *args)
def answer(self): return _freeswitch.CoreSession_answer(self)
def _print(self, *args): return _freeswitch.CoreSession__print(self, *args)
def preAnswer(self): return _freeswitch.CoreSession_preAnswer(self)
def hangup(self, cause="normal_clearing"): return _freeswitch.CoreSession_hangup(self, cause)
def hangupState(self): return _freeswitch.CoreSession_hangupState(self)
@@ -6897,6 +6897,40 @@ fail:
}
SWIGINTERN PyObject *_wrap_CoreSession__print(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
char *arg2 = (char *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int res2 ;
char *buf2 = 0 ;
int alloc2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
int result;
if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession__print",&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession__print" "', argument " "1"" of type '" "CoreSession *""'");
}
arg1 = reinterpret_cast< CoreSession * >(argp1);
res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
if (!SWIG_IsOK(res2)) {
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession__print" "', argument " "2"" of type '" "char *""'");
}
arg2 = reinterpret_cast< char * >(buf2);
result = (int)(arg1)->print(arg2);
resultobj = SWIG_From_int(static_cast< int >(result));
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
return resultobj;
fail:
if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
return NULL;
}
SWIGINTERN PyObject *_wrap_CoreSession_preAnswer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
@@ -10154,6 +10188,7 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"CoreSession_voice_name_get", _wrap_CoreSession_voice_name_get, METH_VARARGS, NULL},
{ (char *)"CoreSession_insertFile", _wrap_CoreSession_insertFile, METH_VARARGS, NULL},
{ (char *)"CoreSession_answer", _wrap_CoreSession_answer, METH_VARARGS, NULL},
{ (char *)"CoreSession__print", _wrap_CoreSession__print, METH_VARARGS, NULL},
{ (char *)"CoreSession_preAnswer", _wrap_CoreSession_preAnswer, METH_VARARGS, NULL},
{ (char *)"CoreSession_hangup", _wrap_CoreSession_hangup, METH_VARARGS, NULL},
{ (char *)"CoreSession_hangupState", _wrap_CoreSession_hangupState, METH_VARARGS, NULL},