voltando a versao de n aberturas e fechamentos de sockets data 19/09

Dependencies:   EthernetInterface NTPClient mbed-rtos mbed EALib

Fork of header_main_publish by VZTECH

Revision:
12:07fd716e0f35
Parent:
10:22da1a0ac1e1
Child:
13:ae278302dffe
--- a/main.cpp	Mon Sep 15 20:58:59 2014 +0000
+++ b/main.cpp	Tue Sep 16 13:21:01 2014 +0000
@@ -311,6 +311,7 @@
                 }
             }break;
         }// fim switch
+        debug_msg("Sai do loop");
         for( register int i = 0; i < v_call->size(); i++ ){
             VZ_call * call = ( VZ_call * )v_call->get_element( i );
             int length = 0;
@@ -330,18 +331,23 @@
                 __send_to_cb__( pkg2cb );
             }
         } 
+        debug_msg("");
         if( v_call->size() ) registry_aging( v_cb, buffer, write_buffer );
         
+        debug_msg("");
         int ret = sip_manager( v_cb, v_call, write_buffer );
+        debug_msg("--ret::%d", ret );
         if( ret > 0x00 ){
             Call_Box * cb = __find_CB__( v_cb, ret );
             if( cb != NULL ){
+                debug_msg("");
                 if( cb->status == cb_on_call ){
                     ts->return_timeslice( cb->get_timeslice() );
                     cb->set_timeslice( 0x00 );
                     set_status(cb->status,cb_idle);
                     buffer[ __TIMESLICE_PLACE__ ] = 0x00;
                     cb->set_msg_id( ( ( cb->get_msg_id() ) + 1 ) & ( BIT7 ^ 0xff ) );
+                    debug_msg("");
                     for( register uint8_t i = 0; i < v_call->size(); i++ ){
                         VZ_call * call = ( VZ_call * )v_call->get_element( i );
                         if( call->get_cb_ext() == ret ){
@@ -349,6 +355,7 @@
                             delete( call );
                         }
                     }
+                    debug_msg("");
                     __send_to_cb__( __build_cb_package__( ext, port, __CB_BYE__, 
                         ( char * )buffer, cb->get_msg_id(), __CB_BUFFER_SIZE__ - __VZ_HEADER_OFFSET__, write_buffer ) );
                     cb->reset_sip();
@@ -356,7 +363,7 @@
                 }
             }else debug_msg("Nao encontrado CBx :: %d -- Type :: %d", ext, type );
         }
-        
+        debug_msg("");
         call_manager( v_call, v_cb, buffer, write_buffer, ts );
         
         static uint8_t flag = 0;