<!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 implement a new button on the SER Menu > Server Services
> 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 implement a change to the dialplan in Siremis.</div>
<div><br>
</div>
<div>I have successfully enabled this feature on the drop-down
menu in SER Menu > Command Services > 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><?xml version="1.0" standalone="no"?></div>
<div><PluginService Name="siremisMICommands" Package="asipto"
Class="siremisMICommands"></div>
<div><span class="Apple-tab-span" style="white-space: pre;"> </span><MIConfig
name="MIConfig" type="udp" mode="rich"></div>
<div><span class="Apple-tab-span" style="white-space: pre;"> </span><Local
name="local" address="127.0.0.1" port="8044"
timeout="3.0"/></div>
<div><span class="Apple-tab-span" style="white-space: pre;"> </span><Remote
name="remote" address="127.0.0.1" port="8033"/></div>
<div><span class="Apple-tab-span" style="white-space: pre;"> </span><MICommands></div>
<div><span class="Apple-tab-span" style="white-space: pre;"> </span><cmd
name="ps" title="List Processes" command="ps"/></div>
<div><span class="Apple-tab-span" style="white-space: pre;"> </span><cmd
name="uptime" title="Show Uptime" command="uptime"/></div>
<div><span class="Apple-tab-span" style="white-space: pre;"> </span><cmd
name="getstatsall" title="Get All Statistics"
command="get_statistics all"/></div>
<div><span class="Apple-tab-span" style="white-space: pre;"> </span><cmd
name="which" title="Get All MI Commands" command="which"/></div>
<div><span class="Apple-tab-span" style="white-space: pre;"> </span><span
class="Apple-style-span" style="background-color: rgb(255,
255, 0);"><cmd name="dp_reload" title="Reload Dailplan"
command="dp_reload"/> <------ Code I added,
WORKS!</span></div>
<div><span class="Apple-tab-span" style="white-space: pre;"> </span></MICommands></div>
<div><span class="Apple-tab-span" style="white-space: pre;"> </span></MIConfig></div>
<div></PluginService></div>
<div><br>
</div>
<div><br>
</div>
<div>Here's where I'm stuck: I can't seem to get a new button
to implement 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 SER Menu >
Server Services > 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><Element Name="btn_refresh" Class="Button"
Text="Activate" CssClass="button_gray_m"
Description="Refresh dialplan in Kamailio without restarting
Kamailio"></div>
<div><span class="Apple-tab-span" style="white-space: pre;"> </span>
<EventHandler Name="dp_reload" Event="onclick"
EventLogMsg="" Function="" ContextMenu="Activate"/></div>
<div></Element></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 appreciate 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>