summaryrefslogtreecommitdiff
path: root/channels/misdn/isdn_lib.c
diff options
context:
space:
mode:
authorChristian Richter <christian.richter@beronet.com>2007-07-02 09:34:19 +0000
committerChristian Richter <christian.richter@beronet.com>2007-07-02 09:34:19 +0000
commitb7b027d19b1f30c46997cabd8267db0f6eb9bf15 (patch)
tree00d2bf249086b3e055a5534e27a0163e1e8e4832 /channels/misdn/isdn_lib.c
parentefea29fde8577f7afd4652f519cf77fa3c959060 (diff)
Merged revisions 72852 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r72852 | crichter | 2007-07-02 10:41:08 +0200 (Mo, 02 Jul 2007) | 9 lines Merged revisions 72585 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r72585 | crichter | 2007-06-29 15:08:26 +0200 (Fr, 29 Jun 2007) | 1 line check if the bchannel stack id is already used, if so don't use it a second time. Also added a release_chan lock, so that the same chan_list object cannot be freed twice. chan_misdn does not crash anymore on heavy load with these changes. ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72869 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/misdn/isdn_lib.c')
-rw-r--r--channels/misdn/isdn_lib.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/channels/misdn/isdn_lib.c b/channels/misdn/isdn_lib.c
index bd428400f..981b6b2a8 100644
--- a/channels/misdn/isdn_lib.c
+++ b/channels/misdn/isdn_lib.c
@@ -966,7 +966,7 @@ int setup_bc(struct misdn_bchannel *bc)
int channel=bc->channel-1-(bc->channel>16);
int b_stid=stack->b_stids[channel>=0?channel:0];
-
+
switch (bc->bc_state) {
case BCHAN_CLEANED:
break;
@@ -977,6 +977,15 @@ int setup_bc(struct misdn_bchannel *bc)
cb_log(5, stack->port, "$$$ Setting up bc with stid :%x\n", b_stid);
+ /*check if the b_stid is alread initialized*/
+ int i;
+ for (i=0; i <= stack->b_num; i++) {
+ if (stack->bc[i].b_stid == b_stid) {
+ cb_log(0, bc->port, "setup_bc: b_stid:%x already in use !!!\n", b_stid);
+ return -1;
+ }
+ }
+
if (b_stid <= 0) {
cb_log(0, stack->port," -- Stid <=0 at the moment in channel:%d\n",channel);