Disable / Enable Extension remotely

Discussion in 'General' started by 13bedar, Nov 29, 2010.

  1. 13bedar

    Joined:
    Jul 9, 2010
    Messages:
    15
    Likes Received:
    0
    Hi Dear Masters

    I wanna to disable/enable our extensions remotely. Is there any script or soft or...?
     
  2. 13bedar

    Joined:
    Jul 9, 2010
    Messages:
    15
    Likes Received:
    0
    Anybody..... Any response... plz....
     
  3. danardf

    Joined:
    Dec 3, 2007
    Messages:
    8,069
    Likes Received:
    12
    Hi and wellcome to our Elastix Forum.

    What do you mean about enable/disable extensions remotely?
     
  4. 13bedar

    Joined:
    Jul 9, 2010
    Messages:
    15
    Likes Received:
    0
    Thanks a lot for your reply.

    we wanna to manage our extensions centrally and ability to turn off or disable or unregistered extensions remotely by administrator. Is there any open source software or a script or .... that enable us to register/unregistered extensions by admin and without deleting the extension?

    thanks
     
  5. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    Perhaps take advantage of iptables, make an executable script:-

    #!/bin/bash
    EXTIP=`rasterisk -x 'sip show peers'|grep -e ^$1|awk '{print $2}'`
    iptables -$2 INPUT -s $EXTIP -j DROP
    service iptables save


    (no error or boundary checking here, you should add them)


    call with

    scriptname <ext> A

    to Add a rule and disable the extension

    scriptname <ext> D

    to Delete the rule and re-enable it.

    If the extension is remote and behind a firewall it will disable all extension in that network, if you need to do that with more granularity look into doing the same with ports but have each co-located ext register on a separate port .
     
  6. 13bedar

    Joined:
    Jul 9, 2010
    Messages:
    15
    Likes Received:
    0
    Thanks a lot

    So sorry. I am an armature and "remotely" means it is from same network but from another station ( a windows-based software that enable us to do register/unregistered from that station). how could we do that?
    Thanks
     
  7. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    Unfortunately I can't help you there as I don't consider windoze as a properly functional OS, so I won't support or use it, I suggest you install putty et al and you can then pretend you have a real machine :) . For scripting cygwin will give you a real posix compliant shell and all the hooks necessary to properly converse with your VOIP server of choice.
     
  8. fraggle4

    Joined:
    Apr 22, 2009
    Messages:
    98
    Likes Received:
    0
    I got this feature working, it was a learning experience.
    What I did was to install a local phone locking app that basically sets a lock bit in the AstDB for each extension.
    All the info to do this can be found here:
    http://www.freepbx.org/forum/freepbx/us ... ng-a-phone

    Having got that working, I then used Ward Mundy's Phone Genie app which allows the AstDB to be accessed remotely. http://bestof.nerdvittles.com/applications/phonegenie/

    Then I lashed up a rough web page with a lock/unlock command for each extension:
    For example:
    https://192.168.x.x/nv-genie.php?action ... =*********

    https://192.168.x.x/nv-genie.php?action ... =*********

    So extensions can be locked/unlocked via the keypad or via the lan, It could be done over the wan as well via a vpn. I toyed with the idea of turning the web page into a FOP-like display, but that's beyond my skill.
     
  9. 13bedar

    Joined:
    Jul 9, 2010
    Messages:
    15
    Likes Received:
    0
    Thanks a lot Dear Masters

    Our goal is to prep a tiny software could be scheduled to register/unregistered our extensions (win-based).
     
  10. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    There is no native way to do that in FreePBX, either fraggle4's suggestion, or bear in mind that part of . . .putty (et al). . . is plink

    so calling from your windoze box:


    plink <yourelastixserver> <myscriptfilename> <theextensiontocontrol> <A|D>

    is pretty tiny wouldn't you agree?

    (you will need to set up ssh keys to make it automatic, ref:

    http://the.earth.li/~sgtatham/putty/0.5 ... pter7.html

    )


    make a shortcut to call it, add the parameterization to choose the extension to control

    either as a an armature (sic.) or stator, you will have to provide the EMF to make either method work.
     
  11. 13bedar

    Joined:
    Jul 9, 2010
    Messages:
    15
    Likes Received:
    0
    Hey Dicko ... Who is this pretty kid in your avatar?.... your son?... I hope he become so clever and Good man like his dad....
     
  12. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    He is indeed my son, he is however now 27 and definitely cleverer than his dad (at least he tells me he is!) , I don't think either of us are particularly good though ;)

    thanks and good luck

    dicko
     
  13. 13bedar

    Joined:
    Jul 9, 2010
    Messages:
    15
    Likes Received:
    0
    Thanks Dicko.
     

Share This Page