FSCORE-450

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15006 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-09-28 19:46:38 +00:00
parent bcc1694a45
commit c5f1d9ec0a
12 changed files with 4 additions and 231 deletions

View File

@ -20,19 +20,8 @@ extern "C" {
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)); \
@ -199,7 +188,6 @@ SWITCH_DECLARE(void) consoleCleanLog(char *msg);
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);
@ -247,12 +235,10 @@ SWITCH_DECLARE(void) consoleCleanLog(char *msg);
*/
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
*

View File

@ -193,10 +193,6 @@ public class CoreSession {
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));
}

View File

@ -125,7 +125,6 @@ class freeswitchJNI {
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);

View File

@ -2345,31 +2345,6 @@ SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1reco
}
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 ;

View File

@ -5459,36 +5459,6 @@ static int _wrap_CoreSession_recordFile(lua_State* L) {
}
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 ;
@ -7372,7 +7342,6 @@ static swig_lua_method swig_CoreSession_methods[] = {
{"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},

View File

@ -28848,18 +28848,6 @@ SWIGEXPORT int SWIGSTDCALL CSharp_CoreSession_RecordFile(void * jarg1, char * ja
}
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 ;

View File

@ -260,10 +260,6 @@ public class CoreSession : IDisposable {
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;
@ -11420,9 +11416,6 @@ class freeswitchPINVOKE {
[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);

View File

@ -414,7 +414,6 @@ sub DESTROY {
*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;

View File

@ -7080,55 +7080,6 @@ XS(_wrap_CoreSession_recordFile) {
}
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 ;
@ -11738,7 +11689,6 @@ static swig_command_info swig_commands[] = {
{"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},
@ -12095,17 +12045,17 @@ XS(SWIG_init) {
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);

View File

@ -272,7 +272,6 @@ class CoreSession(_object):
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)

View File

@ -7175,51 +7175,6 @@ fail:
}
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 ;
@ -10474,7 +10429,6 @@ static PyMethodDef SwigMethods[] = {
{ (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},

View File

@ -981,7 +981,7 @@ SWITCH_DECLARE(int) CoreSession::originate(CoreSession *a_leg_session, char *des
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);
@ -1078,41 +1078,6 @@ SWITCH_DECLARE(void) CoreSession::waitForAnswer(CoreSession *calling_session)
}
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();