freetdm: ss7 - fixed bug in dnis if ST character present

This commit is contained in:
Konrad Hammel 2010-09-16 16:50:36 -04:00
parent 401b23549e
commit a045519f6b
2 changed files with 10 additions and 5 deletions

View File

@ -483,14 +483,17 @@ static void ftdm_sangoma_ss7_process_state_change (ftdm_channel_t * ftdmchan)
i++;
}
/* check if the end of pulsing character has arrived or the right number of digits */
if (ftdmchan->caller_data.dnis.digits[i] == 0xF) {
/* check if the end of pulsing (ST) character has arrived or the right number of digits */
if (ftdmchan->caller_data.dnis.digits[i-1] == 'F') {
SS7_DEBUG_CHAN(ftdmchan, "Received the end of pulsing character %s\n", "");
/* remove the ST */
ftdmchan->caller_data.dnis.digits[i-1] = '\0';
/*now go to the RING state */
ftdm_set_state_locked (ftdmchan, FTDM_CHANNEL_STATE_RING);
} else if (i >= g_ftdm_sngss7_data.min_digits) {
} else if (i > g_ftdm_sngss7_data.min_digits) {
SS7_DEBUG_CHAN(ftdmchan, "Received %d digits (min digits = %d)\n", i, g_ftdm_sngss7_data.min_digits);
/*now go to the RING state */

View File

@ -306,9 +306,9 @@ uint8_t copy_tknStr_from_sngss7(TknStr str, char *ftdm, TknU8 oddEven)
j = 0;
for (i = 0; i < str.len; i++) {
sprintf(&ftdm[j], "%d", (str.val[i] & 0x0F));
sprintf(&ftdm[j], "%X", (str.val[i] & 0x0F));
j++;
sprintf(&ftdm[j], "%d", ((str.val[i] & 0xF0) >> 4));
sprintf(&ftdm[j], "%X", ((str.val[i] & 0xF0) >> 4));
j++;
}
@ -318,6 +318,8 @@ uint8_t copy_tknStr_from_sngss7(TknStr str, char *ftdm, TknU8 oddEven)
} else {
ftdm[j] = '\0';
}
} else {
SS7_ERROR("Asked to copy tknStr that is not present!\n");
return 1;