Event Socket Issue
Forum » WikiPBX / Technical Support » Event Socket Issue
Started by: bbhenrybbhenry
On: 1250591780|%e %b %Y, %H:%M %Z|agohover
Number of posts: 14
rss icon RSS: New posts
Event Socket Issue
bbhenrybbhenry 1250591780|%e %b %Y, %H:%M %Z|agohover

I have installed wikipbx on a Centos. Everything looks except it doesn't connect to the event socket. I have already tested that the event socket is turned on and working. Here is the event I get from wikipbx of not being able to connect to event socket. Please help.

2009-08-18 02:33:48+0000 [FreeswitchEventLogger,client] disconnected.  reason: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.
2009-08-18 02:33:48+0000 [FreeswitchEventLogger,client] ]
2009-08-18 02:33:48+0000 [FreeswitchEventLogger,client] connectionLost: [Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.
2009-08-18 02:33:48+0000 [FreeswitchEventLogger,client] ]
2009-08-18 02:33:48+0000 [FreeswitchEventLogger,client] clientConnectionLost! conn=<twisted.internet.tcp.Connector instance at 0x924aaec>, reason=[Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.
Reply  |  Options
Unfold Event Socket Issue by bbhenrybbhenry, 1250591780|%e %b %Y, %H:%M %Z|agohover
Re: Event Socket Issue
stas_shtinstas_shtin 1250593325|%e %b %Y, %H:%M %Z|agohover

Make sure you've got correct event socket IP/port/password configured. Try to login by running:

telnet IP PORT

and then entering

auth PASSWORD
Last edited on 1250612318|%e %b %Y, %H:%M %Z|agohover By stas_shtin + Show more
Reply  |  Options
Unfold Re: Event Socket Issue by stas_shtinstas_shtin, 1250593325|%e %b %Y, %H:%M %Z|agohover
Re: Event Socket Issue
bbhenrybbhenry 1250642716|%e %b %Y, %H:%M %Z|agohover

Hi:

I have already tested the event socket with Telnet before I made my post. And it was working fine.

Reply  |  Options
Unfold Re: Event Socket Issue by bbhenrybbhenry, 1250642716|%e %b %Y, %H:%M %Z|agohover
Re: Event Socket Issue
tleydentleyden 1250707829|%e %b %Y, %H:%M %Z|agohover

Maybe Freeswitch was started before wikipbx, so did not pull configugration from wikipbx and fell back to default XML config files. When that happens, it is possible that wikipbx could be trying to connect to a different ip/port than freeswitch is actually listening on.

Please update to svn 111 and retry, it will output which ip/port it is trying to connect on. In the logs you should see:

Going to connect to freeswitch event socket on ip: 127.0.0.1 port: 8021

Reply  |  Options
Unfold Re: Event Socket Issue by tleydentleyden, 1250707829|%e %b %Y, %H:%M %Z|agohover
Re: Event Socket Issue
bbhenrybbhenry 1250728613|%e %b %Y, %H:%M %Z|agohover

after I get the updated svn, do I need to run through each and every step again in the installation instruction on the wiki?
Or I just need to run a simple script for updates?

Reply  |  Options
Unfold Re: Event Socket Issue by bbhenrybbhenry, 1250728613|%e %b %Y, %H:%M %Z|agohover
Re: Event Socket Issue
stas_shtinstas_shtin 1250754698|%e %b %Y, %H:%M %Z|agohover

After updating you don't need to reinstall anything. Just restart wikipbx and then freeswitch.

And make sure that you run wikipbx before running freeswitch. Otherwise you may get freeswitch running with a correct event socket config, but not the one that wikipbx uses.

Reply  |  Options
Unfold Re: Event Socket Issue by stas_shtinstas_shtin, 1250754698|%e %b %Y, %H:%M %Z|agohover
Re: Event Socket Issue
bbhenrybbhenry 1250845638|%e %b %Y, %H:%M %Z|agohover

I still can't connect to the event socket after doing what you told me. Here's the log:

2009-08-21 00:50:54+0000 [Uninitialized] Connection to 127.0.0.1:8021 refused, retrying attempt #10 in 5 seconds
2009-08-21 00:50:54+0000 [Uninitialized] Stopping factory <freepy.fseventlistener.FreeswitchEventListenerFactory instance at 0x957f78c>
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1] got post: <MultiValueDict: {'key_value': ['xml_cdr.conf'], 'key_name': ['name'], 'section': ['configuration'], 'hos
tname': ['wikipbx.worldteltech.com'], 'tag_name': ['configuration']}>
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1] <document type="freeswitch/xml">
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1] <section name="configuration" description="Various Configuration">
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1]
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1] <configuration name='xml_cdr.conf' description='XML CDR CURL logger'>
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1]   <settings>
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1]     <param name='retries' value='1'/>
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1]     <param name='url' value='http://127.0.0.1:8086/add_cdr/'/>
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1]     <param name='delay' value='30'/>
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1]     <param name='log-dir' value='/usr/src/wikipbx/cdr'/>
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1]     <param name='encode' value='True'/>
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1]     <param name='cred' value='user:pass'/>
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1]     <param name='err-log-dir' value='/usr/src/wikipbx/cdr/err'/>
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1]   </settings>
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1] </configuration>
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1]
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1] </section>
2009-08-21 00:50:55+0000 [HTTPChannel,0,127.0.0.1] </document>
2009-08-21 00:50:55+0000 [-] 127.0.0.1 - - [21/Aug/2009:00:50:55 -0600] "POST /xml_dialplan/ HTTP/1.1" 200 581 "-" "freeswitch-xml/1.0"
2009-08-21 00:50:55+0000 [HTTPChannel,1,127.0.0.1] got post: <MultiValueDict: {'key_value': ['cdr_csv.conf'], 'key_name': ['name'], 'section': ['configuration'], 'hostname': ['wikipbx.worldteltech.com'], 'tag_name': ['configuration']}>
2009-08-21 00:50:55+0000 [-] 127.0.0.1 - - [21/Aug/2009:00:50:55 -0600] "POST /xml_dialplan/ HTTP/1.1" 200 127 "-" "freeswitch-xml/1.0"
2009-08-21 00:50:55+0000 [HTTPChannel,2,127.0.0.1] got post: <MultiValueDict: {'FreeSWITCH-IPv4': ['192.168.1.69'], 'key_value': ['sofia.conf'], 'FreeSWITCH-IPv6': ['::1'], 'Event-Date-Local': ['2009-08-20 18:50:55'], 'Event-Calling-Line-Number': ['2051'], 'key_name': ['name'], 'section': ['configuration'], 'hostname': ['wikipbx.worldteltech.com'], 'Event-Date-GMT': ['Fri, 21 Aug 2009 00:50:55 GMT'], 'Event-Name': ['REQUEST_PARAMS'], 'tag_name': ['configuration'], 'FreeSWITCH-Hostname': ['wikipbx.worldteltech.com'], 'Event-Date-Timestamp': ['1250815855142899'], 'Event-Calling-Function': ['config_sofia'], 'Event-Calling-File': ['sofia.c'], 'Core-UUID': ['1ec5600c-802b-4d14-b065-19145c85b00e']}>

