megaco_compact_text???

Hakan Mattsson hakan@REDACTED
Thu Mar 4 12:44:22 CET 2004


Oops, I forgot to cc the list.

/Håkan

---------- Forwarded message ----------
Date: Thu, 4 Mar 2004 10:07:52 +0100 (MET)
From: Hakan Mattsson <hakan@REDACTED>
To: Carlos Rodríguez Alcalá Villagra <crav@REDACTED>
Subject: Re: megaco_compact_text???

On Wed, 3 Mar 2004, Carlos Rodríguez Alcalá Villagra wrote:

Carlos> With which it gives a syntax error, i guess that the error is in 'MEGACO/1'  that it must that be '!/1' ??

No, it is the profile that is erroneous, enclosed printouts below.
The profile must contain a name and a version separated by a slash:

   serviceChangeProfile = ProfileToken EQUAL NAME SLASH Version

I think that the easiest way to debug these kinds of errors is to use
built-in debug support in the Megaco application. The sequence chart
tool 'et' is quite powerful.

BTW, even if you use the compact text encoder in the megaco
application it will decode both short and long keywords. It is
only the encoder that will be using the short message style.

/Håkan

---
Håkan Mattsson
Ericsson
High Availability Software, DBMS Internals
http://www.erlang.org/~hakan/


1> M = "MEGACO/1 [192.168.0.108]:0
T=1 {
C= - {
SC=ROOT {
SV {
MT=RS,
AD=0,
V=1,
PF=TGW1,
RE=\"901 MGCold BOOT\", 19700101T0002}}}}".
2> megaco_compact_text_encoder:decode_message([], list_to_binary(M)).
{error,[{reason,{8,megaco_text_parser,{bad_profile,"tgw1"}}},
        {token,[{'SafeChars',1,"megaco/1"},
                {'LSBRKT',1},
                {'SafeChars',1,"192.168.0.108"},
                {'RSBRKT',1},
                {'COLON',1},
                {'SafeChars',1,"0"},
                {'SEP',1},
                {'TransToken',1,"t"},
                {'EQUAL',1},
                {'SafeChars',1,"1"},
                {'LBRKT',1},
                {'CtxToken',2,"c"},
                {'EQUAL',2},
                {'SafeChars',2,"-"},
                {'LBRKT',2},
                {'ServiceChangeToken',3,"sc"},
                {'EQUAL',3},
                {'SafeChars',3,"root"},
                {'LBRKT',3},
                {'ServicesToken',4,"sv"},
                {'LBRKT',4},
                {'MethodToken'|...},
                {...}|...]},
        {chars,<<77,69,71,65,67,79,47,49,32,91,49,57,50,46,49,54,56,46,48,46,49,48,...>>}]}
3> M2 = "MEGACO/1 [192.168.0.108]:0
T=1 {
C= - {
SC=ROOT {
SV {
MT=RS,
AD=0,
V=1,
PF=TGW1/42,
RE=\"901 MGCold BOOT\", 19700101T0002}}}}".
4> megaco_compact_text_encoder:decode_message([], list_to_binary(M2)).
{ok,{'MegacoMessage',asn1_NOVALUE,
                     {'Message',1,
                                {ip4Address,{'IP4Address',[192,168,0,108],0}},
                                {transactions,
                                    [{transactionRequest,
                                         {'TransactionRequest',
                                             1,
                                             [{'ActionRequest',
                                                  0,
                                                  asn1_NOVALUE,
                                                  asn1_NOVALUE,
                                                  [...]}]}}]}}}}



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