@ -1122,9 +1122,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 ) ) ;
@ -3189,13 +3186,15 @@ void misdn_lib_log_ies(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 )
@ -3634,7 +3633,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 " ) ;
@ -3645,9 +3644,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 ) ;