Asterisk PBX Add-On [Under Constraction]

Addons for Cacti and discussion about those addons

Moderators: Developers, Moderators

User avatar
mojiro
Cacti User
Posts: 121
Joined: Sun Jul 24, 2005 12:20 pm
Location: Ireland, Dublin

Asterisk PBX Add-On [Under Constraction]

Post by mojiro »

Intro:
One month ago I started working on Asterisk. I allready had cacti, so I said
"why not to make an addon ?". But I haven't noticed the need of the Plugin
Architecture and I started modifying the cacti 0.8.6g php code to accept my
plugins/addons. How stupid movement, because most of modifications were
ready from the P.A. mod. That means, I have an Addon with such a nice and
friendly GUI but no compatility with current P.A. There are several reasons
that I cannot change(I have translated to Greek language) Cacti version.

What I have done:
It connects succesfully to CLI (asterisk console) and then returns data. At
the moment I have parsers for the following commands:
  • Sip Show Peers
    Sip Show Settings
    Sip Show Channels
    Sip Show Registry
    Sip Show Users
    Database Show
    Show Translation
Parsers are reading CLI data and outport html tables with css etc. support.

Also there is already support to ADD, EDIT, DELETE a SIP friend-acount.
You cannot manipulate(from cacti) with SIP peers-acounts or IAX.

What the Plugin Needs:
Of course asterisk, cacti, mysql(for saving sip data) and modifications
at your asterisk configuration.

What I want:
Notices, information, feature requests, ideas


I want to say that the main work of the addon is to manipulate with sip
friends(just simple functions) and retrieve-show statistics. I will not make
a plugin to configure your Asterisk, there other programs for this job. I
really wait for 0.9 version, to fit my plugin on it. Allthow I am not able to
export my plugin at the moment, I will do it with the next cacti version.
Attachments
friend-settings.gif
friend-settings.gif (12.14 KiB) Viewed 67470 times
list-mysql-registrations.gif
list-mysql-registrations.gif (13.13 KiB) Viewed 67470 times
sip-show-peers.gif
sip-show-peers.gif (17.89 KiB) Viewed 67470 times
sip-show-settings.gif
sip-show-settings.gif (14.11 KiB) Viewed 67470 times
sip-show-user.gif
sip-show-user.gif (11.54 KiB) Viewed 67470 times
that_kid
Posts: 29
Joined: Fri Mar 18, 2005 10:29 pm

Post by that_kid »

I would love this, I've been looking all over for a way to have cacti monitor my asterisk server.
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

Most of the items you have added seem like they would be very easy to migrate to the Plugin Architecture. If you would like, you can email the addon to me, and I will gladly convert it to a plugin for you. The process is realitively quick and painless, taking only a few hours at most.
User avatar
mojiro
Cacti User
Posts: 121
Joined: Sun Jul 24, 2005 12:20 pm
Location: Ireland, Dublin

Post by mojiro »

I want to do a final beta-bug test and then I will add some functions to be
easy installed (auto install mysql, etc), and then I will upload it.

Cigamit, if I add a table inside the main cacti-database, would it make
problems at the cacti upgrade function ?

Also for the add-on menu, I use the cacti-function for making menus and
I have added the menu-table at <cacti_dir>/include/config_arrays.php.
Is it proper ? Is it possible to be done from P.A. ?
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Post by cigamit »

mojiro wrote:I want to do a final beta-bug test and then I will add some functions to be
easy installed (auto install mysql, etc), and then I will upload it.

Cigamit, if I add a table inside the main cacti-database, would it make
problems at the cacti upgrade function ?
You should have no issues updating cacti if you include extra tables, Cacti only changes what it has to in the upgrade process, so the extra tables are never even looked at. Most plugins out there already add a few extra tables to the database.
mojiro wrote: Also for the add-on menu, I use the cacti-function for making menus and
I have added the menu-table at <cacti_dir>/include/config_arrays.php.
Is it proper ? Is it possible to be done from P.A. ?
That is the proper way to do it, and it is possible to do it via the Plugin Architecture. With the plugin architecture, instead of manually modifying config_arrays.php, you add a function to the plugins setup.php file (all plugins require this file as a sort of registration file) and have it add to the arrays from within this function. Its not the easiest to explain without getting technical, but documentation is in the works!
mgob
Posts: 25
Joined: Wed Dec 07, 2005 3:43 am
Location: Arizona
Contact:

Post by mgob »

PLEASE keep us updated on the progress of this, let me know if there is anything i can do to assist, this looks like something i would love to have.

