Giter Club home page Giter Club logo

h323plus's Introduction

h323plus's People

Contributors

brad0 avatar eustas avatar lastique avatar qiao-hq avatar shorne89 avatar willamowius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

h323plus's Issues

Add lookup for ptlib-config

Hi!

Could you please add this patch into configure.ac - it's for macports build:

  •    AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/bin:/usr/bin)
    
  •    AC_PATH_PROG(PTLIB_CONFIG, ptlib-config, , /usr/local/bin:/usr/bin:/opt/local/bin)
    

configure.ac.diff.txt

A crash occurs when the call is immediately hung up

Enter the function "H323Connection::SendSignalSetup" when I call.

When I immediately hang up, enter the function "H323Connection::CleanUpOnCallEnd"
innerMutex.Wait(); Will enter the locked state, connectionState also changes to ShuttingDownConnection.
However, "signallingChannel->Connect()" is not in the locked interval
image
When connect return, the connectionState value is changed again.
innerMutex.Wait() later causes the thread to fail to exit
image
image

My solution is as follows:

if (connectFailed) {  
  connectionState = NoConnectionActive;
  switch (signallingChannel->GetErrorNumber()) {
    case ENETUNREACH :
      reason = EndedByUnreachable;
      break;
    case ECONNREFUSED :
      reason = EndedByNoEndPoint;
      break;
    case ETIMEDOUT :
      reason = EndedByHostOffline;
      break;
    default:
       reason = EndedByConnectFail;
  }
}

Move this code under Lock

  // Lock while checking for shutting down.
  if (!Lock())
    return EndedByCallerAbort;
  else if (reason != NumCallEndReasons)
    return reason;

result

// Lock while checking for shutting down.
 if (!Lock())
   return EndedByCallerAbort;
 else if (reason != NumCallEndReasons)
   return reason;
 
 // See if transport connect failed, abort if so.
 if (connectFailed) {
   connectionState = NoConnectionActive;
   switch (signallingChannel->GetErrorNumber()) {
     case ENETUNREACH :
   	reason = EndedByUnreachable;
   	break;
     case ECONNREFUSED :
   	reason = EndedByNoEndPoint;
   	break;
     case ETIMEDOUT :
   	reason = EndedByHostOffline;
   	break;
     default:
   	 reason = EndedByConnectFail;
   }
 }

Adjust the location of "connectFailed" again
Please excuse my poor English!!!

segmentation fault with h263-1998_video_pwplugin.so

Hi, I get segmentation fault when I run simph323:

