[Freeswitch-svn] [commit] r11526 - freeswitch/branches/gmaruzz/mod_skypiax

FreeSWITCH SVN gmaruzz at freeswitch.org
Tue Jan 27 16:24:48 PST 2009


Author: gmaruzz
Date: Tue Jan 27 18:24:48 2009
New Revision: 11526

Log:
skypiax: moving switch specific things out of skypiax_protocol.c

Modified:
   freeswitch/branches/gmaruzz/mod_skypiax/mod_skypiax.c
   freeswitch/branches/gmaruzz/mod_skypiax/skypiax.h
   freeswitch/branches/gmaruzz/mod_skypiax/skypiax_protocol.c

Modified: freeswitch/branches/gmaruzz/mod_skypiax/mod_skypiax.c
==============================================================================
--- freeswitch/branches/gmaruzz/mod_skypiax/mod_skypiax.c	(original)
+++ freeswitch/branches/gmaruzz/mod_skypiax/mod_skypiax.c	Tue Jan 27 18:24:48 2009
@@ -1042,6 +1042,27 @@
 	return skypiax_do_skypeapi_thread_func(obj);
 }
 
+int dtmf_received(private_t *tech_pvt, char *value){
+              switch_core_session_t *session = NULL;
+              switch_channel_t *channel = NULL;
+
+              session = switch_core_session_locate(tech_pvt->session_uuid_str);
+              channel = switch_core_session_get_channel(session);
+
+              if (channel) {
+                switch_dtmf_t dtmf =
+                  { (char) value[0], switch_core_default_dtmf_duration(0) };
+                DEBUGA_SKYPE("%c DTMF %s\n", SKYPIAX_P_LOG, dtmf.digit,
+                             switch_channel_get_name(channel));
+                switch_mutex_lock(tech_pvt->flag_mutex);
+                switch_channel_queue_dtmf(channel, &dtmf);
+                switch_set_flag(tech_pvt, TFLAG_DTMF);
+                switch_mutex_unlock(tech_pvt->flag_mutex);
+              }
+              switch_core_session_rwunlock(session);
+
+	return 0;
+}
 
 /* For Emacs:
  * Local Variables:

Modified: freeswitch/branches/gmaruzz/mod_skypiax/skypiax.h
==============================================================================
--- freeswitch/branches/gmaruzz/mod_skypiax/skypiax.h	(original)
+++ freeswitch/branches/gmaruzz/mod_skypiax/skypiax.h	Tue Jan 27 18:24:48 2009
@@ -254,3 +254,4 @@
 
 void * skypiax_do_skypeapi_thread_func(void *obj);
 void *SWITCH_THREAD_FUNC skypiax_do_skypeapi_thread(switch_thread_t * thread, void *obj);
+int dtmf_received(private_t *tech_pvt, char *value);

Modified: freeswitch/branches/gmaruzz/mod_skypiax/skypiax_protocol.c
==============================================================================
--- freeswitch/branches/gmaruzz/mod_skypiax/skypiax_protocol.c	(original)
+++ freeswitch/branches/gmaruzz/mod_skypiax/skypiax_protocol.c	Tue Jan 27 18:24:48 2009
@@ -1349,12 +1349,13 @@
                 tech_pvt->interface_state = SKYPIAX_STATE_PRERING;
             }
 
-            if (!strcasecmp(prop, "DTMF")) {
-              switch_core_session_t *session = NULL;
-              switch_channel_t *channel = NULL;
+            if (!strcasecmp(prop, "DTMF")) { 
+              //switch_core_session_t *session = NULL;
+              //switch_channel_t *channel = NULL;
 
               DEBUGA_SKYPE("Call %s received a DTMF: %s\n", SKYPIAX_P_LOG, id, value);
 
+	      /*
               session = switch_core_session_locate(tech_pvt->session_uuid_str);
               channel = switch_core_session_get_channel(session);
 
@@ -1369,6 +1370,8 @@
                 switch_mutex_unlock(tech_pvt->flag_mutex);
               }
               switch_core_session_rwunlock(session);
+	      */
+	      dtmf_received(tech_pvt, value);
             }
 
             if (!strcasecmp(prop, "FAILUREREASON")) {
@@ -1532,7 +1535,7 @@
                   DEBUGA_SKYPE("skype_call: %s SKYPIAX_CONTROL_ANSWER sent\n",
                                SKYPIAX_P_LOG, id);
 
-                if (1) {        //FIXME
+                if (1) {        //FIXME //CICOPET
                   char msg_to_skype[1024];
                   switch_threadattr_t *thd_attr = NULL;
 
@@ -1568,7 +1571,7 @@
 
                 //FIXME *new_session=switch_loadable_module_create_interface(skypiax_endpoint_interface, pool);
 
-                if (!strlen(tech_pvt->session_uuid_str)) {
+                if (!strlen(tech_pvt->session_uuid_str)) { //CICOPET
                   switch_core_session_t *session = NULL;
                   //private_t *tech_pvt = NULL;
                   switch_channel_t *channel = NULL;
@@ -1618,7 +1621,7 @@
                     }
                   }
                   switch_channel_mark_answered(channel);
-                } else {
+                } else { //CICOPET
                   switch_core_session_t *session = NULL;
                   switch_channel_t *channel = NULL;
 
@@ -1687,10 +1690,6 @@
 int skypiax_skype_call(private_t * tech_pvt, char *rdest, int timeout)
 {
   char msg_to_skype[1024];
-  //private_t *tech_pvt;
-  //switch_caller_profile_t *caller_profile;
-
-  //tech_pvt = p;
 
   if (option_debug > 10) {
     DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG);



More information about the Freeswitch-svn mailing list