tts_name = NULL; \
voice_name = NULL; \
xml_cdr_text = NULL; \
- memset(&caller_profile, 0, sizeof(caller_profile)); \
memset(&args, 0, sizeof(args)); \
ap = NULL; \
- caller_profile.source = "mod_unknown"; \
- caller_profile.dialplan = ""; \
- caller_profile.context = ""; \
- caller_profile.caller_id_name = ""; \
- caller_profile.caller_id_number = ""; \
- caller_profile.network_addr = ""; \
- caller_profile.ani = ""; \
- caller_profile.aniii = ""; \
- caller_profile.rdnis = ""; \
- caller_profile.username = ""; \
flags = 0; \
on_hangup = NULL; \
memset(&cb_state, 0, sizeof(cb_state)); \
switch_input_args_t args; // holds ptr to cb function and input_callback_state struct
// which has a language specific callback function
switch_input_args_t *ap; // ptr to args .. (is this really needed?)
- switch_caller_profile_t caller_profile; // avoid passing so many args to originate,
// instead set them here first
char *xml_cdr_text;
void store_file_handle(switch_file_handle_t *fh);
*/
SWITCH_DECLARE(int) recordFile(char *file_name, int time_limit = 0, int silence_threshold = 0, int silence_hits = 0);
-
/** \brief Set attributes of caller data for purposes of outgoing calls
* \param var - the variable name, eg, "caller_id_name"
* \param val - the data to set, eg, "bob"
*/
- SWITCH_DECLARE(void) setCallerData(char *var, char *val);
/** \brief Originate a call to a destination
*
return freeswitchJNI.CoreSession_recordFile__SWIG_3(swigCPtr, this, file_name);
}
- public void setCallerData(String var, String val) {
- freeswitchJNI.CoreSession_setCallerData(swigCPtr, this, var, val);
- }
-
public int originate(CoreSession a_leg_session, String dest, int timeout, SWIGTYPE_p_switch_state_handler_table_t handlers) {
return freeswitchJNI.CoreSession_originate__SWIG_0(swigCPtr, this, CoreSession.getCPtr(a_leg_session), a_leg_session, dest, timeout, SWIGTYPE_p_switch_state_handler_table_t.getCPtr(handlers));
}
public final static native int CoreSession_recordFile__SWIG_1(long jarg1, CoreSession jarg1_, String jarg2, int jarg3, int jarg4);
public final static native int CoreSession_recordFile__SWIG_2(long jarg1, CoreSession jarg1_, String jarg2, int jarg3);
public final static native int CoreSession_recordFile__SWIG_3(long jarg1, CoreSession jarg1_, String jarg2);
- public final static native void CoreSession_setCallerData(long jarg1, CoreSession jarg1_, String jarg2, String jarg3);
public final static native int CoreSession_originate__SWIG_0(long jarg1, CoreSession jarg1_, long jarg2, CoreSession jarg2_, String jarg3, int jarg4, long jarg5);
public final static native int CoreSession_originate__SWIG_1(long jarg1, CoreSession jarg1_, long jarg2, CoreSession jarg2_, String jarg3, int jarg4);
public final static native int CoreSession_originate__SWIG_2(long jarg1, CoreSession jarg1_, long jarg2, CoreSession jarg2_, String jarg3);
}
-SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1setCallerData(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3) {
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
-
- (void)jenv;
- (void)jcls;
- (void)jarg1_;
- arg1 = *(CoreSession **)&jarg1;
- arg2 = 0;
- if (jarg2) {
- arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
- if (!arg2) return ;
- }
- arg3 = 0;
- if (jarg3) {
- arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
- if (!arg3) return ;
- }
- (arg1)->setCallerData(arg2,arg3);
- if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
- if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
-}
-
-
SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1originate_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_, jstring jarg3, jint jarg4, jlong jarg5) {
jint jresult = 0 ;
CoreSession *arg1 = (CoreSession *) 0 ;
}
-static int _wrap_CoreSession_setCallerData(lua_State* L) {
- int SWIG_arg = -1;
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
-
- SWIG_check_num_args("setCallerData",3,3)
- if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setCallerData",1,"CoreSession *");
- if(!lua_isstring(L,2)) SWIG_fail_arg("setCallerData",2,"char *");
- if(!lua_isstring(L,3)) SWIG_fail_arg("setCallerData",3,"char *");
-
- if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
- SWIG_fail_ptr("CoreSession_setCallerData",1,SWIGTYPE_p_CoreSession);
- }
-
- arg2 = (char *)lua_tostring(L, 2);
- arg3 = (char *)lua_tostring(L, 3);
- (arg1)->setCallerData(arg2,arg3);
- SWIG_arg=0;
-
- return SWIG_arg;
-
- if(0) SWIG_fail;
-
-fail:
- lua_error(L);
- return SWIG_arg;
-}
-
-
static int _wrap_CoreSession_originate__SWIG_0(lua_State* L) {
int SWIG_arg = -1;
CoreSession *arg1 = (CoreSession *) 0 ;
{"hangupCause", _wrap_CoreSession_hangupCause},
{"getState", _wrap_CoreSession_getState},
{"recordFile", _wrap_CoreSession_recordFile},
- {"setCallerData", _wrap_CoreSession_setCallerData},
{"originate", _wrap_CoreSession_originate},
{"destroy", _wrap_CoreSession_destroy},
{"setDTMFCallback", _wrap_CoreSession_setDTMFCallback},
}
-SWIGEXPORT void SWIGSTDCALL CSharp_CoreSession_SetCallerData(void * jarg1, char * jarg2, char * jarg3) {
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
-
- arg1 = (CoreSession *)jarg1;
- arg2 = (char *)jarg2;
- arg3 = (char *)jarg3;
- (arg1)->setCallerData(arg2,arg3);
-}
-
-
SWIGEXPORT int SWIGSTDCALL CSharp_CoreSession_originate(void * jarg1, void * jarg2, char * jarg3, int jarg4, void * jarg5) {
int jresult ;
CoreSession *arg1 = (CoreSession *) 0 ;
return ret;
}
- public void SetCallerData(string var, string val) {
- freeswitchPINVOKE.CoreSession_SetCallerData(swigCPtr, var, val);
- }
-
protected int originate(CoreSession a_leg_session, string dest, int timeout, switch_state_handler_table handlers) {
int ret = freeswitchPINVOKE.CoreSession_originate(swigCPtr, CoreSession.getCPtr(a_leg_session), dest, timeout, switch_state_handler_table.getCPtr(handlers));
return ret;
[DllImport("mod_managed", EntryPoint="CSharp_CoreSession_RecordFile")]
public static extern int CoreSession_RecordFile(HandleRef jarg1, string jarg2, int jarg3, int jarg4, int jarg5);
- [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_SetCallerData")]
- public static extern void CoreSession_SetCallerData(HandleRef jarg1, string jarg2, string jarg3);
-
[DllImport("mod_managed", EntryPoint="CSharp_CoreSession_originate")]
public static extern int CoreSession_originate(HandleRef jarg1, HandleRef jarg2, string jarg3, int jarg4, HandleRef jarg5);
*hangupCause = *freeswitchc::CoreSession_hangupCause;
*getState = *freeswitchc::CoreSession_getState;
*recordFile = *freeswitchc::CoreSession_recordFile;
-*setCallerData = *freeswitchc::CoreSession_setCallerData;
*originate = *freeswitchc::CoreSession_originate;
*destroy = *freeswitchc::CoreSession_destroy;
*setDTMFCallback = *freeswitchc::CoreSession_setDTMFCallback;
}
-XS(_wrap_CoreSession_setCallerData) {
- {
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- int res3 ;
- char *buf3 = 0 ;
- int alloc3 = 0 ;
- int argvi = 0;
- dXSARGS;
-
- if ((items < 3) || (items > 3)) {
- SWIG_croak("Usage: CoreSession_setCallerData(self,var,val);");
- }
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 | 0 );
- if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_setCallerData" "', 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_setCallerData" "', argument " "2"" of type '" "char *""'");
- }
- arg2 = reinterpret_cast< char * >(buf2);
- res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_setCallerData" "', argument " "3"" of type '" "char *""'");
- }
- arg3 = reinterpret_cast< char * >(buf3);
- (arg1)->setCallerData(arg2,arg3);
-
-
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- XSRETURN(argvi);
- fail:
-
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- SWIG_croak_null();
- }
-}
-
-
XS(_wrap_CoreSession_originate__SWIG_0) {
{
CoreSession *arg1 = (CoreSession *) 0 ;
{"freeswitchc::CoreSession_hangupCause", _wrap_CoreSession_hangupCause},
{"freeswitchc::CoreSession_getState", _wrap_CoreSession_getState},
{"freeswitchc::CoreSession_recordFile", _wrap_CoreSession_recordFile},
-{"freeswitchc::CoreSession_setCallerData", _wrap_CoreSession_setCallerData},
{"freeswitchc::CoreSession_originate", _wrap_CoreSession_originate},
{"freeswitchc::CoreSession_destroy", _wrap_CoreSession_destroy},
{"freeswitchc::CoreSession_setDTMFCallback", _wrap_CoreSession_setDTMFCallback},
SWIG_TypeClientData(SWIGTYPE_p_IVRMenu, (void*) "freeswitch::IVRMenu");
SWIG_TypeClientData(SWIGTYPE_p_API, (void*) "freeswitch::API");
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_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_HUP)));
SvREADONLY_on(sv);
} 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_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_FREE)));
SvREADONLY_on(sv);
} 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_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(S_RDLOCK)));
SvREADONLY_on(sv);
def hangupCause(*args): return _freeswitch.CoreSession_hangupCause(*args)
def getState(*args): return _freeswitch.CoreSession_getState(*args)
def recordFile(*args): return _freeswitch.CoreSession_recordFile(*args)
- def setCallerData(*args): return _freeswitch.CoreSession_setCallerData(*args)
def originate(*args): return _freeswitch.CoreSession_originate(*args)
def destroy(*args): return _freeswitch.CoreSession_destroy(*args)
def setDTMFCallback(*args): return _freeswitch.CoreSession_setDTMFCallback(*args)
}
-SWIGINTERN PyObject *_wrap_CoreSession_setCallerData(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
- PyObject *resultobj = 0;
- CoreSession *arg1 = (CoreSession *) 0 ;
- char *arg2 = (char *) 0 ;
- char *arg3 = (char *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
- int res2 ;
- char *buf2 = 0 ;
- int alloc2 = 0 ;
- int res3 ;
- char *buf3 = 0 ;
- int alloc3 = 0 ;
- PyObject * obj0 = 0 ;
- PyObject * obj1 = 0 ;
- PyObject * obj2 = 0 ;
-
- if (!PyArg_ParseTuple(args,(char *)"OOO:CoreSession_setCallerData",&obj0,&obj1,&obj2)) 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_setCallerData" "', 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_setCallerData" "', argument " "2"" of type '" "char *""'");
- }
- arg2 = reinterpret_cast< char * >(buf2);
- res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CoreSession_setCallerData" "', argument " "3"" of type '" "char *""'");
- }
- arg3 = reinterpret_cast< char * >(buf3);
- (arg1)->setCallerData(arg2,arg3);
- resultobj = SWIG_Py_Void();
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return resultobj;
-fail:
- if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
- if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
- return NULL;
-}
-
-
SWIGINTERN PyObject *_wrap_CoreSession_originate__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
CoreSession *arg1 = (CoreSession *) 0 ;
{ (char *)"CoreSession_hangupCause", _wrap_CoreSession_hangupCause, METH_VARARGS, NULL},
{ (char *)"CoreSession_getState", _wrap_CoreSession_getState, METH_VARARGS, NULL},
{ (char *)"CoreSession_recordFile", _wrap_CoreSession_recordFile, METH_VARARGS, NULL},
- { (char *)"CoreSession_setCallerData", _wrap_CoreSession_setCallerData, METH_VARARGS, NULL},
{ (char *)"CoreSession_originate", _wrap_CoreSession_originate, METH_VARARGS, NULL},
{ (char *)"CoreSession_destroy", _wrap_CoreSession_destroy, METH_VARARGS, NULL},
{ (char *)"CoreSession_setDTMFCallback", _wrap_CoreSession_setDTMFCallback, METH_VARARGS, NULL},
handlers,
NULL,
NULL,
- &caller_profile,
+ NULL,
NULL,
SOF_NONE) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Error Creating Outgoing Channel! [%s]\n", dest);
}
-SWITCH_DECLARE(void) CoreSession::setCallerData(char *var, char *val) {
-
- this_check_void();
- sanity_check_noreturn;
-
- if (strcmp(var, "dialplan") == 0) {
- caller_profile.dialplan = val;
- }
- if (strcmp(var, "context") == 0) {
- caller_profile.context = val;
- }
- if (strcmp(var, "caller_id_name") == 0) {
- caller_profile.caller_id_name = val;
- }
- if (strcmp(var, "caller_id_number") == 0) {
- caller_profile.caller_id_number = val;
- }
- if (strcmp(var, "network_addr") == 0) {
- caller_profile.network_addr = val;
- }
- if (strcmp(var, "ani") == 0) {
- caller_profile.ani = val;
- }
- if (strcmp(var, "aniii") == 0) {
- caller_profile.aniii = val;
- }
- if (strcmp(var, "rdnis") == 0) {
- caller_profile.rdnis = val;
- }
- if (strcmp(var, "username") == 0) {
- caller_profile.username = val;
- }
-
-}
-
SWITCH_DECLARE(void) CoreSession::setHangupHook(void *hangup_func) {
this_check_void();