<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.apple-style-span
        {mso-style-name:apple-style-span;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1757511598;
        mso-list-type:hybrid;
        mso-list-template-ids:1578412760 -818873890 201916419 201916421 201916417 201916419 201916421 201916417 201916419 201916421;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level3
        {mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level4
        {mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level5
        {mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level6
        {mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level7
        {mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level8
        {mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l0:level9
        {mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black'>ILoadNotificationPlugin is probably what you want, as it&#8217;ll get notified that the assembly is being initialized for FS.<o:p></o:p></span></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black'><o:p>&nbsp;</o:p></span></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black'>I think you&#8217;re right about creating new ManagedSession objects, but I don&#8217;t recall exactly at this moment.<o:p></o:p></span></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black'><o:p>&nbsp;</o:p></span></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black'>-Michael</span></span><span style='font-size:10.0pt;font-family:"Arial","sans-serif";color:black'><o:p></o:p></span></p><p class=MsoNormal><a name="_MailEndCompose"><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></a></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] <b>On Behalf Of </b>Schenk, Oliver<br><b>Sent:</b> Monday, May 02, 2011 10:03 PM<br><b>To:</b> freeswitch-users@lists.freeswitch.org<br><b>Subject:</b> [Freeswitch-users] FreeSWITCH, mod_managed and IApiPlugin<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span lang=EN-AU>Hi All,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-AU>I&#8217;m completely new to FreeSWITCH, but in a week I managed to achieve quite a bit. It was quite a learning curve to say the least. This is my current setup:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span lang=EN-AU><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span lang=EN-AU>FreeSWITCH 1.0.7 built from tarball.<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span lang=EN-AU><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span lang=EN-AU>Developing on Windows XP with VS2008 in C#.<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span lang=EN-AU><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span lang=EN-AU>Configured extension 1024 to connect to a managed dll file, which implements IAppPlugin.<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo2'><![if !supportLists]><span lang=EN-AU><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]><span lang=EN-AU>Using X-Lite softphone I can connect to FreeSWITCH as user 1001 and dial 1024 and start going through a menu that I built in C#. It successfully retrieves records from an SQL database and so forth. No problems there.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-AU>My first step was to create a module that gets called whenever a user dials IN bound. They will hear the menu just described.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-AU>My struggle now is relating to OUT bound calls. What I want is a module that is started as soon as FreeSWITCH is started and begins executing on an endless processing loop in the background. This will continuously monitor a database and if certain conditions occur an outbound call should be queued and then made. If multiple calls need to be made I guess they will be queued and processed one by one. I can handle the queuing part.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-AU>At this stage I will be testing using extension 1001 as the receiver of the call using my softphone.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-AU>Question 1:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-AU>I&#8217;ve been trying to use a class that implements IApiPlugin, but how do I get it to start when FreeSWITCH starts? As I said it should simply be a never ending thread as long as FreeSWITCH is running. I can&#8217;t find any information regarding how to &#8220;Execute&#8221; a managed module immediately when FreeSWITCH has started.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-AU>Question 2:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-AU>If IApiPlugin can do this, how do I get the session object? Like this?<br><br>ManagedSession session = new ManagedSession();<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU>session.Originate(???);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-AU>I can&#8217;t find any help at all on this.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-AU>Thanks very much!<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><b><span lang=EN-AU style='font-size:10.0pt;font-family:"Arial","sans-serif";color:#58595B'>Oliver Schenk<o:p></o:p></span></b></p><p class=MsoNormal><span lang=EN-AU><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-AU style='font-size:12.0pt;font-family:"Times New Roman","serif"'><br>NOTICE - This e-mail and any files transmitted with it are confidential and are only for the use of the person to whom they are addressed. <br>If you are not the intended recipient then you have received this e-mail in error; please advise us immediately if this is the case. <br>Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of WestNet Rail.<o:p></o:p></span></p></div></body></html>