[Home]

Summary:ASTERISK-28348: Failed to initialize OOH323 endpoint-OOH323 Disabled
Reporter:Dmitry Shubin (dssaster@comita.ru)Labels:patch pjsip
Date Opened:2019-03-26 04:23:49Date Closed:2019-04-12 09:20:07
Priority:MinorRegression?
Status:Closed/CompleteComponents:Addons/chan_ooh323
Versions:16.2.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:( 0) asterisk.conf
( 1) ASTERISK-28348-1.patch
( 2) ASTERISK-28348-2.patch
( 3) configure.log
( 4) make_install.log
( 5) make.log
( 6) modules.conf
( 7) ooh323.conf
Description:I’ve compiled latest asterisk-16.2.1 with chan_ooh323, but this module can’t start even with default config after make samples!
I’ve got error:
{quote}
> ERROR[22478]: chan_ooh323.c:3842 load_module: Failed to initialize OOH323 endpoint-OOH323 Disabled

sipsrv1*CLI> module show like 323
Module                         Description                              Use Count  Status      Support Level
chan_ooh323.so                 Objective Systems H323 Channel           0          Not Running      extended
1 modules loaded

sipsrv1*CLI> module load chan_ooh323.so
Unable to load module chan_ooh323.so
Command 'module load chan_ooh323.so ' failed.
   --   == Setting default context to default
[Mar 25 16:07:26] ERROR[2348]: chan_ooh323.c:3842 load_module: Failed to initialize OOH323 endpoint-OOH323 Disabled
{quote}

No errors during compilation or configuration (Configuration and compilation logs attached):
./contrib/scripts/install_prereq test
./configure --prefix=/usr/local/asterisk-16.2.1 --sysconfdir=/etc/aster16lts --localstatedir=/var/aster16lts --with-ssl --with-srtp --with-netsnmp --with-jansson-bundled --with-pjproject-bundled
menuselect.makeopts
make
make install
make samples

{quote}
root@sipsrv1:/usr/local/asterisk-16.2.1/lib/asterisk/modules# ldd chan_ooh323.so
       linux-vdso.so.1 =>  (0x00007fffd6c75000)
       libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6783bc5000)
       libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6783839000)
       /lib64/ld-linux-x86-64.so.2 (0x00007f678413e000)
{quote}

{quote}
root@sipsrv1:/usr/local/asterisk-16.2.1/lib/asterisk/modules# lsof -nPi
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
ntpd     1859  ntp   16u  IPv4   7184      0t0  UDP *:123
ntpd     1859  ntp   17u  IPv4   7188      0t0  UDP 127.0.0.1:123
ntpd     1859  ntp   18u  IPv4   7189      0t0  UDP 192.168.164.114:123
sshd     1950 root    3u  IPv4   4558      0t0  TCP *:22 (LISTEN)
snmpd    1992 snmp    9u  IPv4   5975      0t0  UDP 127.0.0.1:161
snmpd    1992 snmp   10u  IPv4   5951      0t0  UDP *:56552
asterisk 2019 root   12u  IPv4   6041      0t0  UDP *:4569
asterisk 2019 root   13u  IPv4   6044      0t0  TCP *:2000 (LISTEN)
asterisk 2019 root   15u  IPv4   6049      0t0  UDP *:5060
asterisk 2019 root   16u  IPv4   6050      0t0  UDP *:2727
asterisk 2019 root   17u  IPv4   6051      0t0  UDP *:5000
asterisk 2019 root   18u  IPv4   6054      0t0  UDP *:4520
master   2069 root   12u  IPv4   6235      0t0  TCP *:25 (LISTEN)
sshd     2120 root    3r  IPv4   6017      0t0  TCP 192.168.164.114:22->192.168.164.45:38471 (ESTABLISHED)
sshd     2167 root    3r  IPv4   6068      0t0  TCP 192.168.164.114:22->192.168.164.45:38485 (ESTABLISHED)
sshd     2256 root    3r  IPv4   6078      0t0  TCP 192.168.164.114:22->192.168.164.45:38488 (ESTABLISHED)
sshd     2349 root    3r  IPv4   6796      0t0  TCP 192.168.164.114:22->192.168.164.45:38509 (ESTABLISHED)
sshd     2467 root    3r  IPv4   7539      0t0  TCP 192.168.164.114:22->192.168.164.45:38543 (ESTABLISHED)
{quote}

