Was this page helpful?

修改 Asterisk GUI 網路設定

    從 Digium 下載安裝 Asterisk GUI 並沒有介面可以設定網路,所以自製一個網路設定介面。

    主要檔案

    1. static-http/config/networking.html
    2. static-http/config/atcom/js
    3. static-http/config/atcom/stylesheets
    4. /etc/asterisk/rc_org.conf
      如果檔案不存在,必須手動新增並加上以下內容
      [network]
      HOSTANME=

    修改重點

    1. static-http/config/index.html: 在主選單增加 Networking 項目
    找到這幾行,將它刪除

    <div page='networking.html' class='forAA50'>
    				<div class="ui-accordion-link">Networking</div>
    				<div class="ui-accordion-desc">Configures networking parameters.</div>
    			</div>

    找到 class='AdvancedMode'

    <div page='sip.html' class='AdvancedMode'>
    				<div class="ui-accordion-link">SIP Settings</div>
    				<div class="ui-accordion-desc">Global SIP Settings.</div>
    			</div>
                            <!-- 加上這幾行 -->
    			<div page='networking.html' class='AdvancedMode'>
    				<div class="ui-accordion-link">Networking</div>
    				<div class="ui-accordion-desc">Configures networking parameters.</div>
    			</div>

    2. static-http/config/networking.html: 依據表單建立網路設定參數檔

    ...
    var save_changes = function(){
    
       /* added by alang */
       var network_params = "/etc/default/network.params";
       var cmd1 = "echo \"HOSTNAME=" + ASTGUI.getFieldValue('host') + " DOMAIN=" + ASTGUI.getFieldValue('domain') + " IPADDRESS=" +  ASTGUI.getFieldValue('ipaddress') + " NETMASK=" + ASTGUI.getFieldValue('subnet') + " GATEWAY=" + ASTGUI.getFieldValue('gateway') + " DNS=" + ASTGUI.getFieldValue('dns') + " NTP=" + ASTGUI.getFieldValue('ntp') + " DHCPD=" + _$('dhcp').value + "\" > " + network_params;
       parent.ASTGUI.systemCmd( cmd1 , function(){ });
    ...

    /etc/init.d/networking

    #!/bin/sh
    #
    # start/stop networking daemons.
    # modified by alang <[email protected]>
    #
    #
    
    PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
    
    _IPADDRESS="192.168.6.10"
    _NETMASK="255.255.255.0"
    _GATEWAY="192.168.6.254"
    _DNS="8.8.8.8"
    _NTP="asia.pool.ntp.org"
    _DHCPD="yes"
    
    CFG="/etc/default/network.params"
    if [ -r $CFG ]; then
          . $CFG
    fi
    
    [ -z $IPADDRESS ] && IPADDRESS=$_IPADDRESS
    [ -z $NETMASK ] && NETMASK=$_NETMASK
    [ -z $GATEWAY ] && GATEWAY=$_GATEWAY
    [ -z $DNS ] && DNS=$_DNS
    [ -z $NTP ] && NTP=$_NTP
    [ -z $DHCPD ] && DHCPD=$_DHCPD
    
    echo "IPADDRESS -> $IPADDRESS"
    echo "NETMASK   -> $NETMASK"
    echo "GATEWAY   -> $GATEWAY"
    echo "DNS       -> $DNS"
    echo "NTP       -> $NTP"
    echo "DHCPD     -> $DHCPD"
    
    if [ $DHCPD = "yes" ]; then
       /sbin/udhcpc &
    else
       /sbin/ifconfig eth0 $IPADDRESS netmask $NETMASK
       /sbin/route add default gw $GATEWAY
       echo "nameserver $DNS" > /etc/resolv.conf
    fi

    解決: MoH 與 Voice Menu Prompts 無法上傳檔案

    Was this page helpful?
    標籤 (Edit tags)
    • No tags

    文件 1

    文件大小日期附件上傳者 
     Patch_static-http.zip
    更新 static-http
    121.64 KB21:55, 20 Oct 2012alang動作
    您必須 登入 才能發佈評論。
    Powered by MindTouch Core