Reply command

Micael Karlberg micael.karlberg@REDACTED
Fri Nov 7 12:00:48 CET 2003


Hi,

There is no "command reply" type. Instead, you wrap this as
follows:
	
handle_megaco_request({handle_trans_request, CH, _PV, AR}, S) ->
        do_something_usefull_with_the_request(CH, AR),

        %% Compose a reply
	ContextId  = 1,
	AmmsReply  = cre_ammsReply(?A4444),
	CmdReply   = [{subtractReply, AmmsReply}],
	ActReplies = [cre_actionReply(ContextId, CmdReply)],
	{discard_ack, ActReplies}.

You can find more message examples by looking at the 
megaco_codec_test.erl file (search for e.g. 'msg25(Mid)').

/BMK

mwilligs@REDACTED writes:
 > We want to send that Reply package:
 > 
 > MEGACO/1 ...
 > Transaction = 1237{
 > 	Context = 1 {
 > 		Subtract = Trunk1/line1{Audit{}}
 > 	}
 > 
 > 
 > 
 > So we modify the 'megaco_test_mg.erl' file in this function:
 > 
 > handle_megaco_request({handle_trans_request, CH, _PV, _AR}, S) ->
 >     ED =  cre_error_descr(?megaco_not_implemented, "Transaccion no
 > soportada"),
 >     {{discard_ack, ED}, S#mg{conn_handle = CH}};
 > 
 > 
 > 
 > 
 > 
 > We modify like this:
 > 
 > 
 > handle_megaco_request({handle_trans_request, CH, _PV, _AR}, S) ->
 >     %ED =  cre_error_descr(?megaco_not_implemented, "Transaccion no
 > soportada"),
 > 
 >     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 >     SUBR	= cre_ammsReply(?A4444),
 >     ED	= cre_commandRep({subtractReply, SUBR}),
 >     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 > 
 >     {{discard_ack, [ED]}, S#mg{conn_handle = CH}};
 > 
 > 
 > cre_commandRep(Cmd)->
 > 	#'CommandRequest'{	command	= Cmd}.
 > 
 > cre_ammsReply(Id)->
 > 	#'AmmsReply'{	terminationID	= [#megaco_term_id{id=Id}]}.
 > 
 > 
 > 
 > What is wrong in my code?
 > 
 > Thanks in advance.

-- 
Micael Karlberg          Ericsson AB, Älvsjö Sweden
Tel:  +46 8 727 5668     EAB/UHK/KD - OTP Product Development
ECN:  851 5668           Mail: micael.karlberg@REDACTED
Fax:  +46 8 727 5775    



More information about the erlang-questions mailing list