Hi Russell,
your email slipped unnoticed so far ... see more comments inline.
On 2/24/11 10:14 PM, Russell Feeser wrote:
To Siremis Admin,
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.
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.
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:
(taken from siremisMICommands.xml)
<?xml version="1.0" standalone="no"?>
<PluginService Name="siremisMICommands" Package="asipto"
Class="siremisMICommands">
<MIConfig name="MIConfig" type="udp" mode="rich">
<Local name="local" address="127.0.0.1" port="8044"
timeout="3.0"/>
<Remote name="remote" address="127.0.0.1"
port="8033"/>
<MICommands>
<cmd name="ps" title="List Processes" command="ps"/>
<cmd name="uptime" title="Show Uptime"
command="uptime"/>
<cmd name="getstatsall" title="Get All Statistics"
command="get_statistics all"/>
<cmd name="which" title="Get All MI Commands"
command="which"/>
<cmd name="dp_reload" title="Reload Dailplan"
command="dp_reload"/>
<------ Code I added, WORKS!
</MICommands>
</MIConfig>
</PluginService>
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:
(taken from DialplanListForm.xml)
<Element Name="btn_refresh" Class="Button"
Text="Activate"
CssClass="button_gray_m" Description="Refresh dialplan in Kamailio
without restarting Kamailio">
<EventHandler Name="dp_reload" Event="onclick"
EventLogMsg=""
Function="" ContextMenu="Activate"/>
</Element>
Anything you can say would be most helpful, as this is a feature I'm
sure many using Siremis would appreciate having.
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.
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.
Hopefully soon the version 2.0 of siremis will get on GIT and we can
grant access to others that want to contribute.
Regards,
Ramona