# Flexisip:RegEvent Server

**URL:** https://forum.ficusonline.com/t/topic/511
**Category:** Server
**Created:** [2024 年 6 月 2 日午前 1:17 UTC](https://forum.ficusonline.com/t/topic/511 "2024-06-02T01:17:51Z")
**Posts on this page:** 2
**Page:** 1

<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: [2024 年 6 月 2 日午前 1:17 UTC](https://forum.ficusonline.com/t/topic/511/1 "2024-06-02T01:17:51Z")

</div>

### FlexisipのRegEventサーバーとは？

FlexisipのRegEventサーバーは、RFC3680に基づいて動作します。このRFCは、SIP（セッション開始プロトコル）の「reg」イベントに関する仕様を定めたもので、具体的には、SIPクライアントがサーバーに対して「自分の登録情報がどうなっているのか教えてほしい」というリクエスト（SUBSCRIBEメッセージ）を送ると、RegEventサーバーがそのリクエストに応答する役割を担います。

### RFC3680の「reg」イベント

RFC3680は、SIPクライアントが自身の登録状態に関する情報を取得するための方法を定義しています。クライアントはSIP SUBSCRIBEメッセージを使ってサーバーに対して登録情報の更新を通知するようにリクエストします。サーバーは、そのリクエストに基づいて、NOTIFYメッセージを送信して登録情報をクライアントに提供します。

### Flexisipの動作概要

1. **SUBSCRIBEの受信** :

- FlexisipのRegEventサーバーは、クライアントからのSIP SUBSCRIBEメッセージを受信します。このメッセージは、クライアントが自身の登録情報の状態を知りたいときに送信します。

1. **登録データベースの参照** :

- 受信したリクエストに応じて、RegEventサーバーは「レジストラデータベース」（登録情報を管理するデータベース）を参照します。このデータベースは、module::Registrarセクションで設定されているものです。

1. **NOTIFYの送信** :

- レジストラデータベースから取得した情報を基に、サーバーはクライアントに対してNOTIFYメッセージを送信します。このメッセージには、クライアントの登録情報が含まれています。

> **[regevent-server - XWiki](https://wiki.linphone.org/xwiki/wiki/public/view/Flexisip/A.%20Configuration%20Reference%20Guide/2.3.3/regevent-server)**
>
> regevent-server

> **[RegEvent - XWiki](https://wiki.linphone.org/xwiki/wiki/public/view/Flexisip/A.%20Configuration%20Reference%20Guide/2.3.3/module/RegEvent)**
>
> RegEvent

 ![Screenshot from 2024-06-02 10-27-13](https://forum.ficusonline.com/uploads/default/original/2X/b/b9e3eae452adff96fc255819fefee23bc07bea9c.png)

起動コマンド

```auto
# flexisip --server regevent <option: --debug> <option: --daemon> 

```

---

<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: [2024 年 6 月 3 日午前 5:05 UTC](https://forum.ficusonline.com/t/topic/511/2 "2024-06-03T05:05:38Z")

</div>

## regevent server error

> <https://github.com/BelledonneCommunications/flexisip/issues/185>
>
> Hi again guys,
> 
> Do we still need to run systemctl start flexisip-regevent as i…mplied by the comments in flexisip.conf?
> \`\`\`
> \# Servers started by default when no --server option is specified
> \# on command line. Possible values are 'proxy', 'presence', 'conference',
> \# 'regevent' separated by whitespaces.
> \`\`\`
> 
> I ask if this has been deprecated because your wiki makes no mention of regevent service, only proxy, presence and conference as can be \[seen here\](https://wiki.linphone.org/xwiki/wiki/public/view/Flexisip/1.%20Installation/) which is confusing:
> 
> \`\`\`
> Flexisip's executable is installed in /opt/belledonne-communications/bin/flexisip . Running it without any argument will make Flexisip behave as a SIP proxy, but it can provide other kind of services. This can be chosen by using --server command-line argument, which takes three values:
> 
> proxy: launch Flexisip as a SIP proxy (default behaviour).
> presence: launch Flexisip as a \[presence server\](https://wiki.linphone.org/xwiki/wiki/public/view/Flexisip/C.%20Features/Presence%20server/).
> conference: launch Flexisip as a conference server (group chat).
> \`\`\`
> 
> When I do try to start flexisip-regevent I get a core dump because of missing database support (I think that's why it crashes):
> \`\`\`
> liblinphone-warning-Database explicitely not requested, this Core is built with no database support.
> liblinphone-message-Using \[/root/.local/share/linphone/call-history.db\] as legacy call history database path
> \`\`\`
> Doesn't the regevent service use by default the same flexisip.conf as proxy, presence and conference? The other 3 services start normally and obviously they are using the database configured in flexisip.conf so I don't understand why regevent crashes.
> I am probably doing something wrong but it is hard to understand what's the current best practice to get it working.
> 
> Any ideas?
> 
> Cheers

gdbの実行(run)とbt(back trace)によるエラー箇所の確認

```auto
$ docker compose exec ubuntu-flexisip bash

# gdb --args ./bin/flexisip --server regevent
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./bin/flexisip...
(No debugging symbols found in ./bin/flexisip)
(gdb) run
Starting program: /opt/belledonne-communications/bin/flexisip --server regevent
warning: Error disabling address space randomization: Operation not permitted
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Writing logs in : /var/opt/belledonne-communications/log/flexisip/flexisip-regevent.log
Starting flexisip regevent-server version 2.3.3
[New Thread 0x775b44e00640 (LWP 90)]
2024-05-31 04:46:09:420 liblinphone-error-Could not find a suitable soundcard with capabilities : 2
2024-05-31 04:46:09:420 liblinphone-error-Could not find a suitable soundcard with capabilities : 2
2024-05-31 04:46:09:420 liblinphone-error-Could not find a suitable soundcard with capabilities : 1
2024-05-31 04:46:09:420 liblinphone-error-Could not find a suitable soundcard with capabilities : 2

Thread 1 "flexisip" received signal SIGSEGV, Segmentation fault.
0x0000775b4849614d in soci::session::begin() () from /opt/belledonne-communications/lib/libsoci_core.so.4.0
(gdb) bt
#0 0x0000775b4849614d in soci::session::begin() () from /opt/belledonne-communications/lib/libsoci_core.so.4.0
#1 0x0000775b492f2bed in LinphonePrivate::MainDbPrivate::importLegacyHistory(LinphonePrivate::DbSession&) () from /opt/belledonne-communications/lib/liblinphone.so.10
#2 0x0000775b492f33ab in LinphonePrivate::MainDb::import(LinphonePrivate::AbstractDb::Backend, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
   from /opt/belledonne-communications/lib/liblinphone.so.10
#3 0x0000775b490c77a2 in linphone_core_set_call_logs_database_path () from /opt/belledonne-communications/lib/liblinphone.so.10
#4 0x0000775b492bd807 in LinphonePrivate::CorePrivate::init() () from /opt/belledonne-communications/lib/liblinphone.so.10
#5 0x0000775b490d59db in linphone_core_start () from /opt/belledonne-communications/lib/liblinphone.so.10
#6 0x0000775b4ac660b6 in flexisip::RegistrationEvent::Server::_init() () from /opt/belledonne-communications/lib/libflexisip.so
#7 0x000058ad77d9fd1c in ?? ()
#8 0x0000775b4a07dd90 in __libc_start_call_main (main=main@entry=0x58ad77d9cb00, argc=argc@entry=3, argv=argv@entry=0x7ffd0e52bac8) at ../sysdeps/nptl/libc_start_call_main.h:58
#9 0x0000775b4a07de40 in __libc_start_main_impl (main=0x58ad77d9cb00, argc=3, argv=0x7ffd0e52bac8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7ffd0e52bab8) at ../csu/libc-start.c:392
#10 0x000058ad77da0ea5 in ?? ()

(gdb) bt full
#0 0x000077913e83514d in soci::session::begin() () from /opt/belledonne-communications/lib/libsoci_core.so.4.0
No symbol table info available.
#1 0x000077913f691bed in LinphonePrivate::MainDbPrivate::importLegacyHistory(LinphonePrivate::DbSession&) ()
   from /opt/belledonne-communications/lib/liblinphone.so.10
No symbol table info available.
#2 0x000077913f6923ab in LinphonePrivate::MainDb::import(LinphonePrivate::AbstractDb::Backend, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
   from /opt/belledonne-communications/lib/liblinphone.so.10
No symbol table info available.
#3 0x000077913f4667a2 in linphone_core_set_call_logs_database_path ()
   from /opt/belledonne-communications/lib/liblinphone.so.10
No symbol table info available.
#4 0x000077913f65c807 in LinphonePrivate::CorePrivate::init() ()
   from /opt/belledonne-communications/lib/liblinphone.so.10
No symbol table info available.
#5 0x000077913f4749db in linphone_core_start () from /opt/belledonne-communications/lib/liblinphone.so.10
No symbol table info available.
#6 0x00007791410050b6 in flexisip::RegistrationEvent::Server::_init() ()
   from /opt/belledonne-communications/lib/libflexisip.so
No symbol table info available.
#7 0x0000606f105fad1c in ?? ()
No symbol table info available.
#8 0x000077914041cd90 in __libc_start_call_main (main=main@entry=0x606f105f7b00, argc=argc@entry=3,

```
