Initialize System - Create SIP Profile Issues
Forum » WikiPBX / Technical Support » Initialize System - Create SIP Profile Issues
Started by: lluisrieralluisriera
On: 1272283546|%e %b %Y, %H:%M %Z|agohover
Number of posts: 27
rss icon RSS: New posts
Initialize System - Create SIP Profile Issues
lluisrieralluisriera 1272283546|%e %b %Y, %H:%M %Z|agohover

Hi,

I'm following instructions on User Manual 0.8, and I'm trying to setup a sip profile but I'm having some issuess.
Sip profile is created on mysql but freeswitch doesn't show it when I type sofia status, I've to restart freeswitch.

When I sip profile is created or deleted I got these errors on httpd log:
[Mon Apr 26 11:48:52 2010] [error] restart_profiles called
[Mon Apr 26 11:48:52 2010] [error] get_fs_connections()
[Mon Apr 26 11:48:52 2010] [error] 1 eventsockets
[Mon Apr 26 11:48:52 2010] [error] creating eslconnection

When i create a profile, browser stays loading forever, but it seems that finally the profile is created (at least all the profile info is in mysql).
When i delete a profile, browser stays loading forever, but it seems that finally the profile is deleted (at least all the profile info is in mysql).

Any clue on what is happening?

Thanks,

Lluís

Reply  |  Options
Unfold Initialize System - Create SIP Profile Issues by lluisrieralluisriera, 1272283546|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
stas_shtinstas_shtin 1272285883|%e %b %Y, %H:%M %Z|agohover

There was another user with the same problems - http://wikipbx.subwiki.com/forum/t-233617/problems-getting-0-8-running-on-debian . Turns out everything started working after reinstalling apache and mod_wsgi in his case.

Reply  |  Options
Unfold Re: Initialize System - Create SIP Profile Issues by stas_shtinstas_shtin, 1272285883|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
lluisrieralluisriera 1272370749|%e %b %Y, %H:%M %Z|agohover

I'm using Centos 5.4, and after reinstalling apache and mod_wsgi it happens the same. It seems that fs_util.py stops in

yield ESL.ESLconnection(
socket.listen_ip, str(socket.listen_port),
socket.password)

I've tested from python console:
con = ESL.ESLconnection("localhost","8021","ClueCon")

and python doesn't complain…

I would like to fix it without installing all from scratch…any ideas?

Thanks,

Lluís

Reply  |  Options
Unfold Re: Initialize System - Create SIP Profile Issues by lluisrieralluisriera, 1272370749|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
stas_shtinstas_shtin 1272396843|%e %b %Y, %H:%M %Z|agohover

I probably won't be able to help you here, sorry. Did you try restarting apache?

Reply  |  Options
Unfold Re: Initialize System - Create SIP Profile Issues by stas_shtinstas_shtin, 1272396843|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
tleydentleyden 1272414372|%e %b %Y, %H:%M %Z|agohover

Do you have SE Linux enabled? If I remember correctly Cent OS has it enabled by default. This could be causing the issue .. try disabling it if its enabled.

Also to make the test more realistic, maybe try to run the python shell as the same user that apache runs under, and try running

con = ESL.ESLconnection("localhost","8021","ClueCon")

Does it still work?

Reply  |  Options
Unfold Re: Initialize System - Create SIP Profile Issues by tleydentleyden, 1272414372|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
lluisrieralluisriera 1272442411|%e %b %Y, %H:%M %Z|agohover

I disabled SeLinux during Centos base installation, and now remain still disabled.

I've enabled apache user to /bin/bash and when I execute python as apache:

