Merge branch 'master' of git.sangoma.com:smg_freeswitch

This commit is contained in:
Arnaldo Pereira 2010-11-06 12:50:22 -02:00
commit 21418b083d
2 changed files with 35 additions and 9 deletions

View File

@ -335,7 +335,26 @@ void ft_to_sngss7_acm (ftdm_channel_t * ftdmchan)
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;

View File

@ -132,7 +132,8 @@ uint8_t copy_cgPtyNum_to_sngss7(ftdm_caller_data_t *ftdm, SiCgPtyNum *cgPtyNum)
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];
@ -141,14 +142,15 @@ uint8_t copy_cgPtyNum_to_sngss7(ftdm_caller_data_t *ftdm, SiCgPtyNum *cgPtyNum)
/* 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))) */
@ -156,7 +158,7 @@ uint8_t copy_cgPtyNum_to_sngss7(ftdm_caller_data_t *ftdm, SiCgPtyNum *cgPtyNum)
/* 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;
@ -243,7 +245,8 @@ uint8_t copy_cdPtyNum_to_sngss7(ftdm_caller_data_t *ftdm, SiCdPtyNum *cdPtyNum)
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];
@ -252,14 +255,15 @@ uint8_t copy_cdPtyNum_to_sngss7(ftdm_caller_data_t *ftdm, SiCdPtyNum *cdPtyNum)
/* 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))) */
@ -267,7 +271,7 @@ uint8_t copy_cdPtyNum_to_sngss7(ftdm_caller_data_t *ftdm, SiCdPtyNum *cdPtyNum)
/* 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;
@ -984,6 +988,7 @@ ftdm_status_t encode_subAddrIE_nsap(const char *subAddr, char *subAddrIE, int ty
/* 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++;
@ -1068,6 +1073,7 @@ ftdm_status_t encode_subAddrIE_nat(const char *subAddr, char *subAddrIE, int typ
/* 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];
@ -1084,6 +1090,7 @@ ftdm_status_t encode_subAddrIE_nat(const char *subAddr, char *subAddrIE, int typ
/* 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))) */