<div dir="ltr"><br>Any help ?<br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Sanath Prasanna</b> <span dir="ltr"><<a href="mailto:ahe.sanath@gmail.com">ahe.sanath@gmail.com</a>></span><br>
Date: Thu, Jun 12, 2014 at 8:38 AM<br>Subject: Diameter Encoding Problem<br>To: erlang-questions <<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>><br><br><br><div dir="ltr"><div>Hi,</div>
<div>Pls help to resolve below error.</div><div><br></div><div>=ERROR REPORT==== 12-Jun-2014::08:22:05 ===</div><div>   <b> why: {diameter_codec,encode,</b></div><div><b>             {{encode_failure,undef,'CCR',</b></div>

<div><b>                  [{diameter_gen_base_rfc6733,avp_header,['Session-Id'],[]},</b></div><div>                   {rfc4006_cc_Gy,e,2,</div><div>                       [{file,</div><div>                            "i:diameter-1.0/include/diameter_gen.hrl"},</div>

<div>                        {line,105}]},</div><div>                   {lists,flatmap,2,[{file,"lists.erl"},{line,1184}]},</div><div>                   {rfc4006_cc_Gy,encode_avps,2,</div><div>                       [{file,</div>

<div>                            "i:diameter-1.0/include/diameter_gen.hrl"},</div><div><br></div><div><br></div><div>Sample Code Below:</div><div>client:start().</div><div>client:create_session(No).<br></div><div>

<br></div><div><div>create_session(No) -></div><div><span style="white-space:pre-wrap">  </span>SId = diameter:session_id(?L(?SVC_NAME)),</div><div><span style="white-space:pre-wrap">        </span>CCR = #rfc4006_cc_Gy_CCR{</div>

<div><span style="white-space:pre-wrap">  </span>        'Session-Id' = SId,</div><div><span style="white-space:pre-wrap">                                  </span>'Origin-Host' = ?ORIGIN_HOST,</div><div><span style="white-space:pre-wrap">    </span>        'Origin-Realm' = ?ORIGIN_REALM,</div>

<div><span style="white-space:pre-wrap">                                  </span>'Destination-Realm' = ?DEST_REALM,</div><div><span style="white-space:pre-wrap">       </span>        'Auth-Application-Id' = 4,</div><div><span style="white-space:pre-wrap">                                   </span>'Service-Context-Id' =  ?CONTEXT_ID,</div>

<div><span style="white-space:pre-wrap">                                  </span>'CC-Request-Type' = 4,</div><div><span style="white-space:pre-wrap">                                   </span>'CC-Request-Number' = 0,</div><div><span style="white-space:pre-wrap">                                 </span>%%'Event-Timestamp' = [ erlang:localtime()],</div>

<div><span style="white-space:pre-wrap">                                  </span>'Subscription-Id' = [#'rfc4006_cc_Gy_Subscription-Id' {</div><div><span style="white-space:pre-wrap">  </span>                                'Subscription-Id-Type' = 0,</div>

<div><span style="white-space:pre-wrap">  </span>                                'Subscription-Id-Data' = No}],</div><div><span style="white-space:pre-wrap">                                   </span>'Requested-Service-Unit' = [0],</div>

<div><span style="white-space:pre-wrap">                                  </span>'Requested-Action' = 0},<span style="white-space:pre-wrap">                </span></div><div><span style="white-space:pre-wrap"> </span>io:fwrite("connect ~p~n",[{CCR}]),</div>

<div><span style="white-space:pre-wrap">  </span>diameter:call(?SVC_NAME, ?APP_ALIAS, CCR, []).</div></div><div><br></div><div>Br,</div><div>Sanath</div></div>
</div><br></div>