[Freeswitch-users] problems in Using Embedded FreeSWITCH

xl127 x.liu at hw.ac.uk
Tue Nov 22 15:36:06 MSK 2011


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 
> <mailto: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 <mailto: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
>     <mailto: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 
> <mailto:MSN%3Aanthony_minessale at hotmail.com>
> GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com 
> <mailto:PAYPAL%3Aanthony.minessale at gmail.com>
> IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
>
> FreeSWITCH Developer Conference
> sip:888 at conference.freeswitch.org 
> <mailto:sip%3A888 at conference.freeswitch.org>
> googletalk:conf+888 at conference.freeswitch.org 
> <mailto:googletalk%3Aconf%2B888 at conference.freeswitch.org>
> pstn:+19193869900
>
>
> _________________________________________________________________________
> 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



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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20111122/f83f28c0/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hw_uni_of_year.jpg
Type: image/jpeg
Size: 4803 bytes
Desc: not available
Url : http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20111122/f83f28c0/attachment-0001.jpg 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list