simple > gdb ./obj_linux_x86_64_d_s/simph323
GNU gdb (GDB) 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-pc-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 ./obj_linux_x86_64_d_s/simph323...
(gdb) r
Starting program: /home/h/h323plus/samples/simple/obj_linux_x86_64_d_s/simph323
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0 0x0000000000000000 in ?? ()
#1 0x00007ffff7fbaa27 in FFMPEGLibrary::AvSetDimensions(AVCodecContext*, int, int) ()
from /usr/local/lib/opal-1.27.2/codecs/video/h263-1998_video_pwplugin.so
#2 0x00007ffff7fb5b8c in H263_Base_EncoderContext::SetFrameWidth(unsigned int) () from /usr/local/lib/opal-1.27.2/codecs/video/h263-1998_video_pwplugin.so
#3 0x00007ffff7fb5e03 in H263_Base_EncoderContext::Open(CodecID) () from /usr/local/lib/opal-1.27.2/codecs/video/h263-1998_video_pwplugin.so
#4 0x00007ffff7fb5e8c in H263_RFC2190_EncoderContext::Open() () from /usr/local/lib/opal-1.27.2/codecs/video/h263-1998_video_pwplugin.so
#5 0x00007ffff7fb6eb4 in create_encoder(PluginCodec_Definition const*) () from /usr/local/lib/opal-1.27.2/codecs/video/h263-1998_video_pwplugin.so
#6 0x000055555578b48e in OpalPluginCodec::OpalPluginCodec (this=0x555555dc35d0, _codecDefn=0x7ffff7fc14a0 ) at h323pluginmgr.cxx:129
#7 0x00005555557844e9 in H323PluginCodecManager::CreateCapabilityAndMediaFormat (this=0x555555d80070, encoderCodec=0x7ffff7fc14a0 ,
decoderCodec=0x7ffff7fc1530 <h263CodecDefn+144>) at h323pluginmgr.cxx:3066
#8 0x0000555555783710 in H323PluginCodecManager::RegisterCodecs (this=0x555555d80070, count=6, _codecList=0x7ffff7fc14a0 )
at h323pluginmgr.cxx:2813
#9 0x0000555555783408 in H323PluginCodecManager::OnLoadPlugin (this=0x555555d80070, dll=..., code=0) at h323pluginmgr.cxx:2734
#10 0x0000555555a8040c in PPluginModuleManager::OnLoadModule (this=0x555555d80070, dll=..., code=0) at ptlib/common/pluginmgr.cxx:500
#11 0x0000555555789bdd in PPluginModuleManager::OnLoadModule_PNotifier::Call (this=0x555555dc2e90, note=..., extra=0)
at /home/h/ptlib/include/ptlib/pluginmgr.h:165
#12 0x00005555556d52a4 in PNotifierTemplate::operator() (this=0x555555dc2a90, notifier=..., extra=0) at /home/h/ptlib/include/ptlib/notifier.h:129
#13 0x0000555555a801f7 in PPluginManager::CallNotifier (this=0x555555cc5420 PPluginManager::GetPluginManager()::systemPluginMgr, dll=...,
code=PPluginManager::LoadingPlugIn) at ptlib/common/pluginmgr.cxx:466
#14 0x0000555555a80026 in PPluginManager::AddNotifier (this=0x555555cc5420 PPluginManager::GetPluginManager()::systemPluginMgr, notifyFunction=...,
existing=true) at ptlib/common/pluginmgr.cxx:444
#15 0x00005555557830ac in H323PluginCodecManager::H323PluginCodecManager (this=0x555555d80070, _pluginMgr=0x0) at h323pluginmgr.cxx:2689
#16 0x00005555556b3b4f in PFactory<PPluginModuleManager, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >::Worker::Create (this=0x555555cc0d40 ) at /home/h/ptlib/include/ptlib/pfactory.h:238
#17 0x0000555555a819aa in PFactory<PPluginModuleManager, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >::WorkerBase::CreateInstance (this=0x555555cc0d40 , key="h323PluginCodecManager") at /home/h/ptlib/include/ptlib/pfactory.h:182
#18 0x0000555555a816d5 in PFactory<PPluginModuleManager, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >::CreateInstance_Internal (this=0x555555cd7f50, key="h323PluginCodecManager") at /home/h/ptlib/include/ptlib/pfactory.h:389
#19 0x0000555555a80f60 in PFactory<PPluginModuleManager, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >::CreateInstance (
key="h323PluginCodecManager") at /home/h/ptlib/include/ptlib/pfactory.h:281
#20 0x0000555555a80535 in PluginLoaderStartup::OnStartup (this=0x555555d81370) at ptlib/common/pluginmgr.cxx:518
#21 0x0000555555a93fd5 in PProcess::PProcess (this=0x555555d806b0, manuf=0x555555abb0ca "H323Plus", name=0x555555abb0c3 "simple", major=1, minor=27,
stat=PProcess::ReleaseCode, build=2, library=false) at ptlib/common/osutils.cxx:1627
#22 0x00005555556a907b in SimpleH323Process::SimpleH323Process (this=0x555555d806b0) at main.cxx:56
#23 0x00005555556a8fe3 in main (argc=1, argv=0x7fffffffdc18, envp=0x7fffffffdc28) at main.cxx:50

plugins path:

video> pwd
/usr/local/lib/opal-1.27.2/codecs/video
video> ls
h261-vic_video_pwplugin.so h263-ffmpeg_video_pwplugin.so h264_video_pwplugin.so
h263-1998_video_pwplugin.so h264_video_pwplugin_helper

if I remove /usr/local/lib/opal-1.27.2/codecs/video/h263-1998_video_pwplugin.so, simph323 runs ok.

platform:

Linux arch 5.15.76-1-MANJARO #1 SMP PREEMPT Sat Oct 29 14:22:16 UTC 2022 x86_64 GNU/Linux

ffmpeg: ffmpeg-0.5.14.tar.gz build from source
x264: x264-snapshot-20140101-2245-stable.tar.bz2 build from source

