![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Modularizando o src
Dependencies: EALib EthernetInterface_vz mbed-rtos mbed
Fork of header_main_colinas_V0-20-09-14 by
Diff: call_manager.cpp
- Revision:
- 105:a930035b6556
- Parent:
- 99:e80850c51106
- Child:
- 108:18a3702650f3
diff -r 62646ef786a3 -r a930035b6556 call_manager.cpp --- a/call_manager.cpp Wed Feb 25 18:44:11 2015 +0000 +++ b/call_manager.cpp Tue Mar 10 18:10:57 2015 +0000 @@ -21,8 +21,8 @@ //cb->set_msg_id( cb->get_msg_id() & ~BIT7 ); cb->set_msg_id( ( cb->get_msg_id() + 1 ) & ~BIT7 ); - send2callboxes( __build_cb_package__( cb->get_ext(), cb->get_port(), __INVITE__, ( char * )data, - cb->get_msg_id(), __CB_BUFFER_SIZE__ - __VZ_HEADER_OFFSET__, write_buffer ) ); + send2callboxes( build_cb_package( cb->get_ext(), cb->get_port(), __INVITE__, ( char * )data, + cb->get_msg_id(), CB_BUFFER_SIZE - __VZ_HEADER_OFFSET__, write_buffer ) ); return; } @@ -40,8 +40,8 @@ //cb->set_msg_id( cb->get_msg_id() & ~BIT7 ); cb->set_msg_id( ( cb->get_msg_id() + 1 ) & ~BIT7 ); - send2callboxes( __build_cb_package__( cb->get_ext(), cb->get_port(), __CB_BYE__, ( char * )data, - cb->get_msg_id(), __CB_BUFFER_SIZE__ - __VZ_HEADER_OFFSET__, write_buffer ) ); + send2callboxes( build_cb_package( cb->get_ext(), cb->get_port(), __CB_BYE__, ( char * )data, + cb->get_msg_id(), CB_BUFFER_SIZE - __VZ_HEADER_OFFSET__, write_buffer ) ); return; } @@ -78,13 +78,11 @@ ts->return_timeslice( cb->get_timeslice() ); cb->set_timeslice( 0x00 ); data[ __TIMESLICE_PLACE__ ] = 0x00; -// cb->set_msg_id( ( cb->get_msg_id() & ~BIT7 ) + 1 ); cb->set_msg_id( ( cb->get_msg_id() + 1 ) & ~BIT7 ); - send2callboxes( __build_cb_package__( cb->get_ext(), cb->get_port(), __CB_BYE__, - ( char * )data, cb->get_msg_id(), __CB_BUFFER_SIZE__ - __VZ_HEADER_OFFSET__, write_buffer ) ); + send2callboxes( build_cb_package( cb->get_ext(), cb->get_port(), __CB_BYE__, + ( char * )data, cb->get_msg_id(), CB_BUFFER_SIZE - __VZ_HEADER_OFFSET__, write_buffer ) ); cb->send_bye(); set_status( cb->sip->status, sip_idle ); - //cb->re_start_timer(); cb->reset_cb_status(); } delete( call ); @@ -93,8 +91,8 @@ } void invite_handler( Vector * v_call, Vector * v_cb, Timeslice * ts, Call_Box * inviting_cb ){ - uint8_t data[ __CB_BUFFER_SIZE__ ]; - uint8_t write_buffer[ __CB_BUFFER_SIZE__ ]; + uint8_t data[ CB_BUFFER_SIZE ]; + uint8_t write_buffer[ CB_BUFFER_SIZE ]; if( inviting_cb != NULL ){ //if( inviting_cb->status != cb_on_call ){ @@ -126,8 +124,8 @@ data[ __TIMESLICE_PLACE__ ] = 0x00; - send2callboxes( __build_cb_package__( ext, port, __INVITE__, - ( char * )data, cb->get_msg_id(), __CB_BUFFER_SIZE__ - __VZ_HEADER_OFFSET__, write_buffer ) ); + send2callboxes( build_cb_package( ext, port, __INVITE__, + ( char * )data, cb->get_msg_id(), CB_BUFFER_SIZE - __VZ_HEADER_OFFSET__, write_buffer ) ); set_status( cb->sip->status, sip_idle ); @@ -147,8 +145,8 @@ //cb->set_msg_id( ( cb->get_msg_id() + 1 ) & ( ~BIT7 ) ); cb->set_msg_id( ( cb->get_msg_id() + 1 ) & ~BIT7 ); - send2callboxes( __build_cb_package__( ext, port, __INVITE__, - ( char * )data, cb->get_msg_id(), __CB_BUFFER_SIZE__ - __VZ_HEADER_OFFSET__, write_buffer ) ); + send2callboxes( build_cb_package( ext, port, __INVITE__, + ( char * )data, cb->get_msg_id(), CB_BUFFER_SIZE - __VZ_HEADER_OFFSET__, write_buffer ) ); if( debug_invite ) debug_msg("-- %d on TS::%d --", cb->get_ext(), data[ __TIMESLICE_PLACE__ ] ); } @@ -172,8 +170,8 @@ //cb->set_msg_id( ( cb->get_msg_id() & ~BIT7 ) + 1 ); cb->set_msg_id( ( cb->get_msg_id() + 1 ) & ~BIT7 ); - send2callboxes( __build_cb_package__( ext, port, __INVITE__, ( char * )data, - cb->get_msg_id(), __CB_BUFFER_SIZE__ - __VZ_HEADER_OFFSET__, write_buffer ) ); + send2callboxes( build_cb_package( ext, port, __INVITE__, ( char * )data, + cb->get_msg_id(), CB_BUFFER_SIZE - __VZ_HEADER_OFFSET__, write_buffer ) ); //debug_msg("send ok liga o mic"); cb->set_invite_response_pending(); @@ -194,8 +192,8 @@ //cb->set_msg_id( ( cb->get_msg_id() & ~BIT7 ) + 1 ); cb->set_msg_id( ( cb->get_msg_id() + 1 ) & ~BIT7 ); - send2callboxes( __build_cb_package__( ext, port, __CB_BYE__, - ( char * )data, cb->get_msg_id(), __CB_BUFFER_SIZE__ - __VZ_HEADER_OFFSET__, write_buffer ) ); + send2callboxes( build_cb_package( ext, port, __CB_BYE__, + ( char * )data, cb->get_msg_id(), CB_BUFFER_SIZE - __VZ_HEADER_OFFSET__, write_buffer ) ); if( debug_invite ) debug_msg( "-- Trying -- denying call request << Busy Here >> --" ); @@ -221,8 +219,8 @@ //cb->set_msg_id( ( cb->get_msg_id() & ~BIT7 ) + 1 ); cb->set_msg_id( ( cb->get_msg_id() + 1 ) & ~BIT7 ); - send2callboxes( __build_cb_package__( ext, port, __CB_BYE__, - ( char * )data, cb->get_msg_id(), __CB_BUFFER_SIZE__ - __VZ_HEADER_OFFSET__, write_buffer ) ); + send2callboxes( build_cb_package( ext, port, __CB_BYE__, + ( char * )data, cb->get_msg_id(), CB_BUFFER_SIZE - __VZ_HEADER_OFFSET__, write_buffer ) ); for( register uint8_t i = 0; i < v_call->size(); i++ ){ VZ_call * call = ( VZ_call * )v_call->get_element( i );