Modularizando o src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

Revision:
116:39a41ebb675c
Parent:
115:a1e1e2e60a2c
Child:
117:e9facba9db27
--- a/call_box.cpp	Thu Apr 23 13:57:54 2015 +0000
+++ b/call_box.cpp	Thu Apr 23 20:24:09 2015 +0000
@@ -282,14 +282,19 @@
 int Call_Box::get_sip_ext( void ){ return this->sip->get_ext(); }
 int Call_Box::get_sip_port( void ){ return this->sip->get_port(); }
 
-int Call_Box::get_timer( void ){ return t.read(); }
+int Call_Box::get_timer ( void )
+{
+    int now = t.read ();
+    if( now >= 9999 || now <= 0 ) t.reset ();
+    return t.read (); 
+}
 
 int Call_Box::get_rtp_port ( void )
 {
     if( this->sip != NULL ){
         return this->sip->get_sip_rtp_port();
     }else{
-        if( debug_cb) debug_msg("Sip equals NULL o.O");
+        if( debug_cb ) debug_msg("Sip equals NULL o.O");
         deleted_sip++;
         debug_msg("Sip equals NULL o.O");
         return -1;
@@ -307,6 +312,27 @@
     }
 }
 
+void Call_Box::init_rtp_timer ( void )
+{
+    this->rtp_timer.start();   
+}
+
+void Call_Box::reset_rtp_timer ( void )
+{
+    this->rtp_timer.stop();
+    this->rtp_timer.reset();
+}
+
+bool Call_Box::is_rtp_timer_timeout ( void )
+{
+    return ( rtp_timer.read () > RTP_REQUEST_PORT_TIMEOUT ) ? true : false;  
+}
+
+int Call_Box::get_rtp_timer ( void )
+{
+    return ( rtp_timer.read () );
+}
+
 int Call_Box::print_yourself ( void )
 {   
     send_msg ("");
@@ -353,25 +379,4 @@
     send_msg ("");
     
     return ( sizeof( Call_Box ) );
-}
- 
-void Call_Box::init_rtp_timer ( void )
-{
-    this->rtp_timer.start();   
-}
- 
-void Call_Box::reset_rtp_timer ( void )
-{
-    this->rtp_timer.stop();
-    this->rtp_timer.reset();
-}
- 
-bool Call_Box::is_rtp_timer_timeout ( void )
-{
-    return ( rtp_timer.read () > RTP_REQUEST_PORT_TIMEOUT ) ? true : false;  
-}
- 
-int Call_Box::get_rtp_timer ( void )
-{
-    return ( rtp_timer.read () );
 }
\ No newline at end of file