[Freeswitch-users] problems in Using Embedded FreeSWITCH
Anthony Minessale
anthony.minessale at gmail.com
Tue Nov 22 19:47:55 MSK 2011
maybe your user does not have permissions to read and write the target
install dir
try to chown -R to your user on all of /usr/local/freeswitch
you might want to try things the other way around and embedd your app in FS
rather than embed FS in your app.
On Tue, Nov 22, 2011 at 10:20 AM, xl127 <x.liu at hw.ac.uk> wrote:
> If I switch to root user I can successfully run my embedded FS app:
> FS_Embed.
> but it will fails if I run it as non-root user.
>
> One thing I can think of to do is re-install FS as non-root.
> I tried but it failed to access
> /usr/lib/python2.7/site-packages/freeswitch.py due to the permissions.
>
>
>
> On 22/11/11 16:08, Anthony Minessale wrote:
>
> i know you needed apr, not sure, maybe try strace or gdb
>
>
> On Tue, Nov 22, 2011 at 6:36 AM, xl127 <x.liu at hw.ac.uk> wrote:
>
>> Thanks for the advice!
>>
>> I tried it but still got the same error.
>>
>> I added the #include <apr_general.h> and found it from
>> /usr/local/sr/freeswitch/libs/apr/include
>> rather than from the installed directory /usr/local/freeswitch. Hope it
>> is the right one.
>>
>> any more clues?
>>
>>
>>
>> On 22/11/11 01:38, Anthony Minessale wrote:
>>
>> try
>>
>> if (apr_initialize() != SWITCH_STATUS_SUCCESS) {
>> fprintf(stderr, "FATAL ERROR! Could not initialize APR\n");
>> return 255;
>> }
>>
>> early on in main()
>>
>>
>> On Mon, Nov 21, 2011 at 1:12 PM, xl127 <x.liu at hw.ac.uk> wrote:
>>
>>> Hello,
>>>
>>> Following the instructions in
>>> http://wiki.freeswitch.org/wiki/Embedding_FreeSWITCH
>>> I am trying to use Embedded FreeSwitch.
>>>
>>> I installed FS in Fedora linux as a root user in /usr/local/freeswitch.
>>> Now as non-root user,
>>> I compiled following codes:
>>>
>>> #include <switch.h>
>>> int main(int argc, char** argv)
>>> {
>>> switch_core_flag_t flags = SCF_USE_SQL;
>>> bool console = true;
>>> const char *err = NULL;
>>> switch_core_set_globals();
>>> switch_core_init_and_modload(flags, console ? SWITCH_TRUE :
>>> SWITCH_FALSE, &err);
>>> switch_core_runtime_loop(!console);
>>> return 0;
>>> }
>>>
>>> And copy the executable and conf, mod, contents of lib of the installed
>>> FS to my $MyWorkingDir.
>>>
>>> My directory structure looks like:
>>> MyWorkingDir--bin/ (contains my executable: FS_Embed)
>>> --conf/
>>> --mod/
>>> --lib/
>>> --grammars
>>> --sounds
>>> --scripts
>>> --log
>>> (I also tried to copy the contents of lib directory into MyWorkingDir)
>>>
>>> When I run my embedded FS: ./FS_Embed, I got error
>>>
>>> 2011-11-21 18:46:26.606783 [INFO] switch_event.c:631 Activate Eventing
>>> Engine.
>>> 2011-11-21 18:46:26.617941 [DEBUG] switch_event.c:610 Create event
>>> dispatch thread 0
>>> FS_Embed: src/switch_xml.c:2225: switch_xml_open_cfg: Assertion
>>> `MAIN_XML_ROOT != ((void *)0)' failed.
>>> Aborted (core dumped)
>>>
>>> and occasionally on another run, I got error:
>>>
>>> 2011-11-21 16:56:51.756040 [INFO] switch_event.c:631 Activate Eventing
>>> Engine.
>>> 2011-11-21 16:56:51.767198 [DEBUG] switch_event.c:610 Create event
>>> dispatch thread 0
>>> Segmentation fault (core dumped)
>>>
>>> It looks like there are some things wrong with my Environment Setup for
>>> Embedded FS,
>>> but after a while of checking/trying/googling I couldn't find what's
>>> wrong.
>>>
>>> Any advice please?
>>>
>>> Many thanks!
>>> Xing
>>>
>>>
>>>
>>> --
>>> Heriot-Watt University is a Scottish charity
>>> registered under charity number SC000278.
>>>
>>> Heriot-Watt University is the Sunday Times
>>> Scottish University of the Year 2011-2012
>>>
>>>
>>>
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>>
>>>
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://wiki.freeswitch.org
>>> http://www.cluecon.com
>>>
>>> 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
>>>
>>
>>
>>
>> --
>> Anthony Minessale II
>>
>> FreeSWITCH http://www.freeswitch.org/
>> ClueCon http://www.cluecon.com/
>> Twitter: http://twitter.com/FreeSWITCH_wire
>>
>> AIM: anthm
>> MSN:anthony_minessale at hotmail.com
>> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
>> IRC: irc.freenode.net #freeswitch
>>
>> FreeSWITCH Developer Conference
>> sip:888 at conference.freeswitch.org
>> googletalk:conf+888 at conference.freeswitch.org
>> pstn:+19193869900
>>
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:consulting at freeswitch.orghttp://www.freeswitchsolutions.com
>>
>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server
>>
>> Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
>>
>> FreeSWITCH-users mailing listFreeSWITCH-users at lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.freeswitch.org
>>
>>
>>
>> ------------------------------
>>
>> [image: MailScanner Signature HW] *Heriot-Watt University is the
>> Sunday Times
>>
>> Scottish University of the Year 2011-2012
>> *
>>
>> Heriot-Watt University is a Scottish charity
>> registered under charity number SC000278.
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>>
>>
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://wiki.freeswitch.org
>> http://www.cluecon.com
>>
>> 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
>>
>>
>
>
> --
> Anthony Minessale II
>
> FreeSWITCH http://www.freeswitch.org/
> ClueCon http://www.cluecon.com/
> Twitter: http://twitter.com/FreeSWITCH_wire
>
> AIM: anthm
> MSN:anthony_minessale at hotmail.com
> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
> IRC: irc.freenode.net #freeswitch
>
> FreeSWITCH Developer Conference
> sip:888 at conference.freeswitch.org
> googletalk:conf+888 at conference.freeswitch.org
> pstn:+19193869900
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:consulting at freeswitch.orghttp://www.freeswitchsolutions.com
>
> FreeSWITCH-powered IP PBX: The CudaTel Communication Server
>
> Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
>
> FreeSWITCH-users mailing listFreeSWITCH-users at lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.freeswitch.org
>
>
>
> ------------------------------
>
> [image: MailScanner Signature HW] *Heriot-Watt University is the Sunday
> Times
> Scottish University of the Year 2011-2012*
>
> Heriot-Watt University is a Scottish charity
> registered under charity number SC000278.
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
>
>
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> 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
>
>
--
Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm
MSN:anthony_minessale at hotmail.com
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org
googletalk:conf+888 at conference.freeswitch.org
pstn:+19193869900
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20111122/9aae9019/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 4803 bytes
Desc: not available
Url : http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20111122/9aae9019/attachment-0002.jpe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 4803 bytes
Desc: not available
Url : http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20111122/9aae9019/attachment-0003.jpe
Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users
mailing list