17
16

More than 5 years have passed since last update.

Asterisk13その2

Last updated at Posted at 2014-11-12

鍵生成

# astgenkey

This script generates an RSA private and public key pair
in PEM format for use by Asterisk.  You will be asked to
enter a passcode for your key multiple times.  Please
enter the same code each time.  The resulting files will
need to be moved to /var/lib/asterisk/keys if you want
to use them, and any private keys (.key files) will
need to be initialized at runtime either by running
Asterisk with the '-i' option, or with the 'keys init'
command once Asterisk is running.

Press ENTER to continue or ^C to cancel.

Enter key name: pbx.localdomain
Generating SSL key 'pbx.localdomain':
Generating RSA private key, 1024 bit long modulus
................++++++
.....++++++
e is 65537 (0x10001)
Enter pass phrase for pbx.localdomain.key:
Verifying - Enter pass phrase for pbx.localdomain.key:
Enter pass phrase for pbx.localdomain.key:
writing RSA key
Key creation successful.
Public key:  pbx.localdomain.pub
Private key: pbx.localdomain.key

pass phrase

3回聞かれるが、全部同じパスワードを入力。

  • /etc/asterisk/pbx.localdomain.key
  • /etc/asterisk/pbx.localdomain.pub

が生成される。

sip.conf

Fusion IP-Phone マイページのページからSIP-user,SIP-passを取得しておく。

fusion.png

sip.conf (Fusion-IP Phone用)

sip.conf
; 参考:
; http://www.voip-info.jp/index.php/Asterisk_FUSION
; http://www.voip-info.jp/index.php/FUSION_IP-Phone_SMART

[general]
maxexpirey=3600
defaultexpirey=3600
registertimeout=300
context=incoming ;incoming固定
port=5060
bindaddr=0.0.0.0
srvlookup=yes
disallow=all
allow=ulaw
allow=alaw
allow=gsm
language=ja

allowguest=yes ;yes固定

;[fusion1]
register => FUSIONユーザ名:FUSIONパスワード@fusion1/smart.0038.net

[fusion1]
type=friend
username=FUSIONユーザ名
fromuser=FUSIONユーザ名
secret=FUSIONパスワード
canreinvite=no
context=incoming
insecure=port,invite
host=smart.0038.net
fromdomain=smart.0038.net
dtmfmode=inband
allowsubscribe=no
nat=never

[201]
type=friend
defaultuser=201
secret=pass201
context=default ;default固定
canreinvite=no
host=dynamic
dtmfmode=rfc2833
callgroup=1
pickupgroup=1
mailbox=201

[202]
type=friend
defaultuser=202
secret=pass202
context=default
canreinvite=no
host=dynamic
dtmfmode=rfc2833
callgroup=1
pickupgroup=1
mailbox=202

複数registryする場合

sip.conf
  ; 参考:
  ; http://www.voip-info.jp/index.php/Asterisk_FUSION
  ; http://www.voip-info.jp/index.php/FUSION_IP-Phone_SMART

  [general]
  maxexpirey=3600
  defaultexpirey=3600
  registertimeout=300
  context=incoming ;incoming固定
  port=5060
  bindaddr=0.0.0.0
  srvlookup=yes
  disallow=all
  allow=ulaw
  allow=alaw
  allow=gsm
  language=ja

  allowguest=yes ;yes固定

  ;[fusion1]
  register => FUSIONユーザ名1:FUSIONパスワード2@fusion1/smart.0038.net
+ ;[fusion2]
+ register => FUSIONユーザ名2:FUSIONパスワード2@fusion1/smart.0038.net

  [fusion1]
  type=friend
  username=FUSIONユーザ名1
  fromuser=FUSIONユーザ名1
  secret=FUSIONパスワード1
  canreinvite=no
  context=incoming
  insecure=port,invite
  host=smart.0038.net
  fromdomain=smart.0038.net
  dtmfmode=inband
  allowsubscribe=no
  nat=never

+ [fusion2]
+ type=friend
+ username=FUSIONユーザ名2
+ fromuser=FUSIONユーザ名2
+ secret=FUSIONパスワード2
+ canreinvite=no
+ context=incoming
+ insecure=port,invite
+ host=smart.0038.net
+ fromdomain=smart.0038.net
+ dtmfmode=inband
+ allowsubscribe=no
+ nat=never


  [201]
  type=friend
  defaultuser=201
  secret=pass201
  context=default ;default固定
  canreinvite=no
  host=dynamic
  dtmfmode=rfc2833
  callgroup=1
  pickupgroup=1
  mailbox=201

  [202]
  type=friend
  defaultuser=202
  secret=pass202
  context=default
  canreinvite=no
  host=dynamic
  dtmfmode=rfc2833
  callgroup=1
  pickupgroup=1
  mailbox=202
*CLI> core reload
*CLI> sip show registry
Host                                    dnsmgr Username       Refresh State                Reg.Time
fusion1:5060                            N      11111111           585 Registered           Thu, 13 Nov 2014 09:29:36
fusion2:5060                            N      22222222           585 Registered           Thu, 13 Nov 2014 09:29:36
2 SIP registrations.
17
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
16