[erlang-questions] ASN.1 multiple records

Rimon Farouk ce.rfjacob@REDACTED
Mon Feb 10 14:33:48 CET 2014


Thanks a lot Abdu for your help :) you've given me the key actually :)
'SDCDR':decode('TypeName', Bytes) is returning {ok, DecodedValue} but not
returning the Rest.
To return the rest use:
{DecodedValue, Rest, Length}='SDCDR':decode_disp('TypeName', Bytes)

Thanks a lot ...
Best regards ...
Rimon.


On Mon, Feb 10, 2014 at 11:18 AM, Abd El-Fattah Mahran <
abdoo.mahran@REDACTED> wrote:

> Dear Rimon,
>
> Consider you have SDCDR.asn and ASN1 configuration file SDCDR.asn1config
>
>
> *** Compile .asn File*
> asn1ct:compile("SDCDR", [ber_bin, optimize, verbose, driver, undec_rest]).
>
> *** Compile .asn File with configuration file .asn1config*
> asn1ct:compile("SDCDR", [ber_bin, optimize, verbose, driver, asn1config,
> undec_rest]).
>
> *** Steps For decoding .asn file*
> {ok, F} = file:read_file("SDPCDR_sdp01a.ASN").
>
> rr('SDCDR').
> {ok, {lifeCycleChange, LifeCycleChange}, Rest} =
> 'SDCDR':decode('SDPCallDataRecord', F).
>
> *** Use Rest Variable to get the Rest of the data.*
> {ok, {accountAdjustment, AccountAdjustment}, Rest1} =
> 'SDCDR':decode('SDPCallDataRecord', Rest).
>
>
> Thanks,
> best regards,
>
>
> On Sun, Feb 9, 2014 at 3:07 PM, Rimon Farouk <ce.rfjacob@REDACTED> wrote:
>
>> Dears;
>>
>> I've succeeded in reading ASN.1 binary files containing single message,
>> but how can i read an ASN.1 binary file containing multiple messages?
>> I cannot find sufficient resources for Erlang dealing with ASN.1 files.
>> Kindly help.
>>
>> Thanks a lot ...
>> Best regards ...
>> Rimon
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
>
>
> --
> Thanks
> Best Regards,
> Abd El-Fattah Mahran
> http://www.linkedin.com/in/abdoomahran
>
>


-- 
--------------------------------------
Rimon F. Jacob
Mobile +20 10 666 16 234
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140210/5428cf65/attachment.htm>


More information about the erlang-questions mailing list