Modularizando o src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

Revision:
29:7246460b73f8
Parent:
14:22a35f575502
Child:
48:195c97f12e8e
--- a/call_box.cpp	Tue Sep 23 18:28:37 2014 +0000
+++ b/call_box.cpp	Wed Sep 24 18:02:18 2014 +0000
@@ -1,4 +1,5 @@
 #include "call_box.h"
+#include "prompt.h"
 
 Call_Box::Call_Box( int ext, int port ){
     this->ext = ext;
@@ -45,17 +46,13 @@
 void Call_Box::registry( void ){
     if( this->sip == NULL ){
         this->sip = new Sip( ext, port );
-        debug_msg(" Registrando %d", ext );
     
         sip->registry();
     
         delete( sip );
         this->sip = NULL;
-        debug_msg(" Registrado %d", ext );
     }else{
-        debug_msg(" Registrando %d", ext )
         sip->registry();
-        debug_msg(" Registrado %d", ext );
     }
 }
 
@@ -73,25 +70,23 @@
 }
 
 VZ_call * Call_Box::invite( void ){
+    t.stop();
+    VZ_call * call = NULL;
+    
     if( this->sip == NULL ){
-        debug_msg("entrei no invite");
         this->sip = new Sip( ext, port );
         
-        VZ_call * call = sip->invite();
+        call = sip->invite();
         
         delete( sip );
         this->sip = NULL;
-        
-        debug_msg("Valor do retorno do invite :: %p ", call );        
-        return( call );
-    }else{
-        debug_msg("entrei no invite persistente");
-        
-        VZ_call * call = sip->invite();
-        
-        debug_msg("Valor do retorno do invite persistente :: %p ", call );        
-        return( call );
+    }else{   
+        call = sip->invite();
     }
+    
+    if( debug_cb ) debug_msg("Call returned value :: %p ", (void * )call );
+    if( call == NULL ) t.start();
+    return( call );
 }
 
 /*  Retorna 
@@ -152,6 +147,10 @@
     if( this->sip != NULL ){
         this->sip->status = status;
     }else{
-        debug_msg("Sem objeto sip vinculado");
+        if( debug_cb) debug_msg("Sem objeto sip vinculado");
     }        
+}
+
+void Call_Box::re_start_timer( void ){
+    t.start();    
 }
\ No newline at end of file