Modularizando o src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

Revision:
89:0fe315117b00
Parent:
87:679ee0d594a9
Child:
91:c2a86b1f8aaa
--- a/call_box.cpp	Tue Jan 06 16:39:09 2015 +0000
+++ b/call_box.cpp	Wed Jan 07 21:48:53 2015 +0000
@@ -10,8 +10,12 @@
     timeslice = 0x00;
     status = cb_idle;
     sip = new Sip( ext, port );
-    
-    if( sip == NULL ) memory_is_over = true;
+    sip_socket_fd = sip->get_socket_fd();
+    if( sip == NULL )
+    {
+        memory_is_over = true;
+        if( debug_memory ) debug_msg("Sip allocation fail");
+    }
     
     next_aging_type = __CYCLES__;
     seconds.start();
@@ -70,6 +74,7 @@
         this->sip = new Sip( ext, port );
         if( sip == NULL ){
             memory_is_over = true;
+            if( debug_memory ) debug_msg("Call_Box cb allocation fail");
             return;
         }
     
@@ -89,6 +94,7 @@
         this->sip = new Sip( ext, port );
         if( sip == NULL ){
             memory_is_over = true;
+            if( debug_memory ) debug_msg("Call_Box cb allocation fail");
             return;    
         }
         sip->send_unregistry_pkg();
@@ -109,6 +115,7 @@
         
         if( sip != NULL ){
             memory_is_over = true;
+            if( debug_memory ) debug_msg("Call_Box cb allocation fail");
             return( NULL );
         }else{
             call = sip->invite();
@@ -137,6 +144,7 @@
             
             if( sip == NULL ){
                 memory_is_over = true;
+                if( debug_memory ) debug_msg("Call_Box cb allocation fail");
                 return( -1 );
             }else{
                 int out_read = sip->listen_SIP_server();
@@ -173,6 +181,7 @@
         
         if( sip == NULL ){
             memory_is_over = true;
+            if( debug_memory ) debug_msg("Call_Box cb allocation fail");
             return;
         }else{
         
@@ -222,4 +231,13 @@
 
 void Call_Box::set_bye_response_ok( void ){ this->bye_response = true; }
 void Call_Box::set_bye_response_pending( void ){ this->bye_response = false; }
-bool Call_Box::get_bye_response( void ){ return( this->bye_response ); }
\ No newline at end of file
+bool Call_Box::get_bye_response( void ){ return( this->bye_response ); }
+
+
+int Call_Box::get_sip_socket_fd( void ){
+    return( sip_socket_fd );
+}
+
+int Call_Box::sip_udp_drop_once( void ){
+    return sip->udp_drop_once();
+}
\ No newline at end of file