![](/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@121:ee02790d00b7, 2015-05-08 (annotated)
- Committer:
- klauss
- Date:
- Fri May 08 04:15:23 2015 +0000
- Revision:
- 121:ee02790d00b7
- Parent:
- 119:ee6a53069455
- Child:
- 123:1d395b5a4cad
compiling
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 | 121:ee02790d00b7 | 12 | #include <stdint.h> |
klauss | 0:4d17cd9c8f9d | 13 | #include "object.h" |
klauss | 0:4d17cd9c8f9d | 14 | #include "sip.h" |
klauss | 74:81c47fff88a5 | 15 | |
klauss | 119:ee6a53069455 | 16 | const int __RESQUEST_TIME__ = 3; |
klauss | 121:ee02790d00b7 | 17 | |
klauss | 119:ee6a53069455 | 18 | const uint16_t MAX_INVITE_RETRY = 512 * 2; |
klauss | 78:1353744f01e1 | 19 | |
klauss | 119:ee6a53069455 | 20 | const uint8_t __TIMEOUT__ = 250; |
klauss | 119:ee6a53069455 | 21 | |
klauss | 69:65665afbad5d | 22 | ///< O tempo que a Header demora para "pingar" o Call_Box para saber se esta tudo bem. |
klauss | 119:ee6a53069455 | 23 | const uint8_t __RANGE_TO_REGISTER__ = 150; |
klauss | 78:1353744f01e1 | 24 | ///< Doc. later |
klauss | 119:ee6a53069455 | 25 | const uint8_t __TIME_TO_REGISTER__ = __TIMEOUT__ - __RANGE_TO_REGISTER__; |
klauss | 121:ee02790d00b7 | 26 | |
klauss | 119:ee6a53069455 | 27 | const uint8_t __CYCLES__ = __TIME_TO_REGISTER__ / __RESQUEST_TIME__; // 200 // 3 ~ 66 |
klauss | 121:ee02790d00b7 | 28 | |
klauss | 119:ee6a53069455 | 29 | const uint8_t RTP_REQUEST_PORT_TIMEOUT = 45; |
klauss | 78:1353744f01e1 | 30 | |
klauss | 119:ee6a53069455 | 31 | const short int REQUEST_REGISTRY = -1; |
klauss | 119:ee6a53069455 | 32 | const short int REQUEST_PEND = -2; |
klauss | 119:ee6a53069455 | 33 | const short int REQUEST_PING = -4; |
klauss | 121:ee02790d00b7 | 34 | ///< Valor usado como referencia para registro do equipamento CBx. |
klauss | 78:1353744f01e1 | 35 | |
klauss | 119:ee6a53069455 | 36 | const uint8_t __MAX_ATTEMPTS__ = 5; |
klauss | 69:65665afbad5d | 37 | ///< O numero maximo de vezes que a Header vai tentar pingar o Call_Box |
klauss | 121:ee02790d00b7 | 38 | |
klauss | 119:ee6a53069455 | 39 | const uint8_t __STEP__ = 30; |
klauss | 69:65665afbad5d | 40 | ///< Usado para aumentar o intervalo entre cada ping, fora de uso atualmente. |
klauss | 121:ee02790d00b7 | 41 | |
klauss | 119:ee6a53069455 | 42 | const uint8_t __MAX_TIMEOUT__ = __STEP__ * __MAX_ATTEMPTS__; |
klauss | 69:65665afbad5d | 43 | ///< Usado para limitar o tempo maximo de timeout do Call_Box sem responder o ping, fora de uso. |
klauss | 0:4d17cd9c8f9d | 44 | |
klauss | 119:ee6a53069455 | 45 | const uint8_t cb_idle = 1; |
klauss | 69:65665afbad5d | 46 | ///< Representa que o Call_Box esta disponivel |
klauss | 121:ee02790d00b7 | 47 | |
klauss | 119:ee6a53069455 | 48 | const uint8_t cb_ringing = 2; |
klauss | 69:65665afbad5d | 49 | ///< Representa o Call_Box no status, discando. |
klauss | 121:ee02790d00b7 | 50 | |
klauss | 119:ee6a53069455 | 51 | const uint8_t cb_trying = 3; |
klauss | 69:65665afbad5d | 52 | ///< Representa o Call_Box no status tentando concluir o pedido de ligação. |
klauss | 121:ee02790d00b7 | 53 | |
klauss | 119:ee6a53069455 | 54 | const uint8_t cb_on_call = 4; |
klauss | 69:65665afbad5d | 55 | ///< Representa que o Call_Box já esta em uma ligação. |
klauss | 121:ee02790d00b7 | 56 | |
klauss | 119:ee6a53069455 | 57 | const uint8_t cb_busy = 5; |
klauss | 69:65665afbad5d | 58 | ///< Representa que o Call_Box esta ocupado. |
klauss | 121:ee02790d00b7 | 59 | |
klauss | 119:ee6a53069455 | 60 | const uint8_t cb_denied = 6; |
klauss | 78:1353744f01e1 | 61 | ///< Representa que o pedido de invite do Call_Box foi negado. |
klauss | 121:ee02790d00b7 | 62 | |
klauss | 119:ee6a53069455 | 63 | const uint8_t cb_bootloader = 7; |
klauss | 119:ee6a53069455 | 64 | ///< Representa que o Call_Box esta em atualizacao de firmware |
klauss | 119:ee6a53069455 | 65 | |
klauss | 0:4d17cd9c8f9d | 66 | |
klauss | 121:ee02790d00b7 | 67 | class Call_Box : public Object { |
klauss | 0:4d17cd9c8f9d | 68 | private : |
klauss | 121:ee02790d00b7 | 69 | /** |
klauss | 121:ee02790d00b7 | 70 | * @Synopsis Objeto Sip que será usado para tratativas com o servidor. |
klauss | 121:ee02790d00b7 | 71 | * |
klauss | 121:ee02790d00b7 | 72 | * \note Esse objeto é criado no construtor da classe Call_Box, com os mesmos parâmetros passados para o |
klauss | 121:ee02790d00b7 | 73 | * construtor da classe Call_Box. |
klauss | 121:ee02790d00b7 | 74 | */ |
klauss | 121:ee02790d00b7 | 75 | Sip * sip; |
klauss | 121:ee02790d00b7 | 76 | |
klauss | 119:ee6a53069455 | 77 | bool invite_response; |
klauss | 119:ee6a53069455 | 78 | bool bye_response; |
klauss | 121:ee02790d00b7 | 79 | bool overflow; |
klauss | 119:ee6a53069455 | 80 | |
klauss | 0:4d17cd9c8f9d | 81 | int ext; // ramal |
klauss | 0:4d17cd9c8f9d | 82 | int port; // porta |
klauss | 119:ee6a53069455 | 83 | int sip_socket_fd; |
klauss | 119:ee6a53069455 | 84 | int shift_port; |
klauss | 119:ee6a53069455 | 85 | |
klauss | 121:ee02790d00b7 | 86 | /** |
klauss | 121:ee02790d00b7 | 87 | * @Synopsis Representa o status do Call_Box. |
klauss | 121:ee02790d00b7 | 88 | * |
klauss | 121:ee02790d00b7 | 89 | * \note Este valor sempre é atualizado ( por convenção ) com o uso da macro set_status(a,b), definida em utils.h |
klauss | 121:ee02790d00b7 | 90 | */ |
klauss | 121:ee02790d00b7 | 91 | uint8_t status; |
klauss | 121:ee02790d00b7 | 92 | |
klauss | 0:4d17cd9c8f9d | 93 | uint8_t remaining_attempts; |
klauss | 0:4d17cd9c8f9d | 94 | uint8_t msg_id; |
klauss | 0:4d17cd9c8f9d | 95 | uint8_t timeslice; |
klauss | 78:1353744f01e1 | 96 | uint8_t next_aging_type; |
klauss | 119:ee6a53069455 | 97 | uint8_t invite_try_number; |
klauss | 119:ee6a53069455 | 98 | |
klauss | 99:e80850c51106 | 99 | uint16_t invite_retry_count; |
klauss | 119:ee6a53069455 | 100 | |
klauss | 121:ee02790d00b7 | 101 | //FIXME remove timeout |
klauss | 119:ee6a53069455 | 102 | float timeout; |
klauss | 119:ee6a53069455 | 103 | |
klauss | 119:ee6a53069455 | 104 | Timer t; |
klauss | 119:ee6a53069455 | 105 | Timer rtp_timer; // usado pra controlar o timeout dos pedidos de porta rtp |
klauss | 119:ee6a53069455 | 106 | Timer invite_timer; |
klauss | 0:4d17cd9c8f9d | 107 | public : |
klauss | 69:65665afbad5d | 108 | /** |
klauss | 69:65665afbad5d | 109 | * @Synopsis Cria um objeto Call_Box |
klauss | 69:65665afbad5d | 110 | * |
klauss | 69:65665afbad5d | 111 | * @param ext Vincula o objeto ao ramal informado |
klauss | 69:65665afbad5d | 112 | * @param port Vincula o objeto a porto informada. |
klauss | 69:65665afbad5d | 113 | * |
klauss | 69:65665afbad5d | 114 | * Exemplo: |
klauss | 69:65665afbad5d | 115 | * @code |
klauss | 69:65665afbad5d | 116 | * ... |
klauss | 69:65665afbad5d | 117 | * int ext = 5121; |
klauss | 69:65665afbad5d | 118 | * int port = 5021; |
klauss | 69:65665afbad5d | 119 | * Call_Box * cb = new Call_Box( ext, port ); |
klauss | 69:65665afbad5d | 120 | * ... |
klauss | 69:65665afbad5d | 121 | * @endcode |
klauss | 69:65665afbad5d | 122 | */ |
klauss | 121:ee02790d00b7 | 123 | Call_Box ( const int ext, const int port ); |
klauss | 69:65665afbad5d | 124 | |
klauss | 69:65665afbad5d | 125 | /** |
klauss | 69:65665afbad5d | 126 | * @Synopsis Destroi o objeto Call_Box |
klauss | 69:65665afbad5d | 127 | * |
klauss | 69:65665afbad5d | 128 | * Exemplo: |
klauss | 69:65665afbad5d | 129 | * @code |
klauss | 69:65665afbad5d | 130 | * ... |
klauss | 69:65665afbad5d | 131 | * delete( cb ); |
klauss | 69:65665afbad5d | 132 | * ... |
klauss | 69:65665afbad5d | 133 | * @endcode |
klauss | 69:65665afbad5d | 134 | * \note Deleta o objeto Sip nesse processo. |
klauss | 69:65665afbad5d | 135 | */ |
klauss | 121:ee02790d00b7 | 136 | ~Call_Box ( void ); |
klauss | 0:4d17cd9c8f9d | 137 | |
klauss | 69:65665afbad5d | 138 | /** |
klauss | 69:65665afbad5d | 139 | * @Synopsis Informa o ramal vinculado ao objeto Call_Box. |
klauss | 69:65665afbad5d | 140 | * |
klauss | 69:65665afbad5d | 141 | * @return O numero do ramal contido atualmente no objeto Call_Box |
klauss | 69:65665afbad5d | 142 | * |
klauss | 69:65665afbad5d | 143 | * Exemplo: |
klauss | 69:65665afbad5d | 144 | * @code |
klauss | 69:65665afbad5d | 145 | * ... |
klauss | 69:65665afbad5d | 146 | * int ext = cb->get_ext(); |
klauss | 69:65665afbad5d | 147 | * ... |
klauss | 69:65665afbad5d | 148 | * @endcode |
klauss | 69:65665afbad5d | 149 | */ |
klauss | 121:ee02790d00b7 | 150 | int get_ext ( void ); |
klauss | 69:65665afbad5d | 151 | |
klauss | 69:65665afbad5d | 152 | /** |
klauss | 69:65665afbad5d | 153 | * @Synopsis Informa o numero da porta vinculada ao objeto Call_Box. |
klauss | 69:65665afbad5d | 154 | * |
klauss | 69:65665afbad5d | 155 | * @return O numero da porta contido atualmente no objeto Call_Box |
klauss | 69:65665afbad5d | 156 | * |
klauss | 69:65665afbad5d | 157 | * Exemplo: |
klauss | 69:65665afbad5d | 158 | * @code |
klauss | 69:65665afbad5d | 159 | * ... |
klauss | 69:65665afbad5d | 160 | * int port = cb->get_port(); |
klauss | 69:65665afbad5d | 161 | * ... |
klauss | 69:65665afbad5d | 162 | * @endcode |
klauss | 69:65665afbad5d | 163 | */ |
klauss | 121:ee02790d00b7 | 164 | int get_port ( void ); |
klauss | 69:65665afbad5d | 165 | |
klauss | 69:65665afbad5d | 166 | /** |
klauss | 69:65665afbad5d | 167 | * @Synopsis Informa o tempo decorrido. |
klauss | 69:65665afbad5d | 168 | * \note O timer de cada objeto é iniciado no momento da criação do objeto Call_Box. |
klauss | 69:65665afbad5d | 169 | * |
klauss | 69:65665afbad5d | 170 | * @return O tempo decorrido desde a ultima vez que o timer do objeto foi resetado. |
klauss | 69:65665afbad5d | 171 | * |
klauss | 69:65665afbad5d | 172 | * Exemplo: |
klauss | 69:65665afbad5d | 173 | * @code |
klauss | 69:65665afbad5d | 174 | * ... |
klauss | 69:65665afbad5d | 175 | * float elapsed_time = cb->get_elapsed_time(); |
klauss | 69:65665afbad5d | 176 | * ... |
klauss | 69:65665afbad5d | 177 | * @endcode |
klauss | 69:65665afbad5d | 178 | */ |
klauss | 121:ee02790d00b7 | 179 | float get_elapsed_time ( void ); |
klauss | 69:65665afbad5d | 180 | |
klauss | 69:65665afbad5d | 181 | /** |
klauss | 69:65665afbad5d | 182 | * @Synopsis Reseta o timer do objeto Call_Box. |
klauss | 69:65665afbad5d | 183 | * |
klauss | 69:65665afbad5d | 184 | * Exemplo: |
klauss | 69:65665afbad5d | 185 | * @code |
klauss | 69:65665afbad5d | 186 | * ... |
klauss | 69:65665afbad5d | 187 | * cb->reset_elapsed_time(); |
klauss | 69:65665afbad5d | 188 | * ... |
klauss | 69:65665afbad5d | 189 | * @endcode |
klauss | 69:65665afbad5d | 190 | */ |
klauss | 121:ee02790d00b7 | 191 | void reset_elapsed_time ( void ); |
klauss | 69:65665afbad5d | 192 | |
klauss | 69:65665afbad5d | 193 | /** |
klauss | 69:65665afbad5d | 194 | * @Synopsis Invoca o método de registro deste Call_Box ( via objeto Sip vinculado ). |
klauss | 69:65665afbad5d | 195 | * |
klauss | 69:65665afbad5d | 196 | * Exemplo: |
klauss | 69:65665afbad5d | 197 | * @code |
klauss | 69:65665afbad5d | 198 | * ... |
klauss | 69:65665afbad5d | 199 | * cb->registry(); |
klauss | 69:65665afbad5d | 200 | * ... |
klauss | 69:65665afbad5d | 201 | * @endcode |
klauss | 69:65665afbad5d | 202 | */ |
klauss | 121:ee02790d00b7 | 203 | void registry ( void ); |
klauss | 69:65665afbad5d | 204 | |
klauss | 69:65665afbad5d | 205 | /** |
klauss | 69:65665afbad5d | 206 | * @Synopsis Invoca o método de pedido de ligação. |
klauss | 69:65665afbad5d | 207 | * |
klauss | 69:65665afbad5d | 208 | * @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 | 209 | * negado pelo server ou aconteceu timeout do invite. |
klauss | 69:65665afbad5d | 210 | * |
klauss | 69:65665afbad5d | 211 | * Exemplo: |
klauss | 69:65665afbad5d | 212 | * @code |
klauss | 69:65665afbad5d | 213 | * ... |
klauss | 69:65665afbad5d | 214 | * VZ_call * call = cb->invite(); |
klauss | 69:65665afbad5d | 215 | * ... |
klauss | 69:65665afbad5d | 216 | * @endcode |
klauss | 69:65665afbad5d | 217 | */ |
klauss | 121:ee02790d00b7 | 218 | VZ_call * invite ( void ); |
klauss | 69:65665afbad5d | 219 | |
klauss | 69:65665afbad5d | 220 | /** |
klauss | 69:65665afbad5d | 221 | * @Synopsis Valor inicial para preenchimento deste campo nos pacotes trocados entre Header/Call_Box. |
klauss | 69:65665afbad5d | 222 | * |
klauss | 69:65665afbad5d | 223 | * @param msg_id Seta o valor recebido como parâmetro na variável do objeto. |
klauss | 69:65665afbad5d | 224 | * |
klauss | 69:65665afbad5d | 225 | * Exemplo: |
klauss | 69:65665afbad5d | 226 | * @code |
klauss | 69:65665afbad5d | 227 | * ... |
klauss | 69:65665afbad5d | 228 | * cb->set_msg_id( 0x12 ); |
klauss | 69:65665afbad5d | 229 | * ... |
klauss | 69:65665afbad5d | 230 | * @endcode |
klauss | 69:65665afbad5d | 231 | */ |
klauss | 121:ee02790d00b7 | 232 | void set_msg_id ( const uint8_t msg_id ); |
klauss | 69:65665afbad5d | 233 | |
klauss | 69:65665afbad5d | 234 | /** |
klauss | 69:65665afbad5d | 235 | * @Synopsis Informa o numero atual de msg_id que será enviado na próxima mensagem desse Call_Box |
klauss | 69:65665afbad5d | 236 | * |
klauss | 69:65665afbad5d | 237 | * @return O valor atual de msg_id. |
klauss | 69:65665afbad5d | 238 | * |
klauss | 69:65665afbad5d | 239 | * Exemplo: |
klauss | 69:65665afbad5d | 240 | * @code |
klauss | 69:65665afbad5d | 241 | * ... |
klauss | 69:65665afbad5d | 242 | * uint8_t msg_id = cb->get_msg_id(); |
klauss | 69:65665afbad5d | 243 | * ... |
klauss | 69:65665afbad5d | 244 | * @endcode |
klauss | 69:65665afbad5d | 245 | */ |
klauss | 121:ee02790d00b7 | 246 | uint8_t get_msg_id ( void ); |
klauss | 69:65665afbad5d | 247 | |
klauss | 69:65665afbad5d | 248 | |
klauss | 69:65665afbad5d | 249 | /** |
klauss | 69:65665afbad5d | 250 | * @Synopsis Armazena o valor de Timeslice atualmente em uso pelo Call_Box. |
klauss | 69:65665afbad5d | 251 | * |
klauss | 69:65665afbad5d | 252 | * @param timeslice O valor que corresponde ao Timeslice disponivel para comunição do Call_Box |
klauss | 69:65665afbad5d | 253 | * |
klauss | 69:65665afbad5d | 254 | * Exemplo: |
klauss | 69:65665afbad5d | 255 | * @code |
klauss | 69:65665afbad5d | 256 | * ... |
klauss | 69:65665afbad5d | 257 | * Timeslice * ts = new Timeslice(); |
klauss | 69:65665afbad5d | 258 | * cb->set_timeslice( ts->get_timeslice() ); |
klauss | 69:65665afbad5d | 259 | * ... |
klauss | 69:65665afbad5d | 260 | * @endcode |
klauss | 69:65665afbad5d | 261 | */ |
klauss | 121:ee02790d00b7 | 262 | void set_timeslice ( const uint8_t timeslice ); |
klauss | 69:65665afbad5d | 263 | |
klauss | 69:65665afbad5d | 264 | /** |
klauss | 69:65665afbad5d | 265 | * @Synopsis Informa o timeslice ocupado atualmente pelo Call_Box. |
klauss | 69:65665afbad5d | 266 | * |
klauss | 69:65665afbad5d | 267 | * @return O valor do timeslice em uso pelo Call_Box. |
klauss | 69:65665afbad5d | 268 | * |
klauss | 69:65665afbad5d | 269 | * Exemplo: |
klauss | 69:65665afbad5d | 270 | * @code |
klauss | 69:65665afbad5d | 271 | * ... |
klauss | 69:65665afbad5d | 272 | * uint8_t ts = cb->get_timeslice(); |
klauss | 69:65665afbad5d | 273 | * ... |
klauss | 69:65665afbad5d | 274 | * @endcode |
klauss | 69:65665afbad5d | 275 | */ |
klauss | 121:ee02790d00b7 | 276 | uint8_t get_timeslice ( void ); |
klauss | 69:65665afbad5d | 277 | |
klauss | 69:65665afbad5d | 278 | /** |
klauss | 69:65665afbad5d | 279 | * @Synopsis Faz chamada ( via objeto Sip vinculado ) a função que irá escutar a porta SIP associada neste Call_Box. |
klauss | 69:65665afbad5d | 280 | * |
klauss | 69:65665afbad5d | 281 | * @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 | 282 | * recebido, ou quando a execução foi bem sucedida e nenhuma mensagem que demanda tramamento foi recebida; um numero |
klauss | 69:65665afbad5d | 283 | * 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 | 284 | * |
klauss | 69:65665afbad5d | 285 | * Exemplo: |
klauss | 69:65665afbad5d | 286 | * @code |
klauss | 69:65665afbad5d | 287 | * ... |
klauss | 69:65665afbad5d | 288 | * int returned_value = cb->listen_SIP_server(); |
klauss | 69:65665afbad5d | 289 | * ... |
klauss | 69:65665afbad5d | 290 | * @endcode |
klauss | 69:65665afbad5d | 291 | */ |
klauss | 121:ee02790d00b7 | 292 | int listen_SIP_server ( void ); |
klauss | 69:65665afbad5d | 293 | |
klauss | 69:65665afbad5d | 294 | /** |
klauss | 69:65665afbad5d | 295 | * @Synopsis Invoca ( via objeto Sip ) o método de envio do pacote de "bye" para o servidor. |
klauss | 69:65665afbad5d | 296 | * |
klauss | 69:65665afbad5d | 297 | * Exemplo: |
klauss | 69:65665afbad5d | 298 | * @code |
klauss | 69:65665afbad5d | 299 | * ... |
klauss | 69:65665afbad5d | 300 | * cb->send_bye(); |
klauss | 69:65665afbad5d | 301 | * ... |
klauss | 69:65665afbad5d | 302 | * @endcode |
klauss | 69:65665afbad5d | 303 | */ |
klauss | 121:ee02790d00b7 | 304 | void send_bye ( void ); |
klauss | 69:65665afbad5d | 305 | |
klauss | 69:65665afbad5d | 306 | /** |
klauss | 69:65665afbad5d | 307 | * @Synopsis Destroi o objeto Sip vinculado ao Call_Box, criando e vinculando outro em seguida. |
klauss | 69:65665afbad5d | 308 | * |
klauss | 69:65665afbad5d | 309 | * Exemplo: |
klauss | 69:65665afbad5d | 310 | * @code |
klauss | 69:65665afbad5d | 311 | * ... |
klauss | 69:65665afbad5d | 312 | * cb->reset_sip(); |
klauss | 69:65665afbad5d | 313 | * ... |
klauss | 69:65665afbad5d | 314 | * @endcode |
klauss | 69:65665afbad5d | 315 | */ |
klauss | 121:ee02790d00b7 | 316 | void reset_sip ( void ); |
klauss | 69:65665afbad5d | 317 | |
klauss | 69:65665afbad5d | 318 | /** |
klauss | 69:65665afbad5d | 319 | * @Synopsis Altera o valor do status do objeto Sip vinculado. |
klauss | 69:65665afbad5d | 320 | * |
klauss | 69:65665afbad5d | 321 | * @param status O novo valor de status que será associado ao objeto Sip vinculado ao Call_Box. |
klauss | 69:65665afbad5d | 322 | * |
klauss | 69:65665afbad5d | 323 | * Exemplo: |
klauss | 69:65665afbad5d | 324 | * @code |
klauss | 69:65665afbad5d | 325 | * ... |
klauss | 69:65665afbad5d | 326 | * cb->set_sip_status( 0 ); |
klauss | 69:65665afbad5d | 327 | * ... |
klauss | 69:65665afbad5d | 328 | * @endcode |
klauss | 69:65665afbad5d | 329 | */ |
klauss | 121:ee02790d00b7 | 330 | void set_sip_status ( const int status ); |
klauss | 78:1353744f01e1 | 331 | |
klauss | 119:ee6a53069455 | 332 | /*------------------------------------------------------------------------------------------------*/ |
klauss | 121:ee02790d00b7 | 333 | bool get_invite_response ( void ); |
klauss | 121:ee02790d00b7 | 334 | |
klauss | 121:ee02790d00b7 | 335 | bool get_bye_response ( void ); |
klauss | 121:ee02790d00b7 | 336 | |
klauss | 119:ee6a53069455 | 337 | bool time_to_retry ( void ); |
klauss | 121:ee02790d00b7 | 338 | |
klauss | 119:ee6a53069455 | 339 | bool is_rtp_timer_timeout ( void ); |
klauss | 78:1353744f01e1 | 340 | |
klauss | 121:ee02790d00b7 | 341 | bool get_overflow_flag ( void ); |
klauss | 121:ee02790d00b7 | 342 | |
klauss | 121:ee02790d00b7 | 343 | |
klauss | 121:ee02790d00b7 | 344 | uint8_t get_invite_try_number ( void ); |
klauss | 121:ee02790d00b7 | 345 | |
klauss | 121:ee02790d00b7 | 346 | uint8_t msg_id_update ( void ); |
klauss | 121:ee02790d00b7 | 347 | |
klauss | 121:ee02790d00b7 | 348 | uint16_t get_invite_retry_count ( void ); |
klauss | 121:ee02790d00b7 | 349 | |
klauss | 121:ee02790d00b7 | 350 | |
klauss | 121:ee02790d00b7 | 351 | int get_sip_status ( void ); |
klauss | 121:ee02790d00b7 | 352 | |
klauss | 121:ee02790d00b7 | 353 | void set_sip_status ( const uint8_t sip_status ); |
klauss | 121:ee02790d00b7 | 354 | |
klauss | 121:ee02790d00b7 | 355 | int get_status ( void ); |
klauss | 121:ee02790d00b7 | 356 | |
klauss | 121:ee02790d00b7 | 357 | int get_sip_ext ( void ); |
klauss | 121:ee02790d00b7 | 358 | |
klauss | 121:ee02790d00b7 | 359 | int get_sip_port ( void ); |
klauss | 121:ee02790d00b7 | 360 | |
klauss | 121:ee02790d00b7 | 361 | int get_timer ( void ); |
klauss | 121:ee02790d00b7 | 362 | |
klauss | 108:18a3702650f3 | 363 | int get_rtp_port ( void ); |
klauss | 121:ee02790d00b7 | 364 | |
klauss | 114:472502b31a12 | 365 | int print_yourself ( void ); |
klauss | 121:ee02790d00b7 | 366 | |
klauss | 121:ee02790d00b7 | 367 | int get_sip_socket_fd ( void ); |
klauss | 121:ee02790d00b7 | 368 | |
klauss | 121:ee02790d00b7 | 369 | int sip_udp_incomming_pkg ( void ); |
klauss | 121:ee02790d00b7 | 370 | |
klauss | 119:ee6a53069455 | 371 | int get_rtp_timer ( void ); |
klauss | 121:ee02790d00b7 | 372 | |
klauss | 121:ee02790d00b7 | 373 | int call_init ( const int timeslice ); |
klauss | 121:ee02790d00b7 | 374 | |
klauss | 121:ee02790d00b7 | 375 | int call_end ( const bool send_bye_to_ast = true ); |
klauss | 121:ee02790d00b7 | 376 | |
klauss | 119:ee6a53069455 | 377 | int call_confirmed ( void ); |
klauss | 121:ee02790d00b7 | 378 | |
klauss | 119:ee6a53069455 | 379 | int retry_send_invite_pkg_to_ast ( void ); |
klauss | 119:ee6a53069455 | 380 | |
klauss | 121:ee02790d00b7 | 381 | int sip_print_yourself ( void ); |
klauss | 121:ee02790d00b7 | 382 | |
klauss | 121:ee02790d00b7 | 383 | |
klauss | 121:ee02790d00b7 | 384 | void cb_set_status ( const uint8_t status ); |
klauss | 119:ee6a53069455 | 385 | |
klauss | 121:ee02790d00b7 | 386 | void set_invite_response_ok ( void ); |
klauss | 121:ee02790d00b7 | 387 | |
klauss | 121:ee02790d00b7 | 388 | void set_invite_response_pending ( void ); |
klauss | 119:ee6a53069455 | 389 | |
klauss | 121:ee02790d00b7 | 390 | void set_bye_response_ok ( void ); |
klauss | 121:ee02790d00b7 | 391 | |
klauss | 121:ee02790d00b7 | 392 | void set_bye_response_pending ( void ); |
klauss | 119:ee6a53069455 | 393 | |
klauss | 121:ee02790d00b7 | 394 | void reset_cb_status ( void ); |
klauss | 119:ee6a53069455 | 395 | |
klauss | 121:ee02790d00b7 | 396 | void invite_retry_count_reset ( void ); |
klauss | 121:ee02790d00b7 | 397 | |
klauss | 121:ee02790d00b7 | 398 | void set_rtp_port ( const int new_rtp_port ); |
klauss | 119:ee6a53069455 | 399 | |
klauss | 112:6ae726539ab9 | 400 | void init_rtp_timer ( void ); |
klauss | 121:ee02790d00b7 | 401 | |
klauss | 112:6ae726539ab9 | 402 | void reset_rtp_timer ( void ); |
klauss | 121:ee02790d00b7 | 403 | |
klauss | 121:ee02790d00b7 | 404 | void call_config ( void ); |
klauss | 121:ee02790d00b7 | 405 | |
klauss | 121:ee02790d00b7 | 406 | Sip * get_sip ( void ); |
klauss | 0:4d17cd9c8f9d | 407 | }; |
klauss | 119:ee6a53069455 | 408 | |
klauss | 0:4d17cd9c8f9d | 409 | #endif |