# VoIP Linphone install on Orange Pi PC

**URL:** https://forum.ficusonline.com/t/voip-linphone-install-on-orange-pi-pc/25
**Category:** Orange Pi
**Created:** [2016 年 10 月 6 日午前 9:13 UTC](https://forum.ficusonline.com/t/voip-linphone-install-on-orange-pi-pc/25 "2016-10-06T09:13:48Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2023 年 6 月 10 日午前 9:05 UTC](https://forum.ficusonline.com/t/voip-linphone-install-on-orange-pi-pc/25/8 "2023-06-10T09:05:41Z")

</div>

LinphoneをRaspberry PIなどのコンピュータボードでデーモンとして常駐させ、SSH接続でコンソールから遠隔操作するのであれば、linphone-nogtkではなく **`linphone-cli`** を利用します。

**ホストマシン：OS**  
Orangepi PC : Armbian 22.11.4 Bullseye with Linux 5.15.89-sunxi

**インストール**

```auto
$ sudo apt install linphone-cli

```

‼ Linphoneの各種設定を書出す設定ファイル **`.linphonerc`** とユーザ登録に必要なデータベース用ディレクトリ **`/home/USER/.local/share/linphone`** を作成します。

```auto
$ mkdir -p /home/USER/.local/share/linphone
$ touch .linphonerc

```

[https://github.com/BelledonneCommunications/linphone-desktop/issues/234](https://github.com/BelledonneCommunications/linphone-desktop/issues/234)

ログファイル出力（オプション）を指定して起動

```auto
$ sudo -H -u username linphonecsh init -c /home/USER/linphone/.linphonerc -d 6 -l /tmp/linphone-log.txt

```

予めLinphoneのホームページで登録したユーザでSIPサーバへログインします。このユーザはデフォルトユーザとしてLinphoneアプリの設定ファイルとデータベースに登録されます。

```auto
$ linphonecsh register --host sip.linphone.org --username user_name --password xxxxxxx

```

SIPサーバ側でユーザ認証されたかどうか確認して下さい。

```auto
$ linphonecsh status register
registered, identity=sip:user_name@sip.linphone.org duration=3600

```

システムデーモンとして登録するためのスクリプトを作成

`/etc/init.d/linphonecsh`

```auto
#!/bin/sh
### BEGIN INIT INFO
# Provides: linphone
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts Linphone daemon.
# Description: Linphone is used to call and receive message on VoIP System.
### END INIT INFO
sudo -H -u username linphonecsh init -c /home/USER/.linphonerc -d 6 -l /tmp/linphone-log.txt

```

実行権の付与

```auto
$ sudo chmod +x /etc/init.d/linphonecsh

```

起動時スクリプトの登録

```auto
$ sudo update-rc.d linphonecsh defaults

```

[Ubuntu Manpage: update-rc.d - install and remove System-V style init script links](https://manpages.ubuntu.com/manpages/xenial/man8/update-rc.d.8.html)

* * *

### 動作チェック

呼出音の設定以外は **`$ linphonecsh generic " ~ "`** コマンドで設定。動作中のLinphoneに対して設定を上書きします。

**サウンド設定追加**

```auto
$ linphonecsh generic "soundcard list"
0: ALSA: default
1: ALSA: H3 Audio Codec
2: ALSA: sun9i-hdmi

$ linphonecsh generic "soundcard use 0"
Using sound device ALSA: default

```

**STUNサーバを指定、firewallコマンドで有効化**

```auto
$ linphonecsh generic "stun stun.linphone.org"
Stun server: stun.linphone.org (disabled - use 'firewall stun' to enable)
$ linphonecsh generic "firewall stun"

```

**firewallコマンド**

```auto
$ linphonecsh generic "help firewall"
'firewall' : show current firewall policy.
'firewall none' : use direct connection.
'firewall nat' : use nat address given with the 'nat' command.
'firewall stun' : use stun server given with the 'stun' command.
'firewall ice' : use ice.
'firewall upnp' : use uPnP IGD.

```

**ICEを有効化**

```auto
$ linphonecsh generic "firewall ice"
Using ice with stun server �a to discover firewall address

```

**IPv6有効化の確認**

```auto
$ linphonecsh generic "ipv6 status"
ipv6 use enabled: true

```

**受信音の設定**

受信時の再生音に関してはデフォルトでも未設定のため、Linphone停止後、受信時の再生音のディレクトリとファイル名を以下の`[sound]`セクションに追加する必要があります。

> `local_ring=/usr/share/sounds/linphone/toy-mono.wav`

`.linphonerc`

```auto
[sound]
remote_ring=/usr/share/sounds/linphone/ringback.wav
local_ring=/usr/share/sounds/linphone/toy-mono.wav
playback_gain_db=0.000000
mic_gain_db=0.000000
ringer_dev_id=ALSA: default
playback_dev_id=ALSA: default
capture_dev_id=ALSA: default

```

---

_[View the full topic](https://forum.ficusonline.com/t/voip-linphone-install-on-orange-pi-pc/25)._
