Skip to main content

Show registration status on user extensions page

Posted by ithornton on Mon, 01/09/2012

Please can I request the registration status of the extension be shown under the user extensions page. There could be an icon with a red and green status indicator showing if it is currently registered. This would make it much easier rather than going into the PBX information screen, or logging into asterisk and performing a 'sip show peers like'.

If you like the idea or have any comments please respond.

Regards,
Ian


Submitted by Jasril on Fri, 01/13/2012 Permalink

i ended up creating my own searchable/sortable link for this in the link manager... but having it actually ON the user extension page would be nice

Submitted by Jasril on Mon, 01/23/2012 Permalink

sorry it took so long, had to have Boss' approval... *and i was able to get it via the ensuing screenshots which look like a government document about area 51*

show_peers.cgi

if you have any questions i'd be happy to answer them, even though it is very simple it's one of the first programs i ever made so be gentle haha~

i have also created a tenant lookup which links directly to this program so you can find a tenant based on their tenant name or their description... i'd show a pic of it but it's just 2 columns and a search bar~

Submitted by Jasril on Wed, 02/01/2012 Permalink

Sure if anyone is interested I can post the code for it... I also have a few other programs I use, so please let me know if any of the following interest people:

1) a tenant search tool that matches to the tenant name or the description, and links up with the show_peers tool

2) a voicemail aging and deleting script which allows you to set different numbers of days for each tenant before their old voicemails automatically delete

3) a DID listing tool on a per tenant basis (my boss wanted this cause it's faster than doing it in thirdlane)

4) A tool that shows each tenant's current office mode, and gives you the ability to change them witch a button click

5) A tool which allows you to upload a CSV file to call everyone in the CSV file and connect them with a script of your choice (could be an IVR, or something to connect the called party to a person's phone, whatever you specify) this program is still in early stages, cause it has no voicemail detection, so if one of the phone numbers in the CSV file is answered by voicemail it won't know the difference lol

Anywho, let me know what you all are interested in, and I'll try to get the code up as soon as I can

Submitted by ithornton on Thu, 02/02/2012 Permalink

I'm liking the tool you've created Jasril. If we could have something like that integrated within Thirdlane it would be great.

Thirdlane is currently geared up for confguration and management rather than monitoring the system health and checking the status of configured accounts/trunks. It would be great if we could do some simple things like seeing registration and call status in the Thirdlane GUI rather than have to extract it from the asterisk terminal.

Submitted by Jasril on Thu, 02/02/2012 Permalink

ok, I'll work on putting up some source code, there is no installation, these are just CGI scripts written in perl (just like all of thirdlane) you would just need to copy and paste them into the

/usr/libexec/webmin/asterisk/

folder of your thirdlane, there might be some tweaks you may need to do to the script to get them to work for you, i designed them to work for me and i use a tenant naming scheme of a 10 digit number... i tried to make sure they would work for tenants with letters in their name too, but it might not be the case in some instances...

also copy and paste the contents of http://www.kryogenix.org/code/browser/sorttable/sorttable.js into a file labeled "sorttable.js" in the same folder, that will make the columns sortable by clicking the headers

Submitted by armandomuniz305 on Fri, 03/09/2012 Permalink

Hi Jasril

You did a great job on that script i Just installed it and it worked right out the door awesome, I have a suggestion if you can add this to the search. I do a ( asterisk -rx "sip show peer 1014-tenant" | grep 'Reg. Contact' every time we bring up a new tenant it returns something like Reg. Contact : sip:1014-tenant@192.168.1.2:5062 which tells us if they have a router that is compatible or that it has SIP ALG turned off this is a very helpful tool right now I dont give any of our employees cli access to run any commands and this would be great information with no security risk.?

I would love to see some of your other Scripts like the one to delete Voicemails.

Thank you for all you work

Armando Muniz

Submitted by eeman on Fri, 03/09/2012 Permalink

deleting voicemail is fairly simple.. i just modified the sample one that comes with the asterisk source code to accept a parameter for sub directory, then I run the script from a 'for' loop indexing the main /var/spool/asterisk/voicemail directory.

Submitted by IVSCOMM on Fri, 03/09/2012 Permalink

I have gone to the Link Manager and added it like this.

http://${HOSTADDRESS}/asterisk/show_peers.cgi

Is this right? I suspect not.

I have dropped the two files into the folders you told me and I get errors.

Submitted by IVSCOMM on Mon, 03/12/2012 Permalink

Error - Perl execution failed

Can't locate Time/Duration.pm in @INC (@INC contains: /usr/libexec/webmin /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /usr/libexec/webmin/asterisk/show_peers.cgi line 4.
BEGIN failed--compilation aborted at /usr/libexec/webmin/asterisk/show_peers.cgi line 4.

Submitted by Jasril on Mon, 03/12/2012 Permalink

Ahhh ok, the problem you are having is my perl script used a module you have no installed yet... You need to install the perl module Time/Duration.pm

Submitted by armandomuniz305 on Mon, 03/12/2012 Permalink

Hi Jasril

First of all thank you for the great script, but I've been breaking my head NOT Hard to do trying to figure out how do a sip show peer (extension number) with your script I would like to be able to do both sip show peers (extension number) and the latter. this would be very help full to us all. can you help us out?

Submitted by Jasril on Mon, 03/12/2012 Permalink

It would probably take a while for me to develop the additional function, as I don't have as much free time to put into programming, although I will try to look into adding a "sip show peer xxx-xxxxxxxxxx" feature... It's only not in there now cause I hardly ever found it very useful to tell the truth *shrug* but to each their own...

P.S.

Glad to hear people do like the script though heh