How to use openh323 in an exist project?

Discussion related to implementation and use of the H.323 Plus H.323 stack at https://www.h323plus.org.
Post Reply
siguadao
Posts: 6
Joined: Sat Aug 09, 2014 1:53 pm

How to use openh323 in an exist project?

Post by siguadao »

How to use openh323 in an exist project?

I have downloaded openh323_v1_18_0 source code and pwlib_v1_10_3 source code and compile them successfully with 'make optnoshared' separately.
Then I faced some problems when using the lib.

Q1. How to use the openh323 lib in an exist project?
All openh323 tutorials are about how to develop a new program instead of adding h.323 function to an exist project.

Q2. My exist project is developed in C language, but openh323 is developed in C++ language. So I'd like to code an adaptation layer as a static lib(using openh323 lib & pwlib lib), in which packaging some openh323 interface. What is like this:

Code: Select all

extern "C" {
	void my_api(void)
	{
		//api in openh323
		openh323_api();
	}
}
Finish coding, I compile the code with 'make optlibs', but it doesn't work by prompting me like felow:
'make[1]: Entering directory '/home/ysc/code/my_openh323/pwlib'
'make[1]: *** No rule to make target 'optdepend'. Stop.'.

How should I do? I have googled for this two questions for days...

Thanks in advance.
User avatar
willamowius
Posts: 50
Joined: Tue Sep 01, 2009 7:25 am
Contact:

Re: How to use openh323 in an exist project?

Post by willamowius »

I think its probably easier to convert your current project to C++:
With very few exceptions, C is also valid C++ code.

OpenH323 is meant to be used by subclassing. Converting every method overload into a callback is doable, but a huge amount of work.

Also, please go to http://www.h323plus.org/ and download the latest H323Plus version and use it instead of OpenH323. Its fully backwards compatible and has a lot of bug fixes and new features.
Jan Willamowius
Founder of the GNU Gatekeeper Project
https://www.gnugk.org
https://www.willamowius.com (H.323 support)
siguadao
Posts: 6
Joined: Sat Aug 09, 2014 1:53 pm

Re: How to use openh323 in an exist project?

Post by siguadao »

willamowius wrote:I think its probably easier to convert your current project to C++:
With very few exceptions, C is also valid C++ code.

OpenH323 is meant to be used by subclassing. Converting every method overload into a callback is doable, but a huge amount of work.

Also, please go to http://www.h323plus.org/ and download the latest H323Plus version and use it instead of OpenH323. Its fully backwards compatible and has a lot of bug fixes and new features.
Thank you for your response.
I downloaded h323plus v1_26_5 and ptlib v_2.12.8, but I met some problems in compiling them.

Q1: Everything is ok in compiling ptlib, but it failed in compling h323plus code. My compling steps and result are like below:
1. ./configure -It doesn't work at first, after I replace all "ptlib/make/lib.mak" with "ptlib/make/ptlib.mak", it works.
2. make optnoshared -It doesn't work, fail information is:
make[2]: Entering directory `/home/ysc/code/h323plus/src'
......
make[2]: *** No rule to make target `/home/ysc/code/h323plus/lib/libh323___s.a', needed by `default_target'. Stop.

Are my compling steps wrong, or the ptlib version and h323plus version mismatch?

Q2: I notice there is a compile option in ptlib/make/common.mak, which is "optlibs". But it seems doesn't work. When I use it, it prompts me like below:
[ysc@ysc ptlib]$ make optlibs
Setting default PTLIBDIR to /home/ysc/code/ptlib
'make[1]: Entering directory `/home/ysc/code/ptlib'
make[2]: Entering directory `/home/ysc/code/ptlib'
make[3]: Entering directory `/home/ysc/code/ptlib'
make[3]: Nothing to be done for `default_depend'.
make[3]: Leaving directory `/home/ysc/code/ptlib'
make[2]: Leaving directory `/home/ysc/code/ptlib'
make[1]: Leaving directory `/home/ysc/code/ptlib'

I certainly would appreciate some helps. Thank you.
User avatar
willamowius
Posts: 50
Joined: Tue Sep 01, 2009 7:25 am
Contact:

Re: How to use openh323 in an exist project?

Post by willamowius »

You probably shouldn't edit configure. My guess is that you didn't do a "make install" for PTLib, which is required if you compile PTLib > 2.10.x on Linux.

I would suggest you only use the "optnoshared" and "debugnoshared" targets for PTLib and H323Plus.
Jan Willamowius
Founder of the GNU Gatekeeper Project
https://www.gnugk.org
https://www.willamowius.com (H.323 support)
Post Reply