There is a bug in the 'Q931::SetBearerCapabilities' function

There is a bug in the 'Q931::SetBearerCapabilities' function, when the call bandwidth is 2048kbps, data[1] should be equal to 0x18.
And 'Q931::SetBearerTransferRate' should not be called, otherwise the call bandwidth cannot be greater than 1920kbps.

image

Helpwanted: How can I share my desktop with simpleh323!

I used simpleh323 to share my desktop to Polycom HDX7000 but it said that:
"H.239 open error: Remote may not support feature".
I have already configure h323plus with --enable-h239!
I can't find what's wrong there. Help me please!

RTP Jitter thread consumes 100% CPU

Dear,

I've tested with my own implemented audio capability and I found that RTP Jitter buffer consumes 100% CPU. If I change "needJitter" to FALSE in OpalMediaFormat, the CPU become normal. My Platform is CentOS 7 3.10.0-862.9.1.el7.x86_64. I attached here my sample that I modified from simple sample. Please check.
simple_test.tar.gz

PTLib can't be found during cross compile, but ptlib-config is found.

I am in the process of packaging h323plus for Void Linux so that we can have h323 support in Yate. Void makes extensive use of cross compiling, and it looks like something between the way void drives the build and how h323plus expects to be informed it is being cross compiled are out of sync:

checking for ptlib-config... /usr/bin/ptlib-config
checking for /usr/share/ptlib//make/lib.mak... configure: error: cannot check for file existence when cross compiling

(Full log here)

Given that I'm on 1.27.2 which explicitly lists improved cross support I feel like this is an issue with the way I'm running the build. Have I missed something obvious?

plugins compilation error

hi, I get some errors while compiling a/v plugins, fixed by:

diff --git a/plugins/audio/G.722.2/AMR-WB/enc_if.c b/plugins/audio/G.722.2/AMR-WB/enc_if.c
index 2d93f6d..089e4b5 100644
--- a/plugins/audio/G.722.2/AMR-WB/enc_if.c
+++ b/plugins/audio/G.722.2/AMR-WB/enc_if.c
@@ -74,7 +74,7 @@ extern const Word16 dfh_M24k[];
 /* overall table with the parameters of the
    decoder homing frames for all modes */
 