{quote}
root@sipsrv1:/usr/local/asterisk-16.2.1/lib/asterisk/modules# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
   link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
   inet 127.0.0.1/8 scope host lo
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UNKNOWN qlen 1000
   link/ether 00:50:56:a3:6d:c6 brd ff:ff:ff:ff:ff:ff
   inet 192.168.164.114/22 brd 192.168.167.255 scope global eth0
{quote}

Part from make log:
{quote}
  [CC] chan_ooh323.c -> chan_ooh323.o
  [CC] ooh323c/src/ooCmdChannel.c -> ooh323c/src/ooCmdChannel.o
  [CC] ooh323c/src/ooLogChan.c -> ooh323c/src/ooLogChan.o
  [CC] ooh323c/src/ooUtils.c -> ooh323c/src/ooUtils.o
  [CC] ooh323c/src/ooGkClient.c -> ooh323c/src/ooGkClient.o
  [CC] ooh323c/src/context.c -> ooh323c/src/context.o
  [CC] ooh323c/src/ooDateTime.c -> ooh323c/src/ooDateTime.o
  [CC] ooh323c/src/decode.c -> ooh323c/src/decode.o
  [CC] ooh323c/src/dlist.c -> ooh323c/src/dlist.o
  [CC] ooh323c/src/encode.c -> ooh323c/src/encode.o
  [CC] ooh323c/src/errmgmt.c -> ooh323c/src/errmgmt.o
  [CC] ooh323c/src/memheap.c -> ooh323c/src/memheap.o
  [CC] ooh323c/src/ootrace.c -> ooh323c/src/ootrace.o
  [CC] ooh323c/src/oochannels.c -> ooh323c/src/oochannels.o
  [CC] ooh323c/src/ooh245.c -> ooh323c/src/ooh245.o
  [CC] ooh323c/src/ooports.c -> ooh323c/src/ooports.o
  [CC] ooh323c/src/ooq931.c -> ooh323c/src/ooq931.o
  [CC] ooh323c/src/ooCapability.c -> ooh323c/src/ooCapability.o
  [CC] ooh323c/src/ooSocket.c -> ooh323c/src/ooSocket.o
  [CC] ooh323c/src/perutil.c -> ooh323c/src/perutil.o
  [CC] ooh323c/src/eventHandler.c -> ooh323c/src/eventHandler.o
  [CC] ooh323c/src/ooCalls.c -> ooh323c/src/ooCalls.o
  [CC] ooh323c/src/ooStackCmds.c -> ooh323c/src/ooStackCmds.o
  [CC] ooh323c/src/ooh323.c -> ooh323c/src/ooh323.o
  [CC] ooh323c/src/ooh323ep.c -> ooh323c/src/ooh323ep.o
  [CC] ooh323c/src/printHandler.c -> ooh323c/src/printHandler.o
  [CC] ooh323c/src/rtctype.c -> ooh323c/src/rtctype.o
  [CC] ooh323c/src/ooTimer.c -> ooh323c/src/ooTimer.o
  [CC] ooh323c/src/h323/H235-SECURITY-MESSAGESDec.c -> ooh323c/src/h323/H235-SECURITY-MESSAGESDec.o
  [CC] ooh323c/src/h323/H235-SECURITY-MESSAGESEnc.c -> ooh323c/src/h323/H235-SECURITY-MESSAGESEnc.o
  [CC] ooh323c/src/h323/H323-MESSAGES.c -> ooh323c/src/h323/H323-MESSAGES.o
  [CC] ooh323c/src/h323/H323-MESSAGESDec.c -> ooh323c/src/h323/H323-MESSAGESDec.o
  [CC] ooh323c/src/h323/H323-MESSAGESEnc.c -> ooh323c/src/h323/H323-MESSAGESEnc.o
  [CC] ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROL.c -> ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROL.o
  [CC] ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROLDec.c -> ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROLDec.o
  [CC] ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROLEnc.c -> ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROLEnc.o
  [CC] ooh323cDriver.c -> ooh323cDriver.o
  [LD] chan_ooh323.o ooh323c/src/ooCmdChannel.o ooh323c/src/ooLogChan.o ooh323c/src/ooUtils.o ooh323c/src/ooGkClient.o ooh323c/src/context.o ooh323c/src/ooDateTime.o ooh323c/src/decode.o ooh323c/src/dlist.o ooh323c/src/encode.o ooh323c/src/errmgmt.o ooh323c/src/memheap.o ooh323c/src/ootrace.o ooh323c/src/oochannels.o ooh323c/src/ooh245.o ooh323c/src/ooports.o ooh323c/src/ooq931.o ooh323c/src/ooCapability.o ooh323c/src/ooSocket.o ooh323c/src/perutil.o ooh323c/src/eventHandler.o ooh323c/src/ooCalls.o ooh323c/src/ooStackCmds.o ooh323c/src/ooh323.o ooh323c/src/ooh323ep.o ooh323c/src/printHandler.o ooh323c/src/rtctype.o ooh323c/src/ooTimer.o ooh323c/src/h323/H235-SECURITY-MESSAGESDec.o ooh323c/src/h323/H235-SECURITY-MESSAGESEnc.o ooh323c/src/h323/H323-MESSAGES.o ooh323c/src/h323/H323-MESSAGESDec.o ooh323c/src/h323/H323-MESSAGESEnc.o ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROL.o ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROLDec.o ooh323c/src/h323/MULTIMEDIA-SYSTEM-CONTROLEnc.o ooh323cDriver.o -> chan_ooh323.so
{quote}

