]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add waitForAnswer to cpp
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 2 Jun 2008 23:42:59 +0000 (23:42 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 2 Jun 2008 23:42:59 +0000 (23:42 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8745 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_cpp.h
src/mod/languages/mod_java/src/org/freeswitch/swig/CoreSession.java
src/mod/languages/mod_java/src/org/freeswitch/swig/freeswitchJNI.java
src/mod/languages/mod_java/switch_swig_wrap.cpp
src/mod/languages/mod_lua/mod_lua_wrap.cpp
src/mod/languages/mod_perl/freeswitch.pm
src/mod/languages/mod_perl/mod_perl_wrap.cpp
src/mod/languages/mod_python/freeswitch.py
src/mod/languages/mod_python/mod_python_wrap.cpp
src/switch_cpp.cpp

index 16479559916534012018fc3e4b65af828c3d7ce4..8feb7c036b9171e85af7a96b56d1d51a9bcf81bd 100644 (file)
@@ -282,6 +282,8 @@ SWITCH_DECLARE(void) consoleCleanLog(char *msg);
                 SWITCH_DECLARE(bool) answered();
                 SWITCH_DECLARE(bool) mediaReady();
 
+                SWITCH_DECLARE(void) waitForAnswer(CoreSession *calling_session);
+
                 SWITCH_DECLARE(void) execute(char *app, char *data = NULL);
 
                 SWITCH_DECLARE(void) sendEvent(Event * sendME);
index aa225ba4f6a7848239813c54dcf127fe2f22895f..0e574cf38bc431b549ec03ad07756142f4223ce2 100644 (file)
@@ -225,6 +225,18 @@ public class CoreSession {
     return freeswitchJNI.CoreSession_ready(swigCPtr, this);
   }
 
+  public boolean answered() {
+    return freeswitchJNI.CoreSession_answered(swigCPtr, this);
+  }
+
+  public boolean mediaReady() {
+    return freeswitchJNI.CoreSession_mediaReady(swigCPtr, this);
+  }
+
+  public void waitForAnswer(CoreSession calling_session) {
+    freeswitchJNI.CoreSession_waitForAnswer(swigCPtr, this, CoreSession.getCPtr(calling_session), calling_session);
+  }
+
   public void execute(String app, String data) {
     freeswitchJNI.CoreSession_execute__SWIG_0(swigCPtr, this, app, data);
   }
index 7a8691b9ebfe618bb435635407f57d4275c8ed3e..ffd9b9e9c413b0bc07a0bd3faba323cfa42d5b1c 100644 (file)
@@ -107,6 +107,9 @@ class freeswitchJNI {
   public final static native int CoreSession_setAutoHangup(long jarg1, CoreSession jarg1_, boolean jarg2);
   public final static native void CoreSession_setHangupHook(long jarg1, CoreSession jarg1_, long jarg2);
   public final static native boolean CoreSession_ready(long jarg1, CoreSession jarg1_);
+  public final static native boolean CoreSession_answered(long jarg1, CoreSession jarg1_);
+  public final static native boolean CoreSession_mediaReady(long jarg1, CoreSession jarg1_);
+  public final static native void CoreSession_waitForAnswer(long jarg1, CoreSession jarg1_, long jarg2, CoreSession jarg2_);
   public final static native void CoreSession_execute__SWIG_0(long jarg1, CoreSession jarg1_, String jarg2, String jarg3);
   public final static native void CoreSession_execute__SWIG_1(long jarg1, CoreSession jarg1_, String jarg2);
   public final static native void CoreSession_sendEvent(long jarg1, CoreSession jarg1_, long jarg2, Event jarg2_);
index 9c4857a1c42a5469e1ef6917743832715a1eeb6b..9a6a5f2eb3f249169655d6559ff49e92cb30be33 100644 (file)
@@ -2119,6 +2119,50 @@ SWIGEXPORT jboolean JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1
 }
 
 
+SWIGEXPORT jboolean JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1answered(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+  jboolean jresult = 0 ;
+  CoreSession *arg1 = (CoreSession *) 0 ;
+  bool result;
+  
+  (void)jenv;
+  (void)jcls;
+  (void)jarg1_;
+  arg1 = *(CoreSession **)&jarg1; 
+  result = (bool)(arg1)->answered();
+  jresult = (jboolean)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT jboolean JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1mediaReady(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_) {
+  jboolean jresult = 0 ;
+  CoreSession *arg1 = (CoreSession *) 0 ;
+  bool result;
+  
+  (void)jenv;
+  (void)jcls;
+  (void)jarg1_;
+  arg1 = *(CoreSession **)&jarg1; 
+  result = (bool)(arg1)->mediaReady();
+  jresult = (jboolean)result; 
+  return jresult;
+}
+
+
+SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1waitForAnswer(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jlong jarg2, jobject jarg2_) {
+  CoreSession *arg1 = (CoreSession *) 0 ;
+  CoreSession *arg2 = (CoreSession *) 0 ;
+  
+  (void)jenv;
+  (void)jcls;
+  (void)jarg1_;
+  (void)jarg2_;
+  arg1 = *(CoreSession **)&jarg1; 
+  arg2 = *(CoreSession **)&jarg2; 
+  (arg1)->waitForAnswer(arg2);
+}
+
+
 SWIGEXPORT void JNICALL Java_org_freeswitch_swig_freeswitchJNI_CoreSession_1execute_1_1SWIG_10(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3) {
   CoreSession *arg1 = (CoreSession *) 0 ;
   char *arg2 = (char *) 0 ;
index 673a44d8f23de5dac9038ef5f1500e5d3fa7085e..2a80683d63f2fa637604c1369eec5cdd32dd131d 100644 (file)
@@ -4907,6 +4907,87 @@ fail:
 }
 
 
+static int _wrap_CoreSession_answered(lua_State* L) {
+  int SWIG_arg = -1;
+  CoreSession *arg1 = (CoreSession *) 0 ;
+  bool result;
+  
+  SWIG_check_num_args("answered",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("answered",1,"CoreSession *");
+  
+  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
+    SWIG_fail_ptr("CoreSession_answered",1,SWIGTYPE_p_CoreSession);
+  }
+  
+  result = (bool)(arg1)->answered();
+  SWIG_arg=0;
+  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  return SWIG_arg;
+  
+  if(0) SWIG_fail;
+  
+fail:
+  lua_error(L);
+  return SWIG_arg;
+}
+
+
+static int _wrap_CoreSession_mediaReady(lua_State* L) {
+  int SWIG_arg = -1;
+  CoreSession *arg1 = (CoreSession *) 0 ;
+  bool result;
+  
+  SWIG_check_num_args("mediaReady",1,1)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("mediaReady",1,"CoreSession *");
+  
+  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
+    SWIG_fail_ptr("CoreSession_mediaReady",1,SWIGTYPE_p_CoreSession);
+  }
+  
+  result = (bool)(arg1)->mediaReady();
+  SWIG_arg=0;
+  lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
+  return SWIG_arg;
+  
+  if(0) SWIG_fail;
+  
+fail:
+  lua_error(L);
+  return SWIG_arg;
+}
+
+
+static int _wrap_CoreSession_waitForAnswer(lua_State* L) {
+  int SWIG_arg = -1;
+  CoreSession *arg1 = (CoreSession *) 0 ;
+  CoreSession *arg2 = (CoreSession *) 0 ;
+  
+  SWIG_check_num_args("waitForAnswer",2,2)
+  if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("waitForAnswer",1,"CoreSession *");
+  if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("waitForAnswer",2,"CoreSession *");
+  
+  if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_CoreSession,0))){
+    SWIG_fail_ptr("CoreSession_waitForAnswer",1,SWIGTYPE_p_CoreSession);
+  }
+  
+  
+  if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_CoreSession,0))){
+    SWIG_fail_ptr("CoreSession_waitForAnswer",2,SWIGTYPE_p_CoreSession);
+  }
+  
+  (arg1)->waitForAnswer(arg2);
+  SWIG_arg=0;
+  
+  return SWIG_arg;
+  
+  if(0) SWIG_fail;
+  
+fail:
+  lua_error(L);
+  return SWIG_arg;
+}
+
+
 static int _wrap_CoreSession_execute__SWIG_0(lua_State* L) {
   int SWIG_arg = -1;
   CoreSession *arg1 = (CoreSession *) 0 ;
@@ -5306,6 +5387,9 @@ static swig_lua_method swig_CoreSession_methods[] = {
     {"setAutoHangup", _wrap_CoreSession_setAutoHangup}, 
     {"setHangupHook", _wrap_CoreSession_setHangupHook}, 
     {"ready", _wrap_CoreSession_ready}, 
+    {"answered", _wrap_CoreSession_answered}, 
+    {"mediaReady", _wrap_CoreSession_mediaReady}, 
+    {"waitForAnswer", _wrap_CoreSession_waitForAnswer}, 
     {"execute", _wrap_CoreSession_execute}, 
     {"sendEvent", _wrap_CoreSession_sendEvent}, 
     {"setEventData", _wrap_CoreSession_setEventData}, 
index f1df1c752cce23af459b72d544d9b2bd7eefb2bb..3e5555ed82a9b8e2492d9ab8b277b730102ab150 100644 (file)
@@ -327,6 +327,9 @@ sub DESTROY {
 *setAutoHangup = *freeswitchc::CoreSession_setAutoHangup;
 *setHangupHook = *freeswitchc::CoreSession_setHangupHook;
 *ready = *freeswitchc::CoreSession_ready;
+*answered = *freeswitchc::CoreSession_answered;
+*mediaReady = *freeswitchc::CoreSession_mediaReady;
+*waitForAnswer = *freeswitchc::CoreSession_waitForAnswer;
 *execute = *freeswitchc::CoreSession_execute;
 *sendEvent = *freeswitchc::CoreSession_sendEvent;
 *setEventData = *freeswitchc::CoreSession_setEventData;
index 28559f7fa45ae5b09a225e4d330f48700907e19f..c1df391a6ec180f42aa8060230119c90f9975687 100644 (file)
@@ -6547,6 +6547,99 @@ XS(_wrap_CoreSession_ready) {
 }
 
 
+XS(_wrap_CoreSession_answered) {
+  {
+    CoreSession *arg1 = (CoreSession *) 0 ;
+    bool result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: CoreSession_answered(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_answered" "', argument " "1"" of type '" "CoreSession *""'"); 
+    }
+    arg1 = reinterpret_cast< CoreSession * >(argp1);
+    result = (bool)(arg1)->answered();
+    ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_CoreSession_mediaReady) {
+  {
+    CoreSession *arg1 = (CoreSession *) 0 ;
+    bool result;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: CoreSession_mediaReady(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_mediaReady" "', argument " "1"" of type '" "CoreSession *""'"); 
+    }
+    arg1 = reinterpret_cast< CoreSession * >(argp1);
+    result = (bool)(arg1)->mediaReady();
+    ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_CoreSession_waitForAnswer) {
+  {
+    CoreSession *arg1 = (CoreSession *) 0 ;
+    CoreSession *arg2 = (CoreSession *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    void *argp2 = 0 ;
+    int res2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: CoreSession_waitForAnswer(self,calling_session);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CoreSession, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoreSession_waitForAnswer" "', argument " "1"" of type '" "CoreSession *""'"); 
+    }
+    arg1 = reinterpret_cast< CoreSession * >(argp1);
+    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_CoreSession, 0 |  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_waitForAnswer" "', argument " "2"" of type '" "CoreSession *""'"); 
+    }
+    arg2 = reinterpret_cast< CoreSession * >(argp2);
+    (arg1)->waitForAnswer(arg2);
+    
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
 XS(_wrap_CoreSession_execute__SWIG_0) {
   {
     CoreSession *arg1 = (CoreSession *) 0 ;
@@ -8290,6 +8383,9 @@ static swig_command_info swig_commands[] = {
 {"freeswitchc::CoreSession_setAutoHangup", _wrap_CoreSession_setAutoHangup},
 {"freeswitchc::CoreSession_setHangupHook", _wrap_CoreSession_setHangupHook},
 {"freeswitchc::CoreSession_ready", _wrap_CoreSession_ready},
+{"freeswitchc::CoreSession_answered", _wrap_CoreSession_answered},
+{"freeswitchc::CoreSession_mediaReady", _wrap_CoreSession_mediaReady},
+{"freeswitchc::CoreSession_waitForAnswer", _wrap_CoreSession_waitForAnswer},
 {"freeswitchc::CoreSession_execute", _wrap_CoreSession_execute},
 {"freeswitchc::CoreSession_sendEvent", _wrap_CoreSession_sendEvent},
 {"freeswitchc::CoreSession_setEventData", _wrap_CoreSession_setEventData},
index e8e6086b285f5366a3c15d1bfcadaefd45dbbf37..e5b92b052ae29aaa666ac7e6e0557777bcaf42a8 100644 (file)
@@ -218,6 +218,9 @@ class CoreSession(_object):
     def setAutoHangup(*args): return _freeswitch.CoreSession_setAutoHangup(*args)
     def setHangupHook(*args): return _freeswitch.CoreSession_setHangupHook(*args)
     def ready(*args): return _freeswitch.CoreSession_ready(*args)
+    def answered(*args): return _freeswitch.CoreSession_answered(*args)
+    def mediaReady(*args): return _freeswitch.CoreSession_mediaReady(*args)
+    def waitForAnswer(*args): return _freeswitch.CoreSession_waitForAnswer(*args)
     def execute(*args): return _freeswitch.CoreSession_execute(*args)
     def sendEvent(*args): return _freeswitch.CoreSession_sendEvent(*args)
     def setEventData(*args): return _freeswitch.CoreSession_setEventData(*args)
index cec904cd8302b23f4d2ad00f5d8ba4d193e29846..8084e6ad39b5130840e555eee401418cdb689bbd 100644 (file)
@@ -6760,6 +6760,80 @@ fail:
 }
 
 
+SWIGINTERN PyObject *_wrap_CoreSession_answered(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CoreSession *arg1 = (CoreSession *) 0 ;
+  bool result;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_answered",&obj0)) 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_answered" "', argument " "1"" of type '" "CoreSession *""'"); 
+  }
+  arg1 = reinterpret_cast< CoreSession * >(argp1);
+  result = (bool)(arg1)->answered();
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_mediaReady(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CoreSession *arg1 = (CoreSession *) 0 ;
+  bool result;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CoreSession_mediaReady",&obj0)) 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_mediaReady" "', argument " "1"" of type '" "CoreSession *""'"); 
+  }
+  arg1 = reinterpret_cast< CoreSession * >(argp1);
+  result = (bool)(arg1)->mediaReady();
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CoreSession_waitForAnswer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CoreSession *arg1 = (CoreSession *) 0 ;
+  CoreSession *arg2 = (CoreSession *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CoreSession_waitForAnswer",&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_waitForAnswer" "', argument " "1"" of type '" "CoreSession *""'"); 
+  }
+  arg1 = reinterpret_cast< CoreSession * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CoreSession, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CoreSession_waitForAnswer" "', argument " "2"" of type '" "CoreSession *""'"); 
+  }
+  arg2 = reinterpret_cast< CoreSession * >(argp2);
+  (arg1)->waitForAnswer(arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
 SWIGINTERN PyObject *_wrap_CoreSession_execute__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *resultobj = 0;
   CoreSession *arg1 = (CoreSession *) 0 ;
@@ -7736,6 +7810,9 @@ static PyMethodDef SwigMethods[] = {
         { (char *)"CoreSession_setAutoHangup", _wrap_CoreSession_setAutoHangup, METH_VARARGS, NULL},
         { (char *)"CoreSession_setHangupHook", _wrap_CoreSession_setHangupHook, METH_VARARGS, NULL},
         { (char *)"CoreSession_ready", _wrap_CoreSession_ready, METH_VARARGS, NULL},
+        { (char *)"CoreSession_answered", _wrap_CoreSession_answered, METH_VARARGS, NULL},
+        { (char *)"CoreSession_mediaReady", _wrap_CoreSession_mediaReady, METH_VARARGS, NULL},
+        { (char *)"CoreSession_waitForAnswer", _wrap_CoreSession_waitForAnswer, METH_VARARGS, NULL},
         { (char *)"CoreSession_execute", _wrap_CoreSession_execute, METH_VARARGS, NULL},
         { (char *)"CoreSession_sendEvent", _wrap_CoreSession_sendEvent, METH_VARARGS, NULL},
         { (char *)"CoreSession_setEventData", _wrap_CoreSession_setEventData, METH_VARARGS, NULL},
index fab6f58bbea7df35060fdc52e0e753cfcb193efe..c806bd0cccbd76a8579729da40bf4a7b6f91150a 100644 (file)
@@ -890,6 +890,15 @@ SWITCH_DECLARE(int) CoreSession::setAutoHangup(bool val)
        return SWITCH_STATUS_SUCCESS;
 }
 
+SWITCH_DECLARE(void) CoreSession::waitForAnswer(CoreSession *calling_session) 
+{
+       this_check_void();
+       sanity_check_noreturn;
+       
+       switch_ivr_wait_for_answer(calling_session ? calling_session->session : NULL, session);
+
+}
+
 SWITCH_DECLARE(void) CoreSession::setCallerData(char *var, char *val) {
 
        this_check_void();