-const Word16 *dhf[10];
+extern const Word16 *dhf[10];
 
 
 /*
diff --git a/plugins/video/common/dyna.cxx b/plugins/video/common/dyna.cxx
index f7e4948..c01be27 100644
--- a/plugins/video/common/dyna.cxx
+++ b/plugins/video/common/dyna.cxx
@@ -114,7 +114,7 @@ bool DynaLink::InternalOpen(const char * dir, const char *name)
   }
 TRACE(1, "\tDYNA\tLoading " << path);
 #ifndef _WIN32
-  if (strlen(path) < (sizeof(path) - strlen(".so"))
+  if (strlen(path) < (sizeof(path) - strlen(".so")))
     strcat(path, ".so");
 #endif

my platform:

Linux arch 5.15.76-1-MANJARO #1 SMP PREEMPT Sat Oct 29 14:22:16 UTC 2022 x86_64 GNU/Linux

Add support H.235 for H.239

I don't have permission to commit so I write it here. I have patched for supporting H.235 for H.239. Please review it. I renamed to mypatch.txt cause this not support "patch" extension
mypatch.txt

Build h323plus/plugins fail

Build h323plus/plugins on Ubuntu 22 with master sources,I got below error:

../common/dyna.cxx:118:5: error: expected ‘)’ before ‘strcat’

Looks like is a bug....

DynaLink::Open strncpy ptlibPath may not be null-terminated

In crc\h323plus\plugins\video\common\dyna.cxx:81

  // try directories specified in PTLIBPLUGINDIR
  char ptlibPath[1024];
  memset(ptlibPath, 0, sizeof(ptlibPath));
  char * env = ::getenv("PTLIBPLUGINDIR");
  if (env != NULL)
    strncpy(ptlibPath, env, sizeof(ptlibPath));  // <-- if PTLIBPLUGINDIR's length is bigger than 1024, ptlibPath may not be null-terminated

  char * p = ::strtok(ptlibPath, PATH_SEP);

Test

// clang -g -o dyna -fsanitize=address dyna.c && PTLIBPLUGINDIR=1234567890123456 ./dyna

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
{
  char ptlibPath[16];
  memset(ptlibPath, 0, sizeof(ptlibPath));
  char * env = getenv("PTLIBPLUGINDIR");
  if (env != NULL)
    strncpy(ptlibPath, env, sizeof(ptlibPath));
  char * p = strtok(ptlibPath, ":");
  return p == NULL;
}
=================================================================
==1884==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffea936e110 at pc 0x559f5fe449c1 bp 0x7ffea936e0d0 sp 0x7ffea936d890
READ of size 17 at 0x7ffea936e110 thread T0
    #0 0x559f5fe449c0 in strtok (/home/qiuhao/tmp/dyna+0x369c0) (BuildId: 48b1a96d205a9787b7359e57c7c5636c83bc1a88)
    #1 0x559f5fee9fbe in main /home/qiuhao/tmp/dyna.c:14:14
    #2 0x7f016f5d6d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #3 0x7f016f5d6e3f in __libc_start_main csu/../csu/libc-start.c:392:3
    #4 0x559f5fe2c314 in _start (/home/qiuhao/tmp/dyna+0x1e314) (BuildId: 48b1a96d205a9787b7359e57c7c5636c83bc1a88)
......

Fix

qiuhao@HW0018292:~/tmp$ diff dyna_fix.c dyna.c
13c13
<     strncpy(ptlibPath, env, sizeof(ptlibPath) - 1);
---
>     strncpy(ptlibPath, env, sizeof(ptlibPath));

Thanks,
  Qiuhao Li, Zoom Video Communications, Inc.

Setting PWLIBPLUGINDIR and no sound card is found anymore

I compiled the audio plugins and installed them with make install . Then I set PWLIBPLUGINDIR=/usr/local/lib/opal-1.27.2/codecs/audio (I tried also a local path before make install- same result). When this is done all my audio devices are gone in the program.

 ./simph323 -P "G.726-16k{sw}" -s "Sennheiser USB headset" -l -n
simple Version 1.27.2 by H323Plus on Unix Linux (5.4.0-81-generic-x86_64)

2021/09/28 23:17:50.288	0	                (0)		Version 1.27.2 by H323Plus on Unix Linux (5.4.0-81-generic-x86_64) with PTLib (v2.10.9 (svn:0)) at 2021/9/28 23:17:50.288
Device for sound ("Sennheiser USB headset") must be one of:
  "Null Audio"
  "*.wav"

When not setting the PWLIBPLUGINDIR I can use all sound devices, but the plugins are missing. What is wrong?

simph323 no speex support when compiled

When running the simph323 sample app it does not list Speex as supported codec. What is wrong?

2021/09/28 02:36:44.239	0	                (0)		Version 1.27.2 by H323Plus on Unix Linux (5.4.0-81-generic-x86_64) with PTLib (v2.10.9 (svn:0)) at 2021/9/28 2:36:44.239
Available Video Drivers: 
FakeVideo
Shm
YUVFile
FFMPEG
V4L2
Using video driver *
Local username: foobar
Silence compression is Disabled
Auto answer is 0
FastConnect is Disabled
H245Tunnelling is Enabled
H245QoS is Enabled
Jitter buffer: 50-250 ms
Sound output device: "Default"
Sound  input device: "Default"
Codecs (in preference order):
 Table:
   G.711-ALaw-64k <1>
   G.711-uLaw-64k <2>
   UserInput/hookflash <3>
   UserInput/basicString <4>
   UserInput/dtmf <5>
   UserInput/RFC2833 <6>
 Set:
   0:
     0:
       G.711-ALaw-64k <1>
       G.711-uLaw-64k <2>
     1:
       UserInput/hookflash <3>
     2:
       UserInput/basicString <4>
       UserInput/dtmf <5>
       UserInput/RFC2833 <6>

Available Features: 
Std9	QoS Monitoring-H.460.9
Std18	NatTraversal-H.460.18
Std19	NatTraversal-H.460.19
Std22	H.225.0 Sec-H.460.22
Std23	P2Pnat Detect-H.460.23
Std24	P2Pnat Media-H.460.24

Available NAT Methods: 
STUN
H46019
H46024
GnuGk

Available Security: 
H2351_Authenticator
SimpleCAT
SimpleMD5
TimeSync

Waiting for incoming calls for "foobar"
Press X to exit.
H323>

The library compilation and the resulting .so should support it. This is the output of configure:

                             GSM :  yes (system)
                          gsm-amr :  yes
                             iLBC :  yes (internal)
                            Speex :  yes (internal, version 1.1.11.1)
                            LPC10 :  yes
                            G.726 :  yes
                        IMA_ADPCM :  yes
                              SBC :  no

                           H.261  :  yes
                           H.263  :  no (ffmpeg version)
                     H.263/H.263+ :  no
                           H.264  :  no
                          THEORA  :  no
                    MPEG4 Part 2  :  no
                            CELT  :  no

Several security issue abot h323plus

HI,
I've found several security issue about h323plus.

I don't think it is a good idea to config plugin directiory by environment variable, it may lead to several problem. And attackers may set malicious enviroment in some way like setenv, putenv, or something like shellshock, etc. There are a few issues related to it.

Buffer Overflow in dyna.cxx

h323plus/plugins/video/common/dyna.cxx


bool DynaLink::Open(const char *name)
{
  ...
  // try directories specified in PTLIBPLUGINDIR
  char ptlibPath[1024];
  memset(ptlibPath, 0, sizeof(ptlibPath));
  char * env = ::getenv("PTLIBPLUGINDIR");               << untrusted input
  if (env != NULL) 
    strcpy(ptlibPath, env);                              << strcpy here may buffer overflow
  ...
}

bool DynaLink::InternalOpen(const char * dir, const char *name)
{
  char path[1024];
  memset(path, 0, sizeof(path));

  // Copy the directory to "path" and add a separator if necessary
  if (strlen(dir) > 0) {
    strcpy(path, dir);                                   << buffer overflow possibily here
    if (path[strlen(path)-1] != DIR_SEPARATOR[0]) 
      strcat(path, DIR_SEPARATOR);                       << buffer overflow possibily here
  }
  strcat(path, name);                                    << buffer overflow possibily here

  if (strlen(path) == 0) {
    TRACE(1, _codecString << "\tDYNA\tdir '" << (dir != NULL ? dir : "(NULL)") << "', name '" << (name != NULL ? name : "(NULL)") << "' resulted in empty path");
    return false;
  }

#ifndef _WIN32
  strcat(path, ".so");                                   << buffer overflow possibily here
#endif
  ...
}

Suggestion:

Use secure function like strcpy_s/strcat_s instead of strcpy/strcat

Dynamic Link Library Hijack

Also, untrusted source of plugin paths may lead to Dynamic Link Library hijack.

If the PTLIBPLUGINDIR is setted to some other directory with malicious dll/so with same name in it, the code in it will have a chance to be execute.

bool DynaLink::InternalOpen(const char * dir, const char *name)
{
  ...
  // Load the Libary
#ifdef _WIN32
# ifdef UNICODE
  WITH_ALIGNED_STACK({  // must be called before using avcodec lib
     USES_CONVERSION;
    _hDLL = LoadLibrary(A2T(path));                      << may load library from untrusted path
  });
# else
  WITH_ALIGNED_STACK({  // must be called before using avcodec lib
    _hDLL = LoadLibrary(path);                           << may load library from untrusted path
  });
# endif /* UNICODE */
#else
  WITH_ALIGNED_STACK({  // must be called before using avcodec lib
    _hDLL = dlopen((const char *)path, RTLD_NOW);        << may load library from untrusted path
  });