Python 2.4.3 (#1, Sep 3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import ESL

Traceback (most recent call last):
File "<stdin>", line 1, in ?
ImportError: No module named ESL

It uses Python 2.4.3 and it should use Python 2.6.5, an is not able to import ESL library…so it seems that I should change default python console for apache? Could you tell how can I do that?

Thanks,

Lluís

Reply  |  Options
Unfold Re: Initialize System - Create SIP Profile Issues by lluisrieralluisriera, 1272442411|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
lluisrieralluisriera 1272451873|%e %b %Y, %H:%M %Z|agohover

I've added WSGIPythonHome /opt/python2.6 in httpd.conf and restarted apache; but it still happens the same.

Keep googling :-)

Reply  |  Options
Unfold Re: Initialize System - Create SIP Profile Issues by lluisrieralluisriera, 1272451873|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
stas_shtinstas_shtin 1272460545|%e %b %Y, %H:%M %Z|agohover

So can you import ESL module from python 2.6? I think that your problem is caused by compiling it with python2.4, which gave you module that works only with 2.4. You should probably edit the /path/to/freeswitch/libs/esl/python/Makefile file and modify it to point to python2.6 location instead of default system-wide python.

Reply  |  Options
Unfold Re: Initialize System - Create SIP Profile Issues by stas_shtinstas_shtin, 1272460545|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
lluisrieralluisriera 1272524121|%e %b %Y, %H:%M %Z|agohover

I've done that yet to avoid a segmentation fault, as you can see in ESL.so.

[root@wikipbx python]# ldd _ESL.so
libpython2.6.so.1.0 => /opt/python2.6/lib/libpython2.6.so.1.0 (0x00002ad1010bf000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002ad10146e000)
libm.so.6 => /lib64/libm.so.6 (0x00002ad10176e000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002ad1019f2000)
libc.so.6 => /lib64/libc.so.6 (0x00002ad101c00000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002ad101f57000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002ad102173000)
libutil.so.1 => /lib64/libutil.so.1 (0x00002ad102377000)
/lib64/ld-linux-x86-64.so.2 (0x00002ad100c7a000)

Reply  |  Options
Unfold Re: Initialize System - Create SIP Profile Issues by lluisrieralluisriera, 1272524121|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
tleydentleyden 1272473048|%e %b %Y, %H:%M %Z|agohover

Apache is going to use the version of python based on what the mod_wsgi.so object is linked against.

Please try to find the mod_wsgi.so object (not sure where CentOS puts this, on Ubuntu its in /usr/lib/apache2/modules/mod_wsgi.so)

then run

$ ldd mod_wsgi.so

What's the output?

Reply  |  Options
Unfold Re: Initialize System - Create SIP Profile Issues by tleydentleyden, 1272473048|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
lluisrieralluisriera 1272524212|%e %b %Y, %H:%M %Z|agohover

Here you have:

[root@wikipbx python]# ldd /usr/lib64/httpd/modules/mod_wsgi.so
libpython2.6.so.1.0 => /opt/python2.6/lib/libpython2.6.so.1.0 (0x00002ae0bcf76000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00002ae0bd325000)
libdl.so.2 => /lib64/libdl.so.2 (0x00002ae0bd540000)
libutil.so.1 => /lib64/libutil.so.1 (0x00002ae0bd745000)
libm.so.6 => /lib64/libm.so.6 (0x00002ae0bd948000)
libc.so.6 => /lib64/libc.so.6 (0x00002ae0bdbcb000)
/lib64/ld-linux-x86-64.so.2 (0x00002ae0bcb2b000)

Reply  |  Options
Unfold Re: Initialize System - Create SIP Profile Issues by lluisrieralluisriera, 1272524212|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
tleydentleyden 1272657882|%e %b %Y, %H:%M %Z|agohover

OK, I give up. What's the answer? :)

How are your python skills? If we tell you to "create a trivial wsgi script which tries to make an ESL connection", could you handle it? Let me know and I will elaborate.

Unfold Re: Initialize System - Create SIP Profile Issues by tleydentleyden, 1272657882|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
lluisrieralluisriera 1272871078|%e %b %Y, %H:%M %Z|agohover

I'm a complet newbie in python; if you could help me on that script and how to execute it, it would be great.

