<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Hi Russell,<br>
    <br>
    your email slipped unnoticed so far ... see more comments inline.<br>
    <br>
    On 2/24/11 10:14 PM, Russell Feeser wrote:
    <blockquote
      cite="mid:AANLkTinX6UL2tOZMXdsnfOXyZm7xLj9nRLEZm7W=VT1q@mail.gmail.com"
      type="cite">To Siremis Admin,
      <div><br>
      </div>
      <div>I'm a bit of a php rookie, and even more of a noob with
        openbiz cubi, but I've burnt a day and a half trying
        to&nbsp;implement&nbsp;a new button on the SER Menu &gt; Server Services
        &gt; Dialplan List page, and curious if you could give some
        words of advice concerning my plight.</div>
      <div><br>
      </div>
      <div>Ideally, I would like dialplan to auto update the Kamailio
        mySQL database with the dp_reload feature; I am simply sick of
        bouncing Kamailio with a "kamctl restart" from the command line
        each time I&nbsp;implement&nbsp;a change to the dialplan in Siremis.</div>
      <div><br>
      </div>
      <div>I have&nbsp;successfully enabled this feature on the drop-down
        menu in SER Menu &gt; Command Services &gt; MI Commands,
        however, I don't want to have to navigate to the MI Commands
        page each time I wish to refresh dialplan. In
        siremisMICommands.xml, I was able to activate dp_reload with the
        following code:</div>
      <div><br>
      </div>
      <div>(taken from siremisMICommands.xml)</div>
      <div><br>
      </div>
      <div>
        <div>&lt;?xml version="1.0" standalone="no"?&gt;</div>
        <div>&lt;PluginService Name="siremisMICommands" Package="asipto"
          Class="siremisMICommands"&gt;</div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>&lt;MIConfig
          name="MIConfig" type="udp" mode="rich"&gt;</div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>&lt;Local
          name="local" address="127.0.0.1" port="8044"
          timeout="3.0"/&gt;</div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>&lt;Remote
          name="remote" address="127.0.0.1" port="8033"/&gt;</div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>&lt;MICommands&gt;</div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>&lt;cmd
          name="ps" title="List Processes" command="ps"/&gt;</div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>&lt;cmd
          name="uptime" title="Show Uptime" command="uptime"/&gt;</div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>&lt;cmd
          name="getstatsall" title="Get All Statistics"
          command="get_statistics all"/&gt;</div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>&lt;cmd
          name="which" title="Get All MI Commands" command="which"/&gt;</div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span><span
            class="Apple-style-span" style="background-color: rgb(255,
            255, 0);">&lt;cmd name="dp_reload" title="Reload Dailplan"
            command="dp_reload"/&gt; &nbsp; &nbsp; &nbsp; &nbsp;&lt;------ Code I added,
            WORKS!</span></div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>&lt;/MICommands&gt;</div>
        <div><span class="Apple-tab-span" style="white-space: pre;"> </span>&lt;/MIConfig&gt;</div>
        <div>&lt;/PluginService&gt;</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Here's where I'm stuck: I can't seem to get a new button
          to&nbsp;implement&nbsp;dp_reload in the DialplanListForm.xml. I'm not
          sure if I need to write a function to call dp_reload, or if I
          can simply activate dp_reload from the DialplanListForm.xml.
          The code I have written creates a button on the&nbsp;&nbsp;SER Menu &gt;
          Server Services &gt; Dialplan List page, but thats as far as
          I've gotten. My code currently looks like this:</div>
        <div><br>
        </div>
        <div>(taken from DialplanListForm.xml)</div>
        <div><br>
        </div>
        <div>
          <div>&lt;Element Name="btn_refresh" Class="Button"
            Text="Activate" CssClass="button_gray_m"
            Description="Refresh dialplan in Kamailio without restarting
            Kamailio"&gt;</div>
          <div><span class="Apple-tab-span" style="white-space: pre;"> </span>
            &nbsp; &nbsp;&lt;EventHandler Name="dp_reload" Event="onclick"
            EventLogMsg="" Function="" ContextMenu="Activate"/&gt;</div>
          <div>&lt;/Element&gt;</div>
        </div>
        <div><br>
        </div>
        <div>Anything you can say would be most helpful, as this is a
          feature I'm sure many using Siremis would&nbsp;appreciate&nbsp;having.</div>
      </div>
    </blockquote>
    One option is to extend the base class for the dialplan form where
    you add a new function to perform the dp_reload function, then
    create the button that will perform an action calling the new
    function.<br>
    <br>
    There are several cases when siremis uses same approach, see
    modules/ser/common/... for the base functions and then reused to
    have a particular functionality (such as search results). You can
    search for "extended" in ser module to see what classes are
    extending other.<br>
    <br>
    Hopefully soon the version 2.0 of siremis will get on GIT and we can
    grant access to others that want to contribute.<br>
    <br>
    Regards,<br>
    Ramona<br>
  </body>
</html>