issue #5566
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6938 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
81116fa432
commit
733158c357
|
@ -1,5 +1,7 @@
|
|||
2005-11-01 Kevin P. Fleming <kpfleming@digium.com>
|
||||
|
||||
* many files: make chan_misdn actually build (issue #5566)
|
||||
|
||||
* many files: more Cygwin build system support (issue #4678)
|
||||
|
||||
* apps/app_parkandannounce.c (parkandannounce_exec): supply parent channel to ast_request_and_dial so channel variables can be inherited (issue #5564)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -20,7 +20,17 @@
|
|||
if qi is not NULL (TE-mode), offset is set
|
||||
*/
|
||||
|
||||
#include "isdn_lib.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#include "isdn_lib_intern.h"
|
||||
|
||||
#include <mISDNlib.h>
|
||||
#include <isdn_net.h>
|
||||
#include <l3dss1.h>
|
||||
#include <net_l3.h>
|
||||
|
||||
|
||||
#define CENTREX_FAC 0x88
|
||||
#define CENTREX_ID 0xa1
|
||||
|
@ -667,8 +677,9 @@ void enc_ie_channel_id(unsigned char **ntmode, msg_t *msg, int exclusive, int ch
|
|||
unsigned char *p;
|
||||
Q931_info_t *qi = (Q931_info_t *)(msg->data + mISDN_HEADER_LEN);
|
||||
int l;
|
||||
int pri = bc->stack->pri;
|
||||
|
||||
struct misdn_stack *stack=get_stack_by_bc(bc);
|
||||
int pri = stack->pri;
|
||||
|
||||
if (exclusive<0 || exclusive>1)
|
||||
{
|
||||
printf("%s: ERROR: exclusive(%d) is out of range.\n", __FUNCTION__, exclusive);
|
||||
|
@ -738,7 +749,8 @@ void enc_ie_channel_id(unsigned char **ntmode, msg_t *msg, int exclusive, int ch
|
|||
|
||||
void dec_ie_channel_id(unsigned char *p, Q931_info_t *qi, int *exclusive, int *channel, int nt, struct misdn_bchannel *bc)
|
||||
{
|
||||
int pri = bc->stack->pri;
|
||||
struct misdn_stack *stack=get_stack_by_bc(bc);
|
||||
int pri =stack->pri;
|
||||
|
||||
*exclusive = -1;
|
||||
*channel = -1;
|
||||
|
@ -1332,7 +1344,8 @@ void enc_ie_facility(unsigned char **ntmode, msg_t *msg, unsigned char *facility
|
|||
void dec_ie_facility(unsigned char *p, Q931_info_t *qi, unsigned char *facility, int *facility_len, int nt, struct misdn_bchannel *bc)
|
||||
{
|
||||
int i;
|
||||
|
||||
struct misdn_stack *stack=get_stack_by_bc(bc);
|
||||
|
||||
*facility_len = 0;
|
||||
|
||||
if (!nt)
|
||||
|
@ -1350,10 +1363,10 @@ void dec_ie_facility(unsigned char *p, Q931_info_t *qi, unsigned char *facility,
|
|||
i = 0;
|
||||
while(i < *facility_len)
|
||||
{
|
||||
cb_log(3, bc->stack->port, " %02x", facility[i]);
|
||||
cb_log(3, stack->port, " %02x", facility[i]);
|
||||
i++;
|
||||
}
|
||||
cb_log(3, bc->stack->port, " facility\n");
|
||||
cb_log(3, stack->port, " facility\n");
|
||||
}
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -14,37 +14,13 @@
|
|||
#ifndef TE_LIB
|
||||
#define TE_LIB
|
||||
|
||||
#include <mISDNlib.h>
|
||||
#include <isdn_net.h>
|
||||
#include <l3dss1.h>
|
||||
#include <net_l3.h>
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#ifndef mISDNUSER_HEAD_SIZE
|
||||
|
||||
#ifdef MISDNUSER_JOLLY
|
||||
#define mISDNUSER_HEAD_SIZE (sizeof(mISDNuser_head_t))
|
||||
#else
|
||||
#define mISDNUSER_HEAD_SIZE (sizeof(mISDN_head_t))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define MISDN_ASTERISK_TECH_PVT(ast) ast->tech_pvt
|
||||
#define MISDN_ASTERISK_PVT(ast) 1
|
||||
#define MISDN_ASTERISK_TYPE(ast) ast->tech->type
|
||||
|
||||
|
||||
/* #include "ies.h" */
|
||||
|
||||
#define MAX_BCHANS 30
|
||||
|
||||
|
||||
/** For initialization usage **/
|
||||
/* typedef int ie_nothing_t ;*/
|
||||
/** end of init usage **/
|
||||
|
||||
|
||||
#define MAX_BCHANS 30
|
||||
|
||||
enum bc_state_e {
|
||||
STATE_NOTHING=0,
|
||||
STATE_NULL,
|
||||
|
@ -173,12 +149,20 @@ enum facility_type {
|
|||
FACILITY_CALLDEFLECT
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
struct misdn_bchannel {
|
||||
|
||||
int nt;
|
||||
int port;
|
||||
/** init stuff **/
|
||||
int b_stid;
|
||||
/* int b_addr; */
|
||||
int layer_id;
|
||||
|
||||
|
||||
|
||||
|
||||
/** var stuff**/
|
||||
int l3_id;
|
||||
int pid;
|
||||
|
@ -194,11 +178,13 @@ struct misdn_bchannel {
|
|||
int bframe_len;
|
||||
int time_usec;
|
||||
|
||||
sem_t astsem;
|
||||
sem_t misdnsem;
|
||||
ibuffer_t *astbuf;
|
||||
ibuffer_t *misdnbuf;
|
||||
|
||||
|
||||
void *astbuf;
|
||||
void *misdnbuf;
|
||||
|
||||
|
||||
int te_choose_channel;
|
||||
|
||||
/* dtmf digit */
|
||||
int dtmf;
|
||||
int send_dtmf;
|
||||
|
@ -297,58 +283,8 @@ struct misdn_bchannel {
|
|||
int rxgain;
|
||||
|
||||
struct misdn_bchannel *next;
|
||||
struct misdn_stack *stack;
|
||||
};
|
||||
|
||||
struct misdn_stack {
|
||||
/** is first element because &nst equals &mISDNlist **/
|
||||
net_stack_t nst;
|
||||
manager_t mgr;
|
||||
|
||||
int d_stid;
|
||||
|
||||
int b_num;
|
||||
|
||||
int b_stids[MAX_BCHANS + 1];
|
||||
|
||||
int ptp;
|
||||
int lower_id;
|
||||
int upper_id;
|
||||
|
||||
int l2link;
|
||||
|
||||
time_t l2establish;
|
||||
|
||||
int l1link;
|
||||
int midev;
|
||||
|
||||
enum mode_e {NT_MODE, TE_MODE} mode;
|
||||
int pri;
|
||||
|
||||
|
||||
int procids[0x100+1];
|
||||
|
||||
msg_queue_t downqueue;
|
||||
int busy;
|
||||
|
||||
int port;
|
||||
struct misdn_bchannel bc[MAX_BCHANS + 1];
|
||||
|
||||
struct misdn_bchannel* bc_list;
|
||||
|
||||
int channels[MAX_BCHANS + 1];
|
||||
|
||||
|
||||
|
||||
int te_choose_channel;
|
||||
|
||||
|
||||
struct misdn_bchannel *holding; /* Queue which holds holded channels :) */
|
||||
|
||||
struct misdn_stack *next;
|
||||
};
|
||||
|
||||
struct misdn_stack* get_misdn_stack( void );
|
||||
|
||||
enum event_response_e (*cb_event) (enum event_e event, struct misdn_bchannel *bc, void *user_data);
|
||||
void (*cb_log) (int level, int port, char *tmpl, ...);
|
||||
|
@ -400,35 +336,26 @@ int misdn_inband_avail(struct misdn_bchannel *bc);
|
|||
int misdn_lib_send_facility(struct misdn_bchannel *bc, enum facility_type fac, void *data);
|
||||
|
||||
|
||||
struct isdn_msg {
|
||||
unsigned long misdn_msg;
|
||||
|
||||
enum layer_e layer;
|
||||
enum event_e event;
|
||||
|
||||
void (*msg_parser)(struct isdn_msg *msgs, msg_t *msg, struct misdn_bchannel *bc, int nt);
|
||||
msg_t *(*msg_builder)(struct isdn_msg *msgs, struct misdn_bchannel *bc, int nt);
|
||||
void (*msg_printer)(struct isdn_msg *msgs);
|
||||
|
||||
char *info;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void manager_ec_enable(struct misdn_bchannel *bc);
|
||||
void manager_ec_disable(struct misdn_bchannel *bc);
|
||||
|
||||
|
||||
/* for isdn_msg_parser.c */
|
||||
msg_t *create_l3msg(int prim, int mt, int dinfo , int size, int nt);
|
||||
void get_show_stack_details(int port, char *buf);
|
||||
|
||||
|
||||
/** Ibuf interface **/
|
||||
int misdn_ibuf_usedcount(void *buf);
|
||||
int misdn_ibuf_freecount(void *buf);
|
||||
void misdn_ibuf_memcpy_r(char *to, void *from, int len);
|
||||
void misdn_ibuf_memcpy_w(void *buf, char *from, int len);
|
||||
|
||||
/** Ibuf interface End **/
|
||||
|
||||
|
||||
void misdn_lib_bridge( struct misdn_bchannel * bc1, struct misdn_bchannel *bc2);
|
||||
void misdn_lib_split_bridge( struct misdn_bchannel * bc1, struct misdn_bchannel *bc2);
|
||||
|
||||
|
||||
int misdn_lib_is_ptp(int port);
|
||||
|
||||
#define PRI_TRANS_CAP_SPEECH 0x0
|
||||
#define PRI_TRANS_CAP_DIGITAL 0x08
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
#ifndef ISDN_LIB_INTERN
|
||||
#define ISDN_LIB_INTER
|
||||
|
||||
|
||||
#include <mISDNlib.h>
|
||||
#include <isdn_net.h>
|
||||
#include <l3dss1.h>
|
||||
#include <net_l3.h>
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#include "isdn_lib.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef mISDNUSER_HEAD_SIZE
|
||||
|
||||
#ifdef MISDNUSER_JOLLY
|
||||
#define mISDNUSER_HEAD_SIZE (sizeof(mISDNuser_head_t))
|
||||
#else
|
||||
#define mISDNUSER_HEAD_SIZE (sizeof(mISDN_head_t))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
ibuffer_t *astbuf;
|
||||
ibuffer_t *misdnbuf;
|
||||
|
||||
|
||||
struct isdn_msg {
|
||||
unsigned long misdn_msg;
|
||||
|
||||
enum layer_e layer;
|
||||
enum event_e event;
|
||||
|
||||
void (*msg_parser)(struct isdn_msg *msgs, msg_t *msg, struct misdn_bchannel *bc, int nt);
|
||||
msg_t *(*msg_builder)(struct isdn_msg *msgs, struct misdn_bchannel *bc, int nt);
|
||||
void (*msg_printer)(struct isdn_msg *msgs);
|
||||
|
||||
char *info;
|
||||
|
||||
} ;
|
||||
|
||||
/* for isdn_msg_parser.c */
|
||||
msg_t *create_l3msg(int prim, int mt, int dinfo , int size, int nt);
|
||||
|
||||
|
||||
|
||||
struct misdn_stack {
|
||||
/** is first element because &nst equals &mISDNlist **/
|
||||
net_stack_t nst;
|
||||
manager_t mgr;
|
||||
|
||||
int d_stid;
|
||||
|
||||
int b_num;
|
||||
|
||||
int b_stids[MAX_BCHANS + 1];
|
||||
|
||||
int ptp;
|
||||
int lower_id;
|
||||
int upper_id;
|
||||
|
||||
int l2link;
|
||||
|
||||
time_t l2establish;
|
||||
|
||||
int l1link;
|
||||
int midev;
|
||||
|
||||
enum mode_e {NT_MODE, TE_MODE} mode;
|
||||
|
||||
int pri;
|
||||
|
||||
|
||||
int procids[0x100+1];
|
||||
|
||||
msg_queue_t downqueue;
|
||||
int busy;
|
||||
|
||||
int port;
|
||||
struct misdn_bchannel bc[MAX_BCHANS + 1];
|
||||
|
||||
struct misdn_bchannel* bc_list;
|
||||
|
||||
int channels[MAX_BCHANS + 1];
|
||||
|
||||
|
||||
struct misdn_bchannel *holding; /* Queue which holds holded channels :) */
|
||||
|
||||
struct misdn_stack *next;
|
||||
};
|
||||
|
||||
|
||||
struct misdn_stack* get_stack_by_bc(struct misdn_bchannel *bc);
|
||||
|
||||
#endif
|
|
@ -20,6 +20,8 @@ void parse_proceeding (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel
|
|||
{
|
||||
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
|
||||
CALL_PROCEEDING_t *proceeding=(CALL_PROCEEDING_t*)((unsigned long)msg->data+ HEADER_LEN);
|
||||
struct misdn_stack *stack=get_stack_by_bc(bc);
|
||||
|
||||
{
|
||||
int exclusive, channel;
|
||||
dec_ie_channel_id(proceeding->CHANNEL_ID, (Q931_info_t *)proceeding, &exclusive, &channel, nt,bc);
|
||||
|
@ -28,7 +30,7 @@ void parse_proceeding (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel
|
|||
channel=-1;
|
||||
|
||||
/* ALERT: is that everytime true ? */
|
||||
if (channel > 0 && bc->stack->mode == NT_MODE)
|
||||
if (channel > 0 && stack->mode == NT_MODE)
|
||||
bc->channel = channel;
|
||||
}
|
||||
|
||||
|
@ -37,8 +39,6 @@ void parse_proceeding (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel
|
|||
#if DEBUG
|
||||
printf("Parsing PROCEEDING Msg\n");
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
msg_t *build_proceeding (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
|
||||
{
|
||||
|
@ -819,7 +819,9 @@ void parse_restart (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *b
|
|||
{
|
||||
int HEADER_LEN = nt?mISDNUSER_HEAD_SIZE:mISDN_HEADER_LEN;
|
||||
RESTART_t *restart=(RESTART_t*)((unsigned long)(msg->data+HEADER_LEN));
|
||||
|
||||
|
||||
struct misdn_stack *stack=get_stack_by_bc(bc);
|
||||
|
||||
#if DEBUG
|
||||
printf("Parsing RESTART Msg\n");
|
||||
#endif
|
||||
|
@ -829,7 +831,7 @@ void parse_restart (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *b
|
|||
dec_ie_channel_id(restart->CHANNEL_ID, (Q931_info_t *)restart, &exclusive, &channel, nt,bc);
|
||||
if (channel==0xff) /* any channel */
|
||||
channel=-1;
|
||||
cb_log(0, bc->stack->port, "CC_RESTART Request on channel:%d on port:%d\n",bc->stack->port);
|
||||
cb_log(0, stack->port, "CC_RESTART Request on channel:%d on port:%d\n",stack->port);
|
||||
}
|
||||
|
||||
|
||||
|
@ -892,6 +894,9 @@ void parse_release_complete (struct isdn_msg msgs[], msg_t *msg, struct misdn_bc
|
|||
RELEASE_COMPLETE_t *release_complete=(RELEASE_COMPLETE_t*)((unsigned long)(msg->data+HEADER_LEN));
|
||||
int location;
|
||||
iframe_t *frm = (iframe_t*) msg->data;
|
||||
|
||||
struct misdn_stack *stack=get_stack_by_bc(bc);
|
||||
|
||||
#ifdef MISDNUSER_JOLLY
|
||||
mISDNuser_head_t *hh;
|
||||
hh=(mISDNuser_head_t*)msg->data;
|
||||
|
@ -902,12 +907,12 @@ void parse_release_complete (struct isdn_msg msgs[], msg_t *msg, struct misdn_bc
|
|||
|
||||
if (nt) {
|
||||
if (hh->prim == (CC_RELEASE_COMPLETE|CONFIRM)) {
|
||||
cb_log(0, bc->stack->port, "CC_RELEASE_COMPLETE|CONFIRM [NT] port:%d\n",bc->stack->port);
|
||||
cb_log(0, stack->port, "CC_RELEASE_COMPLETE|CONFIRM [NT] port:%d\n",stack->port);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (frm->prim == (CC_RELEASE_COMPLETE|CONFIRM)) {
|
||||
cb_log(0, bc->stack->port, "CC_RELEASE_COMPLETE|CONFIRM [TE] port:%d\n",bc->stack->port);
|
||||
cb_log(0, stack->port, "CC_RELEASE_COMPLETE|CONFIRM [TE] port:%d\n",stack->port);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -217,7 +217,7 @@ use_callingpres=yes
|
|||
; be aware, move this setting only to outgoing portgroups!
|
||||
; A value of zero turns echocancellation off.
|
||||
;
|
||||
; possible values are: 0,32,64,128.256,yes(=128),no(=0)
|
||||
; possible values are: 0,32,64,128,256,yes(=128),no(=0)
|
||||
;
|
||||
; default value: no
|
||||
;
|
||||
|
|
Reference in New Issue