[Freeswitch-users] mod_erlang_event compile problem

Andrew Thompson andrew at hijacked.us
Sun Feb 22 15:32:16 PST 2009


On Sat, Feb 21, 2009 at 03:42:24PM +0100, Leon de Rooij wrote:
> Hi Andrew,
> 
> Thanks for your help so far, I hope you can help me a bit further as I  
> don't get any reply from the FS erlang node, or so it seems.. Here is  
> what I've done:
> 
> - The erlang_event.conf.xml is unchanged:
> 
> <configuration name="erlang_event.conf" description="Erlang Socket  
> Client">
>    <settings>
>      <param name="listen-ip" value="127.0.0.1"/>
>      <param name="listen-port" value="8031"/>
>      <param name="nodename" value="freeswitch"/>
>      <param name="cookie" value="ClueCon"/>
>      <param name="shortname" value="true"/>
>      <param name="encoding" value="string"/>
>    </settings>
> </configuration>

You actually installed this to the right place? It's not installed by
default... The defaults *should* be sane anyway, but I'm just checking.
> 
> - mod_erlang_event is not loaded in FS.
> 
> - First I start "epmd -d -d"
> 
> epmd: Sat Feb 21 13:12:56 2009: epmd running - daemon = 0
> epmd: Sat Feb 21 13:12:56 2009: try to initiate listening port 4369
> epmd: Sat Feb 21 13:12:56 2009: starting
> epmd: Sat Feb 21 13:12:56 2009: entering the main select() loop
> 
> - After that I "load mod_erlang_event" in FS:
> 
> 2009-02-21 13:13:36 [DEBUG] mod_erlang_event.c:1324  
> mod_erlang_event_load() sections 16
> 2009-02-21 13:13:36 [CONSOLE] switch_loadable_module.c:858  
> switch_loadable_module_load_file() Successfully Loaded  
> [mod_erlang_event]
> 2009-02-21 13:13:36 [NOTICE] switch_loadable_module.c:240  
> switch_loadable_module_process() Adding Application 'erlang'
> 2009-02-21 13:13:36 [NOTICE] switch_loadable_module.c:260  
> switch_loadable_module_process() Adding API Function 'erlang'
> 2009-02-21 13:13:36 [DEBUG] mod_erlang_event.c:1401  
> mod_erlang_event_runtime() Socket up listening on 127.0.0.1:8031
> 2009-02-21 13:13:36 [DEBUG] mod_erlang_event.c:1426  
> mod_erlang_event_runtime() Connected and published erlang cnode at  
> freeswitch at erlyfs
> 
> - For which epmd gives the following output:
> 
> epmd: Sat Feb 21 13:13:36 2009: opening connection on file descriptor 4
> epmd: Sat Feb 21 13:13:36 2009: got 25 bytes
> ***** 00000000  00 17 78 1f 5f 68 00 00  05 00 01 00 0a 66 72 65   
> |..x._h.......fre|
> ***** 00000010  65 73 77 69 74 63 68 00  00                       | 
> eswitch..|
> epmd: Sat Feb 21 13:13:36 2009: ** got ALIVE2_REQ
> epmd: Sat Feb 21 13:13:36 2009: registering 'freeswitch:1', port 8031
> epmd: Sat Feb 21 13:13:36 2009: type 104 proto 0 highvsn 5 lowvsn 1
> epmd: Sat Feb 21 13:13:36 2009: got 4 bytes
> ***** 00000000  79 00 00 01                                       |y...|
> epmd: Sat Feb 21 13:13:36 2009: ** sent ALIVE2_RESP for "freeswitch"
> 
> - Then I start an erl shell on that same machine with "erl -sname ldr - 
> setcookie ClueCon". Output of epmd:
> 
> epmd: Sat Feb 21 13:16:24 2009: opening connection on file descriptor 5
> epmd: Sat Feb 21 13:16:24 2009: got 18 bytes
> ***** 00000000  00 10 78 8e 2c 4d 00 00  05 00 05 00 03 6c 64 72   
> |..x.,M.......ldr|
> ***** 00000010  00 00                                             |..|
> epmd: Sat Feb 21 13:16:24 2009: ** got ALIVE2_REQ
> epmd: Sat Feb 21 13:16:24 2009: registering 'ldr:1', port 36396
> epmd: Sat Feb 21 13:16:24 2009: type 77 proto 0 highvsn 5 lowvsn 5
> epmd: Sat Feb 21 13:16:24 2009: got 4 bytes
> ***** 00000000  79 00 00 01                                       |y...|
> epmd: Sat Feb 21 13:16:24 2009: ** sent ALIVE2_RESP for "ldr"
> 
> As far as I understand the freeswitch at erlyfs node cannot be seen with  
> nodes() ? So does that mean that I also cannot net_adm:ping() it ?

