diff --git a/libs/openzap/src/include/zap_types.h b/libs/openzap/src/include/zap_types.h index 40fd649ad2..b515a1f00d 100644 --- a/libs/openzap/src/include/zap_types.h +++ b/libs/openzap/src/include/zap_types.h @@ -164,7 +164,8 @@ typedef enum { ZAP_SIGTYPE_ISDN, ZAP_SIGTYPE_RBS, ZAP_SIGTYPE_ANALOG, - ZAP_SIGTYPE_SS7BOOST + ZAP_SIGTYPE_SS7BOOST, + ZAP_SIGTYPE_M3UA } zap_signal_type_t; typedef enum { diff --git a/libs/openzap/src/m3ua_client.h b/libs/openzap/src/m3ua_client.h index e75a6dcee2..d7eb286029 100644 --- a/libs/openzap/src/m3ua_client.h +++ b/libs/openzap/src/m3ua_client.h @@ -46,16 +46,58 @@ #include #include #include -#include +#include +//#include #include #include #include -#include +//#include #include +#define MAX_DIALED_DIGITS 31 +#define MAX_CALLING_NAME 31 + +/* Next two defines are used to create the range of values for call_setup_id + * in the t_sigboost structure. + * 0..((CORE_MAX_SPANS * CORE_MAX_CHAN_PER_SPAN) - 1) */ +#define CORE_MAX_SPANS 200 +#define CORE_MAX_CHAN_PER_SPAN 30 +#define MAX_PENDING_CALLS CORE_MAX_SPANS * CORE_MAX_CHAN_PER_SPAN +/* 0..(MAX_PENDING_CALLS-1) is range of call_setup_id below */ +#define SIZE_RDNIS 80 + +//#undef MSGWINDOW +#define MSGWINDOW + + +typedef struct +{ + uint32_t event_id; + uint32_t fseqno; +#ifdef MSGWINDOW + uint32_t bseqno; +#endif + uint16_t call_setup_id; + uint32_t trunk_group; + uint32_t span; + uint32_t chan; + uint8_t called_number_digits_count; + char called_number_digits [MAX_DIALED_DIGITS + 1]; /* it's a null terminated string */ + uint8_t calling_number_digits_count; /* it's an array */ + char calling_number_digits [MAX_DIALED_DIGITS + 1]; /* it's a null terminated string */ + uint8_t release_cause; + struct timeval tv; + /* ref. Q.931 Table 4-11 and Q.951 Section 3 */ + uint8_t calling_number_screening_ind; + uint8_t calling_number_presentation; + char redirection_string [SIZE_RDNIS]; /* it's a null terminated string */ + +} t_m3ua; + typedef t_m3ua m3uac_event_t; typedef uint32_t m3uac_event_id_t; + typedef struct m3uac_ip_cfg { char local_ip[25]; @@ -85,27 +127,27 @@ struct m3uac_connection { typedef enum { MSU_FLAG_EVENT = (1 << 0) -} ss7bc_flag_t; +} m3uac_flag_t; typedef struct m3uac_connection m3uac_connection_t; static inline void sctp_no_nagle(int socket) { - int flag = 1; - setsockopt(socket, IPPROTO_SCTP, SCTP_NODELAY, (char *) &flag, sizeof(int)); + //int flag = 1; + //setsockopt(socket, IPPROTO_SCTP, SCTP_NODELAY, (char *) &flag, sizeof(int)); } int m3uac_connection_close(m3uac_connection_t *mcon); int m3uac_connection_open(m3uac_connection_t *mcon, char *local_ip, int local_port, char *ip, int port); -m3uac_event_t *ss7bc_connection_read(m3uac_connection_t *mcon, int iteration); -m3uac_event_t *ss7bc_connection_readp(m3uac_connection_t *mcon, int iteration); -int m3uac_connection_write(m3uac_connection_t *mcon, ss7bc_event_t *event); +m3uac_event_t *m3uac_connection_read(m3uac_connection_t *mcon, int iteration); +m3uac_event_t *m3uac_connection_readp(m3uac_connection_t *mcon, int iteration); +int m3uac_connection_write(m3uac_connection_t *mcon, m3uac_event_t *event); void m3uac_event_init(m3uac_event_t *event, m3uac_event_id_t event_id, int chan, int span); void m3uac_call_init(m3uac_event_t *event, const char *calling, const char *called, int setup_id); const char *m3uac_event_id_name(uint32_t event_id); int m3uac_exec_command(m3uac_connection_t *mcon, int span, int chan, int id, int cmd, int cause); -#endif + /* For Emacs: diff --git a/libs/openzap/src/zap_m3ua.c b/libs/openzap/src/zap_m3ua.c index dcd5aab584..bd35703ff9 100644 --- a/libs/openzap/src/zap_m3ua.c +++ b/libs/openzap/src/zap_m3ua.c @@ -38,7 +38,7 @@ #include "openzap.h" -//#include "m3ua_client.h" +#include "m3ua_client.h" #include "zap_m3ua.h" struct general_config {