#endif /* _WIN32 */
  ...
}

Suggestion:
Don’t trust environment variable input. Using get module path or hardcoded plugin path to locate library may be much safer, or use reliable configure file instead.

Buffer Overflow in h264-x264.cxx/h264pipe_win32.cxx

h323plus/plugins/video/H.264/h264-x264.cxx
h323plus/plugins/video/H.264/h264pipe_win32.cxx

bool H264EncCtx::findGplProcess()
{
  char * env = ::getenv("PWLIBPLUGINDIR");
  if (env == NULL)
    env = ::getenv("PTLIBPLUGINDIR");
  if (env != NULL) {
    const char * token = strtok(env, DIR_TOKENISER);
    while (token != NULL) {
      if (checkGplProcessExists(token))                            << token from untrusted environment variable
        return true;
      token = strtok(NULL, DIR_TOKENISER);
    }
  }
  ...
}

bool H264EncCtx::checkGplProcessExists (const char * dir)
{
  struct stat buffer;
  memset(gplProcess, 0, sizeof(gplProcess));
  strncpy(gplProcess, dir, sizeof(gplProcess));                    << strncpy here

  if (gplProcess[strlen(gplProcess)-1] != DIR_SEPERATOR[0]) 
    strcat(gplProcess, DIR_SEPERATOR);                             << strcat here may overflow
  strcat(gplProcess, VC_PLUGIN_DIR);                               << strcat here may overflow

  if (gplProcess[strlen(gplProcess)-1] != DIR_SEPERATOR[0]) 
    strcat(gplProcess, DIR_SEPERATOR);                             << strcat here may overflow
  strcat(gplProcess, GPL_PROCESS_FILENAME);                        << strcat here may overflow
  ...
}

