Author: jerome
Date: 2009-12-15 14:44:04 +0100 (Tue, 15 Dec 2009)
New Revision: 5981

Modified:
   
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py
Log:
* The plugin starts itself when user is making calls from Skype client 
interface.

Modified: 
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py
===================================================================
--- 
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py
   2009-12-15 11:29:17 UTC (rev 5980)
+++ 
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py
   2009-12-15 13:44:04 UTC (rev 5981)
@@ -153,10 +153,7 @@
         self.client.start()
         
         if self.configuration().getIsOutgoing():
-            #Then getting online contact list.
-            self.command = 'outgoing'
-            self.client.notify('outgoing_call')
-          
+            self.client.notify('get_outgoing_command')
     
     
     def incomingPluginEvent(self, eventName, eventValues):
@@ -186,6 +183,7 @@
             #Proceed call
             if eventName   == 'head':
                 self.client.notify('call_contact')
+                
             #Next contact          
             elif eventName == 'left':
                 self.client.notify('next_contact')
@@ -246,14 +244,25 @@
             self.throwNotification("start")
             self.throwMessage('%s' % Message[4:])
             self.throwNotification("stop")
+        
+        elif Message == 'command>interface_outgoing_call':
+            self.throwNotification("start")
+            self.throwActuation("upFlippers")
+            self.throwActuation("openMouth")
+            self.throwNotification("stop")
+            self.command = 'wait_end_call'
+          
+        elif Message == 'command>user_outgoing_call':
+            self.command = 'outgoing'
+            self.client.notify('get_contacts')
 
     
     def ClientOnConnected(self, id):
         '''
         '''
         pass
+            
     
-    
     ##----------------------------------------------------------------
     ##  * DAEMON command and functions.
     ##----------------------------------------------------------------
@@ -346,8 +355,7 @@
         '''
         Starting the plugin with 'incomingCall' command.
         '''
-        command = 'run'
-        request = '/plugins_server/start_plugin?command='+ command + '&uuid='+ 
self.uuid +'&parameters='
+        request = '/plugins_server/start_plugin?command=run&uuid='+ self.uuid 
+'&parameters='
         TuxDroidServerUtils.sendRequest("127.0.0.1", self.port, request)
         self.command = 'incoming'
     
@@ -358,14 +366,21 @@
         '''
         #Send reset switches signal.
         self.serv.notify('command>endcall')
+        self.command = ""
        
         
     
     def OnOutgoingCall(self, contactHandle):
         '''
-        Outgoing call finished event.
+        Outgoing call in progress event.
         '''
-        self.serv.notify('command>outgoing')
+        #If call was done from skype client interface, then start the plugin
+        if not ( self.command == 'user_outgoing_call' ):
+            parameters = 'isOutgoing=true'
+            request = '/plugins_server/start_plugin?command=run&uuid='+ 
self.uuid +'&parameters=' + parameters
+            TuxDroidServerUtils.sendRequest("127.0.0.1", self.port, request)
+            self.command = 'interface_outgoing_call'
+            
         
     
     def OnOutgoingFinished(self, contactHandle):
@@ -373,6 +388,7 @@
         '''
         #Send reset switches signal.
         self.serv.notify('command>endcall')
+        self.command = ""
     
     
     def OnChatMessage(self, contactHandle):
@@ -531,12 +547,12 @@
             self.synchronious.rejectCall()
         
         #--------  Outgoing IPN messages --------#        
-        elif Message == 'outgoing_call':
+        elif Message == 'get_contacts':
             #Outgoing call requested, so getting online list and sending 
outgoing command.
             self.onlineList = self.synchronious.getOnlineList()
             #And throwing the first online contact in list.
             self.nextContact()
-   
+            
         #Outgoing
         elif Message == 'call_contact':
             #Proceed call.
@@ -552,6 +568,16 @@
             thread = threading.Thread(target=self.previousContact)
             thread.start()
         
+        elif Message == 'get_outgoing_command':
+            if self.command == 'interface_outgoing_call':
+                #User call someone with Skype client interface.
+                self.serv.notify('command>interface_outgoing_call')
+                self.command = 'interface_outgoing_call'
+            else:
+                #User pick contact from tuxdroid
+                self.serv.notify('command>user_outgoing_call')
+                self.command = 'user_outgoing_call'
+        
         #--------  Common IPN messages --------#
         elif Message == 'end_call':
             self.synchronious.finishCall()


------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to