megaco_test_mg and megaco_test_mgc

Hakan Mattsson hakan@REDACTED
Fri Oct 17 09:26:07 CEST 2003


On Thu, 16 Oct 2003, Miguel Willigs wrote:

Miguel> No problem in this point, but when I am triyng to run
Miguel> megaco_test_mg:service_change/1 in the mg side, I get the following error
Miguel> message:
Miguel> 
Miguel> <0.37.0>:MG: loop(initiated) -> received request to perform service change
Miguel> DBG: <0.37.0>:MG: loop(initiated) -> service change result: {error,
Miguel> 								{bad_megaco_conn_handle,
Miguel> 								    {error,
Miguel> 									{megaco_tcp_connect,
Miguel> 									    {gen_tcp_connect,
Miguel> 										econnrefused}}}}}

This means that gen_tcp:connect fails with a 'econnrefused' error code.
No one is listening on the remote address. 

Either the MGC is not started or it is listening on the wrong port.

Miguel> But the most common message error is in the MGC side, is the following:

The key information in the error printout is:

  {error,{function_clause,[{megaco_pretty_text_encoder,enc_MId,[[{deviceName,[99,116,114,108]}],[]]}

By reading the source code for enc_MId/2 in megaco_text_gen.hrl or by
checking the ASN.1 spec for the MID's definition it becomes clear that
the error is in the serviceChangeMgcId field in the
'ServiceChangeResParm' record.

It should be  {deviceName,"ctrl"} and not [{deviceName,"ctrl"}].

/Håkan

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




More information about the erlang-questions mailing list