aboutsummaryrefslogtreecommitdiffstats
path: root/channels/misdn/isdn_lib.c
diff options
context:
space:
mode:
authorcrichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-11 10:29:18 +0000
committercrichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-11 10:29:18 +0000
commit4469af7edc9b542412c75d1f7b38653d992685f3 (patch)
tree7b84c14e8fa41addcd6a0e519c585a902bac7baf /channels/misdn/isdn_lib.c
parent0f0446f2dd6e944f71c8ba725e00e2354e16191b (diff)
Merged revisions 68631 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r68631 | crichter | 2007-06-11 11:18:01 +0200 (Mo, 11 Jun 2007) | 1 line fixed problem that the dummybc chanels had no lock, checking for the lock now. Also fixed the channel restart stuff, we can now specify and restart particular channels too. ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@68644 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/misdn/isdn_lib.c')
-rw-r--r--channels/misdn/isdn_lib.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/channels/misdn/isdn_lib.c b/channels/misdn/isdn_lib.c
index c1fc2332f..d9632a003 100644
--- a/channels/misdn/isdn_lib.c
+++ b/channels/misdn/isdn_lib.c
@@ -1135,9 +1135,6 @@ int init_bc(struct misdn_stack *stack, struct misdn_bchannel *bc, int midev, in
}
-
-
-
{
stack_info_t *stinf;
ret = mISDN_get_stack_info(midev, stack->port, buff, sizeof(buff));
@@ -3208,13 +3205,15 @@ void misdn_send_unlock(struct misdn_bchannel *bc);
void misdn_send_lock(struct misdn_bchannel *bc)
{
//cb_log(0,bc->port,"Locking bc->pid:%d\n", bc->pid);
- pthread_mutex_lock(&bc->send_lock->lock);
+ if (bc->send_lock)
+ pthread_mutex_lock(&bc->send_lock->lock);
}
void misdn_send_unlock(struct misdn_bchannel *bc)
{
//cb_log(0,bc->port,"UnLocking bc->pid:%d\n", bc->pid);
- pthread_mutex_unlock(&bc->send_lock->lock);
+ if (bc->send_lock)
+ pthread_mutex_unlock(&bc->send_lock->lock);
}
int misdn_lib_send_event(struct misdn_bchannel *bc, enum event_e event )
@@ -3654,7 +3653,7 @@ int misdn_lib_pid_restart(int pid)
}
/*Sends Restart message for every bchnanel*/
-int misdn_lib_send_restart(int port)
+int misdn_lib_send_restart(int port, int channel)
{
struct misdn_stack *stack=find_stack_by_port(port);
cb_log(0, port, "Sending Restarts on this port.\n");
@@ -3665,9 +3664,17 @@ int misdn_lib_send_restart(int port)
dummybc.l3_id=MISDN_ID_GLOBAL;
dummybc.nt=stack->nt;
+ /*default is all channels*/
int max=stack->pri?30:2;
- int i;
- for (i=1;i<=max;i++) {
+ int i=1;
+
+ /*if a channel is specified we restart only this one*/
+ if (channel > 0) {
+ i=channel;
+ max=channel;
+ }
+
+ for (;i<=max;i++) {
dummybc.channel=i;
cb_log(0, port, "Restarting channel %d\n",i);
misdn_lib_send_event(&dummybc, EVENT_RESTART);