SKIP -------------

2009-08-21 00:50:57+0000 [HTTPChannel,14,127.0.0.1] <document type="freeswitch/xml">
2009-08-21 00:50:57+0000 [HTTPChannel,14,127.0.0.1] <section name="configuration" description="Various Configuration">
2009-08-21 00:50:57+0000 [HTTPChannel,14,127.0.0.1]
2009-08-21 00:50:57+0000 [HTTPChannel,14,127.0.0.1] <configuration name='event_socket.conf' description='Socket Client'>
2009-08-21 00:50:57+0000 [HTTPChannel,14,127.0.0.1]   <settings>
2009-08-21 00:50:57+0000 [HTTPChannel,14,127.0.0.1]     <param name='listen-ip' value='127.0.0.1'/>
2009-08-21 00:50:57+0000 [HTTPChannel,14,127.0.0.1]     <param name='password' value='ClueCon'/>
2009-08-21 00:50:57+0000 [HTTPChannel,14,127.0.0.1]     <!-- <param name='password' value='$${default_event_socket_password}'/> -->
2009-08-21 00:50:57+0000 [HTTPChannel,14,127.0.0.1]     <param name='listen-port' value='8021'/>
2009-08-21 00:50:57+0000 [HTTPChannel,14,127.0.0.1]   </settings>
2009-08-21 00:50:57+0000 [HTTPChannel,14,127.0.0.1] </configuration>
2009-08-21 00:50:57+0000 [HTTPChannel,14,127.0.0.1]
2009-08-21 00:50:57+0000 [HTTPChannel,14,127.0.0.1] </section>
2009-08-21 00:50:57+0000 [HTTPChannel,14,127.0.0.1] </document>
2009-08-21 00:50:57+0000 [-] 127.0.0.1 - - [21/Aug/2009:00:50:57 -0600] "POST /xml_dialplan/ HTTP/1.1" 200 455 "-" "freeswitch-xml/1.0"
2009-08-21 00:50:57+0000 [HTTPChannel,15,127.0.0.1] No profile name given, will use domain to lookup account
2009-08-21 00:50:57+0000 [HTTPChannel,15,127.0.0.1] ERROR!!
2009-08-21 00:50:57+0000 [HTTPChannel,15,127.0.0.1] Error generating directory: not all arguments converted during string formatting
2009-08-21 00:50:57+0000 [HTTPChannel,15,127.0.0.1] Traceback (most recent call last):
2009-08-21 00:50:57+0000 [HTTPChannel,15,127.0.0.1]   File "/usr/src/wikipbx/wikipbxweb/views.py", line 1915, in xml_dialplan
2009-08-21 00:50:57+0000 [HTTPChannel,15,127.0.0.1]     raw_xml = xmlconfig.directory_user(request)
2009-08-21 00:50:57+0000 [HTTPChannel,15,127.0.0.1]   File "/usr/src/wikipbx/xmlconfig.py", line 368, in directory_user
2009-08-21 00:50:57+0000 [HTTPChannel,15,127.0.0.1]     "WikiPBX.  Not known to cause bugs. " % domain)
2009-08-21 00:50:57+0000 [HTTPChannel,15,127.0.0.1] TypeError: not all arguments converted during string formatting
2009-08-21 00:50:57+0000 [-] 127.0.0.1 - - [21/Aug/2009:00:50:57 -0600] "POST /xml_dialplan/ HTTP/1.1" 200 127 "-" "freeswitch-xml/1.0"
2009-08-21 00:50:57+0000 [HTTPChannel,16,127.0.0.1] got post: <MultiValueDict: {'key_value': ['post_load_switch.conf'], 'key_name': ['name'], 'section': ['configurati
on'], 'hostname': ['wikipbx.worldteltech.com'], 'tag_name': ['configuration']}>
2009-08-21 00:50:57+0000 [-] 127.0.0.1 - - [21/Aug/2009:00:50:57 -0600] "POST /xml_dialplan/ HTTP/1.1" 200 127 "-" "freeswitch-xml/1.0"
2009-08-21 00:50:59+0000 [-] Starting factory <freepy.fseventlistener.FreeswitchEventListenerFactory instance at 0x957f78c>
2009-08-21 00:50:59+0000 [Uninitialized] General error: [Failure instance: Traceback: <type 'exceptions.TypeError'>: __init__() takes exactly 2 arguments (1 given)
2009-08-21 00:50:59+0000 [Uninitialized] /usr/src/freeswitch/scripts/python/freepy/fseventlistener.py:73:connectionMade
2009-08-21 00:50:59+0000 [Uninitialized] /usr/src/freeswitch/scripts/python/freepy/fseventlistener.py:221:conncb
2009-08-21 00:50:59+0000 [Uninitialized] /usr/local/lib/python2.5/site-packages/twisted/internet/defer.py:243:callback
2009-08-21 00:50:59+0000 [Uninitialized] /usr/local/lib/python2.5/site-packages/twisted/internet/defer.py:312:_startRunCallbacks
2009-08-21 00:50:59+0000 [Uninitialized] --- <exception caught here> ---
2009-08-21 00:50:59+0000 [Uninitialized] /usr/local/lib/python2.5/site-packages/twisted/internet/defer.py:328:_runCallbacks
2009-08-21 00:50:59+0000 [Uninitialized] /usr/src/freeswitch/scripts/python/freepy/fseventlistener.py:260:dologin
2009-08-21 00:50:59+0000 [Uninitialized] /usr/src/freeswitch/scripts/python/freepy/fseventlistener.py:86:login
2009-08-21 00:50:59+0000 [Uninitialized] /usr/src/freeswitch/scripts/python/freepy/request.py:183:__init__
2009-08-21 00:50:59+0000 [Uninitialized] /usr/src/freeswitch/scripts/python/freepy/loginrequest_sm.py:173:__init__
2009-08-21 00:50:59+0000 [Uninitialized] ]
2009-08-21 00:50:59+0000 [Uninitialized] ERROR!!
2009-08-21 00:50:59+0000 [Uninitialized] Event logger failed to connect: [Failure instance: Traceback: <type 'exceptions.TypeError'>: __init__() takes exactly 2 arguments (1 given)
2009-08-21 00:50:59+0000 [Uninitialized] /usr/src/freeswitch/scripts/python/freepy/fseventlistener.py:73:connectionMade
2009-08-21 00:50:59+0000 [Uninitialized] /usr/src/freeswitch/scripts/python/freepy/fseventlistener.py:221:conncb
2009-08-21 00:50:59+0000 [Uninitialized] /usr/local/lib/python2.5/site-packages/twisted/internet/defer.py:243:callback
2009-08-21 00:50:59+0000 [Uninitialized] /usr/local/lib/python2.5/site-packages/twisted/internet/defer.py:312:_startRunCallbacks
2009-08-21 00:50:59+0000 [Uninitialized] --- <exception caught here> ---
2009-08-21 00:50:59+0000 [Uninitialized] /usr/local/lib/python2.5/site-packages/twisted/internet/defer.py:328:_runCallbacks
2009-08-21 00:50:59+0000 [Uninitialized] /usr/src/freeswitch/scripts/python/freepy/fseventlistener.py:260:dologin
2009-08-21 00:50:59+0000 [Uninitialized] /usr/src/freeswitch/scripts/python/freepy/fseventlistener.py:86:login
2009-08-21 00:50:59+0000 [Uninitialized] /usr/src/freeswitch/scripts/python/freepy/request.py:183:__init__
2009-08-21 00:50:59+0000 [Uninitialized] /usr/src/freeswitch/scripts/python/freepy/loginrequest_sm.py:173:__init__
2009-08-21 00:50:59+0000 [Uninitialized] ]
2009-08-21 00:50:59+0000 [Uninitialized] Traceback (most recent call last):
2009-08-21 00:50:59+0000 [Uninitialized]   File "/usr/local/lib/python2.5/site-packages/twisted/internet/defer.py", line 328, in _runCallbacks
2009-08-21 00:50:59+0000 [Uninitialized]     self.result = callback(self.result, *args, **kw)
2009-08-21 00:50:59+0000 [Uninitialized]   File "/usr/src/freeswitch/scripts/python/freepy/fseventlistener.py", line 260, in dologin
2009-08-21 00:50:59+0000 [Uninitialized]     return self.protocol.login(self.passwd)
2009-08-21 00:50:59+0000 [Uninitialized]   File "/usr/src/freeswitch/scripts/python/freepy/fseventlistener.py", line 86, in login
2009-08-21 00:50:59+0000 [Uninitialized]     req = request.LoginRequest()
2009-08-21 00:50:59+0000 [Uninitialized]   File "/usr/src/freeswitch/scripts/python/freepy/request.py", line 183, in __init__
2009-08-21 00:50:59+0000 [Uninitialized]     self._fsm = loginrequest_sm.LoginRequest_sm(self)
2009-08-21 00:50:59+0000 [Uninitialized]   File "/usr/src/freeswitch/scripts/python/freepy/loginrequest_sm.py", line 173, in __init__
2009-08-21 00:50:59+0000 [Uninitialized]     statemap.FSMContext.__init__(self)
2009-08-21 00:50:59+0000 [Uninitialized] TypeError: __init__() takes exactly 2 arguments (1 given)
Last edited on 1250845729|%e %b %Y, %H:%M %Z|agohover By bbhenry + Show more
Reply  |  Options
Unfold Re: Event Socket Issue by bbhenrybbhenry, 1250845638|%e %b %Y, %H:%M %Z|agohover
Re: Event Socket Issue
stas_shtinstas_shtin 1250876376|%e %b %Y, %H:%M %Z|agohover

I suppose that this error will be fixed by installing SMC version 5.0.2 from http://downloads.sourceforge.net/sourceforge/smc/smc_5_0_2.tgz . Installation instructions has been changed to 6.0.0 some time ago, but looks like it has some minor backwards incompatible changes.

WikiPBX won't use that lib in the upcoming release anyway, so it's easier to revert to the tested version rather than updated one that won't give us any benefits anyway.

Reply  |  Options
Unfold Re: Event Socket Issue by stas_shtinstas_shtin, 1250876376|%e %b %Y, %H:%M %Z|agohover
Re: Event Socket Issue
bbhenrybbhenry 1251161275|%e %b %Y, %H:%M %Z|agohover

Do I need to uninstall smc 6.0.0? if so, how do I do that?

Reply  |  Options
Unfold Re: Event Socket Issue by bbhenrybbhenry, 1251161275|%e %b %Y, %H:%M %Z|agohover
Re: Event Socket Issue
tleydentleyden 1250883003|%e %b %Y, %H:%M %Z|agohover

Yes, it was a bug in the documentation .. introduced by pumpkineater.

Reply  |  Options
Unfold Re: Event Socket Issue by tleydentleyden, 1250883003|%e %b %Y, %H:%M %Z|agohover
Re: Event Socket Issue
pumpkineaterpumpkineater 1251031183|%e %b %Y, %H:%M %Z|agohover

Oops, overlooked in a hurry.
sorry for that

Reply  |  Options
Unfold Re: Event Socket Issue by pumpkineaterpumpkineater, 1251031183|%e %b %Y, %H:%M %Z|agohover
Re: Event Socket Issue
bbhenrybbhenry 1251168719|%e %b %Y, %H:%M %Z|agohover

Hi, I still get the same error after installing smc 5.0.2. Do I need to somehow uninstall smc 6.0.0 first?
How do I make sure wikipbx is using smc 5.0.2 instead of 6.0.0?

thanks

Reply  |  Options
Unfold Re: Event Socket Issue by bbhenrybbhenry, 1251168719|%e %b %Y, %H:%M %Z|agohover
Re: Event Socket Issue
tleydentleyden 1251221614|%e %b %Y, %H:%M %Z|agohover

You shouldn't need to .. but you could try manually deleting /usr/lib/python2.x/site-packages/statemap.py and statemap.pyc (where x is the version of python you are using .. buy maybe check all to be safe)

Then re-install smc 5.0.2

wget http://downloads.sourceforge.net/sourceforge/smc/smc_5_0_2.tgz
tar xvfz smc_5_0_2.tgz
cd smc_5_0_2/lib/Python
python setup.py install

Reply  |  Options
Unfold Re: Event Socket Issue by tleydentleyden, 1251221614|%e %b %Y, %H:%M %Z|agohover
Re: Event Socket Issue
tleydentleyden 1251221649|%e %b %Y, %H:%M %Z|agohover

No big deal ..

So does it work for you using the smc 6.0.0 version?

Reply  |  Options
Unfold Re: Event Socket Issue by tleydentleyden, 1251221649|%e %b %Y, %H:%M %Z|agohover
New Post
page_revision: 0, last_edited: 1226259295|%e %b %Y, %H:%M %Z (%O ago)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License