[asterisk-ss7] F on the end of the number

Marcelo Pacheco marcelo at m2j.com.br
Sun Jul 29 16:18:48 CDT 2012


Those who looked up the code might have noticed my "Original code" 
didn't match libss7.
I changed digit handling code, so inside libss7 I always use 0...9 A...F 
digits. #->A and *->B translation happens early coming in, and on the 
way back A-># and B->*. The original #/* conversion scheme in libss7 
made it impossible to properly use # in libss7 (due to F being ST 
digit). The other change was to expressed the ST digit properly as 'F' 
instead of '#', since '#' is now converted to 'A' instead of 'F'.

I'm sending this as food for thought for MattF. Those who would like to 
pick up the code and use it in production should know exactly what 
they're doing. This is not meant as a patch for testing/production usage 
at all.

static char char2digit(char localchar)
{
         switch (localchar) {
                 case '0':
                         return 0;
                 case '1':
                         return 1;
                 case '2':
                         return 2;
                 case '3':
                         return 3;
                 case '4':
                         return 4;
                 case '5':
                         return 5;
                 case '6':
                         return 6;
                 case '7':
                         return 7;
                 case '8':
                         return 8;
                 case '9':
                         return 9;
                 case '#':
                 case 'A':
                         return 0xA;
                 case '*':
                 case 'B':
                         return 0xB;
                 case 'C':
                         return 0xC;
                 case 'D':
                         return 0xD;
                 case 'E':
                         return 0xE;
                 case 'F':
                         return 0xF;
                 default:
                         return 0;
         }
}

static char digit2char(unsigned char digit)
{
         switch (digit & 0xf) {
                 case 0:
                         return '0';
                 case 1:
                         return '1';
                 case 2:
                         return '2';
                 case 3:
                         return '3';
                 case 4:
                         return '4';
                 case 5:
                         return '5';
                 case 6:
                         return '6';
                 case 7:
                         return '7';
                 case 8:
                         return '8';
                 case 9:
                         return '9';
                 case 0xA:
                         return '#';
                 case 0xB:
                         return '*';
                 case 0xC:
                         return 'C';
                 case 0xD:
                         return 'D';
                 case 0xE:
                         return 'E';
                 case 0xF:
                         return 'F';
                 default:
                         return 0;
         }
}



On 07/26/12 13:53, Marcelo Pacheco wrote:
> Removing the F on sent numbers is very simple.
>
> Original code:
> void isup_set_called(struct isup_call *c, const char *called, unsigned 
> char called_nai, const struct ss7 *ss7)
> {
>         if (called && called[0]) {
>                 if (ss7->switchtype == SS7_ITU)
>                         snprintf(c->called_party_num, 
> sizeof(c->called_party_num), "%sF", called);
>                 else
>                         snprintf(c->called_party_num, 
> sizeof(c->called_party_num), "%s", called);
>                 c->called_nai = called_nai;
>         }
>
> }
>
> Modified code:
> void isup_set_called(struct isup_call *c, const char *called, unsigned 
> char called_nai, const struct ss7 *ss7)
> {
>         if (called && called[0]) {
>                 snprintf(c->called_party_num, 
> sizeof(c->called_party_num), "%s", called);
>                 c->called_nai = called_nai;
>         }
> }
>
> On chan_ss7 this is a configuration file option.
> On 07/26/12 13:25, Kaloyan Kovachev wrote:
>> On Thu, 26 Jul 2012 12:54:58 -0300, Gustavo Mársico
>> <gustavomarsico at gmail.com> wrote:
>>> I faced a similar issue recently and was related to the Screening
>>> Indicator. Was solved adding before Dial the following line:
>>>
>>> Set(CALLERPRES()=allowed) or Set(CALLERPRES()= prohib)
>>>
>>> In both cases the important was the 2 bits saying "network provided".
>>>
>>> Hope this helps.
>>>
>>>
>>> On Jul 26, 2012, at 12:29 PM, Marcus Vinicius wrote:
>>>
>>>> Hi Kaloyan,
>>>>
>>>> If I change ss7type=ansi the link doens't work:
>>>>
>>>> [Jul 26 11:05:43] ERROR[637]: chan_dahdi.c:13836 dahdi_ss7_error: [3]
>>>> Received message destined for point code 0x37c372 but we're 0x372.
>>>> Dropping
>>>>
>>>> The ERICSSON uses ITU standard as well. It uses ITU/ISUP BRAZIL.
>>>>
>>>> But the Ericsson doesn't understand the F on the number.
>> Not sure about the Brazil variant, but ITU-T Q.764 defines the en-block
>> dialing to end with ST.
>> 0xf is ST signal it means 'end of dialing' or 'number is complete', 
>> so it
>> should understand it and your problem is probably somewhere else.
>>
>> As Johann Steinwendtner have noted you receive the number without 
>> leading
>> 0, but you send it with 0 - this or as Gustavo suggested
>> Screening/Presentation may be the problem.
>>
>>>>> Can I disable this F ?
>>>>>
>>>>> Is it hardcode? Anyone knows how can I change this?
>>>>>
>> Yes, it is hardcoded for ITU switchtype - check isup.c 
>> isup_set_called().
>> You may try to modify the code, but i don't think that this is the 
>> problem.
>>
>>>>> Thank you so much!
>>>>>
>>>>>
>>>>> -- 
>>>>> Marcus Vinicius
>>>>
>>>> -- 
>>>> _____________________________________________________________________
>>>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>>>
>>>> asterisk-ss7 mailing list
>>>> To UNSUBSCRIBE or update options visit:
>>>>    http://lists.digium.com/mailman/listinfo/asterisk-ss7
>> -- 
>> _____________________________________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>>
>> asterisk-ss7 mailing list
>> To UNSUBSCRIBE or update options visit:
>>     http://lists.digium.com/mailman/listinfo/asterisk-ss7
>
>
>
> -- 
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-ss7 mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-ss7





More information about the asterisk-ss7 mailing list