acm.bckCallInd.isdnAccInd.pres = PRSNT_NODEF;
acm.bckCallInd.isdnAccInd.val = ISDNACC_NONISDN;
acm.bckCallInd.echoCtrlDevInd.pres = PRSNT_NODEF;
- acm.bckCallInd.echoCtrlDevInd.val = 0x1; /* ec device present */
+ switch (ftdmchan->caller_data.bearer_capability) {
+ /**********************************************************************/
+ case (FTDM_BEARER_CAP_SPEECH):
+ acm.bckCallInd.echoCtrlDevInd.val = 0x1;
+ break;
+ /**********************************************************************/
+ case (FTDM_BEARER_CAP_64K_UNRESTRICTED):
+ acm.bckCallInd.echoCtrlDevInd.val = 0x0;
+ break;
+ /**********************************************************************/
+ case (FTDM_BEARER_CAP_3_1KHZ_AUDIO):
+ acm.bckCallInd.echoCtrlDevInd.val = 0x1;
+ break;
+ /**********************************************************************/
+ default:
+ SS7_ERROR_CHAN(ftdmchan, "Unknown Bearer capability falling back to speech%s\n", " ");
+ acm.bckCallInd.echoCtrlDevInd.val = 0x1;
+ break;
+ /**********************************************************************/
+ } /* switch (ftdmchan->caller_data.bearer_capability) */
acm.bckCallInd.sccpMethInd.pres = PRSNT_NODEF;
acm.bckCallInd.sccpMethInd.val = SCCPMTH_NOIND;
tmp[0] = ftdm->cid_num.digits[k];
/* check if the digit is a number and that is not null */
- while (!(isdigit(tmp[0])) && (tmp[0] != '\0')) {
+ while (!(isxdigit(tmp[0])) && (tmp[0] != '\0')) {
+ SS7_INFO("Dropping invalid digit: %c\n", tmp[0]);
/* move on to the next value */
k++;
tmp[0] = ftdm->cid_num.digits[k];
/* check if tmp is null or a digit */
if (tmp[0] != '\0') {
/* push it into the lower nibble */
- lower = atoi(&tmp[0]);
+ lower = strtol(&tmp[0], (char **)NULL, 16);
/* move to the next digit */
k++;
/* grab a digit from the ftdm digits */
tmp[0] = ftdm->cid_num.digits[k];
/* check if the digit is a number and that is not null */
- while (!(isdigit(tmp[0])) && (tmp[0] != '\0')) {
+ while (!(isxdigit(tmp[0])) && (tmp[0] != '\0')) {
+ SS7_INFO("Dropping invalid digit: %c\n", tmp[0]);
k++;
tmp[0] = ftdm->cid_num.digits[k];
} /* while(!(isdigit(tmp))) */
/* check if tmp is null or a digit */
if (tmp[0] != '\0') {
/* push the digit into the upper nibble */
- upper = (atoi(&tmp[0])) << 4;
+ upper = (strtol(&tmp[0], (char **)NULL, 16)) << 4;
} else {
/* there is no upper ... fill in 0 */
upper = 0x0;
tmp[0] = ftdm->dnis.digits[k];
/* check if the digit is a number and that is not null */
- while (!(isdigit(tmp[0])) && (tmp[0] != '\0')) {
+ while (!(isxdigit(tmp[0])) && (tmp[0] != '\0')) {
+ SS7_INFO("Dropping invalid digit: %c\n", tmp[0]);
/* move on to the next value */
k++;
tmp[0] = ftdm->dnis.digits[k];
/* check if tmp is null or a digit */
if (tmp[0] != '\0') {
/* push it into the lower nibble */
- lower = atoi(&tmp[0]);
+ lower = strtol(&tmp[0], (char **)NULL, 16);
/* move to the next digit */
k++;
/* grab a digit from the ftdm digits */
tmp[0] = ftdm->dnis.digits[k];
/* check if the digit is a number and that is not null */
- while (!(isdigit(tmp[0])) && (tmp[0] != '\0')) {
+ while (!(isxdigit(tmp[0])) && (tmp[0] != '\0')) {
+ SS7_INFO("Dropping invalid digit: %c\n", tmp[0]);
k++;
tmp[0] = ftdm->dnis.digits[k];
} /* while(!(isdigit(tmp))) */
/* check if tmp is null or a digit */
if (tmp[0] != '\0') {
/* push the digit into the upper nibble */
- upper = (atoi(&tmp[0])) << 4;
+ upper = (strtol(&tmp[0], (char **)NULL, 16)) << 4;
} else {
/* there is no upper ... fill in ST */
upper = 0xF0;
/* confirm it is a digit */
if (!isdigit(tmp[0])) {
+ SS7_INFO("Dropping invalid digit: %c\n", tmp[0]);
/* move to the next character in subAddr */
x++;
/* confirm it is a hex digit */
while ((!isxdigit(tmp[0])) && (tmp[0] != '\0')) {
+ SS7_INFO("Dropping invalid digit: %c\n", tmp[0]);
/* move to the next character in subAddr */
x++;
tmp[0] = subAddr[x];
/* check if the digit is a hex digit and that is not null */
while (!(isxdigit(tmp[0])) && (tmp[0] != '\0')) {
+ SS7_INFO("Dropping invalid digit: %c\n", tmp[0]);
x++;
tmp[0] = subAddr[x];
} /* while(!(isdigit(tmp))) */