Modularizando o src

Dependencies:   EALib EthernetInterface_vz mbed-rtos mbed

Fork of header_main_colinas_V0-20-09-14 by VZTECH

Revision:
97:8985817e8847
Parent:
92:92df17f538a8
Child:
99:e80850c51106
--- a/sip.cpp	Sat Jan 10 17:06:55 2015 +0000
+++ b/sip.cpp	Sat Jan 10 23:59:51 2015 +0000
@@ -123,6 +123,8 @@
     this->my_ip[ 15 ] = '\0';
     
     this->my_port = my_port;
+    if( debug_sip ) debug_msg("Fixado na porta %d", this->my_port );
+    
     this->my_rtp_port = fill_random_rtp_port();
     this->my_ext = id;
     itoa( this->my_ext, this->my_display, 10 );
@@ -172,7 +174,7 @@
     
     int sent = sock.sendTo( sip_server, buffer, strlen( buffer ) ); // > 400
 
-    if( debug_sip ) debug_msg("Sent %i of %i bytes to ext %d", sent, strlen( buffer ), my_ext );
+    if( debug_sip ) debug_msg("Sent %i of %i bytes to ext %d -- port %d", sent, strlen( buffer ), my_ext, my_port );
     
     if( sent != strlen( buffer ) ){
         sip_socket_send_failure++;
@@ -277,6 +279,7 @@
     strcat( buffer, ":" );
     itoa( my_port, itoa_buffer, 10 );
     strcat( buffer, itoa_buffer );
+    if( debug_sip ) debug_msg("Fixado na porta %s-", itoa_buffer  );
     strcat( buffer, ";branch=" );
     strcat( buffer, branch );
     strcat( buffer, "\r\nFrom: " );
@@ -1123,7 +1126,7 @@
             if( sip_response >= 400 && sip_response < 700 ){
                 if( debug_invite ) { 
                     buffer[ 11 ] = 0; 
-                    debug_msg("Busy Here :: %s", buffer + 8 );
+                    if( debug_invite ) debug_msg("Busy Here :: %s", buffer + 8 );
                 }
                 send_bye();
                 //if( call != NULL ) delete( call );
@@ -1177,4 +1180,8 @@
 
 void Sip::reset_call( void ){
     if( call != NULL ) call = NULL;    
-}
\ No newline at end of file
+}
+
+int Sip::get_ext( void ){ return my_ext; }
+
+int Sip::get_port( void ){ return my_port; }
\ No newline at end of file