<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    If I switch to root user I can successfully run my embedded FS app:
    FS_Embed.<br>
    but it will fails if I run it as non-root user.<br>
    <br>
    One thing I can think of to do is re-install FS as non-root.<br>
    I tried but it failed to access
    /usr/lib/python2.7/site-packages/freeswitch.py due to the
    permissions.<br>
    <br>
    <br>
    On 22/11/11 16:08, Anthony Minessale wrote:
    <blockquote
cite="mid:CAKbxfG-weTahQDhJzV3xRQd9LMBoPJKV+mjLjUGp=xjoCtCp2A@mail.gmail.com"
      type="cite">i know you needed apr, not sure, maybe try strace or
      gdb
      <div><br>
        <br>
        <div class="gmail_quote">On Tue, Nov 22, 2011 at 6:36 AM, xl127
          <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:x.liu@hw.ac.uk">x.liu@hw.ac.uk</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex;">
            <div text="#000000" bgcolor="#FFFFFF"> Thanks for the
              advice!<br>
              <br>
              I tried it but still got the same error. <br>
              <br>
              I added the #include &lt;apr_general.h&gt; and found it
              from /usr/local/sr/freeswitch/libs/apr/include<br>
              rather than from the installed directory
              /usr/local/freeswitch. Hope it is the right one.<br>
              <br>
              any more clues?
              <div>
                <div class="h5"><br>
                  <br>
                  <br>
                  On 22/11/11 01:38, Anthony Minessale wrote:
                  <blockquote type="cite">try&nbsp;
                    <div><br>
                    </div>
                    <div>
                      <div>&nbsp; &nbsp; if (apr_initialize() !=
                        SWITCH_STATUS_SUCCESS) {</div>
                      <div>&nbsp; &nbsp; &nbsp; &nbsp; fprintf(stderr, "FATAL ERROR! Could
                        not initialize APR\n");</div>
                      <div>&nbsp; &nbsp; &nbsp; &nbsp; return 255;</div>
                      <div>&nbsp; &nbsp; }</div>
                      <div> <br>
                      </div>
                      <div>early on in main()</div>
                      <div><br>
                      </div>
                      <br>
                      <div class="gmail_quote">On Mon, Nov 21, 2011 at
                        1:12 PM, xl127 <span dir="ltr">&lt;<a
                            moz-do-not-send="true"
                            href="mailto:x.liu@hw.ac.uk" target="_blank">x.liu@hw.ac.uk</a>&gt;</span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex"> Hello,<br>
                          <br>
                          Following the instructions in<br>
                          <a moz-do-not-send="true"
                            href="http://wiki.freeswitch.org/wiki/Embedding_FreeSWITCH"
                            target="_blank">http://wiki.freeswitch.org/wiki/Embedding_FreeSWITCH</a><br>
                          I am trying to use Embedded FreeSwitch.<br>
                          <br>
                          I installed FS in Fedora linux as a root user
                          in /usr/local/freeswitch.<br>
                          Now as non-root user,<br>
                          I compiled following codes:<br>
                          <br>
                          #include &lt;switch.h&gt;<br>
                          int main(int argc, char** argv)<br>
                          {<br>
                          &nbsp; &nbsp; switch_core_flag_t flags = SCF_USE_SQL;<br>
                          &nbsp; &nbsp; bool console = true;<br>
                          &nbsp; &nbsp; const char *err = NULL;<br>
                          &nbsp; &nbsp; switch_core_set_globals();<br>
                          &nbsp; &nbsp; switch_core_init_and_modload(flags,
                          console ? SWITCH_TRUE :<br>
                          SWITCH_FALSE, &amp;err);<br>
                          &nbsp; &nbsp; switch_core_runtime_loop(!console);<br>
                          &nbsp; &nbsp; return 0;<br>
                          }<br>
                          <br>
                          And copy the executable and conf, mod,
                          contents of lib of the installed<br>
                          FS to my $MyWorkingDir.<br>
                          <br>
                          My directory structure looks like:<br>
                          &nbsp; &nbsp;MyWorkingDir--bin/ &nbsp;(contains my
                          executable: FS_Embed)<br>
                          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --conf/<br>
                          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --mod/<br>
                          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --lib/<br>
                          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --grammars<br>
                          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --sounds<br>
                          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --scripts<br>
                          &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --log<br>
                          (I also tried to copy the contents of lib
                          directory into MyWorkingDir)<br>
                          <br>
                          When I run my embedded FS: ./FS_Embed, I got
                          error<br>
                          <br>
                          2011-11-21 18:46:26.606783 [INFO]
                          switch_event.c:631 Activate Eventing<br>
                          Engine.<br>
                          2011-11-21 18:46:26.617941 [DEBUG]
                          switch_event.c:610 Create event<br>
                          dispatch thread 0<br>
                          FS_Embed: src/switch_xml.c:2225:
                          switch_xml_open_cfg: Assertion<br>
                          `MAIN_XML_ROOT != ((void *)0)' failed.<br>
                          Aborted (core dumped)<br>
                          <br>
                          and occasionally on another run, I got error:<br>
                          <br>
                          2011-11-21 16:56:51.756040 [INFO]
                          switch_event.c:631 Activate Eventing<br>
                          Engine.<br>
                          2011-11-21 16:56:51.767198 [DEBUG]
                          switch_event.c:610 Create event<br>
                          dispatch thread 0<br>
                          Segmentation fault (core dumped)<br>
                          <br>
                          It looks like there are some things wrong with
                          my Environment Setup for<br>
                          Embedded FS,<br>
                          but after a while of checking/trying/googling
                          I couldn't find what's wrong.<br>
                          <br>
                          Any advice please?<br>
                          <br>
                          Many thanks!<br>
                          Xing<br>
                          <br>
                          <br>
                          <br>
                          --<br>
                          Heriot-Watt University is a Scottish charity<br>
                          registered under charity number SC000278.<br>
                          <br>
                          Heriot-Watt University is the Sunday Times<br>
                          Scottish University of the Year 2011-2012<br>
                          <br>
                          <br>
                          <br>
_________________________________________________________________________<br>
                          Professional FreeSWITCH Consulting Services:<br>
                          <a moz-do-not-send="true"
                            href="mailto:consulting@freeswitch.org"
                            target="_blank">consulting@freeswitch.org</a><br>
                          <a moz-do-not-send="true"
                            href="http://www.freeswitchsolutions.com"
                            target="_blank">http://www.freeswitchsolutions.com</a><br>
                          <br>
                          FreeSWITCH-powered IP PBX: The CudaTel
                          Communication Server<br>
                          <a moz-do-not-send="true"
                            href="http://www.cudatel.com"
                            target="_blank">http://www.cudatel.com</a><br>
                          <br>
                          Official FreeSWITCH Sites<br>
                          <a moz-do-not-send="true"
                            href="http://www.freeswitch.org"
                            target="_blank">http://www.freeswitch.org</a><br>
                          <a moz-do-not-send="true"
                            href="http://wiki.freeswitch.org"
                            target="_blank">http://wiki.freeswitch.org</a><br>
                          <a moz-do-not-send="true"
                            href="http://www.cluecon.com"
                            target="_blank">http://www.cluecon.com</a><br>
                          <br>
                          FreeSWITCH-users mailing list<br>
                          <a moz-do-not-send="true"
                            href="mailto:FreeSWITCH-users@lists.freeswitch.org"
                            target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
                          <a moz-do-not-send="true"
                            href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
                            target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
                          UNSUBSCRIBE:<a moz-do-not-send="true"
                            href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
                            target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
                          <a moz-do-not-send="true"
                            href="http://www.freeswitch.org"
                            target="_blank">http://www.freeswitch.org</a><br>
                        </blockquote>
                      </div>
                      <br>
                      <br clear="all">
                      <div><br>
                      </div>
                      -- <br>
                      Anthony Minessale II<br>
                      <br>
                      FreeSWITCH <a moz-do-not-send="true"
                        href="http://www.freeswitch.org/"
                        target="_blank">http://www.freeswitch.org/</a><br>
                      ClueCon <a moz-do-not-send="true"
                        href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
                      Twitter: <a moz-do-not-send="true"
                        href="http://twitter.com/FreeSWITCH_wire"
                        target="_blank">http://twitter.com/FreeSWITCH_wire</a><br>
                      <br>
                      AIM: anthm<br>
                      <a moz-do-not-send="true"
                        href="mailto:MSN%3Aanthony_minessale@hotmail.com"
                        target="_blank">MSN:anthony_minessale@hotmail.com</a><br>
                      GTALK/JABBER/<a moz-do-not-send="true"
                        href="mailto:PAYPAL%3Aanthony.minessale@gmail.com"
                        target="_blank">PAYPAL:anthony.minessale@gmail.com</a><br>
                      IRC: <a moz-do-not-send="true"
                        href="http://irc.freenode.net" target="_blank">irc.freenode.net</a>
                      #freeswitch<br>
                      <br>
                      FreeSWITCH Developer Conference<br>
                      <a moz-do-not-send="true"
                        href="mailto:sip%3A888@conference.freeswitch.org"
                        target="_blank">sip:888@conference.freeswitch.org</a><br>
                      <a moz-do-not-send="true"
                        href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org"
                        target="_blank">googletalk:conf+888@conference.freeswitch.org</a><br>
                      pstn:<a moz-do-not-send="true"
                        href="tel:%2B19193869900" value="+19193869900"
                        target="_blank">+19193869900</a><br>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                    <pre>_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a moz-do-not-send="true" href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a moz-do-not-send="true" href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a moz-do-not-send="true" href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a moz-do-not-send="true" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a moz-do-not-send="true" href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
<a moz-do-not-send="true" href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a moz-do-not-send="true" href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a moz-do-not-send="true" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a moz-do-not-send="true" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a moz-do-not-send="true" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</pre>
                  </blockquote>
                  <br>
                  <br>
                </div>
              </div>
              <hr>
              <br>
              <img src="cid:part1.09030104.01070700@hw.ac.uk"
                alt="MailScanner Signature HW" align="left">
              <font face="arial,helvetica">
                &nbsp; <b>Heriot-Watt University is the Sunday Times
                  <div class="im"><br>
                    &nbsp; Scottish University of the Year 2011-2012</div>
                </b>
              </font>
              <br>
              <div class="im"><br>
                <font face="arial,helvetica" size="-1">
                  &nbsp; Heriot-Watt University is a Scottish charity<br>
                  &nbsp; registered under charity number SC000278.
                  <br>
                </font>
              </div>
            </div>
            <br>
_________________________________________________________________________<br>
            Professional FreeSWITCH Consulting Services:<br>
            <a moz-do-not-send="true"
              href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
            <a moz-do-not-send="true"
              href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
            <br>
            FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
            <a moz-do-not-send="true" href="http://www.cudatel.com"
              target="_blank">http://www.cudatel.com</a><br>
            <br>
            Official FreeSWITCH Sites<br>
            <a moz-do-not-send="true" href="http://www.freeswitch.org"
              target="_blank">http://www.freeswitch.org</a><br>
            <a moz-do-not-send="true" href="http://wiki.freeswitch.org"
              target="_blank">http://wiki.freeswitch.org</a><br>
            <a moz-do-not-send="true" href="http://www.cluecon.com"
              target="_blank">http://www.cluecon.com</a><br>
            <br>
            FreeSWITCH-users mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
              target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
            UNSUBSCRIBE:<a moz-do-not-send="true"
              href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
              target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
            <a moz-do-not-send="true" href="http://www.freeswitch.org"
              target="_blank">http://www.freeswitch.org</a><br>
            <br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        Anthony Minessale II<br>
        <br>
        FreeSWITCH <a moz-do-not-send="true"
          href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>
        ClueCon <a moz-do-not-send="true"
          href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
        Twitter: <a moz-do-not-send="true"
          href="http://twitter.com/FreeSWITCH_wire">http://twitter.com/FreeSWITCH_wire</a><br>
        <br>
        AIM: anthm<br>
        <a moz-do-not-send="true"
          href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>
        GTALK/JABBER/<a moz-do-not-send="true"
          href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
        IRC: <a moz-do-not-send="true" href="http://irc.freenode.net">irc.freenode.net</a>
        #freeswitch<br>
        <br>
        FreeSWITCH Developer Conference<br>
        <a moz-do-not-send="true"
          href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br>
        <a moz-do-not-send="true"
          href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
        pstn:+19193869900<br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a class="moz-txt-link-abbreviated" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a class="moz-txt-link-freetext" href="http://www.cudatel.com">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.cluecon.com">http://www.cluecon.com</a>

FreeSWITCH-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
</pre>
    </blockquote>
    <br>
  <br>
<hr>
<br>
<img src="cid:hw_uni_of_year.jpg" align=left 
alt="MailScanner Signature HW">
<font face="arial,helvetica">
&nbsp; <b>Heriot-Watt University is the Sunday Times<br> 
&nbsp; Scottish University of the Year 2011-2012</b>
</font>
<br><br>
<font face="arial,helvetica" size="-1">
&nbsp; Heriot-Watt University is a Scottish charity<br>
&nbsp; registered under charity number SC000278.
<br>
</font>

</body>
</html>