ooh323.conf (lines beginning with “;” was removed):
{quote}
[general]
bindaddr=0.0.0.0
h323id=ObjSysAsterisk
e164=100
callerid=asterisk
aniasdni=no
gatekeeper = DISABLE
context=default
disallow=all     ;Note order of disallow/allow is important.
allow=gsm
allow=ulaw
dtmfmode=rfc2833
faxdetect = cng
directmedia=no
directrtpsetup=no

[myuser1]
type=user
context=context1
disallow=all
allow=gsm
allow=ulaw

[myfriend1]
type=friend
context=default
ip=10.0.0.82   ; UPDATE with appropriate ip address
port=1820    ; UPDATE with appropriate port
disallow=all
allow=ulaw
e164=12345
rtptimeout=60
dtmfmode=rfc2833
{quote}
Comments:By: Asterisk Team (asteriskteam) 2019-03-26 04:23:49.803-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: Dmitry Shubin (dssaster@comita.ru) 2019-03-26 08:55:14.488-0500

It seems, because of old libc or other libs. I have libc6:amd64  2.13-38+deb7u6

ERROR[2019] loader.c: Error loading module 'res_pjsip.so': /usr/local/asterisk-16.2.1/lib/asterisk/modules/res_pjsip.so: undefined symbol: pj_ssl_cipher_name

Please, update /contrib/scripts/install_prereq to check required libs versions.

By: Alexander Anikin (may213) 2019-03-27 15:50:24.234-0500

Hi,

Dmitry, could you please check if directory /var/log/asterisk exists or
insert location of h323 logfiles in your ooh323 config in [general]:
logfile=<your asterisk installation log path>/h323_log

Looks like OOH323 stack couldn't create his log.


By: Dmitry Shubin (dssaster@comita.ru) 2019-03-28 05:22:12.069-0500

I attach asterisk.conf, modules.conf, ooh323.conf.




By: Dmitry Shubin (dssaster@comita.ru) 2019-03-28 05:26:24.078-0500

Thnx - problem was in log file!
When I added line in ooh323 config:
{quote}
logfile=/var/aster16lts/log/asterisk/h323_log
{quote}

I attached asterisk.conf and we can see logdir settings:
{quote}
astlogdir => /var/aster16lts/log/asterisk
{quote}