Suggestion solution:
Don’t trust environment variable input. Hardcoded plugin path is more safer, or use reliable configure file instead.
Don’t use unsafe function like strcat. snprintf_s is recommanded.

Command Injection in h264-x264.cxx/h264pipe_win32.cxx

h323plus/plugins/video/H.264/h264-x264.cxx
h323plus/plugins/video/H.264/h264pipe_win32.cxx

bool H264EncCtx::findGplProcess()
{
  char * env = ::getenv("PWLIBPLUGINDIR");
  if (env == NULL)
    env = ::getenv("PTLIBPLUGINDIR");
  if (env != NULL) {
    const char * token = strtok(env, DIR_TOKENISER);
    while (token != NULL) {

      if (checkGplProcessExists(token))                 << token from environment variable
        return true;

      token = strtok(NULL, DIR_TOKENISER);
    }
  }
  ...
}

bool H264EncCtx::checkGplProcessExists (const char * dir)
{
  struct stat buffer;
  memset(gplProcess, 0, sizeof(gplProcess));
  strncpy(gplProcess, dir, sizeof(gplProcess));        << may lead to command injection

  if (gplProcess[strlen(gplProcess)-1] != DIR_SEPERATOR[0]) 
    strcat(gplProcess, DIR_SEPERATOR);
  strcat(gplProcess, VC_PLUGIN_DIR);

  if (gplProcess[strlen(gplProcess)-1] != DIR_SEPERATOR[0]) 
    strcat(gplProcess, DIR_SEPERATOR);
  strcat(gplProcess, GPL_PROCESS_FILENAME);
  ...
}

void H264EncCtx::execGplProcess() 
{
  unsigned msg;
  unsigned status = 0;
  if (execl(gplProcess,"h264_video_pwplugin_helper", dlName,ulName, NULL) == -1) {   << exec command
  ...
}

Suggestion:
Don’t trust environment variable input. Using get module path or hardcoded plugin path to locate library may be much safer, or use reliable configure file instead.

callgen and simph323 H225 assert in CallCeanup

Hello,
openh323 looks broken:
I got the same assert for callgen and openh323/samples/simple/simph32
Versions:
ptlib V10.9.4 or V10.9.3 (the same)
openh323 V1.27.2
ubuntu 22.04 tls

Example called:
openh323plus/sample/simple/obj_linux_x86_64_s/simph323 -tttt -n 8.8.8.8

It makes no different if the destination is reachable or not, after 10sec (WaitForTermination) I got the assert:

2022/09/30 14:06:25.037 3       transports.cxx(1065)  H323  H323Transport::Close
2022/09/30 14:06:25.037 3       transports.cxx(1210)  H323  H323Transport::CleanUpOnTermination for H225 Caller:e62c5640
2022/09/30 14:06:35.045 0           assert.cxx(114)   PWLib Assertion fail: Transport thread did not terminate, file transports.cxx, line 1211
Assertion fail: Transport thread did not terminate, file transports.cxx, line 121

How to add h.264 video capability in TCS?

I downloaded h323plus source code, I have no idea how to add h.264 video capability in local capability set.

When new an endpoint, I use 'AddAllCapability(0, 0, "*")', but there're only audio capabilities in local capability set (use WireShark tool to ensure the point). I want to add h.264 video capability but I don't know how.

I have worked on this issue for days and I certainly would appreciate some helps here. Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.