hack megaco_text_parser.yrl

Carlos Rodríguez Alcalá Villagra <>
Wed Mar 10 10:14:59 CET 2004


Hi, Hakan

Thanks for the answer, but it didn't work...
We did what you told us to do. We agregated the line:

megacoMessage        -> optSep authenticationHeader message safeToken
endOfMessage
      : #'MegacoMessage'{authHeader = '$2', mess = '$3'} .


into the file megaco_text_parser.yrl (and compiled with erlc -W
megaco_text_parser.yrl and erl ;c(megaco_text_parser). and the we copied
that into ebin)

Then we tried this:

We've put in the same place a safeToken2
this way
megacoMessage        -> optSep authenticationHeader message safeToken2
endOfMessage
      : #'MegacoMessage'{authHeader = '$2', mess = '$3'} .

where safeToken2 is a non ternimal in this way:

safeToken2 -> 'SEP' : make_safe_token('$1') .%agregamos es por que el megaco
tracer no dice :  error,[{reason,{bad_token,[{'SEP',5,0}, [{'RBRKT',5}....
donde 'SEP' es que cosa???
safeToken2 -> 'SEP' : make_safe_token('$1') .%This line is because the
megaco tracer told that  :  error,[{reason,{bad_token,[{'SEP',5,0},
[{'RBRKT',5}, [{'RBRKT',5}.... whrere 'SEP' is ???
safeToken2 -> 'NULLT' : make_safe_token('$1') .

and, we've aggregated the line "-define(NULLT, [?NullToken])." to the
megaco_compact_text_encoder and megaco_pretty_text_encoder files.

after that, we also have aggregated the line "-define( NullToken, 16#00)."
to the megaco_text_encoder file.

but it don`t work neither.

How can we solve the problem?
We basically want to aggregate something like this:

megacoMessage        -> optSep authenticationHeader message safeToken2
endOfMessage
      : #'MegacoMessage'{authHeader = '$2', mess = '$3'} .

where safetoken2 captures the '\000' (the Byte that the MP102 sends
incorrectly) and ignores it.


Thanks again
















----- Original Message -----
From: "Hakan Mattsson" <>
To: "Carlos Rodríguez Alcalá Villagra" <>
Cc: <>
Sent: Monday, March 08, 2004 12:55 PM
Subject: Re: megaco_compact_text comparation


> Carlos> We are testing the erlang megaco application with a mp-102 analog
> Carlos> gateway, but the ServiceChange fails. Find attached a file that
> Carlos> contains images of both ServiceChanges: A valid one and one from
the
> Carlos> mp-102. The difference is visible.
>
> Have you told AudioCodes that their stack does not comply with the
standard?
>
> Carlos> How can we fix this in order to be able to receive a valid
transaction
> Carlos> from the mp-102?, knowing that it always adds the caracters 00 or
\x00
> Carlos> to the ServiceChange Command. Do we need to hack the erlang's code
at
> Carlos> the "handled" libraries?
>
> Yes, if you want to be bug compatible with AudioCodes you need to hack a
little.
>
> Add the following rule to megaco/src/text/megaco_text_parser.yrl:
>
>   megacoMessage        -> optSep authenticationHeader message safeToken
endOfMessage
>       : #'MegacoMessage'{authHeader = '$2', mess = '$3'} .
>
> directly after this rule:
>
>   megacoMessage        -> optSep authenticationHeader message endOfMessage
>       : #'MegacoMessage'{authHeader = '$2', mess = '$3'} .
>
> and recompile the megaco application. This would allow trailing safeChars
in
> any text message.
>
> /Håkan
>
>
> This communication is confidential and intended solely for the
addressee(s). Any unauthorized review, use, disclosure or distribution is
prohibited. If you believe this message has been sent to you in error,
please notify the sender by replying to this transmission and delete the
message without disclosing it. Thank you.
>
> E-mail including attachments is susceptible to data corruption,
interruption, unauthorized amendment, tampering and viruses, and we only
send and receive e-mails on the basis that we are not liable for any such
corruption, interception, amendment, tampering or viruses or any
consequences thereof.
>




More information about the erlang-questions mailing list