123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276 |
- #ifndef CHAN_H323_H
- #define CHAN_H323_H
- #include <arpa/inet.h>
- #include "asterisk/format.h"
- #define TUNNELLING
- #define H323_TUNNEL_CISCO (1 << 0)
- #define H323_TUNNEL_QSIG (1 << 1)
- #define H323_HOLD_NOTIFY (1 << 0)
- #define H323_HOLD_Q931ONLY (1 << 1)
- #define H323_HOLD_H450 (1 << 2)
- typedef int64_t h323_format;
- typedef struct call_options {
- char cid_num[80];
- char cid_name[80];
- char cid_rdnis[80];
- int redirect_reason;
- int presentation;
- int type_of_number;
- int transfer_capability;
- int fastStart;
- int h245Tunneling;
- int silenceSuppression;
- int progress_setup;
- int progress_alert;
- int progress_audio;
- int dtmfcodec[2];
- int dtmfmode;
- h323_format capability;
- int bridge;
- int nat;
- int tunnelOptions;
- int holdHandling;
- int autoframing;
- struct ast_codec_pref prefs;
- } call_options_t;
- struct oh323_user {
- ASTOBJ_COMPONENTS(struct oh323_user);
- char context[80];
- char secret[80];
- char accountcode[AST_MAX_ACCOUNT_CODE];
- int amaflags;
- int host;
- struct sockaddr_in addr;
- struct ast_ha *ha;
- call_options_t options;
- };
- struct oh323_peer {
- ASTOBJ_COMPONENTS(struct oh323_peer);
- char mailbox[80];
- int delme;
- struct sockaddr_in addr;
- struct ast_ha *ha;
- call_options_t options;
- };
- struct oh323_alias {
- ASTOBJ_COMPONENTS(struct oh323_alias);
- char e164[20];
- char prefix[500];
- char secret[20];
- char context[80];
- };
- typedef struct call_details {
- unsigned int call_reference;
- char *call_token;
- char *call_source_aliases;
- char *call_dest_alias;
- char *call_source_name;
- char *call_source_e164;
- char *call_dest_e164;
- char *redirect_number;
- int redirect_reason;
- int presentation;
- int type_of_number;
- int transfer_capability;
- char *sourceIp;
- } call_details_t;
- typedef struct rtp_info {
- char addr[32];
- unsigned int port;
- } rtp_info_t;
- typedef int (*receive_digit_cb)(unsigned, char, const char *, int);
- extern receive_digit_cb on_receive_digit;
- typedef rtp_info_t *(*on_rtp_cb)(unsigned, const char *);
- extern on_rtp_cb on_external_rtp_create;
- typedef void (*start_rtp_cb)(unsigned int, const char *, int, const char *, int);
- extern start_rtp_cb on_start_rtp_channel;
- typedef int (*progress_cb)(unsigned, const char *, int);
- extern progress_cb on_progress;
- typedef call_options_t *(*setup_incoming_cb)(call_details_t *);
- extern setup_incoming_cb on_incoming_call;
- typedef int (*setup_outbound_cb)(call_details_t *);
- extern setup_outbound_cb on_outgoing_call;
- typedef void (*chan_ringing_cb)(unsigned, const char *);
- extern chan_ringing_cb on_chan_ringing;
- typedef void (*con_established_cb)(unsigned, const char *);
- extern con_established_cb on_connection_established;
- typedef void (*clear_con_cb)(unsigned, const char *);
- extern clear_con_cb on_connection_cleared;
- typedef int (*answer_call_cb)(unsigned, const char *);
- extern answer_call_cb on_answer_call;
- typedef void (*rfc2833_cb)(unsigned, const char *, int, int);
- extern rfc2833_cb on_set_rfc2833_payload;
- typedef void (*hangup_cb)(unsigned, const char *, int);
- extern hangup_cb on_hangup;
- typedef void (*setcapabilities_cb)(unsigned, const char *);
- extern setcapabilities_cb on_setcapabilities;
- typedef void (*setpeercapabilities_cb)(unsigned, const char *, int, struct ast_codec_pref *);
- extern setpeercapabilities_cb on_setpeercapabilities;
- typedef void (*onhold_cb)(unsigned, const char *, int);
- extern onhold_cb on_hold;
- extern int h323debug;
- #define H323_DTMF_RFC2833 (1 << 0)
- #define H323_DTMF_CISCO (1 << 1)
- #define H323_DTMF_SIGNAL (1 << 2)
- #define H323_DTMF_INBAND (1 << 3)
- #define H323_DTMF_RFC2833_PT 101
- #define H323_DTMF_CISCO_PT 121
- #ifdef __cplusplus
- extern "C" {
- #endif
- void h323_gk_urq(void);
- void h323_end_point_create(void);
- void h323_end_process(void);
- int h323_end_point_exist(void);
- void h323_debug(int, unsigned);
-
- void h323_callback_register(setup_incoming_cb,
- setup_outbound_cb,
- on_rtp_cb,
- start_rtp_cb,
- clear_con_cb,
- chan_ringing_cb,
- con_established_cb,
- receive_digit_cb,
- answer_call_cb,
- progress_cb,
- rfc2833_cb,
- hangup_cb,
- setcapabilities_cb,
- setpeercapabilities_cb,
- onhold_cb);
- int h323_set_capabilities(const char *, int, int, struct ast_codec_pref *, int);
- int h323_set_alias(struct oh323_alias *);
- int h323_set_gk(int, char *, char *);
- void h323_set_id(char *);
- void h323_show_tokens(void);
- void h323_show_version(void);
-
- int h323_start_listener(int, struct sockaddr_in);
- void h323_native_bridge(const char *, const char *, char *);
-
- void h323_send_tone(const char *call_token, char tone);
-
- int h323_make_call(char *dest, call_details_t *cd, call_options_t *);
- int h323_clear_call(const char *, int cause);
-
- int h323_send_alerting(const char *token);
- int h323_send_progress(const char *token);
- int h323_answering_call(const char *token, int);
- int h323_soft_hangup(const char *data);
- int h323_show_codec(int fd, int argc, char *argv[]);
- int h323_hold_call(const char *token, int);
- #ifdef __cplusplus
- }
- #endif
- #endif
|