![](/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
call_box.h@97:8985817e8847, 2015-01-10 (annotated)
- Committer:
- klauss
- Date:
- Sat Jan 10 23:59:51 2015 +0000
- Revision:
- 97:8985817e8847
- Parent:
- 92:92df17f538a8
- Child:
- 99:e80850c51106
wip
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
klauss | 69:65665afbad5d | 1 | /** |
klauss | 69:65665afbad5d | 2 | * @file call_box.h |
klauss | 69:65665afbad5d | 3 | * @Synopsis Implementa as funções de gerenciamento do Call_Box |
klauss | 69:65665afbad5d | 4 | * @author Jhonatan Casale |
klauss | 69:65665afbad5d | 5 | * @version 1 |
klauss | 69:65665afbad5d | 6 | * @date 2014-11-06 |
klauss | 69:65665afbad5d | 7 | * \class Call_Box |
klauss | 69:65665afbad5d | 8 | */ |
klauss | 0:4d17cd9c8f9d | 9 | #ifndef __CALL_BOX_H__ |
klauss | 0:4d17cd9c8f9d | 10 | #define __CALL_BOX_H__ |
klauss | 0:4d17cd9c8f9d | 11 | |
klauss | 0:4d17cd9c8f9d | 12 | #include "mbed.h" |
klauss | 0:4d17cd9c8f9d | 13 | #include "object.h" |
klauss | 0:4d17cd9c8f9d | 14 | #include "sip.h" |
klauss | 0:4d17cd9c8f9d | 15 | #include "debug.h" |
klauss | 85:b6f2dc1d0f4f | 16 | #include "shared_variables.h" |
klauss | 74:81c47fff88a5 | 17 | |
klauss | 78:1353744f01e1 | 18 | #define __RESQUEST_TIME__ 3 |
klauss | 92:92df17f538a8 | 19 | #define MAX_INVITE_RETRY 30 |
klauss | 92:92df17f538a8 | 20 | |
klauss | 78:1353744f01e1 | 21 | |
klauss | 78:1353744f01e1 | 22 | #define __TIMEOUT__ 250 |
klauss | 69:65665afbad5d | 23 | ///< O tempo que a Header demora para "pingar" o Call_Box para saber se esta tudo bem. |
klauss | 78:1353744f01e1 | 24 | #define __RANGE_TO_REGISTER__ 150 |
klauss | 78:1353744f01e1 | 25 | ///< Doc. later |
klauss | 78:1353744f01e1 | 26 | #define __TIME_TO_REGISTER__ __TIMEOUT__ - __RANGE_TO_REGISTER__ |
klauss | 78:1353744f01e1 | 27 | |
klauss | 78:1353744f01e1 | 28 | #define __CYCLES__ __TIME_TO_REGISTER__ / __RESQUEST_TIME__ // 200 // 3 ~ 66 |
klauss | 78:1353744f01e1 | 29 | |
klauss | 78:1353744f01e1 | 30 | #define REQUEST_REGISTRY -1 |
klauss | 78:1353744f01e1 | 31 | #define REQUEST_PEND -2 |
klauss | 78:1353744f01e1 | 32 | #define REQUEST_PING -4 |
klauss | 78:1353744f01e1 | 33 | |
klauss | 78:1353744f01e1 | 34 | ///< Valor usado como referencia para registro do equipamento CBx. |
klauss | 55:2f5e7374af9d | 35 | #define __MAX_ATTEMPTS__ 5 |
klauss | 69:65665afbad5d | 36 | ///< O numero maximo de vezes que a Header vai tentar pingar o Call_Box |
klauss | 69:65665afbad5d | 37 | #define __STEP__ 30 |
klauss | 69:65665afbad5d | 38 | ///< Usado para aumentar o intervalo entre cada ping, fora de uso atualmente. |
klauss | 0:4d17cd9c8f9d | 39 | #define __MAX_TIMEOUT__ __STEP__ * __MAX_ATTEMPTS__ |
klauss | 69:65665afbad5d | 40 | ///< Usado para limitar o tempo maximo de timeout do Call_Box sem responder o ping, fora de uso. |
klauss | 0:4d17cd9c8f9d | 41 | |
klauss | 0:4d17cd9c8f9d | 42 | #define cb_idle 1 |
klauss | 69:65665afbad5d | 43 | ///< Representa que o Call_Box esta disponivel |
klauss | 0:4d17cd9c8f9d | 44 | #define cb_ringing 2 |
klauss | 69:65665afbad5d | 45 | ///< Representa o Call_Box no status, discando. |
klauss | 0:4d17cd9c8f9d | 46 | #define cb_trying 3 |
klauss | 69:65665afbad5d | 47 | ///< Representa o Call_Box no status tentando concluir o pedido de ligação. |
klauss | 0:4d17cd9c8f9d | 48 | #define cb_on_call 4 |
klauss | 69:65665afbad5d | 49 | ///< Representa que o Call_Box já esta em uma ligação. |
klauss | 0:4d17cd9c8f9d | 50 | #define cb_busy 5 |
klauss | 69:65665afbad5d | 51 | ///< Representa que o Call_Box esta ocupado. |
klauss | 78:1353744f01e1 | 52 | #define cb_denied 6 |
klauss | 78:1353744f01e1 | 53 | ///< Representa que o pedido de invite do Call_Box foi negado. |
klauss | 0:4d17cd9c8f9d | 54 | |
klauss | 0:4d17cd9c8f9d | 55 | class Call_Box : public Object{ |
klauss | 0:4d17cd9c8f9d | 56 | private : |
klauss | 0:4d17cd9c8f9d | 57 | int ext; // ramal |
klauss | 0:4d17cd9c8f9d | 58 | int port; // porta |
klauss | 0:4d17cd9c8f9d | 59 | Timer t; |
klauss | 0:4d17cd9c8f9d | 60 | uint8_t remaining_attempts; |
klauss | 0:4d17cd9c8f9d | 61 | float timeout; |
klauss | 0:4d17cd9c8f9d | 62 | uint8_t msg_id; |
klauss | 0:4d17cd9c8f9d | 63 | uint8_t timeslice; |
klauss | 78:1353744f01e1 | 64 | uint8_t next_aging_type; |
klauss | 81:3656f00ab3db | 65 | bool invite_response; |
klauss | 92:92df17f538a8 | 66 | uint8_t invite_retry_count; |
klauss | 81:3656f00ab3db | 67 | bool bye_response; |
klauss | 78:1353744f01e1 | 68 | Timer seconds; |
klauss | 89:0fe315117b00 | 69 | int sip_socket_fd; |
klauss | 0:4d17cd9c8f9d | 70 | public : |
klauss | 69:65665afbad5d | 71 | /** |
klauss | 69:65665afbad5d | 72 | * @Synopsis Objeto Sip que será usado para tratativas com o servidor. |
klauss | 69:65665afbad5d | 73 | * |
klauss | 69:65665afbad5d | 74 | * \note Esse objeto é criado no construtor da classe Call_Box, com os mesmos parâmetros passados para o |
klauss | 69:65665afbad5d | 75 | * construtor da classe Call_Box. |
klauss | 69:65665afbad5d | 76 | */ |
klauss | 0:4d17cd9c8f9d | 77 | Sip * sip; |
klauss | 69:65665afbad5d | 78 | |
klauss | 69:65665afbad5d | 79 | /** |
klauss | 69:65665afbad5d | 80 | * @Synopsis Cria um objeto Call_Box |
klauss | 69:65665afbad5d | 81 | * |
klauss | 69:65665afbad5d | 82 | * @param ext Vincula o objeto ao ramal informado |
klauss | 69:65665afbad5d | 83 | * @param port Vincula o objeto a porto informada. |
klauss | 69:65665afbad5d | 84 | * |
klauss | 69:65665afbad5d | 85 | * Exemplo: |
klauss | 69:65665afbad5d | 86 | * @code |
klauss | 69:65665afbad5d | 87 | * ... |
klauss | 69:65665afbad5d | 88 | * int ext = 5121; |
klauss | 69:65665afbad5d | 89 | * int port = 5021; |
klauss | 69:65665afbad5d | 90 | * Call_Box * cb = new Call_Box( ext, port ); |
klauss | 69:65665afbad5d | 91 | * ... |
klauss | 69:65665afbad5d | 92 | * @endcode |
klauss | 69:65665afbad5d | 93 | */ |
klauss | 0:4d17cd9c8f9d | 94 | Call_Box( int ext, int port ); |
klauss | 69:65665afbad5d | 95 | |
klauss | 69:65665afbad5d | 96 | /** |
klauss | 69:65665afbad5d | 97 | * @Synopsis Destroi o objeto Call_Box |
klauss | 69:65665afbad5d | 98 | * |
klauss | 69:65665afbad5d | 99 | * Exemplo: |
klauss | 69:65665afbad5d | 100 | * @code |
klauss | 69:65665afbad5d | 101 | * ... |
klauss | 69:65665afbad5d | 102 | * delete( cb ); |
klauss | 69:65665afbad5d | 103 | * ... |
klauss | 69:65665afbad5d | 104 | * @endcode |
klauss | 69:65665afbad5d | 105 | * \note Deleta o objeto Sip nesse processo. |
klauss | 69:65665afbad5d | 106 | */ |
klauss | 0:4d17cd9c8f9d | 107 | ~Call_Box( void ); |
klauss | 0:4d17cd9c8f9d | 108 | |
klauss | 69:65665afbad5d | 109 | /** |
klauss | 69:65665afbad5d | 110 | * @Synopsis Representa o status do Call_Box. |
klauss | 69:65665afbad5d | 111 | * |
klauss | 69:65665afbad5d | 112 | * \note Este valor sempre é atualizado ( por convenção ) com o uso da macro set_status(a,b), definida em utils.h |
klauss | 69:65665afbad5d | 113 | */ |
klauss | 0:4d17cd9c8f9d | 114 | uint8_t status; |
klauss | 0:4d17cd9c8f9d | 115 | |
klauss | 69:65665afbad5d | 116 | /** |
klauss | 69:65665afbad5d | 117 | * @Synopsis Informa o ramal vinculado ao objeto Call_Box. |
klauss | 69:65665afbad5d | 118 | * |
klauss | 69:65665afbad5d | 119 | * @return O numero do ramal contido atualmente no objeto Call_Box |
klauss | 69:65665afbad5d | 120 | * |
klauss | 69:65665afbad5d | 121 | * Exemplo: |
klauss | 69:65665afbad5d | 122 | * @code |
klauss | 69:65665afbad5d | 123 | * ... |
klauss | 69:65665afbad5d | 124 | * int ext = cb->get_ext(); |
klauss | 69:65665afbad5d | 125 | * ... |
klauss | 69:65665afbad5d | 126 | * @endcode |
klauss | 69:65665afbad5d | 127 | */ |
klauss | 0:4d17cd9c8f9d | 128 | int get_ext( void ); |
klauss | 69:65665afbad5d | 129 | |
klauss | 69:65665afbad5d | 130 | /** |
klauss | 69:65665afbad5d | 131 | * @Synopsis Informa o numero da porta vinculada ao objeto Call_Box. |
klauss | 69:65665afbad5d | 132 | * |
klauss | 69:65665afbad5d | 133 | * @return O numero da porta contido atualmente no objeto Call_Box |
klauss | 69:65665afbad5d | 134 | * |
klauss | 69:65665afbad5d | 135 | * Exemplo: |
klauss | 69:65665afbad5d | 136 | * @code |
klauss | 69:65665afbad5d | 137 | * ... |
klauss | 69:65665afbad5d | 138 | * int port = cb->get_port(); |
klauss | 69:65665afbad5d | 139 | * ... |
klauss | 69:65665afbad5d | 140 | * @endcode |
klauss | 69:65665afbad5d | 141 | */ |
klauss | 0:4d17cd9c8f9d | 142 | int get_port( void ); |
klauss | 69:65665afbad5d | 143 | |
klauss | 69:65665afbad5d | 144 | /** |
klauss | 69:65665afbad5d | 145 | * @Synopsis Informa o tempo decorrido. |
klauss | 69:65665afbad5d | 146 | * \note O timer de cada objeto é iniciado no momento da criação do objeto Call_Box. |
klauss | 69:65665afbad5d | 147 | * |
klauss | 69:65665afbad5d | 148 | * @return O tempo decorrido desde a ultima vez que o timer do objeto foi resetado. |
klauss | 69:65665afbad5d | 149 | * |
klauss | 69:65665afbad5d | 150 | * Exemplo: |
klauss | 69:65665afbad5d | 151 | * @code |
klauss | 69:65665afbad5d | 152 | * ... |
klauss | 69:65665afbad5d | 153 | * float elapsed_time = cb->get_elapsed_time(); |
klauss | 69:65665afbad5d | 154 | * ... |
klauss | 69:65665afbad5d | 155 | * @endcode |
klauss | 69:65665afbad5d | 156 | */ |
klauss | 0:4d17cd9c8f9d | 157 | float get_elapsed_time( void ); |
klauss | 69:65665afbad5d | 158 | |
klauss | 69:65665afbad5d | 159 | /** |
klauss | 69:65665afbad5d | 160 | * @Synopsis Informa se o Call_Box esta inativo acima do tempo previsto. |
klauss | 69:65665afbad5d | 161 | * |
klauss | 69:65665afbad5d | 162 | * @retval True - Caso o timer do objeto seja maior que o definido. |
klauss | 69:65665afbad5d | 163 | * @retval False - Caso o timer do objeto seja menor que o definido.. |
klauss | 69:65665afbad5d | 164 | * |
klauss | 69:65665afbad5d | 165 | * Exemplo: |
klauss | 69:65665afbad5d | 166 | * @code |
klauss | 69:65665afbad5d | 167 | * ... |
klauss | 69:65665afbad5d | 168 | * printf(" %s ", ( cb->is_timeout() ) ? "Call_Box is outdated" : "Call_Box is okay" ); |
klauss | 69:65665afbad5d | 169 | * ... |
klauss | 69:65665afbad5d | 170 | * @endcode |
klauss | 69:65665afbad5d | 171 | */ |
klauss | 0:4d17cd9c8f9d | 172 | bool is_timeout( void ); |
klauss | 69:65665afbad5d | 173 | |
klauss | 69:65665afbad5d | 174 | /** |
klauss | 69:65665afbad5d | 175 | * @Synopsis Reconfigura o timeout de forma incremental, informando se ainda existe alguma tentativas de "ping" nesse Call_Box |
klauss | 69:65665afbad5d | 176 | * |
klauss | 69:65665afbad5d | 177 | * @return O numero de tentativas restantes de registro desse Call_Box. Retorno 0 significa que as tentativar acabaram. |
klauss | 69:65665afbad5d | 178 | * |
klauss | 69:65665afbad5d | 179 | * Exemplo: |
klauss | 69:65665afbad5d | 180 | * @code |
klauss | 69:65665afbad5d | 181 | * ... |
klauss | 78:1353744f01e1 | 182 | * if( cb->has_next_try() == 0x00 ){ |
klauss | 69:65665afbad5d | 183 | * // faça alguma coisa ... |
klauss | 69:65665afbad5d | 184 | * } |
klauss | 69:65665afbad5d | 185 | * ... |
klauss | 69:65665afbad5d | 186 | * @endcode |
klauss | 69:65665afbad5d | 187 | */ |
klauss | 78:1353744f01e1 | 188 | bool has_next_try( void ); |
klauss | 69:65665afbad5d | 189 | |
klauss | 69:65665afbad5d | 190 | /** |
klauss | 69:65665afbad5d | 191 | * @Synopsis Reseta o timer do objeto Call_Box. |
klauss | 69:65665afbad5d | 192 | * |
klauss | 69:65665afbad5d | 193 | * Exemplo: |
klauss | 69:65665afbad5d | 194 | * @code |
klauss | 69:65665afbad5d | 195 | * ... |
klauss | 69:65665afbad5d | 196 | * cb->reset_elapsed_time(); |
klauss | 69:65665afbad5d | 197 | * ... |
klauss | 69:65665afbad5d | 198 | * @endcode |
klauss | 69:65665afbad5d | 199 | */ |
klauss | 0:4d17cd9c8f9d | 200 | void reset_elapsed_time( void ); |
klauss | 69:65665afbad5d | 201 | |
klauss | 69:65665afbad5d | 202 | /** |
klauss | 69:65665afbad5d | 203 | * @Synopsis Invoca o método de registro deste Call_Box ( via objeto Sip vinculado ). |
klauss | 69:65665afbad5d | 204 | * |
klauss | 69:65665afbad5d | 205 | * Exemplo: |
klauss | 69:65665afbad5d | 206 | * @code |
klauss | 69:65665afbad5d | 207 | * ... |
klauss | 69:65665afbad5d | 208 | * cb->registry(); |
klauss | 69:65665afbad5d | 209 | * ... |
klauss | 69:65665afbad5d | 210 | * @endcode |
klauss | 69:65665afbad5d | 211 | */ |
klauss | 0:4d17cd9c8f9d | 212 | void registry( void ); |
klauss | 69:65665afbad5d | 213 | |
klauss | 69:65665afbad5d | 214 | /** |
klauss | 69:65665afbad5d | 215 | * @Synopsis Invoca o método de pedido de ligação. |
klauss | 69:65665afbad5d | 216 | * |
klauss | 69:65665afbad5d | 217 | * @return Um ponteiro para um objeto VZ_call quando o pedido foi aceito pelo server, NULL caso em que o pedido de invite foi |
klauss | 69:65665afbad5d | 218 | * negado pelo server ou aconteceu timeout do invite. |
klauss | 69:65665afbad5d | 219 | * |
klauss | 69:65665afbad5d | 220 | * Exemplo: |
klauss | 69:65665afbad5d | 221 | * @code |
klauss | 69:65665afbad5d | 222 | * ... |
klauss | 69:65665afbad5d | 223 | * VZ_call * call = cb->invite(); |
klauss | 69:65665afbad5d | 224 | * ... |
klauss | 69:65665afbad5d | 225 | * @endcode |
klauss | 69:65665afbad5d | 226 | */ |
klauss | 0:4d17cd9c8f9d | 227 | VZ_call * invite( void ); |
klauss | 69:65665afbad5d | 228 | |
klauss | 69:65665afbad5d | 229 | /** |
klauss | 69:65665afbad5d | 230 | * @Synopsis Valor inicial para preenchimento deste campo nos pacotes trocados entre Header/Call_Box. |
klauss | 69:65665afbad5d | 231 | * |
klauss | 69:65665afbad5d | 232 | * @param msg_id Seta o valor recebido como parâmetro na variável do objeto. |
klauss | 69:65665afbad5d | 233 | * |
klauss | 69:65665afbad5d | 234 | * Exemplo: |
klauss | 69:65665afbad5d | 235 | * @code |
klauss | 69:65665afbad5d | 236 | * ... |
klauss | 69:65665afbad5d | 237 | * cb->set_msg_id( 0x12 ); |
klauss | 69:65665afbad5d | 238 | * ... |
klauss | 69:65665afbad5d | 239 | * @endcode |
klauss | 69:65665afbad5d | 240 | */ |
klauss | 0:4d17cd9c8f9d | 241 | void set_msg_id( uint8_t msg_id ); |
klauss | 69:65665afbad5d | 242 | |
klauss | 69:65665afbad5d | 243 | /** |
klauss | 69:65665afbad5d | 244 | * @Synopsis Informa o numero atual de msg_id que será enviado na próxima mensagem desse Call_Box |
klauss | 69:65665afbad5d | 245 | * |
klauss | 69:65665afbad5d | 246 | * @return O valor atual de msg_id. |
klauss | 69:65665afbad5d | 247 | * |
klauss | 69:65665afbad5d | 248 | * Exemplo: |
klauss | 69:65665afbad5d | 249 | * @code |
klauss | 69:65665afbad5d | 250 | * ... |
klauss | 69:65665afbad5d | 251 | * uint8_t msg_id = cb->get_msg_id(); |
klauss | 69:65665afbad5d | 252 | * ... |
klauss | 69:65665afbad5d | 253 | * @endcode |
klauss | 69:65665afbad5d | 254 | */ |
klauss | 0:4d17cd9c8f9d | 255 | uint8_t get_msg_id( void ); |
klauss | 69:65665afbad5d | 256 | |
klauss | 69:65665afbad5d | 257 | |
klauss | 69:65665afbad5d | 258 | /** |
klauss | 69:65665afbad5d | 259 | * @Synopsis Armazena o valor de Timeslice atualmente em uso pelo Call_Box. |
klauss | 69:65665afbad5d | 260 | * |
klauss | 69:65665afbad5d | 261 | * @param timeslice O valor que corresponde ao Timeslice disponivel para comunição do Call_Box |
klauss | 69:65665afbad5d | 262 | * |
klauss | 69:65665afbad5d | 263 | * Exemplo: |
klauss | 69:65665afbad5d | 264 | * @code |
klauss | 69:65665afbad5d | 265 | * ... |
klauss | 69:65665afbad5d | 266 | * Timeslice * ts = new Timeslice(); |
klauss | 69:65665afbad5d | 267 | * cb->set_timeslice( ts->get_timeslice() ); |
klauss | 69:65665afbad5d | 268 | * ... |
klauss | 69:65665afbad5d | 269 | * @endcode |
klauss | 69:65665afbad5d | 270 | */ |
klauss | 69:65665afbad5d | 271 | void set_timeslice( uint8_t timeslice ); |
klauss | 69:65665afbad5d | 272 | |
klauss | 69:65665afbad5d | 273 | |
klauss | 69:65665afbad5d | 274 | /** |
klauss | 69:65665afbad5d | 275 | * @Synopsis Informa o timeslice ocupado atualmente pelo Call_Box. |
klauss | 69:65665afbad5d | 276 | * |
klauss | 69:65665afbad5d | 277 | * @return O valor do timeslice em uso pelo Call_Box. |
klauss | 69:65665afbad5d | 278 | * |
klauss | 69:65665afbad5d | 279 | * Exemplo: |
klauss | 69:65665afbad5d | 280 | * @code |
klauss | 69:65665afbad5d | 281 | * ... |
klauss | 69:65665afbad5d | 282 | * uint8_t ts = cb->get_timeslice(); |
klauss | 69:65665afbad5d | 283 | * ... |
klauss | 69:65665afbad5d | 284 | * @endcode |
klauss | 69:65665afbad5d | 285 | */ |
klauss | 0:4d17cd9c8f9d | 286 | uint8_t get_timeslice( void ); |
klauss | 69:65665afbad5d | 287 | |
klauss | 0:4d17cd9c8f9d | 288 | //void set_sip( Sip * sip ); |
klauss | 69:65665afbad5d | 289 | |
klauss | 69:65665afbad5d | 290 | /** |
klauss | 69:65665afbad5d | 291 | * @Synopsis Faz chamada ( via objeto Sip vinculado ) a função que irá escutar a porta SIP associada neste Call_Box. |
klauss | 69:65665afbad5d | 292 | * |
klauss | 69:65665afbad5d | 293 | * @return Um valor menor que zero se a execução falhar, igual a zero se a execução for bem sucedida e nenhum dado foi |
klauss | 69:65665afbad5d | 294 | * recebido, ou quando a execução foi bem sucedida e nenhuma mensagem que demanda tramamento foi recebida; um numero |
klauss | 69:65665afbad5d | 295 | * maior do que zero, caso tenha recebido um pacote do tipo "bye" do servidor; este numero corresponde ao ramal do Call_Box. |
klauss | 69:65665afbad5d | 296 | * |
klauss | 69:65665afbad5d | 297 | * Exemplo: |
klauss | 69:65665afbad5d | 298 | * @code |
klauss | 69:65665afbad5d | 299 | * ... |
klauss | 69:65665afbad5d | 300 | * int returned_value = cb->listen_SIP_server(); |
klauss | 69:65665afbad5d | 301 | * ... |
klauss | 69:65665afbad5d | 302 | * @endcode |
klauss | 69:65665afbad5d | 303 | */ |
klauss | 0:4d17cd9c8f9d | 304 | int listen_SIP_server( void ); |
klauss | 69:65665afbad5d | 305 | |
klauss | 69:65665afbad5d | 306 | /** |
klauss | 69:65665afbad5d | 307 | * @Synopsis Invoca ( no objeto Sip ) o método de pedido de "desregistro". |
klauss | 69:65665afbad5d | 308 | * |
klauss | 69:65665afbad5d | 309 | * Exemplo: |
klauss | 69:65665afbad5d | 310 | * @code |
klauss | 69:65665afbad5d | 311 | * ... |
klauss | 69:65665afbad5d | 312 | * cb->unregistry(); |
klauss | 69:65665afbad5d | 313 | * ... |
klauss | 69:65665afbad5d | 314 | * @endcode |
klauss | 69:65665afbad5d | 315 | */ |
klauss | 0:4d17cd9c8f9d | 316 | void unregistry( void ); |
klauss | 69:65665afbad5d | 317 | |
klauss | 69:65665afbad5d | 318 | /** |
klauss | 69:65665afbad5d | 319 | * @Synopsis Invoca ( via objeto Sip ) o método de envio do pacote de "bye" para o servidor. |
klauss | 69:65665afbad5d | 320 | * |
klauss | 69:65665afbad5d | 321 | * Exemplo: |
klauss | 69:65665afbad5d | 322 | * @code |
klauss | 69:65665afbad5d | 323 | * ... |
klauss | 69:65665afbad5d | 324 | * cb->send_bye(); |
klauss | 69:65665afbad5d | 325 | * ... |
klauss | 69:65665afbad5d | 326 | * @endcode |
klauss | 69:65665afbad5d | 327 | */ |
klauss | 0:4d17cd9c8f9d | 328 | void send_bye( void ); |
klauss | 69:65665afbad5d | 329 | |
klauss | 69:65665afbad5d | 330 | /** |
klauss | 69:65665afbad5d | 331 | * @Synopsis Destroi o objeto Sip vinculado ao Call_Box, criando e vinculando outro em seguida. |
klauss | 69:65665afbad5d | 332 | * |
klauss | 69:65665afbad5d | 333 | * Exemplo: |
klauss | 69:65665afbad5d | 334 | * @code |
klauss | 69:65665afbad5d | 335 | * ... |
klauss | 69:65665afbad5d | 336 | * cb->reset_sip(); |
klauss | 69:65665afbad5d | 337 | * ... |
klauss | 69:65665afbad5d | 338 | * @endcode |
klauss | 69:65665afbad5d | 339 | */ |
klauss | 1:a1758104fa1d | 340 | void reset_sip( void ); |
klauss | 69:65665afbad5d | 341 | |
klauss | 69:65665afbad5d | 342 | /** |
klauss | 69:65665afbad5d | 343 | * @Synopsis Altera o valor do status do objeto Sip vinculado. |
klauss | 69:65665afbad5d | 344 | * |
klauss | 69:65665afbad5d | 345 | * @param status O novo valor de status que será associado ao objeto Sip vinculado ao Call_Box. |
klauss | 69:65665afbad5d | 346 | * |
klauss | 69:65665afbad5d | 347 | * Exemplo: |
klauss | 69:65665afbad5d | 348 | * @code |
klauss | 69:65665afbad5d | 349 | * ... |
klauss | 69:65665afbad5d | 350 | * cb->set_sip_status( 0 ); |
klauss | 69:65665afbad5d | 351 | * ... |
klauss | 69:65665afbad5d | 352 | * @endcode |
klauss | 69:65665afbad5d | 353 | */ |
klauss | 14:22a35f575502 | 354 | void set_sip_status( int status ); |
klauss | 69:65665afbad5d | 355 | |
klauss | 69:65665afbad5d | 356 | /** |
klauss | 69:65665afbad5d | 357 | * @Synopsis Inicia ( ou re-inicia ) o Timer do objeto Call_Box. |
klauss | 69:65665afbad5d | 358 | * |
klauss | 69:65665afbad5d | 359 | * Exemplo: |
klauss | 69:65665afbad5d | 360 | * @code |
klauss | 69:65665afbad5d | 361 | * ... |
klauss | 69:65665afbad5d | 362 | * cb->re_start_timer(); |
klauss | 69:65665afbad5d | 363 | * ... |
klauss | 69:65665afbad5d | 364 | * @endcode |
klauss | 69:65665afbad5d | 365 | */ |
klauss | 78:1353744f01e1 | 366 | void re_start_timer( void ); |
klauss | 78:1353744f01e1 | 367 | |
klauss | 78:1353744f01e1 | 368 | |
klauss | 78:1353744f01e1 | 369 | int get_sip_status( void ); |
klauss | 78:1353744f01e1 | 370 | int set_sip_status( uint8_t sip_status ); |
klauss | 78:1353744f01e1 | 371 | |
klauss | 78:1353744f01e1 | 372 | int get_status( void ); |
klauss | 78:1353744f01e1 | 373 | void cb_set_status( uint8_t status ); |
klauss | 78:1353744f01e1 | 374 | |
klauss | 78:1353744f01e1 | 375 | int8_t get_next_aging_type( void ); |
klauss | 81:3656f00ab3db | 376 | |
klauss | 92:92df17f538a8 | 377 | //void set_first_invite_response_ok( void ); |
klauss | 92:92df17f538a8 | 378 | //void set_first_invite_response_pending( void ); |
klauss | 92:92df17f538a8 | 379 | //bool get_first_invite_response( void ); |
klauss | 92:92df17f538a8 | 380 | |
klauss | 81:3656f00ab3db | 381 | void set_invite_response_ok( void ); |
klauss | 81:3656f00ab3db | 382 | void set_invite_response_pending( void ); |
klauss | 81:3656f00ab3db | 383 | bool get_invite_response( void ); |
klauss | 81:3656f00ab3db | 384 | |
klauss | 81:3656f00ab3db | 385 | void set_bye_response_ok( void ); |
klauss | 81:3656f00ab3db | 386 | void set_bye_response_pending( void ); |
klauss | 81:3656f00ab3db | 387 | bool get_bye_response( void ); |
klauss | 89:0fe315117b00 | 388 | |
klauss | 89:0fe315117b00 | 389 | int get_sip_socket_fd( void ); |
klauss | 91:c2a86b1f8aaa | 390 | int sip_udp_incomming_pkg( void ); |
klauss | 91:c2a86b1f8aaa | 391 | void reset_cb_status( void ); |
klauss | 92:92df17f538a8 | 392 | void invite_retry_count_reset( void ); |
klauss | 92:92df17f538a8 | 393 | uint8_t get_invite_retry_count( void ); |
klauss | 97:8985817e8847 | 394 | int get_sip_ext( void ); |
klauss | 97:8985817e8847 | 395 | int get_sip_port( void ); |
klauss | 0:4d17cd9c8f9d | 396 | }; |
klauss | 0:4d17cd9c8f9d | 397 | #endif |