-MGOB
mgob
Posts: 25
Joined: Wed Dec 07, 2005 3:43 am
Location: Arizona
Contact:

Post by mgob »

anyways to package it at all? i'd love to help work on it since this is a plugin our company would probably use on a daily basis....

-MGOB
User avatar
mojiro
Cacti User
Posts: 121
Joined: Sun Jul 24, 2005 12:20 pm
Location: Ireland, Dublin

Post by mojiro »

I want to add a menu-page for the configuration, instead of
a config-php file. Until I finish it please make, suggestions for
anything you imagine that may be supported for this plugin.

for example, one usefull option is the deactivation of user
management if it is difficult for someone to adapt his asterisk
configuration to the one I will suggest, to coply with the script.

Because I am not guru at Asterisk, you can help by informing
me for the suitable asterisk-configs. For the moment I use
something like the following:

at sip.conf

Code: Select all

;------------------------------
; mojiro - 18321
;
register => 18321@10.8.213.67::18321@10.8.213.67/18321

Code: Select all

;------------------------------
; mojiro - 18321
;
[mojiro]
type=friend
regexten=18321
username=mojiro
secret=
callerid="18321-mojiro" <18321>
host=dynamic
nat=no
dtmfmode=rfc2833
canreinvite=no
disallow=all
;allow=gsm
allow=ulaw
allow=alaw
context=default
qualify=yes
deny=0.0.0.0/0.0.0.0
permit=10.0.0.0/255.0.0.0
at extensions.conf

Code: Select all

;------------------------------
; mojiro - 18321
;
exten => 18321,hint,SIP/mojiro
exten => 18321,1,Dial(SIP/mojiro,40,rt)
mgob
Posts: 25
Joined: Wed Dec 07, 2005 3:43 am
Location: Arizona
Contact:

Post by mgob »

those configs are right for what they are for, i'm not sure what you are asking..

-MGOB
routerboy
Posts: 9
Joined: Thu Jan 12, 2006 7:12 pm

Post by routerboy »

Just wondering how this is coming along, I'm interested in trying it out.

Thanks
routerboy
docelmo
Posts: 5
Joined: Fri May 12, 2006 2:50 pm

Post by docelmo »

I Dont know if anyone is interested.. I will have a graph w/ script probably complete this weekend. It will graph calls and channels. Im sure you can do more with it but I just need to know the total number of calls and channels.. Nothing more.. :)


Let me know if your interested and I will put up the code.
that_kid
Posts: 29
Joined: Fri Mar 18, 2005 10:29 pm

Post by that_kid »

Yes please post the code, i'm definitely interested. Thanks for the hard work too.
docelmo
Posts: 5
Joined: Fri May 12, 2006 2:50 pm

Post by docelmo »

that_kid wrote:Yes please post the code, i'm definitely interested. Thanks for the hard work too.
ok here comes.. Just need to figure out how to add files.. :P



Send me some news on how your installs go.. Im curious.. :)
Attachments
astman.txt
Astman OOP Class for pollcalls.php
(1.46 KiB) Downloaded 2493 times
cacti_graph_template_asterisk_call_graph(3).xml
Cacti graph and such. You may need to chage input method depending on your install. I didnt use cacti root variable. Its hard coded
(11.17 KiB) Downloaded 3115 times
pollcalls.txt
rename and configure in your /scripts directory. its very basic..
(1.05 KiB) Downloaded 3059 times
cinen
Posts: 1
Joined: Fri May 19, 2006 9:45 am

Post by cinen »

I am trying to get this to work but I am not having any luck. I have edited pollcall.php and astman.php with my server info. When I try to bring up graphs I get nothing. If anyone has any ideas please let me know. I am not a programmer so it may be something simple. I have searched these forums as well as others and this is about the only asterisk monitor I can find for cacti. I am running cacti ver 0.8.6h and asterisk 1.2.7.
docelmo
Posts: 5
Joined: Fri May 12, 2006 2:50 pm

Post by docelmo »

cinen wrote:I am trying to get this to work but I am not having any luck. I have edited pollcall.php and astman.php with my server info. When I try to bring up graphs I get nothing. If anyone has any ideas please let me know. I am not a programmer so it may be something simple. I have searched these forums as well as others and this is about the only asterisk monitor I can find for cacti. I am running cacti ver 0.8.6h and asterisk 1.2.7.
Well your in luck.. I wrote this script and happen to be an asterisk guru.. Did you setup your manager.conf to allow the script to talk to it? Are the scripts executible? There can be many reasons why it will not work. If you would like I can login and give you a hand with it.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests