お問い合わせ

ブログ

これまでに経験してきたプロジェクトで気になる技術の情報を紹介していきます。

Asterisk18 リアルタイムデータベースでoutbound(外線)を設定

okuda Okuda 2 years

リアルタイムのアスタリスクデータベースでのアウトバウンド登録に使用するデフォルト設定を紹介します。

環境設定

  • Asterisk 18
  • ODBC connection
  • Setup for Asterisk realtime (sorcery, extconf, pjsip config files)

アスタリスクのアウトバウンド登録を設定するには、アウトバウンド番号ごとに5つのテーブルに行を追加する必要があります。

  • ps_registrations
  • ps_endpoints
  • ps_auth
  • ps_aors
  • ps_endpoint_id_ips

使用する主なパラメータは次のとおりです。

  • Number — The phone number
  • Password — The password
  • Host — The host name
  • Hostip — The host ip for registrations

各テーブルごとに設定

テーブルごとに設定をしていきましょう。

ps_registrationの編集

$data = [
    'id' => '<number>',
    'client_uri' => 'sip:<number>@<host>',
    'contact_user' => '<number>',
    'outbound_auth' => '<number>',
    'retry_interval' => '60',
    'server_uri' => 'sip:<host>',
    'transport' => 'transport-udp',
    'endpoint' => 'outbound',
];

ps_endpointsの編集

$data = [
    'id' => '<number>',
    'transport' => 'transport-udp',
    'aors' => '<number>',
    'auth' => '<number>',
    'context' => 'outbound',
    'disallow' => 'all',
    'allow' => '!all,g722,ulaw',
    'outbound_auth' => '<number>',
];

ps_auth

$data = [
    'id' => '<number>',
    'password' => '<password>',
    'username' => '<number>',
];

ps_aorsの編集

$data = [
    'id' => '<number>',
    'contact' => 'sip:<number>@<host>',
];

ps_endpoint_id_ipsの編集

$data = [
    'id' => '<number>',
    'endpoint' => '<number>',
    'match' => '<hostip>',
];

Mysqlデータベースに行を追加した後、AsteriskCLIで次のコマンドを使用して登録ステータスを検証できます。

pjsip show registrations

これで外線設定がトー録できます。

Asterisk18 リアルタイムデータベースでoutbound(外線)を設定 2021-08-23 14:03:37

コメントはありません。

4746

お気軽に
お問い合わせください。

お問い合わせ
gomibako@aska-ltd.jp