Lluís

Unfold Re: Initialize System - Create SIP Profile Issues by lluisrieralluisriera, 1272871078|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
lluisrieralluisriera 1273164980|%e %b %Y, %H:%M %Z|agohover

I've been able to execute this from python console:

con=ESL.ESLconnection("127.0.0.1","8021","ClueCon")
esl = con.sendRecv('api sofia status')
print(esl.getBody())

Name Type Data State

external profile sip:612.35.61.271|aifos_dom#612.35.61.271|aifos_dom:5060 RUNNING (0)
ticsolutions.lan alias external ALIASED

1 profile 1 alias

So, it seems ESL is working fine.

I've been able to install all running ok on Debian Lenny, but our company is more used to Centos 5; I think is a problem related to httpd but I really don't know how to fix it.

I will try to follow this howto to fix apache problem:
http://www.freshblurbs.com/tutorial-installing-django-1-1-centos-5-4

Has anybody WikiPBX 0.8 running on Centos 5.4? Any help would be appreciated.

Unfold Re: Initialize System - Create SIP Profile Issues by lluisrieralluisriera, 1273164980|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
stas_shtinstas_shtin 1273171767|%e %b %Y, %H:%M %Z|agohover

It could be useful to run the same code from apache process rather than from console. For example, put it in wikipbx.wsgi file. You should see the same message inside apache error log after viewing any wikibpx page. If it won't happen and you'll get hanging connections on all pages, then there's some problem between apache and ESL module.

There are people running wikipbx on centos, but none of the core developers do it. One of the users reported the same issues as you had, as I've mentioned before.

Unfold Re: Initialize System - Create SIP Profile Issues by stas_shtinstas_shtin, 1273171767|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
tleydentleyden 1273171864|%e %b %Y, %H:%M %Z|agohover

Thanks for reporting this.

If we find anything out on this we'll let you know.

Unfold Re: Initialize System - Create SIP Profile Issues by tleydentleyden, 1273171864|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
lluisrieralluisriera 1273503622|%e %b %Y, %H:%M %Z|agohover

I've tested ESL connection directly on wikipbx.wsgi and it doesn't work, it hangs forever!!

Unfold Re: Initialize System - Create SIP Profile Issues by lluisrieralluisriera, 1273503622|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
stas_shtinstas_shtin 1273515938|%e %b %Y, %H:%M %Z|agohover

Can you check if adding this directive to apache config makes any difference:

WSGIApplicationGroup %{GLOBAL}

Put it near other WSGI configuration directives and restart apache.

Unfold Re: Initialize System - Create SIP Profile Issues by stas_shtinstas_shtin, 1273515938|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
lluisrieralluisriera 1273522725|%e %b %Y, %H:%M %Z|agohover

I'll check your recommendation tomorrow.

Today, what I've found is that when I print(sys.executable) in wikipbx.wsgi it logs /usr/bin/python instead of /opt/python2.5/bin/python.

I've found this howto
http://chester.blog.br/archives/2010/04/howto-python-2-6-5-django-via-passenger-wsgi-at-dreamhost.html

and I've inserted next lines in wsgi script to change python executable path:

INTERP = "/opt/python2.5/bin/python"
if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)

but it stops complaining "can't find mod_wsgi module"

Tomorrow more testing :-)

Unfold Re: Initialize System - Create SIP Profile Issues by lluisrieralluisriera, 1273522725|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
stas_shtinstas_shtin 1273526937|%e %b %Y, %H:%M %Z|agohover

That approach looks like a really bad idea. You should set correct python executable with mod_wsgi configuration, not by forcing OS to replace already running process. See this message for some suggestions.

Unfold Re: Initialize System - Create SIP Profile Issues by stas_shtinstas_shtin, 1273526937|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
lluisrieralluisriera 1273559649|%e %b %Y, %H:%M %Z|agohover

