Skip to main content

FusionPBX

Links

Installation

Debian 11

wget -O - https://raw.githubusercontent.com/fusionpbx/fusionpbx-install.sh/master/debian/pre-install.sh | sh;

cd /usr/src/fusionpbx-install.sh/debian && ./install.sh

NAT Setting

Web Admin > Advanced > Variables > IP Addresses

  • external_rtp_ip: <server-public-ip>
  • external_sip_ip: <server-public-ip>

重啟 freeswitch

systemctl restart freeswitch

驗證

Web Admin > Status > SIP Status

  • sofia status profile internal: ext-rtp-ip, ext-sip-ip
  • sofia status profile external: ext-rtp-ip, ext-sip-ip

RTP Port

/etc/freeswitch/autoload_configs/switch.conf.xml:

<!-- RTP port range -->
<!-- If no definitation the port range would be 16384 - 32768 -->
<param name="rtp-start-port" value="16384"/>
<param name="rtp-end-port" value="17000"/>

Gateway to Asterisk

On FreePBX

  1. Added a custom context 'from-ext-sip-server' with the module Custom Contexts.
  2. FreePBX Admin > Connectivity > Custom Contexts > Add Context
    • Context: from-ext-sip-server
    • Description: Whatever
    • Outbound Routes: <allow-some-route>
  3. Add Trunk
    • Trunk Name: fusionpbx
    • PEER Details:
host=sip.osslab.tw
type=peer
context=from-ext-sip-server
nat=yes
insecure=port,invite

On FusionPBX

Web Admin > Accounts > Gateways > Add

  • Gateway: myasterisk
  • Proxy: <my-asterisk-sip>
  • Register: False
  • Profile: external
  • Enable: Checked

Web Admin > Dialplan > Outbound Routes > Add

  • Gateway: myasterisk
  • Dialplan Expression: 9 Digits
  • Prefix: <blank>
  • Enable: True

另一個方法:以 Bridge 取代 Gateway

Applications > Bridge

  • Name: <自定義>
  • Destination: sofia/Internal/$1@<your-freePBX-IP>:5060

Advanced > Access Controls > Add

  • Name: FreePBX
  • Default: deny
  • Nodes
    • Type: allow
    • CIDR: <your-freePBX-IP>/32
    • Domain: <CIDR 與 Domain 擇其一>
    • Description: <自訂>

 Outbound Route 記得要選 Bridge。

Voicemail to Email

Web Admin > Accounts > Extensions > Select extension and Edit

  • Voicemail Mail to: <your-email-addr>

Web Admin > Advanced > Default Settings > Email

  • address_type: add_address
  • method: smtp
  • smtp_auth: True
  • smtp_from: <sender-from-addr>
  • smtp_from_name: <sender-from-name>
  • smtp_host: smtp-relay.sendinblue.com
  • smtp_hostname: False
  • smtp_username: <smtp-user>
  • smtp_password: <smtp-pass>
  • smtp_port: 587
  • smtp_secure: tls
  • smtp_validate_certificate: True

Send Test Email

Web Admin > Status > Email Logs > TEST

Bug Fixed:

[ERR] switch_cpp.cpp:1465 [database] can not bind parameter: undefined parameter: email_from

Edit /usr/share/freeswitch/scripts/resources/functions/send_mail.lua

if (email_from == nil or email_from == "") then
        email_from = settings:get('email', 'smtp_from', 'text');
        from_name = settings:get('email', 'smtp_from_name', 'text');
end
-- added by Alang
-- fixed: [ERR] switch_cpp.cpp:1465 [database] can not bind parameter: undefined parameter: email_from
email_from = 'noreply@your.domain';

if (email_from == nil or email_from == "") then
        email_from = address;
elseif (from_name ~= nil and from_name ~= "") then
        email_from = from_name .. "<" .. email_from .. ">";
end

Voicemail Transcription

IBM Watson API

IBM Cloud > Watson > STT

  • API Key: SQCKJOwC_4VoRozrhw-zm2vYFcxgztFlb2LskGr
  • API URL: https://api.au-syd.speech-to-text.watson.cloud.ibm.com/instances/{GUID}

FusionPBX > Advanced > Default Settings > 新增以下參數

Category Subcategory Type Value Enabled
voicemail transcribe_provider text watson True
voicemail watson_key text {your watson key} True
voicemail watson_url text {watson url} True
voicemail transcribe_language text en-US True
voicemail transcribe_enabled boolean true True
voicemail json_enabled boolean true True

按下 "Reload" 套用設定。

FusionPBX > Status > SIP Status

按下 "Flush Cache","Reload XML" 與 "Rescan"。

測試 STT API

# Audio file: audio-file.flac
curl -X POST -u "apikey:{API_KET}" \
--header "Content-Type: audio/flac" \
--data-binary @audio-file.flac \
"https://api.au-syd.speech-to-text.watson.cloud.ibm.com/instances/{GUID}/v1/recognize"

Auto Provisioning

Provision (Linksys PAP2T)

Web Admin > Advanced > Default Settings > Provision

  • enabled: True, Enabled: True
  • admin_password: <自訂密碼,硬體電話的管理存取>, Enabled: True
  • http_auth_username: <空白>, Enable: False
    NOTE: PAP2T 不支援 http 認證的 Auto Provisioning。
  • ntp_server_primary: tw.pool.ntp.org, Enable: True
  • spa_dial_plan: (*xx|*0xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|*xxxx|xxxxxxxxxxxx.), Enabled: True
  • spa_time_zone: GMT+08:00, Enabled: True
Device

Web Admin > Accounts > Devices > ADD

  • MAC Address: <PAP2T-MAC-Addr>
  • Domain: <選擇適合的網域>
  • Enabled: Checked
  • 其餘欄位保持空白或預設
Extension

Web Admin > Accounts > Extensions > Add 

  • Extension: <自訂分機號>
  • Device Provisioning:
    • Line: 1
    • MAC Address: <選擇 PAP2T 的 MAC>
    • Template: cisco/pap2t
    • Domain: <選擇合適的網域>
    • Enabled: Checked
驗證 Provision Configuration

瀏覽器輸入 http://<fusionpbx-ip-addr>/app/provision/?mac=<pap2t-mac-addr>

如果有輸出 XML 格式的參數設定檔內容,表示以上的設定正確。

Linksys PAP2T

PAP2T Web Admin > Provisioning

  • Provision Enable: yes
  • Profile Rule: http://<fusionpbx-ip-addr>/app/provision/?mac=$MA

TIP: 如果發生無法註冊成功,且同一個 NAT 網路環境還有其他 SIP 終端裝置。試試修改 PAP2T 的 Local SIP port 為其他 port。

修改 PAP2T 的 Local Port (透過 FusionPBX)

Web Admin > Accounts > Devices > Select: <PAP2T-Mac-Addr> > Lines > Line 1

  • Port: 1001 (預設是 5060) 

重啟 PAP2T 以便重新同步新設定。

Cisco IP Phone 8800/7800 Series

Let's Encrypt

WebRTC