客製~VOIP Settings 的參數

    版本為 15:29, 20 Nov 2024

    到這個版本。

    返回到 版本存檔.

    查閱目前版本

    目的 1:要新增一個參數名為 call_limit。

    VOIP Settings 是用來設定 SIP/ IAX 的設定參數,這裡的修改會針對設定檔 additional_a2billing_sip.conf 裡的內容。
    如果因系統需要增加頁面沒有的 SIP/IAX 的參數,可以參考以下作法:

    1. 資料庫的 Table cc_sip_buddies 增加一個欄位,並且名稱命名為 call_limit。

    mysql> ALTER TABLE cc_sip_buddies ADD call_limit;
    

    2. 編輯 /var/www/html/A2Billing_UI/Public/form_data/FG_var_friend.inc
    注意看 call_limit 的部份

    getpost_ifset(array('defaultuser', 'subscribemwi', 'vmexten', 'cid_number', 'callingpres', 'usereqphone', 'incominglimit', 'subscribecontext', 'musicclass', 'mohsuggest',
    'allowtransfer', 'autoframing', 'maxcallbitrate', 'outboundproxy', 'regserver', 'rtpkeepalive', 'call_limit', 'dbsecret ', 'regcontext ', 'sourceaddress ', 'mohinterpret ', 'mohsuggest ',
    'inkeys ', 'outkey ', ' sendani ', 'fullname ', ' maxauthreq ', 'encryption ', 'transfer ', 'jitterbuffer ', 'forcejitterbuffer ', 'codecpriority ', 'qualifysmoothing ',
    'qualifyfreqok ', 'qualifyfreqnotok ', 'timezone' , 'adsi')); 

    選一個類似欄位的寫法,複製然後將名稱改成你要的。

     $HD_Form -> AddEditElement (gettext("CALL-LIMIT"),
                                                               "call_limit",
                                                               '',
                                                               "INPUT",
                                                               "size=10 maxlength=10",
                                                               "",
                                                               "",
                                                               "" , "", "", "", "", "",     "", "" );
    

    注意 IF 的上下段,上段是 SIP;下段是 IAX

    if ($atmenu=='sip') {
            $field_list_edit .= ', username, md5secret, nat, dtmfmode, canreinvite, callgroup, fromuser, fromdomain, insecure, mailbox, mask, pickupgroup, restrictcid, rtptimeout, rtpholdtimeout, ' .
                            'musiconhold,  cancallforward, defaultuser, subscribemwi, vmexten, callingpres, usereqphone, incominglimit, subscribecontext, musicclass, mohsuggest, allowtransfer, ' .
                            'autoframing, maxcallbitrate, outboundproxy, regserver, rtpkeepalive, call_limit';
    } else {
            $field_list_edit .= ', trunk, dbsecret , regcontext , sourceaddress , mohinterpret , mohsuggest , inkeys , outkey ,  sendani , fullname ,  maxauthreq , encryption , transfer , jitterbuffer , ' .
                            'forcejitterbuffer , codecpriority , qualifysmoothing , qualifyfreqok , qualifyfreqnotok , timezone , adsi, requirecalltoken, maxcallnumbers, maxcallnumbers_nonvalidated';
    }
    
    

     

    3. 編輯 /var/www/html/A2Billing_UI/lib/Class.Realtime.php
    注意文字 call_limit 的部份

     $this -> FG_QUERY_ADITION_SIP = 'name, accountcode, regexten, amaflags, callgroup, callerid, canreinvite, context, DEFAULTip, dtmfmode, fromuser, fromdomain, host, insecure, language, ' .
                                    'mailbox, md5secret, nat, deny, permit, mask, pickupgroup, port, qualify, restrictcid, rtptimeout, rtpholdtimeout, secret, type, username, disallow, allow, musiconhold, regseconds, ' .
                                    'ipaddr, cancallforward, fullcontact, setvar, lastms, regserver, defaultuser, auth, subscribemwi, vmexten, cid_number, callingpres, usereqphone, incominglimit, subscribecontext, ' .
                                    'musicclass, mohsuggest, allowtransfer, autoframing, maxcallbitrate, outboundproxy, rtpkeepalive, call_limit';
    
                    $this -> FG_QUERY_ADITION_IAX = 'name, accountcode, regexten, amaflags, callerid, context, DEFAULTip, host, language, mask, port, qualify, secret, username, disallow, allow, regseconds, ' .
                                    'ipaddr, trunk, dbsecret, regcontext, sourceaddress, mohinterpret, mohsuggest, inkeys, outkey, cid_number, sendani, fullname, auth, maxauthreq, encryption, transfer, jitterbuffer, ' .
                                    'forcejitterbuffer, codecpriority, qualifysmoothing, qualifyfreqok, qualifyfreqnotok, timezone, adsi, setvar, type, deny, permit, requirecalltoken, maxcallnumbers, ' .
                                    'maxcallnumbers_nonvalidated';
    

     

    NOTE:

    * 要加的參數不能包含有 dash,因為 MySQL 的欄位名稱不支援。

    目的 2:

    Powered by MindTouch Core