Subject: [Megaco] Re: [erlang-questions] running sample progs for MGC and MG

From: J Bhanot <[email-masked]>
Date: Thu, 24 Jan 2008 16:06:49 +0530

Hi Maxim,

I was using putty from my local windows machine to connect to linux server 
and then running this sample application.....

but when i ran this script from linux sever itself (FC8)....it did show 
MGC GUI...

now it want to display GUI from my local windows machine running this appl 
on putty...for this i am trying to download an interface b/w linux and 
windows i.e 

ReflectionX

hoping that it would open the GUI from my local windows m/c....

Second question is that -  I am looking into erl_interface library 

now when you say atleast one erlang node should be running ...do you mean 
that anyways i will have to use Erlang in building some application ( 
Start Media Gateway Controller) and then if i want to start Media Gateway 
....i can use my C application to start it and then making MG communicate 
with MGW via erl_interface library using C....

Actually, i am bit hazy about this at this moment...

Could you kindly throw more light on that...

Appreciate your help...

Many Thanks,
jb

"Maxim Treskin" <[email-masked]> 
01/24/2008 03:50 PM

To
"J Bhanot" <[email-masked]>
cc
[email-masked], [email-masked]
Subject
Re: [erlang-questions] running sample progs for MGC and MG

On 24/01/2008, J Bhanot <[email-masked]> wrote:

Hi All, 

I built the stack doing following in FC 8 : 

./configure --disable -sctp 

make all 

make install 

Now i want to test MGC and MG running examples at follwoing location 

/home/j.bhanot/Download/H.248/otp_src_R12B-0/lib/megaco/examples/simple 

i tried to execute megaco_simple_mgc.erl 

following these commands: 

erl -pa ../../../megaco/ebin -s megaco_filter -s megaco 
%%   megaco_simple_mgc:start(). 

but getting the error : 

1> Application initialization failed: no display name and no $DISPLAY 
environment variable 
Error in startup script: no display name and no $DISPLAY environment 
variable 

Question1 : what should the value with which env value DISPLAY be set

DISPLAY is environment variable, which contains address and display number 
of your X server. Megaco sample progs have some GUI to trace megaco 
messages. It seems that you ran stack not in X environment, or under 
another user. 

Question2: these sample applications are made in erlang...is it possible 
to use c/c++ or some other language to use APIs/Functionalities of Megaco 
stack

There is erl_interface library to interact between erlang node and C/C++ 
applications, but it is necessary to run one erlang node for this.

--- Maxim 'Zert' Treskin

ForwardSourceID:NT0000DC1E 
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you

_______________________________________________
Megaco mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/megaco

---

From: "Maxim Treskin" <[email-masked]>
Date: Thu, 24 Jan 2008 16:55:33 +0600

> hoping that it would open the GUI from my local windows m/c....

You have two way:
 1) Install X server on your windows machine, start it, then set DISPLAY
variable on linux station to "your_windows_addr:x_display", where
your_windows_addr is network address of machine and x_display is display
number of X server
 2) Do not run megaco_filter process. In this case you can see megaco
messages on console, not in GUI.

> that anyways i will have to use Erlang in building some application ( Start
> Media Gateway Controller) and then if i want to start Media Gateway ....i
> can use my C application to start it and then making MG communicate with MGW
> via erl_interface library using C....

At least one erlang node should be started for MGC and one node for each MG.
Also you must write pice of code in erlang to handle megaco messages. The
easiest way is learn Erlang OTP, and write whole application on this
platform. You can write low-level part of application on C/C++, but it is
impossible to write high-level part, megaco messaging, on other language,
not Erlang.

> Could you kindly throw more light on that...

---
Maxim 'Zert' Treskin

---

From: J Bhanot <[email-masked]>
Date: Fri, 25 Jan 2008 11:48:33 +0530

Hi ,

I am having some startup trouble here understanding the exact way this 
stack works...

Few queries that I have :

1. Does this stack gives the functionality/instance of MGC and MG or I 
would need it separately (think satck will be providing that)

2. In the user guide for Megaco, in order to prepare MGC to recieve 
messages follwoing needs to ne done

Start the Megaco application. (how to do that -- configure-build-install 
the OTP stack then run follwoing command - erl -pa ../../../megaco/ebin -s 
megaco_filter -s megaco)....am just in the process of learning Erlang as 
well (don't understand the erlang syntax as of now but will learn 
:-)......another question - how to make megaco_filter off so that megaco 
messages can be seen on console)
Start the MGC user. This may either be done explicitly with 
megaco:start_user/2 or implicitly by providing the -megaco users 
configuration parameter. (how to do that - once I run the above command, i 
get erlang shell - 1>...then type megaco:start_user/2.....that should make 
my MGC up and running ..listeniing at some port)
Initiate the transport service and provide it with a receive handle 
obtained from megaco:user_info/2.(How to do that)...

Please correct me if my understanding is correct..
Please forgive me if my quesetions appear to be a bit too novice..
Thanking in anticipation...
Cheers,
jb

01/24/2008 04:25 PM

To

Hi Maxim, 

ReflectionX 

You have two way:

At least one erlang node should be started for MGC and one node for each 
MG. Also you must write pice of code in erlang to handle megaco messages. 
The easiest way is learn Erlang OTP, and write whole application on this 
platform. You can write low-level part of application on C/C++, but it is 
impossible to write high-level part, megaco messaging, on other language, 
not Erlang. 

Appreciate your help... 

Many Thanks, 
jb 

---
Maxim 'Zert' Treskin
ForwardSourceID:NT0000DC3A

---

From: "Maxim Treskin" <[email-masked]>
Date: Fri, 25 Jan 2008 12:49:40 +0600

You can off megaco_filter by removing -s megaco_filter out of your startup
line.

---
Maxim 'Zert' Treskin

---

From: J Bhanot <[email-masked]>
Date: Tue, 29 Jan 2008 17:43:45 +0530

Hi Maxim,

I am now trying to run it from local machine having no xterm server using 
this command

erl -pa ../../../megaco/ebin -s megaco

megaco application is up without any errors

but when on erl shell when i try to execute sample script

megaco_simple_mgc.erl

using follwoing command :
megaco_simple_mgc:start().

I get the following errors:

{ok,[{{error,
          {megaco_tcp_listen,
              {could_not_start_listener,{gen_tcp_listen,eaddrinuse}}}},
      2944,
      {megaco_receive_handle,
          {deviceName,"controller"},
          megaco_pretty_text_encoder,[],megaco_tcp,dynamic}},
     {ok,2944,
         {megaco_receive_handle,
             {deviceName,"controller"},
             megaco_pretty_text_encoder,[],megaco_udp,dynamic}},
     {{error,
          {megaco_tcp_listen,
              {could_not_start_listener,{gen_tcp_listen,eaddrinuse}}}},
      2945,
      {megaco_receive_handle,
          {deviceName,"controller"},
          megaco_binary_encoder,[],megaco_tcp,dynamic}},
     {ok,2945,
         {megaco_receive_handle,
             {deviceName,"controller"},
             megaco_binary_encoder,[],megaco_udp,dynamic}}]}

any ideas on that..

Regards,
jb

To

Hi All, 

make all 

make install 

but getting the error : 

--- Maxim 'Zert' Treskin

---

From: "Maxim Treskin" <[email-masked]>
Date: Tue, 29 Jan 2008 18:20:23 +0600

It seems you have another running mgc on this machine. Run 'ps aux' and kill
unused erlang nodes.

-- 
Maxim Treskin