FDN号码完全匹配
时间:10-02
整理:3721RD
点击:
[DESCRIPTION]
根据GSM对于FDN的规定,FDN 是 prefix 匹配的,即只要所拨打的号码前缀能够匹配上 FDN 中的号码,则该号码就能够拨打出。例如:假设 FDN 列表中存在号码”1234”,则拨打”123456”等前缀为”1234”的号码时能够成功。
有的运营商会要求全号码匹配,即在上面的例子中只能拨打”1234”,可以参照下面的方法修改匹配规则。
[SOLUTION]
若要实现全号码匹配,需要修改Modem srouce code:
修改文件phb_handler_approve.c,在phb_compare_tel_number_prefix()函数中添加如下code:
static kal_bool phb_compare_tel_number_prefix(l4_addr_bcd_struct *given, l4_addr_bcd_struct *candidate)
{
kal_uint16 len;
//add for whole FDN matching start
kal_uint16 len2;
//add end
.........
len = bcd_len(
&candidate->addr_bcd[L4_ADDR_BCD_TEL_NUM_OFFSET],
(kal_uint16) (candidate->addr_length - L4_ADDR_BCD_TON_NPI_SIZE));
//add for whole FDN matching start
len2 = bcd_len(
&given->addr_bcd[L4_ADDR_BCD_TEL_NUM_OFFSET],
(kal_uint16) (given->addr_length - L4_ADDR_BCD_TON_NPI_SIZE));
len = (len < len2)?len2:len;
//add end
...........
}
根据GSM对于FDN的规定,FDN 是 prefix 匹配的,即只要所拨打的号码前缀能够匹配上 FDN 中的号码,则该号码就能够拨打出。例如:假设 FDN 列表中存在号码”1234”,则拨打”123456”等前缀为”1234”的号码时能够成功。
有的运营商会要求全号码匹配,即在上面的例子中只能拨打”1234”,可以参照下面的方法修改匹配规则。
[SOLUTION]
若要实现全号码匹配,需要修改Modem srouce code:
修改文件phb_handler_approve.c,在phb_compare_tel_number_prefix()函数中添加如下code:
static kal_bool phb_compare_tel_number_prefix(l4_addr_bcd_struct *given, l4_addr_bcd_struct *candidate)
{
kal_uint16 len;
//add for whole FDN matching start
kal_uint16 len2;
//add end
.........
len = bcd_len(
&candidate->addr_bcd[L4_ADDR_BCD_TEL_NUM_OFFSET],
(kal_uint16) (candidate->addr_length - L4_ADDR_BCD_TON_NPI_SIZE));
//add for whole FDN matching start
len2 = bcd_len(
&given->addr_bcd[L4_ADDR_BCD_TEL_NUM_OFFSET],
(kal_uint16) (given->addr_length - L4_ADDR_BCD_TON_NPI_SIZE));
len = (len < len2)?len2:len;
//add end
...........
}
:):):):)
学习学习