when I print sys.path from wikipbx.wsgi I get:
['/usr/src/wikipbx', '/usr/src/django', '/usr/src/freeswitch/libs/esl/python', '/opt/python2.5/lib/python2.5/site-packages/setuptools-0.6c11-py2.5.egg', '/opt/python2.5/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-x86_64.egg', '/opt/python2.5/lib/python2.5/site-packages/pytz-2008i-py2.5.egg', '/opt/python2.5/lib/python25.zip', '/opt/python2.5/lib/python2.5', '/opt/python2.5/lib/python2.5/plat-linux2', '/opt/python2.5/lib/python2.5/lib-tk', '/opt/python2.5/lib/python2.5/lib-dynload', '/opt/python2.5/lib/python2.5/site-packages']

So I've added a line in wikipbx.wsgi (as suggested in your link) to set sys.path[0:0], but it happens the same.

Unfold Re: Initialize System - Create SIP Profile Issues by lluisrieralluisriera, 1273559649|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
stas_shtinstas_shtin 1273562499|%e %b %Y, %H:%M %Z|agohover
Presuming that:

  /home/toinbis/Desktop/programming/project/bin/python

is the Python you wanted used, what do you get when you run that and do:

  import sys
  print sys.prefix

Whatever the value of sys.prefix is for the Python you want used, add it as:

  WSGIPythonHome <value of sys.prefix>

Replacing <value of sys.prefix> as appropriate.

Do not set WSGIPythonExecutable in this case.

Alternatively, set:

  WSGIPythonExecutable /home/toinbis/Desktop/programming/project/bin/python

Do not set WSGIPythonHome in this case.

Please try that.

Unfold Re: Initialize System - Create SIP Profile Issues by stas_shtinstas_shtin, 1273562499|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
lluisrieralluisriera 1273565248|%e %b %Y, %H:%M %Z|agohover

Tested and not working.

Reply  |  Options
Unfold Re: Initialize System - Create SIP Profile Issues by lluisrieralluisriera, 1273565248|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
lluisrieralluisriera 1272460505|%e %b %Y, %H:%M %Z|agohover

I've tested all options recommended here:
http://groups.google.com/group/modwsgi/msg/fc8ffd400113627e

and now when I login as apache in bash when I type python it goes to 2.6.5 version. I think it's an step forward but I've got the same error.

Reply  |  Options
Unfold Re: Initialize System - Create SIP Profile Issues by lluisrieralluisriera, 1272460505|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
bvenkybvenky 1273203976|%e %b %Y, %H:%M %Z|agohover

Hi,

I have had the experience of installing wikipbx on centos. the main areas where there was a problem are as below:

1. SELinux disabled
2. Parallel install of python 2.6+
3. Compiling freeswitch - pymod with python 2.6+
4. Correct wsgi for python 2.6+
5. correct version of python used for wsgi, esl

I have tried capturing the install process for 2.6+ in my blog here:
http://www.venkysblog.com/2009/12/centos-python-wsgi-dango/

Check if this helps.

BTW - Welcome to python in centos.

Reply  |  Options
Unfold Re: Initialize System - Create SIP Profile Issues by bvenkybvenky, 1273203976|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
lluisrieralluisriera 1273483466|%e %b %Y, %H:%M %Z|agohover

Yes I've followed your howto and all modules are right (tied to python 2.6), would you mind to explain how your apache environment is configured?

Thank you very much

Reply  |  Options
Unfold Re: Initialize System - Create SIP Profile Issues by lluisrieralluisriera, 1273483466|%e %b %Y, %H:%M %Z|agohover
Re: Initialize System - Create SIP Profile Issues
lluisrieralluisriera 1273502994|%e %b %Y, %H:%M %Z|agohover

I've tested python 2.5 also, being unsuccesful :-(

Reply  |  Options
Unfold Re: Initialize System - Create SIP Profile Issues by lluisrieralluisriera, 1273502994|%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