mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-14 08:31:02 +00:00
fixed a bug which led to chan_list zombies, when the call could not be properly established in misdn_call. also removed the ACK_HDLC stuff which is not really needed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@43764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -102,7 +102,7 @@ int misdn_jb_empty(struct misdn_jb *jb, char *data, int len);
|
|||||||
|
|
||||||
|
|
||||||
enum misdn_chan_state {
|
enum misdn_chan_state {
|
||||||
MISDN_NOTHING, /*!< at beginning */
|
MISDN_NOTHING=0, /*!< at beginning */
|
||||||
MISDN_WAITING4DIGS, /*!< when waiting for infos */
|
MISDN_WAITING4DIGS, /*!< when waiting for infos */
|
||||||
MISDN_EXTCANTMATCH, /*!< when asterisk couldnt match our ext */
|
MISDN_EXTCANTMATCH, /*!< when asterisk couldnt match our ext */
|
||||||
MISDN_DIALING, /*!< when pbx_start */
|
MISDN_DIALING, /*!< when pbx_start */
|
||||||
@@ -1651,8 +1651,6 @@ static int misdn_call(struct ast_channel *ast, char *dest, int timeout)
|
|||||||
else
|
else
|
||||||
chan_misdn_log(2,port,"NO OPTS GIVEN\n");
|
chan_misdn_log(2,port,"NO OPTS GIVEN\n");
|
||||||
|
|
||||||
ch->state=MISDN_CALLING;
|
|
||||||
|
|
||||||
r=misdn_lib_send_event( newbc, EVENT_SETUP );
|
r=misdn_lib_send_event( newbc, EVENT_SETUP );
|
||||||
|
|
||||||
/** we should have l3id after sending setup **/
|
/** we should have l3id after sending setup **/
|
||||||
@@ -1673,6 +1671,8 @@ static int misdn_call(struct ast_channel *ast, char *dest, int timeout)
|
|||||||
ast->hangupcause=16;
|
ast->hangupcause=16;
|
||||||
|
|
||||||
if (newbc->nt) stop_bc_tones(ch);
|
if (newbc->nt) stop_bc_tones(ch);
|
||||||
|
|
||||||
|
ch->state=MISDN_CALLING;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1974,9 +1974,9 @@ static int misdn_hangup(struct ast_channel *ast)
|
|||||||
|
|
||||||
bc=p->bc;
|
bc=p->bc;
|
||||||
|
|
||||||
if (ast->_state == AST_STATE_RESERVED) {
|
if (ast->_state == AST_STATE_RESERVED || p->state == MISDN_NOTHING) {
|
||||||
/* between request and call */
|
/* between request and call */
|
||||||
ast_log(LOG_DEBUG, "State Reserved => chanIsAvail\n");
|
ast_log(LOG_DEBUG, "State Reserved (or nothing) => chanIsAvail\n");
|
||||||
MISDN_ASTERISK_TECH_PVT(ast)=NULL;
|
MISDN_ASTERISK_TECH_PVT(ast)=NULL;
|
||||||
|
|
||||||
cl_dequeue_chan(&cl_te, p);
|
cl_dequeue_chan(&cl_te, p);
|
||||||
@@ -3724,10 +3724,10 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
|
|||||||
cb_log(1,bc->port," --> found holded ch\n");
|
cb_log(1,bc->port," --> found holded ch\n");
|
||||||
if (ch->state == MISDN_CONNECTED ) {
|
if (ch->state == MISDN_CONNECTED ) {
|
||||||
misdn_transfer_bc(ch, holded_ch) ;
|
misdn_transfer_bc(ch, holded_ch) ;
|
||||||
|
hangup_chan(ch);
|
||||||
|
// release_chan(bc);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
hangup_chan(ch);
|
|
||||||
release_chan(bc);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_bc_tones(ch);
|
stop_bc_tones(ch);
|
||||||
|
@@ -991,12 +991,6 @@ int setup_bc(struct misdn_bchannel *bc)
|
|||||||
|
|
||||||
} else if ( bc->hdlc ) {
|
} else if ( bc->hdlc ) {
|
||||||
cb_log(2, stack->port," --> HDLC Mode\n");
|
cb_log(2, stack->port," --> HDLC Mode\n");
|
||||||
#ifdef ACK_HDLC
|
|
||||||
bc->ack_hdlc=(sem_t*)malloc(sizeof(sem_t));
|
|
||||||
if ( sem_init((sem_t*)bc->ack_hdlc, 1, 0)<0 )
|
|
||||||
sem_init((sem_t*)bc->ack_hdlc, 0, 0);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pid.protocol[1] = ISDN_PID_L1_B_64HDLC ;
|
pid.protocol[1] = ISDN_PID_L1_B_64HDLC ;
|
||||||
pid.protocol[2] = ISDN_PID_L2_B_TRANS ;
|
pid.protocol[2] = ISDN_PID_L2_B_TRANS ;
|
||||||
pid.protocol[3] = ISDN_PID_L3_B_USER;
|
pid.protocol[3] = ISDN_PID_L3_B_USER;
|
||||||
@@ -2475,7 +2469,6 @@ int handle_bchan(msg_t *msg)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
free_msg(msg);
|
free_msg(msg);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
case DL_DATA|RESPONSE:
|
case DL_DATA|RESPONSE:
|
||||||
#if MISDN_DEBUG
|
#if MISDN_DEBUG
|
||||||
@@ -3231,7 +3224,6 @@ int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event )
|
|||||||
/*holded_bc->upset=0;
|
/*holded_bc->upset=0;
|
||||||
holded_bc->active=0;*/
|
holded_bc->active=0;*/
|
||||||
bc_state_change(holded_bc,BCHAN_CLEANED);
|
bc_state_change(holded_bc,BCHAN_CLEANED);
|
||||||
|
|
||||||
cb_event( EVENT_NEW_BC, bc, holded_bc);
|
cb_event( EVENT_NEW_BC, bc, holded_bc);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -3940,13 +3932,6 @@ int misdn_lib_tx2misdn_frm(struct misdn_bchannel *bc, void *data, int len)
|
|||||||
|
|
||||||
cb_log(9, stack->port, "Writing %d bytes 2 mISDN\n",len);
|
cb_log(9, stack->port, "Writing %d bytes 2 mISDN\n",len);
|
||||||
r=mISDN_write(stack->midev, buf, frm->len + mISDN_HEADER_LEN, TIMEOUT_INFINIT);
|
r=mISDN_write(stack->midev, buf, frm->len + mISDN_HEADER_LEN, TIMEOUT_INFINIT);
|
||||||
#ifdef ACK_HDLC
|
|
||||||
if (bc->hdlc && bc->ack_hdlc) {
|
|
||||||
cb_log(4,stack->port,"Awaiting Acknowledge [%d]\n",len);
|
|
||||||
sem_wait((sem_t*)bc->ack_hdlc);
|
|
||||||
cb_log(4,stack->port,"Acknowledged\n");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -58,7 +58,7 @@ enum tone_e {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define MAX_BCHANS 30
|
#define MAX_BCHANS 31
|
||||||
|
|
||||||
enum bchannel_state {
|
enum bchannel_state {
|
||||||
BCHAN_CLEANED=0,
|
BCHAN_CLEANED=0,
|
||||||
@@ -211,8 +211,6 @@ struct misdn_bchannel {
|
|||||||
/* int b_addr; */
|
/* int b_addr; */
|
||||||
int layer_id;
|
int layer_id;
|
||||||
|
|
||||||
void *ack_hdlc;
|
|
||||||
|
|
||||||
int layer;
|
int layer;
|
||||||
|
|
||||||
/*state stuff*/
|
/*state stuff*/
|
||||||
|
Reference in New Issue
Block a user