- fix missing CONF messages when no interface is found
This commit is contained in:
parent
160587cf06
commit
6c431378fc
33
chan_capi.c
33
chan_capi.c
|
@ -2661,15 +2661,17 @@ static void capi_handle_data_b3_indication(_cmsg *CMSG, unsigned int PLCI, unsig
|
|||
{
|
||||
_cmsg CMSG2;
|
||||
struct ast_frame fr;
|
||||
unsigned char *b3buf;
|
||||
unsigned char *b3buf = NULL;
|
||||
int b3len = 0;
|
||||
int j;
|
||||
int rxavg = 0;
|
||||
int txavg = 0;
|
||||
|
||||
b3len = DATA_B3_IND_DATALENGTH(CMSG);
|
||||
b3buf = &(i->rec_buffer[AST_FRIENDLY_OFFSET]);
|
||||
memcpy(b3buf, (char *)DATA_B3_IND_DATA(CMSG), b3len);
|
||||
if (i != NULL) {
|
||||
b3len = DATA_B3_IND_DATALENGTH(CMSG);
|
||||
b3buf = &(i->rec_buffer[AST_FRIENDLY_OFFSET]);
|
||||
memcpy(b3buf, (char *)DATA_B3_IND_DATA(CMSG), b3len);
|
||||
}
|
||||
|
||||
/* send a DATA_B3_RESP very quickly to free the buffer in capi */
|
||||
DATA_B3_RESP_HEADER(&CMSG2, capi_ApplID, HEADER_MSGNUM(CMSG), 0);
|
||||
|
@ -2771,10 +2773,7 @@ static void capi_handle_connect_active_indication(_cmsg *CMSG, unsigned int PLCI
|
|||
|
||||
CONNECT_ACTIVE_RESP_HEADER(&CMSG2, capi_ApplID, HEADER_MSGNUM(CMSG), 0);
|
||||
CONNECT_ACTIVE_RESP_PLCI(&CMSG2) = PLCI;
|
||||
|
||||
if (_capi_put_cmsg(&CMSG2) != 0) {
|
||||
return;
|
||||
}
|
||||
_capi_put_cmsg(&CMSG2);
|
||||
|
||||
return_on_no_interface("CONNECT_ACTIVE_IND");
|
||||
|
||||
|
@ -2823,11 +2822,8 @@ static void capi_handle_connect_b3_active_indication(_cmsg *CMSG, unsigned int P
|
|||
/* then send a CONNECT_B3_ACTIVE_RESP */
|
||||
CONNECT_B3_ACTIVE_RESP_HEADER(&CMSG2, capi_ApplID, HEADER_MSGNUM(CMSG), 0);
|
||||
CONNECT_B3_ACTIVE_RESP_NCCI(&CMSG2) = NCCI;
|
||||
_capi_put_cmsg(&CMSG2);
|
||||
|
||||
if (_capi_put_cmsg(&CMSG2) != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
return_on_no_interface("CONNECT_ACTIVE_B3_IND");
|
||||
|
||||
cc_mutex_lock(&contrlock);
|
||||
|
@ -2875,7 +2871,6 @@ static void capi_handle_disconnect_b3_indication(_cmsg *CMSG, unsigned int PLCI,
|
|||
|
||||
DISCONNECT_B3_RESP_HEADER(&CMSG2, capi_ApplID, HEADER_MSGNUM(CMSG), 0);
|
||||
DISCONNECT_B3_RESP_NCCI(&CMSG2) = NCCI;
|
||||
|
||||
_capi_put_cmsg(&CMSG2);
|
||||
|
||||
return_on_no_interface("DISCONNECT_B3_IND");
|
||||
|
@ -2912,10 +2907,12 @@ static void capi_handle_connect_b3_indication(_cmsg *CMSG, unsigned int PLCI, un
|
|||
CONNECT_B3_RESP_HEADER(&CMSG2, capi_ApplID, HEADER_MSGNUM(CMSG), 0);
|
||||
CONNECT_B3_RESP_NCCI(&CMSG2) = NCCI;
|
||||
CONNECT_B3_RESP_REJECT(&CMSG2) = 0;
|
||||
_capi_put_cmsg(&CMSG2);
|
||||
|
||||
return_on_no_interface("CONNECT_B3_IND");
|
||||
|
||||
i->NCCI = NCCI;
|
||||
|
||||
_capi_put_cmsg(&CMSG2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3389,35 +3386,27 @@ static void capi_handle_msg(_cmsg *CMSG)
|
|||
capi_handle_connect_indication(CMSG, PLCI, NCCI, &i);
|
||||
break;
|
||||
case CAPI_P_IND(DATA_B3):
|
||||
if(i == NULL) break;
|
||||
capi_handle_data_b3_indication(CMSG, PLCI, NCCI, i);
|
||||
break;
|
||||
case CAPI_P_IND(CONNECT_B3):
|
||||
if(i == NULL) break;
|
||||
capi_handle_connect_b3_indication(CMSG, PLCI, NCCI, i);
|
||||
break;
|
||||
case CAPI_P_IND(CONNECT_B3_ACTIVE):
|
||||
if(i == NULL) break;
|
||||
capi_handle_connect_b3_active_indication(CMSG, PLCI, NCCI, i);
|
||||
break;
|
||||
case CAPI_P_IND(DISCONNECT_B3):
|
||||
if(i == NULL) break;
|
||||
capi_handle_disconnect_b3_indication(CMSG, PLCI, NCCI, i);
|
||||
break;
|
||||
case CAPI_P_IND(DISCONNECT):
|
||||
if(i == NULL) break;
|
||||
capi_handle_disconnect_indication(CMSG, PLCI, NCCI, i);
|
||||
break;
|
||||
case CAPI_P_IND(FACILITY):
|
||||
if(i == NULL) break;
|
||||
capi_handle_facility_indication(CMSG, PLCI, NCCI, i);
|
||||
break;
|
||||
case CAPI_P_IND(INFO):
|
||||
if(i == NULL) break;
|
||||
capi_handle_info_indication(CMSG, PLCI, NCCI, i);
|
||||
break;
|
||||
case CAPI_P_IND(CONNECT_ACTIVE):
|
||||
if(i == NULL) break;
|
||||
capi_handle_connect_active_indication(CMSG, PLCI, NCCI, i);
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue