![](/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
sip_manager.cpp@122:480c44b0e205, 2015-05-11 (annotated)
- Committer:
- klauss
- Date:
- Mon May 11 15:16:36 2015 +0000
- Revision:
- 122:480c44b0e205
- Parent:
- 121:ee02790d00b7
- Child:
- 135:2f4290590e51
E00 - Limitar em 1500 o show_sip
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 122:480c44b0e205 | 1 | #include "sip_manager.h" |
klauss | 74:81c47fff88a5 | 2 | |
klauss | 74:81c47fff88a5 | 3 | int sip_manager( Vector * v_cb ){ |
klauss | 81:3656f00ab3db | 4 | static int sip_index = 0; |
klauss | 74:81c47fff88a5 | 5 | if( v_cb != NULL ){ |
klauss | 74:81c47fff88a5 | 6 | if( v_cb->size() > 0 ){ |
klauss | 81:3656f00ab3db | 7 | if( sip_index >= v_cb->size() ) sip_index = 0; |
klauss | 74:81c47fff88a5 | 8 | }else return 0; |
klauss | 81:3656f00ab3db | 9 | Call_Box * cb = (Call_Box * )v_cb->get_element( sip_index ); |
klauss | 74:81c47fff88a5 | 10 | /* Retorna |
klauss | 74:81c47fff88a5 | 11 | = 0 :: ok |
klauss | 74:81c47fff88a5 | 12 | < 0 :: tive problemas |
klauss | 74:81c47fff88a5 | 13 | > 0 :: devo remover essa call do vetor de calls |
klauss | 74:81c47fff88a5 | 14 | */ |
klauss | 74:81c47fff88a5 | 15 | int returned_value = 0; |
klauss | 74:81c47fff88a5 | 16 | |
klauss | 81:3656f00ab3db | 17 | //FIXME pensar em ouvir todos os cbx que estiverem em ligacao apenas, sao poucos |
klauss | 82:f55d13babca0 | 18 | //if( cb->status == cb_on_call || cb->status == cb_idle ){ |
klauss | 121:ee02790d00b7 | 19 | if( cb -> get_status () == cb_on_call ){ |
klauss | 74:81c47fff88a5 | 20 | returned_value = cb->listen_SIP_server(); |
klauss | 74:81c47fff88a5 | 21 | } |
klauss | 81:3656f00ab3db | 22 | sip_index++; |
klauss | 74:81c47fff88a5 | 23 | return( returned_value ); |
klauss | 74:81c47fff88a5 | 24 | } |
klauss | 74:81c47fff88a5 | 25 | return( -1 ); |
klauss | 74:81c47fff88a5 | 26 | } |