]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add session.getState()
authorAnthony Minessale <anthony.minessale@gmail.com>
Sat, 19 Sep 2009 15:26:19 +0000 (15:26 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sat, 19 Sep 2009 15:26:19 +0000 (15:26 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14924 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_cpp.h
src/mod/languages/mod_managed/freeswitch_wrap.cxx
src/mod/languages/mod_managed/managed/swig.cs
src/switch_cpp.cpp

index 4c690db6cb4700c0d408ae926c006439759fc45e..0156146e569c205e98082379cf7c0201abb019d6 100644 (file)
@@ -236,6 +236,7 @@ SWITCH_DECLARE(void) consoleCleanLog(char *msg);
                 SWITCH_DECLARE(void) say(const char *tosay, const char *module_name, const char *say_type, const char *say_method);
                 SWITCH_DECLARE(void) sayPhrase(const char *phrase_name, const char *phrase_data = "", const char *phrase_lang = NULL);
                 SWITCH_DECLARE(const char *) hangupCause();
+                SWITCH_DECLARE(const char *) getState();
 
        /** \brief Record to a file
         * \param file_name 
index 9da475d1645d7e4f10d5b7ddc6efeead0b87cd0c..7f7704f849c997562b6f7fb6672f38f7d382727f 100644 (file)
@@ -28788,6 +28788,18 @@ SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_hangupCause(void * jarg1) {
 }
 
 
+SWIGEXPORT char * SWIGSTDCALL CSharp_CoreSession_getState(void * jarg1) {
+  char * jresult ;
+  CoreSession *arg1 = (CoreSession *) 0 ;
+  char *result = 0 ;
+  
+  arg1 = (CoreSession *)jarg1; 
+  result = (char *)(arg1)->getState();
+  jresult = SWIG_csharp_string_callback((const char *)result); 
+  return jresult;
+}
+
+
 SWIGEXPORT int SWIGSTDCALL CSharp_CoreSession_RecordFile(void * jarg1, char * jarg2, int jarg3, int jarg4, int jarg5) {
   int jresult ;
   CoreSession *arg1 = (CoreSession *) 0 ;
index 5f2913088bec8316e22fc5e398d625b621a2ad38..52d8b8deab6fcee056a3f402566bdc87037b6650 100644 (file)
@@ -250,6 +250,11 @@ public class CoreSession : IDisposable {
     return ret;
   }
 
+  public string getState() {
+    string ret = freeswitchPINVOKE.CoreSession_getState(swigCPtr);
+    return ret;
+  }
+
   public int RecordFile(string file_name, int time_limit, int silence_threshold, int silence_hits) {
     int ret = freeswitchPINVOKE.CoreSession_RecordFile(swigCPtr, file_name, time_limit, silence_threshold, silence_hits);
     return ret;
@@ -11388,6 +11393,9 @@ class freeswitchPINVOKE {
   [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_hangupCause")]
   public static extern string CoreSession_hangupCause(HandleRef jarg1);
 
+  [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_getState")]
+  public static extern string CoreSession_getState(HandleRef jarg1);
+
   [DllImport("mod_managed", EntryPoint="CSharp_CoreSession_RecordFile")]
   public static extern int CoreSession_RecordFile(HandleRef jarg1, string jarg2, int jarg3, int jarg4, int jarg5);
 
@@ -19235,11 +19243,10 @@ namespace FreeSWITCH.Native {
   SCF_USE_SQL = (1 << 0),
   SCF_NO_NEW_SESSIONS = (1 << 1),
   SCF_SHUTTING_DOWN = (1 << 2),
-  SCF_CRASH_PROT = (1 << 3),
-  SCF_VG = (1 << 4),
-  SCF_RESTART = (1 << 5),
-  SCF_SHUTDOWN_REQUESTED = (1 << 6),
-  SCF_USE_AUTO_NAT = (1 << 7)
+  SCF_VG = (1 << 3),
+  SCF_RESTART = (1 << 4),
+  SCF_SHUTDOWN_REQUESTED = (1 << 5),
+  SCF_USE_AUTO_NAT = (1 << 6)
 }
 
 }
index 2e0613afb31fe48ea1d9e28d792a25edbbf09b3c..24e4d734a90d57255dc2b62f296ec8a15290388a 100644 (file)
@@ -938,6 +938,18 @@ SWITCH_DECLARE(const char *) CoreSession::hangupCause()
        return switch_channel_cause2str(cause);
 }
 
+SWITCH_DECLARE(const char *) CoreSession::getState()
+{
+       this_check(NULL);
+
+       if (channel) {
+               return switch_channel_state_name(switch_channel_get_state(channel));
+       }
+
+       return "ERROR";
+
+}
+
 SWITCH_DECLARE(int) CoreSession::originate(CoreSession *a_leg_session, char *dest, int timeout, switch_state_handler_table_t *handlers)
 {