- code cleanup
 - major bugfix on called name and connected name (caused an crash)
This commit is contained in:
MelwareDE 2007-08-09 07:53:12 +00:00
parent 8ec9a8f46a
commit 3875d666f1
2 changed files with 16 additions and 12 deletions

View File

@ -819,11 +819,9 @@ static int pbx_capi_alert(struct ast_channel *c)
i->vname, i->state);
return -1;
}
if (i->qsigfeat) {
facilityarray = alloca(CAPI_MAX_FACILITYDATAARRAY_SIZE);
cc_qsig_add_call_alert_data(facilityarray, i, c);
}
facilityarray = alloca(CAPI_MAX_FACILITYDATAARRAY_SIZE);
cc_qsig_add_call_alert_data(facilityarray, i, c);
if (capi_sendf(NULL, 0, CAPI_ALERT_REQ, i->PLCI, get_capi_MessageNumber(),
"(()()()s())", facilityarray) != 0) {
@ -1377,10 +1375,8 @@ static int capi_send_answer(struct ast_channel *c, _cstruct b3conf)
cc_verbose(3, 0, VERBOSE_PREFIX_2 "%s: Answering for %s\n",
i->vname, dnid);
if (i->qsigfeat) {
facilityarray = alloca(CAPI_MAX_FACILITYDATAARRAY_SIZE);
cc_qsig_add_call_answer_data(facilityarray, i, c);
}
facilityarray = alloca(CAPI_MAX_FACILITYDATAARRAY_SIZE);
cc_qsig_add_call_answer_data(facilityarray, i, c);
if (capi_sendf(NULL, 0, CAPI_CONNECT_RESP, i->PLCI, i->MessageNumber,
"w(wwwssss)s()()(()()()s())",

View File

@ -961,10 +961,14 @@ unsigned int cc_qsig_add_call_answer_data(unsigned char *data, struct capi_pvt *
int protocolvar = 0;
const char *connectedname;
data[0] = 0;
if (!i->qsigfeat)
return 0;
connectedname = pbx_builtin_getvar_helper(c, "CONNECTEDNAME");
if (!(connectedname = pbx_builtin_getvar_helper(c, "CONNECTEDNAME")))
return 0;
if (!strlen(connectedname))
return 0;
@ -989,7 +993,7 @@ unsigned int cc_qsig_add_call_answer_data(unsigned char *data, struct capi_pvt *
}
/*
* Handles outgoing Facilies on Call Answer
* Handles outgoing Facilies on Call Alert
*/
unsigned int cc_qsig_add_call_alert_data(unsigned char *data, struct capi_pvt *i, struct ast_channel *c)
{
@ -999,10 +1003,14 @@ unsigned int cc_qsig_add_call_alert_data(unsigned char *data, struct capi_pvt *i
int protocolvar = 0;
const char *connectedname;
data[0] = 0;
if (!i->qsigfeat)
return 0;
connectedname = pbx_builtin_getvar_helper(c, "CALLEDNAME");
if (!(connectedname = pbx_builtin_getvar_helper(c, "CALLEDNAME")))
return 0;
if (!strlen(connectedname))
return 0;