Thanks for your response Anthony,<div><br></div><div>I should of mentioned this in my previous email but The method signature for switch_xml_open_cfg looks like the following:</div><div><br></div><div><p class="p1"><b>public static switch_xml switch_xml_open_cfg(string file_path, SWIGTYPE_p_p_switch_xml node, switch_event arg2)</b></p>
</div><div><br></div><div>and i have been unable to figure out how to create an instance of <b>SWIGTYPE_p_p_switch_xml</b> to pass into that. As far as I can tell, is not instantiable unless you write an interface for swig to use before you build. Perhaps you can give me a hint on how to use that object or is there something that has to be changed on the mod_managed code itself? Sorry, I am pretty new to freeswitch and swig so I am not terribly sure why that object is not available for me to instantiate.</div>
<div><br></div><div>Thank you so much for your help.</div><div><br></div><div>Ryan</div><div><br></div><div><br><div class="gmail_quote">On Thu, Sep 15, 2011 at 9:26 AM, Anthony Minessale <span dir="ltr"><<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">you have to supply the 2nd arg too.<br>
<br>
the returned obj is the whole xml root, the 2nd param is a pointer to<br>
pointer of the section you searched for inside that root.<br>
<div><div></div><div class="h5"><br>
<br>
On Wed, Sep 14, 2011 at 3:41 PM, R H <<a href="mailto:buscom123%2Bfs@gmail.com">buscom123+fs@gmail.com</a>> wrote:<br>
> Has anyone had success working with xml configuration files using<br>
> mod_managed? I have several modules that DO NOT override the xml<br>
> configuration but, rather, I actually want to configure them using the<br>
> freeswitch conf directory structure. I have not even tried to parse the xml<br>
> because I cant even load the xml. Here is a very basic example of what I<br>
> tried and the result I got:<br>
> The Code:<br>
> ------------------------------------------------<br>
> using System;<br>
> using FreeSWITCH;<br>
> using FreeSWITCH.Native;<br>
> namespace PsiCallCenterAddon<br>
> {<br>
> public class FreeSwitchConfigLoader<br>
> {<br>
> public static void loadConfigTest()<br>
> {<br>
> try<br>
> {<br>
> switch_xml xml = freeswitch.switch_xml_open_cfg("freeswitch.conf", null,<br>
> null);<br>
> freeswitch.switch_xml_free(xml);<br>
> Log.WriteLine(LogLevel.Alert, "Config Loader Success!");<br>
> }<br>
> catch<br>
> {<br>
> Log.WriteLine(LogLevel.Alert, "Config Loader Fail!");<br>
> }<br>
> }<br>
> }<br>
> }<br>
> ------------------------------------------------<br>
> The Result:<br>
> ------------------------------------------------<br>
> Stacktrace:<br>
> at (wrapper managed-to-native)<br>
> FreeSWITCH.Native.freeswitchPINVOKE.switch_xml_open_cfg<br>
> (string,System.Runtime.InteropServices.HandleRef,System.Runtime.InteropServices.HandleRef)<br>
> <0x000a3><br>
> at (wrapper managed-to-native)<br>
> FreeSWITCH.Native.freeswitchPINVOKE.switch_xml_open_cfg<br>
> (string,System.Runtime.InteropServices.HandleRef,System.Runtime.InteropServices.HandleRef)<br>
> <0x000a3><br>
> at FreeSWITCH.Native.freeswitch.switch_xml_open_cfg<br>
> (string,FreeSWITCH.Native.SWIGTYPE_p_p_switch_xml,FreeSWITCH.Native.switch_event)<br>
> <0x0004f><br>
> at PsiCallCenterAddon.FreeSwitchConfigLoader.loadConfigTest () <0x0001b><br>
> at PsiCallCenterAddon.QueueMonitorLoader.Load () <0x0000b><br>
> at FreeSWITCH.PluginManager.RunLoadNotify (System.Type[]) <0x00190><br>
> at FreeSWITCH.AsmPluginManager.LoadInternal (string) <0x001eb><br>
> at FreeSWITCH.PluginManager.Load (string) <0x000a7><br>
> at (wrapper remoting-invoke-with-check) FreeSWITCH.PluginManager.Load<br>
> (string) <0x00067><br>
> at (wrapper xdomain-dispatch) FreeSWITCH.PluginManager.Load<br>
> (object,byte[]&,byte[]&,string) <0x0017b><br>
> at (wrapper xdomain-invoke) FreeSWITCH.PluginManager.Load (string)<br>
> <0x00126><br>
> at (wrapper remoting-invoke-with-check) FreeSWITCH.PluginManager.Load<br>
> (string) <0x00047><br>
> at FreeSWITCH.Loader.loadFile (string) <0x004a3><br>
> at FreeSWITCH.Loader.Load () <0x0027b><br>
> at (wrapper runtime-invoke) <Module>.runtime_invoke_bool<br>
> (object,intptr,intptr,intptr) <0x00046><br>
> Native stacktrace:<br>
> /usr/lib64/libmono-2.0.so.1(+0xacba0) [0x7fc7ea58dba0]<br>
> /usr/lib64/libmono-2.0.so.1(+0xfcedf) [0x7fc7ea5ddedf]<br>
> /lib64/libpthread.so.0(+0xf2d0) [0x7fc7f1ceb2d0]<br>
><br>
> /usr/local/freeswitch/lib/libfreeswitch.so.1(switch_xml_open_cfg+0x1a)<br>
> [0x7fc7f260b0ea]<br>
> [0x40155804]<br>
> Debug info from gdb:<br>
> =================================================================<br>
> Got a SIGSEGV while executing native code. This usually indicates<br>
> a fatal error in the mono runtime or one of the native libraries<br>
> used by your application.<br>
> =================================================================<br>
><br>
</div></div>> FreeSWITCH-users mailing list<br>
> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
><br>
><br>
<br>
<br>
<br>
--<br>
Anthony Minessale II<br>
<br>
FreeSWITCH <a href="http://www.freeswitch.org/" target="_blank">http://www.freeswitch.org/</a><br>
ClueCon <a href="http://www.cluecon.com/" target="_blank">http://www.cluecon.com/</a><br>
Twitter: <a href="http://twitter.com/FreeSWITCH_wire" target="_blank">http://twitter.com/FreeSWITCH_wire</a><br>
<br>
AIM: anthm<br>
<a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>
GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net" target="_blank">irc.freenode.net</a> #freeswitch<br>
<br>
FreeSWITCH Developer Conference<br>
<a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:<a href="tel:%2B19193869900" value="+19193869900">+19193869900</a><br>
<br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br></div>