Yes, it's a 'hidden' node, as all non-erlang nodes are. However, it
should be visible in the output of epmd -names.
> 
> Anyway, I tried sending some tuples as is shown on the wiki, but I get  
> no reply:
> 
> (ldr at erlyfs)1> {foo, freeswitch at erlyfs} ! {api, status, ""}, receive X  
> -> X after 1000 -> timeout end.
> timeout
> (ldr at erlyfs)2>
> 
> - Epmd gives some logs:
> 
> epmd: Sat Feb 21 13:19:09 2009: opening connection on file descriptor 6
> epmd: Sat Feb 21 13:19:09 2009: got 13 bytes
> ***** 00000000  00 0b 7a 66 72 65 65 73  77 69 74 63 68            
> |..zfreeswitch|
> epmd: Sat Feb 21 13:19:09 2009: ** got PORT2_REQ
> epmd: Sat Feb 21 13:19:09 2009: got 23 bytes
> ***** 00000000  77 00 1f 5f 68 00 00 05  00 01 00 0a 66 72 65 65  | 
> w.._h.......free|
> ***** 00000010  73 77 69 74 63 68 00                              | 
> switch.|
> epmd: Sat Feb 21 13:19:09 2009: ** sent PORT2_RESP (ok) for "freeswitch"
> epmd: Sat Feb 21 13:19:09 2009: closing connection on file descriptor 6
> 
> - And in tcpdump on lo, I see that epmd is contacted after which some  
> traffic was sent to FS:
> 
> 13:19:09.535293 IP 172.31.0.13.34678 > 172.31.0.13.4369: S  
> 2875169966:2875169966(0) win 32792 <mss 16396,sackOK,timestamp  
> 17946545 0,nop,wscale 6>
> ...
> 13:19:09.536834 IP 172.31.0.13.4369 > 172.31.0.13.34678: . ack 15 win  
> 512 <nop,nop,timestamp 17946546 17946546>
> 13:19:09.536923 IP 172.31.0.13.47054 > 172.31.0.13.8031: S  
> 2868322908:2868322908(0) win 32792 <mss 16396,sackOK,timestamp  
> 17946546 0,nop,wscale 6>
> 13:19:09.536935 IP 172.31.0.13.8031 > 172.31.0.13.47054: R 0:0(0) ack  
> 2868322909 win 0
> 
> Shouldn't FS then send a message back to the process in my erl shell ?
> 
> I tried logging all events in fs_cli, by entering "/event plain all",  
> but I see no events at all coming from erlang, just some heartbeats..
> 
> Also, I recompiled the module with EI_DEBUG defined as suggested on  
> the wiki. Still I don't see anything in the CLI when set to debug  
> logging.

This is the part that's confusing me, you should be seeing *something*,
especially with EI_DEBUG on, because in that case you see *everything*
that is sent to or received by the erlang module. Let me to a 'make
current' and doublecheck something didn't get broken along the way.

Andrew




More information about the FreeSWITCH-users mailing list