[Freeswitch-users] mod_erlang_event compile problem

Leon de Rooij leon at scarlet-internet.nl
Sat Feb 21 06:42:24 PST 2009


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>

- 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 ?

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.

Thanks again,

Leon


On Feb 20, 2009, at 8:08 PM, Andrew Thompson wrote:

> On Fri, Feb 20, 2009 at 05:19:25PM +0100, Leon de Rooij wrote:
>> Hi,
>>
>> I wanted to try out the mod_erlang_event module. I have Erlang R12B5
>> compiled and it's in the same location as the Makefile specifies (/ 
>> usr/
>> local/lib/erlang/...), but running make in the src/mod/ 
>> event_handlers/
>> mod_erlang_event goes wrong:
>>
>
> Yeah, this was a gcc4 thing, I've done most of my testing on gcc3 so  
> it
> didn't show up for me. Thanks to MikeJ for the fix suggestion.
>
>> Also, after this, FS goes haywire after loading the module
>> and spews out these messages continuously:
>>
>
> You don't have the erlang port mapper daemon running (epmd).
> mod_erlang_event needs it to be running in order to be able to  
> register
> itself as an erlang node. On your system; epmd isn't in $PATH so my
> system() call that tries to start it fails. I've made the module init
> system fail properly instead of looping indefinitely as well as  
> print a
> slightly more helpful error message now. Let me know if you have any
> better luck :) The fix is in-tree as of r12192.
>
> Thanks again for the bug report.
>
> Andrew
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org





More information about the FreeSWITCH-users mailing list