How can I hide Supervised Transfer icon?

  1. 10 years ago

    Hello Sir,
    I have installed FOP2(version 2.2.7 with trail license) on my server (OS: CenteOS 6.2) .
    Due to my asterisk vsersion is 1.4.2.2, Supervised Transfer action will not action when I assign a transfer authority to my user account. and it might be strange to have an non-action icon on tool bar.
    So, Can you tell me how to hide Supervised Transfer icon and keep Blind Transfer icon with transfer authority ?

    Thanks for your help

    Mfhsu

  2. admin

    26 Dec 2013 Administrator

    You can edit /var/www/html/fop2/js/jcallback.js and add something like this

    function jCallBack() {
        function zbuttons(nro,data,slot) {
            $('#action_supervisedtransfer').hide();
        }
    
        this.zbuttons = zbuttons;
    }
    
    mycallback = new jCallBack();

    Best regards,

  3. Dear sir,
    I can hide the icon now, thanks for your help.
    By the way, if I also want to hide "Transfer to Mailbox" button( voicemail function disable on server)
    what command should I use to replace $('#action_supervisedtransfer').hide() ?

    Thanks for your helps again.

  4. admin

    27 Dec 2013 Administrator

    $('#action_vmail').hide();

  5. Thanks for your help,
    it works now.

    best regards,
    mfhsu

  6. Dear Sir,
    After add codes below (In xxx/xxx/fop2/jcallback.js ), Icons can be hide when I login FOP2 page.
    But after click extension buttons on the page more than two times, The hide icons(Supervised Transfer * & Transfer to MailBox) appear again.

    Did I miss any procedure that cause this problem ? How can I hide those two Icons forever?

    Thanks for your help.

    function jCallBack() {
        function reload(nro,data,slot) {
            debug("reload inside jCallBack");
        }
    
        function link(nro,data,slot) {
            debug("received link command from server with "+data+", button number"+nro+" in slot "+slot);
        }
        //20140109
        function zbuttons(nro,data,slot) {
            $('#action_supervisedtransfer').hide();
            $('#action_vmail').hide();
        }
        this.zbuttons = zbuttons;
        //20140109 end
    
        this.reload  = reload;
        this.link    = link;
    }
    
    mycallback = new jCallBack();
    
  7. admin

    9 Jan 2014 Administrator

    try changing hide() to remove()

  8. Dear Sir,
    Now I can hide Icons by using remove() function. thanks a lot.But I get another icon display problem now, that need your help.
    When I reload all my asterisk configuration file by using "reload" command, all buttons I configured will become double immediate, for example from 5 extension buttons to 10 buttons, and so does Icons and logout button, and it will not happen if I use "sip reload" command.
    How can I avoid buttons and Icons become double when I exec "reload" command in AMI Mode?

    function reload_conf()
    {
          $socket = fsockopen("127.0.0.1","5038", $errno, $errstr);
          fputs($socket, "Action: Login\r\n");
          fputs($socket, "UserName: fop2\r\n");
          fputs($socket, "Secret: fop2sec\r\n\r\n");
          fputs($socket, "Action: Command\r\n");
          fputs($socket, "Command: extensions reload\r\n\r\n");
          fputs($socket, "Action: Command\r\n");
          fputs($socket, "Command: sip reload\r\n\r\n");
          fputs($socket, "Action: Logoff\r\n\r\n");
          $wrets=fgets($socket,128);
          fclose($socket);
    }

    Calling reload_conf() function will not effect buttons on FOP2 web page.

    function reload_all()
    {
    	$socket = fsockopen("127.0.0.1","5038", $errno, $errstr);
    	fputs($socket, "Action: Login\r\n");
    	fputs($socket, "UserName: test\r\n");
    	fputs($socket, "Secret: test\r\n\r\n");
    	fputs($socket, "Action: Command\r\n");
    	fputs($socket, "Command: reload\r\n\r\n");
    	fputs($socket, "Action: Logoff\r\n\r\n");
    	$wrets=fgets($socket,128);
    	fclose($socket);
    }

    Calling reload_all() function will make buttons/Icons on FOP2 web page become double.

  9. Dear Sir,
    Sorry, for mismatch userName/Secret, it should be fop2/fop2sec.

    function reload_all()
    {
    	$socket = fsockopen("127.0.0.1","5038", $errno, $errstr);
    	fputs($socket, "Action: Login\r\n");
    	fputs($socket, "UserName: fop2\r\n");
    	fputs($socket, "Secret: fop2sec\r\n\r\n");
    	fputs($socket, "Action: Command\r\n");
    	fputs($socket, "Command: reload\r\n\r\n");
    	fputs($socket, "Action: Logoff\r\n\r\n");
    	$wrets=fgets($socket,128);
    	fclose($socket);
    }

or Sign Up to reply!