Module started successfully!
{quote}
sipsrv1*CLI> module load chan_ooh323.so
Loaded chan_ooh323.so
   --   == Setting default context to default
 == Registered channel type 'OOH323' (Objective Systems H323 Channel Driver)
 == Registered RTP glue 'OOH323'
Loaded chan_ooh323.so => (Objective Systems H323 Channel)
{quote}

By: Dmitry Shubin (dssaster@comita.ru) 2019-03-28 05:45:41.083-0500

But it will be good, if you'll fix ooh323 to get path to logfile from astlogdir variable in asterisk.conf

Great thanks for helping me!

By: Alexander Anikin (may213) 2019-03-28 06:04:55.736-0500

Hi,

Yes, the issue was in hard-coded h323 log file name with path.
Please try to test with attached patch where default log name construct with astlogdir value included. And If you specify logfile in ooh323.conf without leading '/' astlogdir value will preceeded to log file

By: Dmitry Shubin (dssaster@comita.ru) 2019-03-28 11:45:17.473-0500

Everything is fine with the commented out logfile var as default:
;logfile=/var/aster16lts/log/asterisk/h323_log

and when the log file was set:
logfile=323.log

But when I set full path, log file is not created:
logfile=/var/log/asterisk/323test.log

Sorry for my poor, poor english... It is hard to explain....
In ooh323.conf there are expamples to set logfile var as a full path like:
;Default - /var/log/asterisk/h323_log

But if someone configure and compile asterisk with params like:
./configure --localstatedir=DIR     #modifiable single-machine data [PREFIX/var]
./configure --prefix=PREFIX         #install architecture-independent files in PREFIX                    [/usr/local]

Logs dir will be changed! And it can't be hardcoded like #define DEFAULT_LOGFILE "/var/log/asterisk/h323_log"
This default variable must be like /astlogdir/h323_log

I think it will be good if you can add some error handling in file creation problems. Someone may have issues like me, someone - mistakes in the path, someone - in file or dir permissions. And module is not loaded and it is hard to understand why... Its hard to troubleshoot it...

By: Alexander Anikin (may213) 2019-03-31 17:30:16.582-0500

Hi Dmitry,

Please try the issue again with attached second patch. It shoud applied to clean asterisk sources without previous patch.
h.323 tracefile name isn't harcoded with absolute path now. Error string now return back from OOH323 Endpoint init to chan_ooh323 and displayed in error message on asterisk console/logs



By: Dmitry Shubin (dssaster@comita.ru) 2019-04-01 04:14:23.739-0500

Everything is fine now:
1) h323_log is creating by default in correct path that was set in localstatedir
2) If log file is can't be created (Wrong permissions, ,directory is absent, wrong path was set in logfile) - I've got correct message like "ERROR[7574]: chan_ooh323.c:3847 load_module: Failed to initialize OOH323 endpoint: Error:Failed to open trace file /var/log/asterisk/h323_log for write"

Now its OK, thnx a lot!

By: Alexander Anikin (may213) 2019-04-10 18:16:27.066-0500

Thanks Dmitry,

I will commit the patch and close issue.


By: Friendly Automation (friendly-automation) 2019-04-12 09:20:09.394-0500

Change 11258 merged by Friendly Automation:
chan_ooh323: fix h323 log file path

[https://gerrit.asterisk.org/c/asterisk/+/11258|https://gerrit.asterisk.org/c/asterisk/+/11258]

By: Friendly Automation (friendly-automation) 2019-04-12 09:20:27.249-0500

Change 11263 merged by Friendly Automation:
chan_ooh323: fix h323 log file path

[https://gerrit.asterisk.org/c/asterisk/+/11263|https://gerrit.asterisk.org/c/asterisk/+/11263]

By: Friendly Automation (friendly-automation) 2019-04-12 09:21:06.122-0500

Change 11259 merged by Friendly Automation:
chan_ooh323: fix h323 log file path

[https://gerrit.asterisk.org/c/asterisk/+/11259|https://gerrit.asterisk.org/c/asterisk/+/11259]