git-svn-id: http://svn.openzap.org/svn/openzap/trunk@416 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale
2008-02-29 00:21:04 +00:00
parent 5e56f09d92
commit 1d3f79cddc
11 changed files with 633 additions and 45 deletions

View File

@@ -150,7 +150,9 @@
#define assert(_Expression) ((void)(_Expression))
#endif
#define ZAP_MAX_CHANNELS_SPAN 513
#define ZAP_MAX_CHANNELS_PHYSICAL_SPAN 32
#define ZAP_MAX_PHYSICAL_SPANS_PER_LOGICAL_SPAN 16
#define ZAP_MAX_CHANNELS_SPAN ZAP_MAX_CHANNELS_PHYSICAL_SPAN * ZAP_MAX_PHYSICAL_SPANS_PER_LOGICAL_SPAN
#define ZAP_MAX_SPANS_INTERFACE 33
#define GOTO_STATUS(label,st) status = st; goto label ;
@@ -506,7 +508,7 @@ zap_status_t zap_span_set_event_callback(zap_span_t *span, zio_event_cb_t event_
zap_status_t zap_channel_set_event_callback(zap_channel_t *zchan, zio_event_cb_t event_callback);
zap_status_t zap_channel_open(uint32_t span_id, uint32_t chan_id, zap_channel_t **zchan);
zap_status_t zap_channel_open_chan(zap_channel_t *zchan);
zap_status_t zap_channel_open_any(uint32_t span_id, zap_direction_t direction, zap_channel_t **zchan);
zap_status_t zap_channel_open_any(uint32_t span_id, zap_direction_t direction, const zap_caller_data_t *caller_data, zap_channel_t **zchan);
zap_status_t zap_channel_close(zap_channel_t **zchan);
zap_status_t zap_channel_done(zap_channel_t *zchan);
zap_status_t zap_channel_use(zap_channel_t *zchan);

View File

@@ -44,7 +44,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#ifdef SS7BC_USE_SCTP
#ifdef HAVE_NETINET_SCTP_H
#include <netinet/sctp.h>
#endif
#include <arpa/inet.h>
@@ -77,13 +77,13 @@
typedef t_sigboost ss7bc_event_t;
typedef uint32_t ss7bc_event_id_t;
typedef struct smg_ip_cfg
typedef struct ss7bc_ip_cfg
{
char local_ip[25];
int local_port;
char remote_ip[25];
int remote_port;
}smg_ip_cfg_t;
}ss7bc_ip_cfg_t;
struct ss7bc_connection {
zap_socket_t socket;
@@ -99,7 +99,7 @@ struct ss7bc_connection {
unsigned int rxseq;
unsigned int txwindow;
unsigned int rxseq_reset;
smg_ip_cfg_t cfg;
ss7bc_ip_cfg_t cfg;
};
typedef enum {
@@ -111,7 +111,7 @@ typedef struct ss7bc_connection ss7bc_connection_t;
/* disable nagle's algorythm */
static inline void sctp_no_nagle(int socket)
{
#ifdef SS7BC_USE_SCTP
#ifdef HAVE_NETINET_SCTP_H
int flag = 1;
setsockopt(socket, IPPROTO_SCTP, SCTP_NODELAY, (char *) &flag, sizeof(int));
#endif
@@ -123,8 +123,9 @@ ss7bc_event_t *ss7bc_connection_read(ss7bc_connection_t *mcon, int iteration);
ss7bc_event_t *ss7bc_connection_readp(ss7bc_connection_t *mcon, int iteration);
int ss7bc_connection_write(ss7bc_connection_t *mcon, ss7bc_event_t *event);
void ss7bc_event_init(ss7bc_event_t *event, ss7bc_event_id_t event_id, int chan, int span);
void ss7bc_call_init(ss7bc_event_t *event, char *calling, char *called, int setup_id);
char *ss7bc_event_id_name(uint32_t event_id);
void ss7bc_call_init(ss7bc_event_t *event, const char *calling, const char *called, int setup_id);
const char *ss7bc_event_id_name(uint32_t event_id);
int ss7bc_exec_command(ss7bc_connection_t *mcon, int span, int chan, int id, int cmd, int cause);
#endif

View File

@@ -33,21 +33,19 @@
#ifndef ZAP_SS7_BOOST_H
#define ZAP_SS7_BOOST_H
#include "ss7_boost_client.h"
#include "openzap.h"
typedef enum {
ZAP_SS7_BOOST_RUNNING = (1 << 0)
} zap_isdn_flag_t;
} zap_ss7_boost_flag_t;
struct zap_ss7_boost_data {
const char *local_ip;
int local_port;
const char *remote_ip;
int remote_port;
typedef struct zap_ss7_boost_data {
ss7bc_connection_t mcon;
ss7bc_connection_t pcon;
zio_signal_cb_t signal_cb;
uint32_t flags;
};
typedef struct zap_ss7_boost_data zap_ss7_boost_data_t;
} zap_ss7_boost_data_t;
zap_status_t zap_ss7_boost_start(zap_span_t *span);
zap_status_t zap_ss7_boost_init(void);

View File

@@ -336,8 +336,9 @@ typedef struct zap_channel zap_channel_t;
typedef struct zap_event zap_event_t;
typedef struct zap_sigmsg zap_sigmsg_t;
typedef struct zap_span zap_span_t;
typedef struct zap_caller_data zap_caller_data_t;
#define ZIO_CHANNEL_REQUEST_ARGS (zap_span_t *span, zap_direction_t direction, zap_channel_t **zchan)
#define ZIO_CHANNEL_REQUEST_ARGS (zap_span_t *span, zap_direction_t direction, const zap_caller_data_t *caller_data, zap_channel_t **zchan)
#define ZIO_CHANNEL_OUTGOING_CALL_ARGS (zap_channel_t *zchan)
#define ZIO_SPAN_POLL_EVENT_ARGS (zap_span_t *span, uint32_t ms)
#define ZIO_SPAN_NEXT_EVENT_ARGS (zap_span_t *span, zap_event_t **event)