Use common find_interface_by_plci() function, no duplicates.
This commit is contained in:
parent
e9d1bbe5c5
commit
92f26bd38b
40
chan_capi.c
40
chan_capi.c
|
@ -2302,46 +2302,6 @@ static void capi_handle_dtmf_fax(struct capi_pvt *i)
|
|||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* find the interface (pvt) the PLCI belongs to
|
||||
*/
|
||||
static struct capi_pvt *find_interface_by_plci(unsigned int plci)
|
||||
{
|
||||
struct capi_pvt *i;
|
||||
|
||||
if (plci == 0)
|
||||
return NULL;
|
||||
|
||||
cc_mutex_lock(&iflock);
|
||||
for (i = iflist; i; i = i->next) {
|
||||
if (i->PLCI == plci)
|
||||
break;
|
||||
}
|
||||
cc_mutex_unlock(&iflock);
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
/*
|
||||
* find the interface (pvt) the messagenumber belongs to
|
||||
*/
|
||||
static struct capi_pvt *find_interface_by_msgnum(unsigned short msgnum)
|
||||
{
|
||||
struct capi_pvt *i;
|
||||
|
||||
if (msgnum == 0x0000)
|
||||
return NULL;
|
||||
|
||||
cc_mutex_lock(&iflock);
|
||||
for (i = iflist; i; i = i->next) {
|
||||
if ((i->PLCI == 0) && (i->MessageNumber == msgnum))
|
||||
break;
|
||||
}
|
||||
cc_mutex_unlock(&iflock);
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
/*
|
||||
* see if did matches
|
||||
*/
|
||||
|
|
|
@ -957,25 +957,6 @@ void interface_cleanup_qsig(struct capi_pvt *i)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* find the interface (pvt) the PLCI belongs to
|
||||
*/
|
||||
static struct capi_pvt *find_interface_by_plci(unsigned int plci)
|
||||
{
|
||||
struct capi_pvt *i;
|
||||
|
||||
if (plci == 0)
|
||||
return NULL;
|
||||
|
||||
for (i = iflist; i; i = i->next) {
|
||||
if (i->PLCI == plci)
|
||||
break;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* CAPI INFO_IND (QSIG part)
|
||||
*/
|
||||
|
|
|
@ -76,7 +76,43 @@ _cword get_capi_MessageNumber(void)
|
|||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* find the interface (pvt) the PLCI belongs to
|
||||
*/
|
||||
struct capi_pvt *find_interface_by_plci(unsigned int plci)
|
||||
{
|
||||
struct capi_pvt *i;
|
||||
|
||||
if (plci == 0)
|
||||
return NULL;
|
||||
|
||||
for (i = iflist; i; i = i->next) {
|
||||
if (i->PLCI == plci)
|
||||
break;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
/*
|
||||
* find the interface (pvt) the messagenumber belongs to
|
||||
*/
|
||||
struct capi_pvt *find_interface_by_msgnum(unsigned short msgnum)
|
||||
{
|
||||
struct capi_pvt *i;
|
||||
|
||||
if (msgnum == 0x0000)
|
||||
return NULL;
|
||||
|
||||
for (i = iflist; i; i = i->next) {
|
||||
if ((i->PLCI == 0) && (i->MessageNumber == msgnum))
|
||||
break;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
/*
|
||||
* log verbose a capi message
|
||||
*/
|
||||
static void log_capi_message(MESSAGE_EXCHANGE_ERROR err, _cmsg *CMSG)
|
||||
{
|
||||
|
|
|
@ -22,6 +22,8 @@ extern char *emptyid;
|
|||
|
||||
extern void cc_verbose(int o_v, int c_d, char *text, ...);
|
||||
extern _cword get_capi_MessageNumber(void);
|
||||
extern struct capi_pvt *find_interface_by_msgnum(unsigned short msgnum);
|
||||
extern struct capi_pvt *find_interface_by_plci(unsigned int plci);
|
||||
extern MESSAGE_EXCHANGE_ERROR _capi_put_cmsg(_cmsg *CMSG);
|
||||
extern MESSAGE_EXCHANGE_ERROR capidev_check_wait_get_cmsg(_cmsg *CMSG);
|
||||
extern char *capi_info_string(unsigned int info);
|
||||
|
|
Loading…
Reference in New Issue