* dozens of white-space removements
* some // comment removements * debugging optimization, use port where possible * fixed pickup problem (pickup didn't work anymore after mqueue) * removed some mIDSN_JOLLY defines which are not needed anymore in mqueue * adapted the new cli.h constifications git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@9215 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
556ec7c940
commit
a43c6c0f49
4 changed files with 62 additions and 148 deletions
|
@ -888,7 +888,7 @@ static int misdn_send_display (int fd, int argc, char *argv[])
|
||||||
return RESULT_SUCCESS ;
|
return RESULT_SUCCESS ;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *complete_ch_helper(char *line, char *word, int pos, int state, int rpos)
|
static char *complete_ch_helper(const char *line, const char *word, int pos, int state, int rpos)
|
||||||
{
|
{
|
||||||
struct ast_channel *c;
|
struct ast_channel *c;
|
||||||
int which=0;
|
int which=0;
|
||||||
|
@ -912,12 +912,12 @@ static char *complete_ch_helper(char *line, char *word, int pos, int state, int
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *complete_ch(char *line, char *word, int pos, int state)
|
static char *complete_ch(const char *line, const char *word, int pos, int state)
|
||||||
{
|
{
|
||||||
return complete_ch_helper(line, word, pos, state, 3);
|
return complete_ch_helper(line, word, pos, state, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *complete_debug_port (char *line, char *word, int pos, int state)
|
static char *complete_debug_port (const char *line, const char *word, int pos, int state)
|
||||||
{
|
{
|
||||||
if (state)
|
if (state)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -1418,13 +1418,6 @@ static int misdn_call(struct ast_channel *ast, char *dest, int timeout)
|
||||||
struct misdn_bchannel *newbc;
|
struct misdn_bchannel *newbc;
|
||||||
char *opts=NULL, *ext,*tokb;
|
char *opts=NULL, *ext,*tokb;
|
||||||
char dest_cp[256];
|
char dest_cp[256];
|
||||||
struct ast_channel *bridged;
|
|
||||||
|
|
||||||
if ( (bridged=ast_bridged_channel(ast)) ) {
|
|
||||||
chan_misdn_log(0,0,"Our Bridged Partner is %s\n",bridged->tech->type);
|
|
||||||
} else {
|
|
||||||
chan_misdn_log(0,0,"No Bridged Partner\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
strncpy(dest_cp,dest,sizeof(dest_cp)-1);
|
strncpy(dest_cp,dest,sizeof(dest_cp)-1);
|
||||||
|
@ -1480,7 +1473,7 @@ static int misdn_call(struct ast_channel *ast, char *dest, int timeout)
|
||||||
strncpy(ast->exten,ext,sizeof(ast->exten));
|
strncpy(ast->exten,ext,sizeof(ast->exten));
|
||||||
|
|
||||||
|
|
||||||
chan_misdn_log(1, 0, "* CALL: %s\n",dest);
|
chan_misdn_log(1, port, "* CALL: %s\n",dest);
|
||||||
|
|
||||||
chan_misdn_log(1, port, " --> * dad:%s tech:%s ctx:%s\n",ast->exten,ast->name, ast->context);
|
chan_misdn_log(1, port, " --> * dad:%s tech:%s ctx:%s\n",ast->exten,ast->name, ast->context);
|
||||||
|
|
||||||
|
@ -1521,7 +1514,7 @@ static int misdn_call(struct ast_channel *ast, char *dest, int timeout)
|
||||||
if (opts)
|
if (opts)
|
||||||
misdn_set_opt_exec(ast,opts);
|
misdn_set_opt_exec(ast,opts);
|
||||||
else
|
else
|
||||||
chan_misdn_log(1,0,"NO OPTS GIVEN\n");
|
chan_misdn_log(2,port,"NO OPTS GIVEN\n");
|
||||||
|
|
||||||
|
|
||||||
ch->state=MISDN_CALLING;
|
ch->state=MISDN_CALLING;
|
||||||
|
@ -2342,8 +2335,8 @@ static struct ast_channel *misdn_request(const char *type, int format, void *dat
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!newbc) {
|
if (!newbc) {
|
||||||
chan_misdn_log(1, 0, " --> ! No free channel chan ext:%s even after Group Call\n",ext);
|
chan_misdn_log(-1, 0, " --> ! No free channel chan ext:%s even after Group Call\n",ext);
|
||||||
chan_misdn_log(1, 0, " --> SEND: State Down\n");
|
chan_misdn_log(-1, 0, " --> SEND: State Down\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2773,7 +2766,6 @@ static void release_chan(struct misdn_bchannel *bc) {
|
||||||
} else {
|
} else {
|
||||||
chan_misdn_log(2, bc->port, "* --> Hangup\n");
|
chan_misdn_log(2, bc->port, "* --> Hangup\n");
|
||||||
ast_queue_hangup(ast);
|
ast_queue_hangup(ast);
|
||||||
//ast_hangup(ast);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2817,7 +2809,6 @@ static void misdn_transfer_bc(struct chan_list *tmp_ch, struct chan_list *holded
|
||||||
holded_chan->state=MISDN_CONNECTED;
|
holded_chan->state=MISDN_CONNECTED;
|
||||||
holded_chan->holded=0;
|
holded_chan->holded=0;
|
||||||
misdn_lib_transfer(holded_chan->bc?holded_chan->bc:holded_chan->holded_bc);
|
misdn_lib_transfer(holded_chan->bc?holded_chan->bc:holded_chan->holded_bc);
|
||||||
|
|
||||||
ast_channel_masquerade(holded_chan->ast, AST_BRIDGED_P(tmp_ch->ast));
|
ast_channel_masquerade(holded_chan->ast, AST_BRIDGED_P(tmp_ch->ast));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2833,7 +2824,6 @@ static void do_immediate_setup(struct misdn_bchannel *bc,struct chan_list *ch ,
|
||||||
|
|
||||||
ch->state=MISDN_DIALING;
|
ch->state=MISDN_DIALING;
|
||||||
|
|
||||||
|
|
||||||
if (bc->nt) {
|
if (bc->nt) {
|
||||||
int ret;
|
int ret;
|
||||||
ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
|
ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
|
||||||
|
@ -2845,7 +2835,6 @@ static void do_immediate_setup(struct misdn_bchannel *bc,struct chan_list *ch ,
|
||||||
ret = misdn_lib_send_event(bc, EVENT_PROCEEDING );
|
ret = misdn_lib_send_event(bc, EVENT_PROCEEDING );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tone_indicate(ch,TONE_DIAL);
|
tone_indicate(ch,TONE_DIAL);
|
||||||
|
|
||||||
chan_misdn_log(1, bc->port, "* Starting Ast ctx:%s dad:%s oad:%s with 's' extension\n", ast->context, ast->exten, AST_CID_P(ast));
|
chan_misdn_log(1, bc->port, "* Starting Ast ctx:%s dad:%s oad:%s with 's' extension\n", ast->context, ast->exten, AST_CID_P(ast));
|
||||||
|
@ -3010,6 +2999,21 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
|
||||||
}
|
}
|
||||||
/* chan_misdn_log(5, bc->port, "Can Match Extension: dad:%s oad:%s\n",bc->dad,bc->oad);*/
|
/* chan_misdn_log(5, bc->port, "Can Match Extension: dad:%s oad:%s\n",bc->dad,bc->oad);*/
|
||||||
|
|
||||||
|
/* Check for Pickup Request first */
|
||||||
|
if (!strcmp(ch->ast->exten, ast_pickup_ext())) {
|
||||||
|
int ret;/** Sending SETUP_ACK**/
|
||||||
|
ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
|
||||||
|
if (ast_pickup_call(ch->ast)) {
|
||||||
|
ast_hangup(ch->ast);
|
||||||
|
} else {
|
||||||
|
struct ast_channel *chan=ch->ast;
|
||||||
|
ch->state = MISDN_CALLING_ACKNOWLEDGE;
|
||||||
|
ch->ast=NULL;
|
||||||
|
ast_setstate(chan, AST_STATE_DOWN);
|
||||||
|
ast_hangup(chan);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!ast_canmatch_extension(ch->ast, ch->context, bc->dad, 1, bc->oad)) {
|
if(!ast_canmatch_extension(ch->ast, ch->context, bc->dad, 1, bc->oad)) {
|
||||||
|
|
||||||
|
@ -3131,6 +3135,20 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
|
||||||
/** queue new chan **/
|
/** queue new chan **/
|
||||||
cl_queue_chan(&cl_te, ch) ;
|
cl_queue_chan(&cl_te, ch) ;
|
||||||
|
|
||||||
|
/* Check for Pickup Request first */
|
||||||
|
if (!strcmp(chan->exten, ast_pickup_ext())) {
|
||||||
|
int ret;/** Sending SETUP_ACK**/
|
||||||
|
ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
|
||||||
|
if (ast_pickup_call(chan)) {
|
||||||
|
ast_hangup(chan);
|
||||||
|
} else {
|
||||||
|
ch->state = MISDN_CALLING_ACKNOWLEDGE;
|
||||||
|
ch->ast=NULL;
|
||||||
|
ast_setstate(chan, AST_STATE_DOWN);
|
||||||
|
ast_hangup(chan);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
added support for s extension hope it will help those poor cretains
|
added support for s extension hope it will help those poor cretains
|
||||||
|
@ -3371,7 +3389,7 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
|
||||||
int res;
|
int res;
|
||||||
int (*generate)(struct ast_channel *chan, void *tmp, int datalen, int samples);
|
int (*generate)(struct ast_channel *chan, void *tmp, int datalen, int samples);
|
||||||
|
|
||||||
chan_misdn_log(9,0,"TONE_GEN: len:%d\n");
|
chan_misdn_log(9,bc->port,"TONE_GEN: len:%d\n");
|
||||||
|
|
||||||
if (!ast->generator) break;
|
if (!ast->generator) break;
|
||||||
|
|
||||||
|
|
|
@ -335,9 +335,8 @@ int send_msg (int midev, struct misdn_bchannel *bc, msg_t *dmsg)
|
||||||
frm = (iframe_t *)dmsg->data;
|
frm = (iframe_t *)dmsg->data;
|
||||||
struct misdn_stack *stack=get_stack_by_bc(bc);
|
struct misdn_stack *stack=get_stack_by_bc(bc);
|
||||||
|
|
||||||
|
|
||||||
if (!stack) {
|
if (!stack) {
|
||||||
cb_log(0,0,"send_msg: IEK!! no stack\n ");
|
cb_log(0,bc->port,"send_msg: IEK!! no stack\n ");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -594,16 +593,11 @@ int chan_in_stack_free(struct misdn_stack *stack, int channel)
|
||||||
|
|
||||||
static int newteid=0;
|
static int newteid=0;
|
||||||
|
|
||||||
#ifdef MISDNUSER_JOLLY
|
|
||||||
#define MAXPROCS 0x100
|
#define MAXPROCS 0x100
|
||||||
#else
|
|
||||||
#define MAXPROCS 0x10
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
int misdn_lib_get_l1_up(struct misdn_stack *stack)
|
int misdn_lib_get_l1_up(struct misdn_stack *stack)
|
||||||
{
|
{
|
||||||
/* Pull Up L1 if we have JOLLY */
|
/* Pull Up L1 */
|
||||||
iframe_t act;
|
iframe_t act;
|
||||||
act.prim = PH_ACTIVATE | REQUEST;
|
act.prim = PH_ACTIVATE | REQUEST;
|
||||||
act.addr = (stack->upper_id | FLG_MSG_DOWN) ;
|
act.addr = (stack->upper_id | FLG_MSG_DOWN) ;
|
||||||
|
@ -693,11 +687,7 @@ static int create_process (int midev, struct misdn_bchannel *bc) {
|
||||||
}
|
}
|
||||||
stack->procids[i]=1;
|
stack->procids[i]=1;
|
||||||
|
|
||||||
#ifdef MISDNUSER_JOLLY
|
|
||||||
l3_id = 0xff00 | i;
|
l3_id = 0xff00 | i;
|
||||||
#else
|
|
||||||
l3_id = 0xfff0 | i;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ncr.prim = CC_NEW_CR | REQUEST;
|
ncr.prim = CC_NEW_CR | REQUEST;
|
||||||
|
|
||||||
|
@ -1054,16 +1044,12 @@ struct misdn_stack* stack_init( int midev, int port, int ptp )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
int nt=stack->nt;
|
int nt=stack->nt;
|
||||||
|
|
||||||
cb_log(4, port, "Init. Stack.\n");
|
cb_log(4, port, "Init. Stack.\n");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
memset(&li, 0, sizeof(li));
|
memset(&li, 0, sizeof(li));
|
||||||
{
|
{
|
||||||
int l = sizeof(li.name);
|
int l = sizeof(li.name);
|
||||||
|
@ -1092,7 +1078,6 @@ struct misdn_stack* stack_init( int midev, int port, int ptp )
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
stack->lower_id = mISDN_get_layerid(midev, stack->d_stid, nt?1:3);
|
stack->lower_id = mISDN_get_layerid(midev, stack->d_stid, nt?1:3);
|
||||||
if (stack->lower_id < 0) {
|
if (stack->lower_id < 0) {
|
||||||
cb_log(-1, port, "%s: Cannot get layer(%d) id of this port.\n", __FUNCTION__, nt?1:3);
|
cb_log(-1, port, "%s: Cannot get layer(%d) id of this port.\n", __FUNCTION__, nt?1:3);
|
||||||
|
@ -1277,7 +1262,6 @@ int handle_event ( struct misdn_bchannel *bc, enum event_e event, iframe_t *frm)
|
||||||
int ret=setup_bc(bc);
|
int ret=setup_bc(bc);
|
||||||
if (ret == -EINVAL){
|
if (ret == -EINVAL){
|
||||||
cb_log(-1,bc->port,"send_event: setup_bc failed\n");
|
cb_log(-1,bc->port,"send_event: setup_bc failed\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1287,7 +1271,6 @@ int handle_event ( struct misdn_bchannel *bc, enum event_e event, iframe_t *frm)
|
||||||
|
|
||||||
if ( *bc->crypt_key ) {
|
if ( *bc->crypt_key ) {
|
||||||
cb_log(4, stack->port, "ENABLING BLOWFISH channel:%d oad%d:%s dad%d:%s\n", bc->channel, bc->onumplan,bc->oad, bc->dnumplan,bc->dad);
|
cb_log(4, stack->port, "ENABLING BLOWFISH channel:%d oad%d:%s dad%d:%s\n", bc->channel, bc->onumplan,bc->oad, bc->dnumplan,bc->dad);
|
||||||
|
|
||||||
manager_ph_control_block(bc, BF_ENABLE_KEY, bc->crypt_key, strlen(bc->crypt_key) );
|
manager_ph_control_block(bc, BF_ENABLE_KEY, bc->crypt_key, strlen(bc->crypt_key) );
|
||||||
}
|
}
|
||||||
case EVENT_SETUP:
|
case EVENT_SETUP:
|
||||||
|
@ -1333,7 +1316,7 @@ int handle_new_process(struct misdn_stack *stack, iframe_t *frm)
|
||||||
|
|
||||||
|
|
||||||
if (!bc) {
|
if (!bc) {
|
||||||
cb_log(-1, 0, " --> !! lib: No free channel!\n");
|
cb_log(-1, stack->port, " --> !! lib: No free channel!\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1347,7 +1330,6 @@ int handle_new_process(struct misdn_stack *stack, iframe_t *frm)
|
||||||
|
|
||||||
int handle_cr ( struct misdn_stack *stack, iframe_t *frm)
|
int handle_cr ( struct misdn_stack *stack, iframe_t *frm)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!stack) return -1;
|
if (!stack) return -1;
|
||||||
|
|
||||||
switch (frm->prim) {
|
switch (frm->prim) {
|
||||||
|
@ -1385,7 +1367,6 @@ int handle_cr ( struct misdn_stack *stack, iframe_t *frm)
|
||||||
dump_chan_list(stack);
|
dump_chan_list(stack);
|
||||||
bc->pid = 0;
|
bc->pid = 0;
|
||||||
cb_event(EVENT_CLEANUP, bc, glob_mgr->user_data);
|
cb_event(EVENT_CLEANUP, bc, glob_mgr->user_data);
|
||||||
|
|
||||||
if (bc->stack_holder) {
|
if (bc->stack_holder) {
|
||||||
cb_log(4,stack->port, "REMOVEING Holder\n");
|
cb_log(4,stack->port, "REMOVEING Holder\n");
|
||||||
stack_holder_remove( stack, bc);
|
stack_holder_remove( stack, bc);
|
||||||
|
@ -1427,7 +1408,7 @@ void misdn_lib_release(struct misdn_bchannel *bc)
|
||||||
|
|
||||||
|
|
||||||
int misdn_lib_get_port_up (int port)
|
int misdn_lib_get_port_up (int port)
|
||||||
{ /* Pull Up L1 if we have JOLLY */
|
{ /* Pull Up L1 */
|
||||||
struct misdn_stack *stack;
|
struct misdn_stack *stack;
|
||||||
|
|
||||||
for (stack=glob_mgr->stack_list;
|
for (stack=glob_mgr->stack_list;
|
||||||
|
@ -1508,16 +1489,11 @@ handle_event_nt(void *dat, void *arg)
|
||||||
return(-EINVAL);
|
return(-EINVAL);
|
||||||
|
|
||||||
hh=(mISDNuser_head_t*)msg->data;
|
hh=(mISDNuser_head_t*)msg->data;
|
||||||
|
|
||||||
|
|
||||||
port=stack->port;
|
port=stack->port;
|
||||||
|
|
||||||
|
|
||||||
cb_log(4, stack->port, " --> lib: prim %x dinfo %x\n",hh->prim, hh->dinfo);
|
cb_log(4, stack->port, " --> lib: prim %x dinfo %x\n",hh->prim, hh->dinfo);
|
||||||
|
|
||||||
{
|
{
|
||||||
switch(hh->prim){
|
switch(hh->prim){
|
||||||
|
|
||||||
case CC_RETRIEVE|INDICATION:
|
case CC_RETRIEVE|INDICATION:
|
||||||
{
|
{
|
||||||
iframe_t frm; /* fake te frm to add callref to global callreflist */
|
iframe_t frm; /* fake te frm to add callref to global callreflist */
|
||||||
|
@ -1549,15 +1525,13 @@ handle_event_nt(void *dat, void *arg)
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case CC_SETUP|CONFIRM:
|
case CC_SETUP|CONFIRM:
|
||||||
{
|
{
|
||||||
struct misdn_bchannel *bc=find_bc_by_l3id(stack, hh->dinfo);
|
struct misdn_bchannel *bc=find_bc_by_l3id(stack, hh->dinfo);
|
||||||
int l3id = *((int *)(((u_char *)msg->data)+ mISDNUSER_HEAD_SIZE));
|
int l3id = *((int *)(((u_char *)msg->data)+ mISDNUSER_HEAD_SIZE));
|
||||||
|
cb_log(4, stack->port, " --> lib: Event_ind:SETUP CONFIRM [NT] : new L3ID is %x\n",l3id );
|
||||||
|
|
||||||
cb_log(4, bc?stack->port:0, " --> lib: Event_ind:SETUP CONFIRM [NT] : new L3ID is %x\n",l3id );
|
if (!bc) { cb_log(4, stack->port, "Bc Not found (after SETUP CONFIRM)\n"); return 0; }
|
||||||
|
|
||||||
if (!bc) { cb_log(4, 0, "Bc Not found (after SETUP CONFIRM)\n"); return 0; }
|
|
||||||
cb_log (2,bc->port,"I IND :CC_SETUP|CONFIRM: old l3id:%x new l3id:%x\n", bc->l3_id, l3id);
|
cb_log (2,bc->port,"I IND :CC_SETUP|CONFIRM: old l3id:%x new l3id:%x\n", bc->l3_id, l3id);
|
||||||
bc->l3_id=l3id;
|
bc->l3_id=l3id;
|
||||||
cb_event(EVENT_NEW_L3ID, bc, glob_mgr->user_data);
|
cb_event(EVENT_NEW_L3ID, bc, glob_mgr->user_data);
|
||||||
|
@ -1656,7 +1630,6 @@ handle_event_nt(void *dat, void *arg)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case CC_RELEASE_COMPLETE|INDICATION:
|
case CC_RELEASE_COMPLETE|INDICATION:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1696,11 +1669,9 @@ handle_event_nt(void *dat, void *arg)
|
||||||
|
|
||||||
frm.addr=stack->upper_id | FLG_MSG_DOWN;
|
frm.addr=stack->upper_id | FLG_MSG_DOWN;
|
||||||
|
|
||||||
|
|
||||||
frm.prim = CC_RELEASE_CR|INDICATION;
|
frm.prim = CC_RELEASE_CR|INDICATION;
|
||||||
cb_log(4, stack->port, " --> Faking Realease_cr for %x\n",frm.addr);
|
cb_log(4, stack->port, " --> Faking Realease_cr for %x\n",frm.addr);
|
||||||
/** removing procid **/
|
/** removing procid **/
|
||||||
|
|
||||||
if (!bc) {
|
if (!bc) {
|
||||||
cb_log(4, stack->port, " --> Didn't found BC so temporarly creating dummy BC (l3id:%x) on this port.\n", hh->dinfo);
|
cb_log(4, stack->port, " --> Didn't found BC so temporarly creating dummy BC (l3id:%x) on this port.\n", hh->dinfo);
|
||||||
memset (&dummybc,0,sizeof(dummybc));
|
memset (&dummybc,0,sizeof(dummybc));
|
||||||
|
@ -1710,20 +1681,10 @@ handle_event_nt(void *dat, void *arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bc) {
|
if (bc) {
|
||||||
#ifdef MISDNUSER_JOLLY
|
|
||||||
if ( (bc->l3_id & 0xff00) == 0xff00) {
|
if ( (bc->l3_id & 0xff00) == 0xff00) {
|
||||||
cb_log(4, stack->port, " --> Removing Process Id:%x on this port.\n", bc->l3_id&0xff);
|
cb_log(4, stack->port, " --> Removing Process Id:%x on this port.\n", bc->l3_id&0xff);
|
||||||
stack->procids[bc->l3_id&0xff] = 0 ;
|
stack->procids[bc->l3_id&0xff] = 0 ;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if ( (bc->l3_id & 0xfff0) == 0xfff0) {
|
|
||||||
cb_log(4, stack->port, " --> Removing Process Id:%x on this port.\n", bc->l3_id&0xf);
|
|
||||||
stack->procids[bc->l3_id&0xf] = 0 ;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else cb_log(-1, stack->port, "Couldnt find BC so I couldnt remove the Process!!!! this is a bad port.\n");
|
else cb_log(-1, stack->port, "Couldnt find BC so I couldnt remove the Process!!!! this is a bad port.\n");
|
||||||
|
|
||||||
|
@ -1731,7 +1692,6 @@ handle_event_nt(void *dat, void *arg)
|
||||||
free_msg(msg);
|
free_msg(msg);
|
||||||
return 0 ;
|
return 0 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CC_NEW_CR|INDICATION:
|
case CC_NEW_CR|INDICATION:
|
||||||
|
@ -1740,25 +1700,16 @@ handle_event_nt(void *dat, void *arg)
|
||||||
{
|
{
|
||||||
struct misdn_bchannel *bc=find_bc_by_l3id(stack, hh->dinfo);
|
struct misdn_bchannel *bc=find_bc_by_l3id(stack, hh->dinfo);
|
||||||
int l3id = *((int *)(((u_char *)msg->data)+ mISDNUSER_HEAD_SIZE));
|
int l3id = *((int *)(((u_char *)msg->data)+ mISDNUSER_HEAD_SIZE));
|
||||||
if (!bc) { cb_log(-1, 0, " --> In NEW_CR: didn't found bc ??\n"); return -1;};
|
if (!bc) { cb_log(-1, stack->port, " --> In NEW_CR: didn't found bc ??\n"); return -1;};
|
||||||
#ifdef MISDNUSER_JOLLY
|
|
||||||
if (((l3id&0xff00)!=0xff00) && ((bc->l3_id&0xff00)==0xff00)) {
|
if (((l3id&0xff00)!=0xff00) && ((bc->l3_id&0xff00)==0xff00)) {
|
||||||
cb_log(4, stack->port, " --> Removing Process Id:%x on this port.\n", 0xff&bc->l3_id);
|
cb_log(4, stack->port, " --> Removing Process Id:%x on this port.\n", 0xff&bc->l3_id);
|
||||||
stack->procids[bc->l3_id&0xff] = 0 ;
|
stack->procids[bc->l3_id&0xff] = 0 ;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if (((l3id&0xfff0)!=0xfff0) && ((bc->l3_id&0xfff0)==0xfff0)) {
|
|
||||||
cb_log(4, stack->port, "Removing Process Id:%x on this port.\n", 0xf&bc->l3_id);
|
|
||||||
stack->procids[bc->l3_id&0xf] = 0 ;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
cb_log(4, stack->port, "lib: Event_ind:CC_NEW_CR : very new L3ID is %x\n",l3id );
|
cb_log(4, stack->port, "lib: Event_ind:CC_NEW_CR : very new L3ID is %x\n",l3id );
|
||||||
|
|
||||||
bc->l3_id =l3id;
|
bc->l3_id =l3id;
|
||||||
cb_event(EVENT_NEW_L3ID, bc, glob_mgr->user_data);
|
cb_event(EVENT_NEW_L3ID, bc, glob_mgr->user_data);
|
||||||
|
|
||||||
|
|
||||||
free_msg(msg);
|
free_msg(msg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1787,8 +1738,6 @@ handle_event_nt(void *dat, void *arg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
/* Parse Events and fire_up to App. */
|
/* Parse Events and fire_up to App. */
|
||||||
struct misdn_bchannel *bc;
|
struct misdn_bchannel *bc;
|
||||||
|
@ -1954,7 +1903,7 @@ int handle_bchan(msg_t *msg)
|
||||||
struct misdn_stack *stack=get_stack_by_bc(bc);
|
struct misdn_stack *stack=get_stack_by_bc(bc);
|
||||||
|
|
||||||
if (!stack) {
|
if (!stack) {
|
||||||
cb_log(0,0,"handle_bchan: STACK not found for prim:%x with addr:%x dinfo:%x\n", frm->prim, frm->addr, frm->dinfo);
|
cb_log(0, bc->port,"handle_bchan: STACK not found for prim:%x with addr:%x dinfo:%x\n", frm->prim, frm->addr, frm->dinfo);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2219,17 +2168,11 @@ int handle_frm(msg_t *msg)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
cb_log(-1, stack->port, "NO BC FOR STACK\n");
|
cb_log(-1, stack->port, "NO BC FOR STACK\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cb_log(4, stack->port, "TE_FRM_HANDLER: Returning 0 on prim:%x \n",frm->prim);
|
cb_log(4, stack->port, "TE_FRM_HANDLER: Returning 0 on prim:%x \n",frm->prim);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2237,10 +2180,7 @@ int handle_frm(msg_t *msg)
|
||||||
int handle_l1(msg_t *msg)
|
int handle_l1(msg_t *msg)
|
||||||
{
|
{
|
||||||
iframe_t *frm = (iframe_t*) msg->data;
|
iframe_t *frm = (iframe_t*) msg->data;
|
||||||
|
|
||||||
struct misdn_stack *stack = find_stack_by_addr(frm->addr);
|
struct misdn_stack *stack = find_stack_by_addr(frm->addr);
|
||||||
|
|
||||||
|
|
||||||
int i ;
|
int i ;
|
||||||
|
|
||||||
if (!stack) return 0 ;
|
if (!stack) return 0 ;
|
||||||
|
@ -2267,19 +2207,16 @@ int handle_l1(msg_t *msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case PH_ACTIVATE | REQUEST:
|
case PH_ACTIVATE | REQUEST:
|
||||||
free_msg(msg);
|
free_msg(msg);
|
||||||
cb_log(1,stack->port,"L1: PH_ACTIVATE|REQUEST \n");
|
cb_log(1,stack->port,"L1: PH_ACTIVATE|REQUEST \n");
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case PH_DEACTIVATE | REQUEST:
|
case PH_DEACTIVATE | REQUEST:
|
||||||
free_msg(msg);
|
free_msg(msg);
|
||||||
cb_log(1,stack->port,"L1: PH_DEACTIVATE|REQUEST \n");
|
cb_log(1,stack->port,"L1: PH_DEACTIVATE|REQUEST \n");
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case PH_DEACTIVATE | CONFIRM:
|
case PH_DEACTIVATE | CONFIRM:
|
||||||
|
@ -2290,13 +2227,11 @@ int handle_l1(msg_t *msg)
|
||||||
if (global_state == MISDN_INITIALIZED) {
|
if (global_state == MISDN_INITIALIZED) {
|
||||||
cb_event(EVENT_CLEANUP, &stack->bc[i], glob_mgr->user_data);
|
cb_event(EVENT_CLEANUP, &stack->bc[i], glob_mgr->user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stack->nt) {
|
if (stack->nt) {
|
||||||
if (stack->nst.l1_l2(&stack->nst, msg))
|
if (stack->nst.l1_l2(&stack->nst, msg))
|
||||||
free_msg(msg);
|
free_msg(msg);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
free_msg(msg);
|
free_msg(msg);
|
||||||
}
|
}
|
||||||
|
@ -2316,8 +2251,6 @@ int handle_l2(msg_t *msg)
|
||||||
|
|
||||||
struct misdn_stack *stack = find_stack_by_addr(frm->addr);
|
struct misdn_stack *stack = find_stack_by_addr(frm->addr);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!stack) {
|
if (!stack) {
|
||||||
return 0 ;
|
return 0 ;
|
||||||
}
|
}
|
||||||
|
@ -2355,13 +2288,10 @@ int handle_l2(msg_t *msg)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int handle_mgmt(msg_t *msg)
|
int handle_mgmt(msg_t *msg)
|
||||||
{
|
{
|
||||||
iframe_t *frm = (iframe_t*) msg->data;
|
iframe_t *frm = (iframe_t*) msg->data;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ( (frm->addr == 0) && (frm->prim == (MGR_DELLAYER|CONFIRM)) ) {
|
if ( (frm->addr == 0) && (frm->prim == (MGR_DELLAYER|CONFIRM)) ) {
|
||||||
cb_log(2, 0, "MGMT: DELLAYER|CONFIRM Addr: 0 !\n") ;
|
cb_log(2, 0, "MGMT: DELLAYER|CONFIRM Addr: 0 !\n") ;
|
||||||
free(msg);
|
free(msg);
|
||||||
|
@ -2393,31 +2323,28 @@ int handle_mgmt(msg_t *msg)
|
||||||
stack->l1link=0;
|
stack->l1link=0;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case SSTATUS_L2_ESTABLISHED:
|
|
||||||
cb_log(1, 0, "MGMT: SSTATUS: L2_ESTABLISH \n");
|
|
||||||
stack->l2link=1;
|
|
||||||
|
|
||||||
|
case SSTATUS_L2_ESTABLISHED:
|
||||||
|
cb_log(1, stack->port, "MGMT: SSTATUS: L2_ESTABLISH \n");
|
||||||
|
stack->l2link=1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SSTATUS_L2_RELEASED:
|
case SSTATUS_L2_RELEASED:
|
||||||
cb_log(1, 0, "MGMT: SSTATUS: L2_RELEASED \n");
|
cb_log(1, stack->port, "MGMT: SSTATUS: L2_RELEASED \n");
|
||||||
stack->l2link=0;
|
stack->l2link=0;
|
||||||
stack->l1link=2;
|
stack->l1link=2;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
free_msg(msg);
|
free_msg(msg);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case MGR_SETSTACK | INDICATION:
|
case MGR_SETSTACK | INDICATION:
|
||||||
cb_log(2, 0, "MGMT: SETSTACK|IND dinfo %x\n",frm->dinfo);
|
cb_log(2, stack->port, "MGMT: SETSTACK|IND dinfo %x\n",frm->dinfo);
|
||||||
free_msg(msg);
|
free_msg(msg);
|
||||||
return 1;
|
return 1;
|
||||||
case MGR_DELLAYER | CONFIRM:
|
case MGR_DELLAYER | CONFIRM:
|
||||||
cb_log(2, 0, "MGMT: DELLAYER|CNF dinfo %x\n",frm->dinfo) ;
|
cb_log(2, stack->port, "MGMT: DELLAYER|CNF dinfo %x\n",frm->dinfo) ;
|
||||||
free_msg(msg);
|
free_msg(msg);
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
@ -2649,7 +2576,6 @@ void misdn_lib_log_ies(struct misdn_bchannel *bc)
|
||||||
|
|
||||||
if (!stack) return;
|
if (!stack) return;
|
||||||
|
|
||||||
|
|
||||||
cb_log(2, stack->port, " --> mode:%s cause:%d ocause:%d rad:%s\n", stack->nt?"NT":"TE", bc->cause, bc->out_cause, bc->rad);
|
cb_log(2, stack->port, " --> mode:%s cause:%d ocause:%d rad:%s\n", stack->nt?"NT":"TE", bc->cause, bc->out_cause, bc->rad);
|
||||||
|
|
||||||
cb_log(3, stack->port, " --> facility:%s out_facility:%s\n",fac2str(bc->fac_type),fac2str(bc->out_fac_type));
|
cb_log(3, stack->port, " --> facility:%s out_facility:%s\n",fac2str(bc->fac_type),fac2str(bc->out_fac_type));
|
||||||
|
@ -2681,11 +2607,9 @@ int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event )
|
||||||
|
|
||||||
if (!bc) goto ERR;
|
if (!bc) goto ERR;
|
||||||
|
|
||||||
|
|
||||||
struct misdn_stack *stack=get_stack_by_bc(bc);
|
struct misdn_stack *stack=get_stack_by_bc(bc);
|
||||||
|
|
||||||
|
cb_log(6,stack->port,"SENDEVENT: stack->nt:%d stack->uperid:%x\n",stack->nt, stack->upper_id);
|
||||||
cb_log(0,0,"SENDEVENT: stack->nt:%d stack->uperid:%x\n",stack->nt, stack->upper_id);
|
|
||||||
|
|
||||||
if ( stack->nt && !stack->l1link) {
|
if ( stack->nt && !stack->l1link) {
|
||||||
/** Queue Event **/
|
/** Queue Event **/
|
||||||
|
@ -2708,8 +2632,6 @@ int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event )
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
case EVENT_CONNECT:
|
case EVENT_CONNECT:
|
||||||
case EVENT_PROGRESS:
|
case EVENT_PROGRESS:
|
||||||
case EVENT_ALERTING:
|
case EVENT_ALERTING:
|
||||||
|
@ -2737,7 +2659,6 @@ int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( (event == EVENT_CONNECT ) && misdn_cap_is_speech(bc->capability) ) {
|
if ( (event == EVENT_CONNECT ) && misdn_cap_is_speech(bc->capability) ) {
|
||||||
if ( *bc->crypt_key ) {
|
if ( *bc->crypt_key ) {
|
||||||
cb_log(4, stack->port, " --> ENABLING BLOWFISH channel:%d oad%d:%s dad%d:%s \n", bc->channel, bc->onumplan,bc->oad, bc->dnumplan,bc->dad);
|
cb_log(4, stack->port, " --> ENABLING BLOWFISH channel:%d oad%d:%s dad%d:%s \n", bc->channel, bc->onumplan,bc->oad, bc->dnumplan,bc->dad);
|
||||||
|
@ -2745,7 +2666,6 @@ int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event )
|
||||||
manager_ph_control_block(bc, BF_ENABLE_KEY, bc->crypt_key, strlen(bc->crypt_key) );
|
manager_ph_control_block(bc, BF_ENABLE_KEY, bc->crypt_key, strlen(bc->crypt_key) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!bc->nodsp) manager_ph_control(bc, DTMF_TONE_START, 0);
|
if (!bc->nodsp) manager_ph_control(bc, DTMF_TONE_START, 0);
|
||||||
|
|
||||||
if (bc->ec_enable) manager_ec_enable(bc);
|
if (bc->ec_enable) manager_ec_enable(bc);
|
||||||
|
@ -2827,7 +2747,6 @@ int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int manager_isdn_handler(iframe_t *frm ,msg_t *msg)
|
int manager_isdn_handler(iframe_t *frm ,msg_t *msg)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -2836,11 +2755,8 @@ int manager_isdn_handler(iframe_t *frm ,msg_t *msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ((frm->addr | ISDN_PID_BCHANNEL_BIT )>> 28 ) == 0x5) {
|
if ( ((frm->addr | ISDN_PID_BCHANNEL_BIT )>> 28 ) == 0x5) {
|
||||||
cb_log(9,0,"BCHANNEL_BIT\n");
|
|
||||||
if (handle_bchan(msg))
|
if (handle_bchan(msg))
|
||||||
return 0 ;
|
return 0 ;
|
||||||
} else {
|
|
||||||
cb_log(9,0,"NO BCHANNEL_BIT !\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (handle_timers(msg))
|
if (handle_timers(msg))
|
||||||
|
@ -2911,9 +2827,7 @@ int misdn_lib_port_restart(int port)
|
||||||
if (stack) {
|
if (stack) {
|
||||||
cb_log(0, port, "Stack:%p\n",stack);
|
cb_log(0, port, "Stack:%p\n",stack);
|
||||||
|
|
||||||
|
|
||||||
clear_l3(stack);
|
clear_l3(stack);
|
||||||
|
|
||||||
{
|
{
|
||||||
msg_t *msg=alloc_msg(MAX_MSG_SIZE);
|
msg_t *msg=alloc_msg(MAX_MSG_SIZE);
|
||||||
iframe_t *frm;
|
iframe_t *frm;
|
||||||
|
@ -2926,12 +2840,9 @@ int misdn_lib_port_restart(int port)
|
||||||
frm=(iframe_t*)msg->data;
|
frm=(iframe_t*)msg->data;
|
||||||
/* we must activate if we are deactivated */
|
/* we must activate if we are deactivated */
|
||||||
/* activate bchannel */
|
/* activate bchannel */
|
||||||
|
|
||||||
frm->prim = DL_RELEASE | REQUEST;
|
frm->prim = DL_RELEASE | REQUEST;
|
||||||
|
|
||||||
frm->addr = stack->upper_id | FLG_MSG_DOWN;
|
frm->addr = stack->upper_id | FLG_MSG_DOWN;
|
||||||
|
|
||||||
|
|
||||||
frm->dinfo = 0;
|
frm->dinfo = 0;
|
||||||
frm->len = 0;
|
frm->len = 0;
|
||||||
msg_queue_tail(&glob_mgr->activatequeue, msg);
|
msg_queue_tail(&glob_mgr->activatequeue, msg);
|
||||||
|
@ -3112,8 +3023,6 @@ int misdn_lib_init(char *portlist, struct misdn_lib_iface *iface, void *user_dat
|
||||||
}
|
}
|
||||||
stack=stack_init(midev, port, ptp);
|
stack=stack_init(midev, port, ptp);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!stack) {
|
if (!stack) {
|
||||||
perror("init_stack");
|
perror("init_stack");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
|
@ -16,11 +16,8 @@
|
||||||
|
|
||||||
#ifndef mISDNUSER_HEAD_SIZE
|
#ifndef mISDNUSER_HEAD_SIZE
|
||||||
|
|
||||||
#ifdef MISDNUSER_JOLLY
|
|
||||||
#define mISDNUSER_HEAD_SIZE (sizeof(mISDNuser_head_t))
|
#define mISDNUSER_HEAD_SIZE (sizeof(mISDNuser_head_t))
|
||||||
#else
|
/*#define mISDNUSER_HEAD_SIZE (sizeof(mISDN_head_t))*/
|
||||||
#define mISDNUSER_HEAD_SIZE (sizeof(mISDN_head_t))
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -165,23 +165,18 @@ void parse_setup (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc,
|
||||||
strcpy(bc->oad, id);
|
strcpy(bc->oad, id);
|
||||||
switch (present) {
|
switch (present) {
|
||||||
case 0:
|
case 0:
|
||||||
// cb_log(3, bc->stack->port, " --> Pres:0\n");
|
|
||||||
bc->pres=0; /* screened */
|
bc->pres=0; /* screened */
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
// cb_log(3, bc->stack->port, " --> Pres:1\n");
|
|
||||||
bc->pres=1; /* not screened */
|
bc->pres=1; /* not screened */
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// cb_log(3, bc->stack->port, " --> Pres:%d\n",present);
|
|
||||||
bc->pres=0;
|
bc->pres=0;
|
||||||
}
|
}
|
||||||
switch (screen) {
|
switch (screen) {
|
||||||
case 0:
|
case 0:
|
||||||
// cb_log(4, bc->stack->port, " --> Screen:0\n");
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// cb_log(4, bc->stack->port, " --> Screen:%d\n",screen);
|
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -210,7 +205,6 @@ void parse_setup (struct isdn_msg msgs[], msg_t *msg, struct misdn_bchannel *bc,
|
||||||
|
|
||||||
strcpy(bc->rad, id);
|
strcpy(bc->rad, id);
|
||||||
bc->rnumplan=type;
|
bc->rnumplan=type;
|
||||||
// cb_log(3, bc->stack->port, " --> Redirecting number (REDIR_NR): '%s'\n", id);
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
int coding, capability, mode, rate, multi, user, async, urate, stopbits, dbits, parity;
|
int coding, capability, mode, rate, multi, user, async, urate, stopbits, dbits, parity;
|
||||||
|
@ -267,7 +261,6 @@ msg_t *build_setup (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
|
||||||
|
|
||||||
setup=(SETUP_t*)((msg->data+HEADER_LEN));
|
setup=(SETUP_t*)((msg->data+HEADER_LEN));
|
||||||
|
|
||||||
// cb_log(2, bc->stack->port, " --> oad %s dad %s channel %d\n",bc->oad, bc->dad,bc->channel);
|
|
||||||
if (bc->channel == 0 || bc->channel == ANY_CHANNEL || bc->channel==-1)
|
if (bc->channel == 0 || bc->channel == ANY_CHANNEL || bc->channel==-1)
|
||||||
enc_ie_channel_id(&setup->CHANNEL_ID, msg, 0, bc->channel, nt,bc);
|
enc_ie_channel_id(&setup->CHANNEL_ID, msg, 0, bc->channel, nt,bc);
|
||||||
else
|
else
|
||||||
|
@ -346,7 +339,7 @@ msg_t *build_connect (struct isdn_msg msgs[], struct misdn_bchannel *bc, int nt)
|
||||||
CONNECT_t *connect;
|
CONNECT_t *connect;
|
||||||
msg_t *msg =(msg_t*)create_l3msg(CC_CONNECT | REQUEST, MT_CONNECT, bc?bc->l3_id:-1, sizeof(CONNECT_t) ,nt);
|
msg_t *msg =(msg_t*)create_l3msg(CC_CONNECT | REQUEST, MT_CONNECT, bc?bc->l3_id:-1, sizeof(CONNECT_t) ,nt);
|
||||||
|
|
||||||
cb_log(0,0,"BUILD_CONNECT: bc:%p bc->l3id:%d, nt:%d\n",bc,bc->l3_id,nt);
|
cb_log(6,bc->port,"BUILD_CONNECT: bc:%p bc->l3id:%d, nt:%d\n",bc,bc->l3_id,nt);
|
||||||
|
|
||||||
connect=(CONNECT_t*)((msg->data+HEADER_LEN));
|
connect=(CONNECT_t*)((msg->data+HEADER_LEN));
|
||||||
|
|
||||||
|
@ -765,7 +758,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);
|
dec_ie_channel_id(restart->CHANNEL_ID, (Q931_info_t *)restart, &exclusive, &channel, nt,bc);
|
||||||
if (channel==0xff) /* any channel */
|
if (channel==0xff) /* any channel */
|
||||||
channel=-1;
|
channel=-1;
|
||||||
cb_log(0, stack->port, "CC_RESTART Request on channel:%d on this port.\n");
|
cb_log(3, stack->port, "CC_RESTART Request on channel:%d on this port.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -822,14 +815,11 @@ void parse_release_complete (struct isdn_msg msgs[], msg_t *msg, struct misdn_bc
|
||||||
iframe_t *frm = (iframe_t*) msg->data;
|
iframe_t *frm = (iframe_t*) msg->data;
|
||||||
|
|
||||||
struct misdn_stack *stack=get_stack_by_bc(bc);
|
struct misdn_stack *stack=get_stack_by_bc(bc);
|
||||||
|
|
||||||
#ifdef MISDNUSER_JOLLY
|
|
||||||
mISDNuser_head_t *hh;
|
mISDNuser_head_t *hh;
|
||||||
hh=(mISDNuser_head_t*)msg->data;
|
hh=(mISDNuser_head_t*)msg->data;
|
||||||
#else
|
|
||||||
mISDN_head_t *hh;
|
/*hh=(mISDN_head_t*)msg->data;
|
||||||
hh=(mISDN_head_t*)msg->data;
|
mISDN_head_t *hh;*/
|
||||||
#endif
|
|
||||||
|
|
||||||
if (nt) {
|
if (nt) {
|
||||||
if (hh->prim == (CC_RELEASE_COMPLETE|CONFIRM)) {
|
if (hh->prim == (CC_RELEASE_COMPLETE|CONFIRM)) {
|
||||||
|
|
Loading…
Reference in a new issue