| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
#ifndef _IAX2_PARSER_H |
| 15 |
#define _IAX2_PARSER_H |
| 16 |
|
| 17 |
struct iax_ies { |
| 18 |
char *called_number; |
| 19 |
char *calling_number; |
| 20 |
char *calling_ani; |
| 21 |
char *calling_name; |
| 22 |
int calling_ton; |
| 23 |
int calling_tns; |
| 24 |
int calling_pres; |
| 25 |
char *called_context; |
| 26 |
char *username; |
| 27 |
char *password; |
| 28 |
unsigned int capability; |
| 29 |
unsigned int format; |
| 30 |
char *codec_prefs; |
| 31 |
char *language; |
| 32 |
int version; |
| 33 |
unsigned short adsicpe; |
| 34 |
char *dnid; |
| 35 |
char *rdnis; |
| 36 |
unsigned int authmethods; |
| 37 |
char *challenge; |
| 38 |
char *md5_result; |
| 39 |
char *rsa_result; |
| 40 |
struct sockaddr_in *apparent_addr; |
| 41 |
unsigned short refresh; |
| 42 |
unsigned short dpstatus; |
| 43 |
unsigned short callno; |
| 44 |
char *cause; |
| 45 |
unsigned char causecode; |
| 46 |
unsigned char iax_unknown; |
| 47 |
int msgcount; |
| 48 |
int autoanswer; |
| 49 |
int musiconhold; |
| 50 |
unsigned int transferid; |
| 51 |
unsigned int datetime; |
| 52 |
char *devicetype; |
| 53 |
char *serviceident; |
| 54 |
int firmwarever; |
| 55 |
unsigned int fwdesc; |
| 56 |
unsigned char *fwdata; |
| 57 |
unsigned char fwdatalen; |
| 58 |
unsigned int provver; |
| 59 |
unsigned short samprate; |
| 60 |
unsigned int provverpres; |
| 61 |
unsigned int rr_jitter; |
| 62 |
unsigned int rr_loss; |
| 63 |
unsigned int rr_pkts; |
| 64 |
unsigned short rr_delay; |
| 65 |
unsigned int rr_dropped; |
| 66 |
unsigned int rr_ooo; |
| 67 |
}; |
| 68 |
|
| 69 |
#define DIRECTION_INGRESS 1 |
| 70 |
#define DIRECTION_OUTGRESS 2 |
| 71 |
|
| 72 |
struct iax_frame { |
| 73 |
#ifdef LIBIAX |
| 74 |
struct iax_session *session; |
| 75 |
struct iax_event *event; |
| 76 |
#endif |
| 77 |
|
| 78 |
|
| 79 |
unsigned short callno; |
| 80 |
|
| 81 |
unsigned short dcallno; |
| 82 |
|
| 83 |
void *data; |
| 84 |
|
| 85 |
int datalen; |
| 86 |
|
| 87 |
int retries; |
| 88 |
|
| 89 |
unsigned int ts; |
| 90 |
|
| 91 |
int retrytime; |
| 92 |
|
| 93 |
int outoforder; |
| 94 |
|
| 95 |
int sentyet; |
| 96 |
|
| 97 |
int oseqno; |
| 98 |
|
| 99 |
int iseqno; |
| 100 |
|
| 101 |
int transfer; |
| 102 |
|
| 103 |
int final; |
| 104 |
|
| 105 |
int direction; |
| 106 |
|
| 107 |
int retrans; |
| 108 |
|
| 109 |
struct iax_frame *next; |
| 110 |
struct iax_frame *prev; |
| 111 |
|
| 112 |
struct ast_frame af; |
| 113 |
unsigned char unused[AST_FRIENDLY_OFFSET]; |
| 114 |
unsigned char afdata[0]; |
| 115 |
}; |
| 116 |
|
| 117 |
struct iax_ie_data { |
| 118 |
unsigned char buf[1024]; |
| 119 |
int pos; |
| 120 |
}; |
| 121 |
|
| 122 |
|
| 123 |
extern void iax_set_output(void (*output)(const char *data)); |
| 124 |
|
| 125 |
extern void iax_set_error(void (*output)(const char *data)); |
| 126 |
extern void iax_showframe(struct iax_frame *f, struct ast_iax2_full_hdr *fhi, int rx, struct sockaddr_in *sin, int datalen); |
| 127 |
|
| 128 |
extern const char *iax_ie2str(int ie); |
| 129 |
|
| 130 |
extern int iax_ie_append_raw(struct iax_ie_data *ied, unsigned char ie, const void *data, int datalen); |
| 131 |
extern int iax_ie_append_addr(struct iax_ie_data *ied, unsigned char ie, struct sockaddr_in *sin); |
| 132 |
extern int iax_ie_append_int(struct iax_ie_data *ied, unsigned char ie, unsigned int value); |
| 133 |
extern int iax_ie_append_short(struct iax_ie_data *ied, unsigned char ie, unsigned short value); |
| 134 |
extern int iax_ie_append_str(struct iax_ie_data *ied, unsigned char ie, const char *str); |
| 135 |
extern int iax_ie_append_byte(struct iax_ie_data *ied, unsigned char ie, unsigned char dat); |
| 136 |
extern int iax_ie_append(struct iax_ie_data *ied, unsigned char ie); |
| 137 |
extern int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen); |
| 138 |
|
| 139 |
extern int iax_get_frames(void); |
| 140 |
extern int iax_get_iframes(void); |
| 141 |
extern int iax_get_oframes(void); |
| 142 |
|
| 143 |
extern void iax_frame_wrap(struct iax_frame *fr, struct ast_frame *f); |
| 144 |
extern struct iax_frame *iax_frame_new(int direction, int datalen); |
| 145 |
extern void iax_frame_free(struct iax_frame *fr); |
| 146 |
#endif |