diff options
author | crichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-07 09:22:44 +0000 |
---|---|---|
committer | crichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-07 09:22:44 +0000 |
commit | 3fab98fbb13e43c32666a28bcfa9f693c16b56e0 (patch) | |
tree | 895ea4c1648ca27929e465c98ca39bf3b45bf70e /channels/misdn | |
parent | 3f5a760c2096890abce0d6c1ebde7a4259157fda (diff) |
Merged revisions 52843 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r52843 | crichter | 2007-01-30 15:38:08 +0100 (Di, 30 Jan 2007) | 1 line
fixed some possible segfaults. also fixed an very important bug which occurs on high load (when calls are very fast generated)
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@53324 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/misdn')
-rw-r--r-- | channels/misdn/isdn_lib.c | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/channels/misdn/isdn_lib.c b/channels/misdn/isdn_lib.c index 0735f6cce..f745e8bcb 100644 --- a/channels/misdn/isdn_lib.c +++ b/channels/misdn/isdn_lib.c @@ -2864,23 +2864,12 @@ static msg_t *fetch_msg(int midev) { msg_t *msg=alloc_msg(MAX_MSG_SIZE); int r; -/* fd_set rdfs; */ if (!msg) { cb_log(0, 0, "fetch_msg: alloc msg failed !!"); return NULL; } -#if 0 - FD_ZERO(&rdfs); - FD_SET(midev,&rdfs); - - mISDN_select(FD_SETSIZE, &rdfs, NULL, NULL, NULL); - //select(FD_SETSIZE, &rdfs, NULL, NULL, NULL); - - if (FD_ISSET(midev, &rdfs)) { -#endif - AGAIN: r=mISDN_read(midev,msg->data,MAX_MSG_SIZE, TIMEOUT_10SEC); msg->len=r; @@ -2902,15 +2891,11 @@ static msg_t *fetch_msg(int midev) cb_log(0,0,"mISDN_read returned :%d error:%s (%d)\n",r,strerror(errno),errno); } - return msg; - #if 0 - } else { - printf ("Select timeout\n"); - } + if (!(frm->prim == (DL_DATA|INDICATION) )|| (frm->prim == (PH_DATA|INDICATION))) + cb_log(0,0,"prim: %x dinfo:%x addr:%x msglen:%d frm->len:%d\n",frm->prim, frm->dinfo, frm->addr, msg->len,frm->len ); #endif - - return NULL; + return msg; } void misdn_lib_isdn_l1watcher(int port) @@ -3954,8 +3939,6 @@ char *manager_isdn_get_info(enum event_e event) void manager_bchannel_activate(struct misdn_bchannel *bc) { char buf[128]; - iframe_t *ifrm; - int ret; struct misdn_stack *stack=get_stack_by_bc(bc); @@ -3971,19 +3954,7 @@ void manager_bchannel_activate(struct misdn_bchannel *bc) mISDN_write_frame(stack->midev, buf, bc->addr | FLG_MSG_DOWN, DL_ESTABLISH | REQUEST, 0,0, NULL, TIMEOUT_1SEC); - ret=mISDN_read(stack->midev,buf,128,TIMEOUT_10SEC); - - ifrm=(iframe_t*)buf; - - if (ret>0) { - if (ifrm->prim== (DL_ESTABLISH|CONFIRM)) { - cb_log(2,stack->port,"bchan: DL_ESTABLISH|CNF\n"); - } - } - - return ; - } @@ -4017,8 +3988,6 @@ void manager_bchannel_deactivate(struct misdn_bchannel * bc) char buf[128]; mISDN_write_frame(stack->midev, buf, bc->addr | FLG_MSG_DOWN, DL_RELEASE|REQUEST,0,0,NULL, TIMEOUT_1SEC); - mISDN_read(stack->midev, buf, 128, TIMEOUT_1SEC); - clear_ibuffer(bc->astbuf); bc_state_change(bc,BCHAN_RELEASE); |