some changes

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@420 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale
2008-03-01 00:48:36 +00:00
parent 051f682516
commit 9c95febcdd
9 changed files with 316 additions and 266 deletions

View File

@@ -307,14 +307,22 @@ struct zap_fsk_modulator {
int16_t sample_buffer[64];
};
typedef struct {
char digits[25];
uint8_t type;
uint8_t plan;
} zap_number_t;
struct zap_caller_data {
char cid_name[80];
char cid_num[80];
char cid_date[8];
char ani[25];
char cid_name[80];
zap_number_t cid_num;
zap_number_t ani;
zap_number_t dnis;
zap_number_t rdnis;
char aniII[25];
char dnis[25];
char rdnis[25];
uint8_t screen;
uint8_t pres;
char collected[25];
int CRV;
int hangup_cause;
@@ -413,6 +421,7 @@ struct zap_span {
zap_data_type_t data_type;
uint32_t span_id;
uint32_t chan_count;
uint32_t active_count;
zap_span_flag_t flags;
struct zap_io_interface *zio;
zio_event_cb_t event_callback;
@@ -455,6 +464,7 @@ struct zap_io_interface {
zio_span_next_event_t next_event;
};
zap_size_t zap_fsk_modulator_generate_bit(zap_fsk_modulator_t *fsk_trans, int8_t bit, int16_t *buf, zap_size_t buflen);
int32_t zap_fsk_modulator_generate_carrier_bits(zap_fsk_modulator_t *fsk_trans, uint32_t bits);
void zap_fsk_modulator_generate_chan_sieze(zap_fsk_modulator_t *fsk_trans);
@@ -545,6 +555,27 @@ ZIO_CODEC_FUNCTION(zio_alaw2ulaw);
#define zap_mutex_unlock(_x) _zap_mutex_unlock(_x)
#endif
static __inline__ void zap_set_state_all(zap_span_t *span, zap_channel_state_t state)
{
uint32_t j;
zap_mutex_lock(span->mutex);
for(j = 1; j <= span->chan_count; j++) {
zap_set_state_locked((&span->channels[j]), state);
}
zap_mutex_unlock(span->mutex);
}
static __inline__ void zap_set_flag_all(zap_span_t *span, uint32_t flag)
{
uint32_t j;
zap_mutex_lock(span->mutex);
for(j = 1; j <= span->chan_count; j++) {
zap_set_flag_locked((&span->channels[j]), flag);
}
zap_mutex_unlock(span->mutex);
}
#endif
/* For Emacs:

View File

@@ -51,12 +51,8 @@
#include <stdarg.h>
#include <netdb.h>
#include <sigboost.h>
#include <pthread.h>
#include <sys/time.h>
#define ss7bc_test_flag(p,flag) ({ \
((p)->flags & (flag)); \
})
@@ -93,13 +89,15 @@ struct ss7bc_connection {
struct hostent remote_hp;
struct hostent local_hp;
unsigned int flags;
pthread_mutex_t lock;
zap_mutex_t *mutex;
FILE *log;
unsigned int txseq;
unsigned int rxseq;
unsigned int txwindow;
unsigned int rxseq_reset;
ss7bc_ip_cfg_t cfg;
uint32_t hb_elapsed;
int up;
};
typedef enum {

View File

@@ -261,7 +261,8 @@ typedef enum {
typedef enum {
ZAP_SPAN_CONFIGURED = (1 << 0),
ZAP_SPAN_READY = (1 << 1),
ZAP_SPAN_STATE_CHANGE = (1 << 2)
ZAP_SPAN_STATE_CHANGE = (1 << 2),
ZAP_SPAN_SUSPENDED = (1 << 3)
} zap_span_flag_t;
typedef enum {
@@ -329,7 +330,10 @@ typedef enum {
ZAP_CHANNEL_CALLERID_DETECT = (1 << 17),
ZAP_CHANNEL_OUTBOUND = (1 << 18),
ZAP_CHANNEL_SUSPENDED = (1 << 19),
ZAP_CHANNEL_3WAY = (1 << 20)
ZAP_CHANNEL_3WAY = (1 << 20),
ZAP_CHANNEL_PROGRESS = (1 << 21),
ZAP_CHANNEL_MEDIA = (1 << 22),
ZAP_CHANNEL_ANSWERED = (1 << 23)
} zap_channel_flag_t;
typedef struct zap_channel zap_channel_t;
@@ -489,6 +493,7 @@ typedef enum {
ZAP_CAUSE_MEDIA_TIMEOUT = 604
} zap_call_cause_t;
#endif
/* For Emacs: