1 Portable Windows Libary
2 =======================
14 7. Platform Specific Issues
20 ================================================================================
25 PWLib is a moderately large class library that has its genesis many years ago as
26 a method to product applications to run on both Microsoft Windows and Unix
27 X-Windows systems. It also was to have a Macintosh port as well but this never
30 Since then the system has grown to having quite good application to areas other
31 than mere Windows GUI portability. Classes for I/O portability, multi-threading
32 portability, aid in producing unix daemons and NT services portably and all
33 sorts of internet protocols were added over the years.
35 All this over and above basic "container" classes such as arrays, linear lists,
36 sorted lists (RB Tree) and dictionaries (hash tables) which were all created
37 before STL became the answer to all our prayers. Unfortunately, due to intertia
38 and the GNU C++ inadequate support of templates, this library will probably not
39 be ported to STL in the near future.
41 The library was used extensively for all our in-house products. Then we decided
42 to support the open H323 project by throwing in some of the code written for
43 one of our products. Thus, required PWLib so it got thrown into the open source
49 ================================================================================
54 As you start using the library, the inevitable question "why did they do it that
55 way?" will come up. The more experienced out there will know that there are
56 several reasons for the way things are:
58 * Carefully considered design,
59 * Workarounds for portability and compiler subtleties,
60 * History, it may be too hard to change an early design decision,
61 * Complete arbitrariness, the absence of any compelling reason.
63 So, when you ask the next question "why didn't you do it this way?" The answer
64 will be one of the above. The last one being a synonym for "we didn't think of
67 The bottom line is, use the library as is or change it as you require. You can
68 even send in suggestions for improvements (or merely changes) and we may (or may
69 not) include them in the base line code. Just do not send us any mail starting
70 with the words "Why did you..." as the answer is quite likely to be "Because!"
75 ================================================================================
80 There is a public CVS archive available at cvs.sourceforge.net. To avoid
81 everyone getting all of the code platforms, we have provided CVS "modules"
82 that allow the Windows and Unix source trees to be extracted seperately.
84 The available modules are:
86 pwlib This ReadMe.txt file only
87 ptlib_unix Unix libraries only
88 ptlib_win32 Windows libraries only
89 pwlib_win32 Windows libraries + GUI (needed for OpenPhone)
90 openh323 OpenH323 only
92 Note that the ptlib_unix, ptlib_win32 and pwlib_win32 modules all extract
93 subcomponents of the pwlib directory tree using the CVS modules file - they
94 are not different directories.
96 To extract one of these modules, use a command line like the following:
98 cvs -z3 -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/openh323 co module
100 where "module" is one of the module names specified above.
102 If you would like see the structure of the CVS, then use the View CVS tool at:
104 http://cvs.sourceforge.net/viewcvs.py/openh323/
106 ================================================================================
111 This library is multi-platform, however there are only two major build systems
112 that are used. The Microsoft DevStudio environment for Windows and the GNU make
113 system for all of the various unix systems.
119 1. Note you will need the bison and flex tools to compile some parts of the
120 system. You can get a copy from http://www.openh323.org/bin/flexbison.zip,
121 follow the instructions included in that package and put the executables
122 somewhere in your path.
124 2. Start MSVC (v5, v6 or v7 (.NET)). If you have another compiler you are on
125 your own! Add these folders to the Include Files path as follows:
127 In VisualStudio v5/6 go into the Tools menu, Options item, Directories tab.
129 In VisualStudio v7, go into the Tools menu, Options item. In the Options
130 dialog, open the Projects folder, VC++ Directories item. In the 'Show
131 Directories for:' list, select 'Include files'.
133 C:\PWLib\Include\PwLib\MSWIN (if you have the full PWLIB version)
134 C:\PWLib\Include\PtLib\MSOS
137 Add the following to the Lib Files path and the Executable Files path:
141 The Lib folder is created as parts of PWLib are built. Also add this
142 directory to your PATH environment variable (so PWRC, MergeSym and
143 ASNParser tools can be found).
145 2. The build should automatically create a file pwlib/include/ptbuildopts.h
146 via the configure.exe program that should be in the pwlib directory. If
147 you have any problems try running the program directly from a command
148 line. Use ".\configure --help" to get information on options such as
149 forcing a feature or library dependency.
151 Note there are additional notes in the "Platform Specific Issues" on how
152 to compile the various libraries in a manner suitable for use by PWLib
155 3. In VisualStudio v5/6 open the pwlib.dsw file in the pwlib top directory.
156 If you have the minimum library it will come up with several requests to
157 find .dsp files, just cancel past these.
159 In VisualStudio v7 open the pwlib.sln file in the pwlib top directory.
161 4. In VisualStudio v5/6 use the Batch Build command and build the "ASNParser
162 Win32 Release", "pwtest Win32 Release" and "pwtest Win32 Debug" targets.
163 Make sure all other targets are not checked.
165 In VisualStudio v7 use the Batch Build command. It seems as though the
166 batch build does not build dependent parts unless they're checked in the
167 Build column. For a test build, be sure all Projects are checked except
168 ASNParser-debug, MergeSym-debug, PacketVXD-release, PWRC-debug, and both
171 5. That's it, now you're on your own!
175 These are the project relationships:
177 project dependencies output
178 ------- ------------ ------
179 Console (none) ptlibs.lib
180 GUI (none) pwlibs.lib
181 MergeSym ptlibs.lib mergesym.exe
182 PTLib ptlibs.lib, mergesym.exe ptlib.dll & lib
183 PWLib pwlibs.lib, mergesysm.exe, ptlib.lib pwlib.dll & lib
184 Console Components (none) ptclib.lib
185 GUI Components (none) pwclib.lib
186 ASN Parser ptlib.lib asnparser.exe
187 PWRC ptlib.lib (flex.exe) pwrc.exe
188 PWTest ptlib,pwlib,ptclib,pwclib.lib,pwrc.exe pwtest.exe
189 MSDevWizard (none) PWLibWizard.awx
190 XMLRPC ptlibs.lib, ptclib.lib xmlrpc.exe
191 PacketVXD (none) epacket.vxd
193 Debug versions append 'd' to filename, ie: ptlibsd.lib.
195 MSDevWizard will not build in VisualStudio v7 and so is not included as a project.
199 --------------------------------------------------------------------------------
203 1. If you have not put pwlib it into your home directory (~/pwlib) then
204 you will have to defined the environment variable PWLIBDIR to point to
205 the correct directory.
206 Also make sure you have added the $PWLIBDIR/lib directory to your
207 LD_LIBRARY_PATH environment variable if you intend to use shared
208 libraries (the default).
210 2. Build the debug and release versions of the PWLib library as follows:
214 This may take some time. Note, you will need bison and flex for this to
215 compile, most unix systems have these. WARNING: there is a bug in most
216 of the bison.simple files. See below for details.
218 PWLib requires GNU Make. If GNU Make (gmake) is not your default make
219 program (eg FreeBSD users), you will need to install GNU Make first
226 If you are getting huge numbers of errors during the compile, then it
227 is likely your platform is not supported, or you have incorrectly set
228 the OSTYPE and MACHTYPE variables.
230 3. That's all there is to it, you are now on your own!
234 Bison problem under Unix
236 The bison.simple file on many releases will not compile with the options used
237 by the PWLib getdate.y grammar. The options are required to make the date
238 parser thread safe so it is necessary to edit the bison.simple file to fix the
241 The file is usually at /usr/lib/bison.simple but in the tradition of unix
242 could actually be anywhere. We leave it up to you to find it.
246 /* Prevent warning if -Wstrict-prototypes. */
253 /* Prevent warning if -Wstrict-prototypes. */
255 #ifndef YYPARSE_PARAM
260 To prevent the incorrect function prototype from being defined. The getdate.y
261 should then produce a getdate.tab.c file that will actually compile.
266 ================================================================================
271 What documentation there is consists of this document and all of the header
272 files. It was intended that a post processer go through the header files and
273 produces HTML help files, but this never got completed.
279 Detailed tutorials will almost certainly not be forthcoming. However, at least
280 giving you an indication on how to start an application would be usefull, so
281 here is the infamous "Hello world!" program.
288 class Hello : public PProcess
290 PCLASSINFO(Hello, PProcess)
295 PCREATE_PROCESS(Hello)
299 cout << "Hello world!\n";
305 The CREATE_PROCESS macro actually defines the main() function and creates an
306 instance of Hello. This assures that everything is initialised in the correct
307 order. C++ does initialisation of global statics badly (and destruction is even
308 worse), so try to put everything into your PProcess descedent rather than
311 A GUI application is very similar but is descended off PApplication rather than
312 PProcess, and would create a window as a descendent off the PMainWindow class.
314 The following is a simple Makefile for Unix platforms for the hello world
318 # Simple makefile for PTLib
324 PWLIBDIR=$(HOME)/pwlib
327 include $(PWLIBDIR)/make/ptlib.mak
333 --------------------------------------------------------------------------------
337 The classes in PWLib fall into the following broad categories
347 While there are a number of container classes you wourld rarely actually descend
348 off them, you would use macros that declare type safe descendents. These are
349 simply templates instantiations when using a compiler that supports templates
350 in a simple manner (GNU C++ does not qualify in our opinion).
354 There are many classes descendend from a basic primitive call a PChannel, which
355 represents an entity for doing I/O. There are classes for files, serial ports,
356 various types of socket and pipes to sub-processes.
358 5.2.3. Threads & Processes
360 These classes support lightweight threading and functionality to do with the
361 process as a whole (for example argument parsing). The threading will be
362 pre-emptive on platforms that support it (Win32, platforms with pthreads eg
363 Linux and FreeBSD) and cooperative on those that don't.
367 There are a very large number of classes to support a GUI interface. This is not
368 very complete at this time. The Win32 implementation is quite usable, though it
369 doesn't include the latest and greatest out of Redmond. The pure xlib
370 implementation has quite a lot implemented but is by no means complete. A motif
371 implementation is in the works but has not progressed very far.
376 ================================================================================
378 6. IPv6 support in pwlib
379 ------------------------
381 The IPv6 support in pwlib is still experimental. You have to get the latest
382 CVS version to compile it (does work since 7th November 2002). Pwlib can be
383 compiled with or without the IPv6 support.
385 When compiled with the IPv6 support, applications using only IPv4 are still
386 fully backward compatible. Pwlib is able to manage simultaneously IPv4 and
391 --------------------------------------------------------------------------------
392 6.1. Windows platforms
393 ----------------------
395 According to microsoft, IPv6 is not supported under 9x, experimental on Win2000,
397 You must use a compiler with IPv6 aware includes and libraries:
398 - VC6 must be patched to support RFC 2553 structure. (See 7.1 and 7.2 for patch)
399 - .Net should be ok (to be confirmed)
400 The port as been performed with VC6 patched on a win2000 platform.
402 For more informations about IPv6 support:
403 Microsoft IPv6 support:
404 http://research.microsoft.com/msripv6/
406 http://msdn.microsoft.com/downloads/sdks/platform/tpipv6.asp
408 http://www.microsoft.com/windowsxp/pro/techinfo/administration/ipv6/default.asp
412 6.1.1. Windows platforms: Win2000
413 ---------------------------------
414 Go to Microsoft win2000 IPv6 tech preview web page.
415 http://msdn.microsoft.com/downloads/sdks/platform/tpipv6.asp
416 Download the 'tpipv6-001205.exe' file and read carrefully the faq.
417 http://msdn.microsoft.com/downloads/sdks/platform/tpipv6/faq.asp
419 This program is designed for win2000 English Service pack 1.
420 To install it on newer Service pack, you have to modify some files.
423 This install the IPv6 driver and the IPv6 includes.
427 6.1.2. Windows platforms: XP
428 ----------------------------
429 Read the IPv6 faq for windows XP
430 http://www.microsoft.com/windowsxp/pro/techinfo/administration/ipv6/default.asp
432 The 'ipv6 install' command installs only the IPv6 drivers.
433 You need to install additionnals IPv6 includes for VC6.
434 .NET should be ready. (to be confirmed ....)
440 To compile pwlib and openh323 with the IPv6 support you have to set an
441 environment variable:
443 Set it using: [Start]/[Configuration pannel]/[System]/[Environment]
445 Add the IPv6 SDK include path in your Visual C++ 6 environment:
446 [Tools]/[Options]/[Directories]/[Include files]
450 --------------------------------------------------------------------------------
454 Recent Linux distributions support IPv6.
455 2.4 kernels are IPv6 aware.
458 http://www.tldp.org/HOWTO/Linux+IPv6-HOWTO/
462 6.2.1. Enabling IPv6 support
463 ----------------------------
464 IPv6 can be compiled statically in the kernel or compiled as a module.
465 To load the IPv6 module, as 'root'
472 Check that IPv6 is really on
473 #ls /proc/net/if_inet6
474 If this file exists, then IPv6 support is compiled in pwlib and openh323.
478 --------------------------------------------------------------------------------
482 The test application sources can be found in the directory: openh323/samples/simple
483 Once compiled the binaries are in simple/debug, release, obj_linux_x86_d, or
485 Under windows, the test application is simple.exe
486 Under linux, the test application is simh323
487 IPv6 support can be tested on only one machine. Just open two shell/command windows.
491 6.3.1. IPv6 Address and port notation
492 -------------------------------------
493 IPv4 address and port are written in dot notation: xx.xx.xx.xx:4000
494 IPv6 global address are written in semi-colon notation: [xx:xx:xx:xx::xx]:4000
495 IPv6 scoped address ad a field for the scope: [xx:xx:xx:xx::xx%scope]:4000
499 [3ffe:0b80:0002:f9c1:0000:0000:500b:0ea5]:4000
500 [3ffe:0b80:0002:f9c1::500b:0ea5]:4000
503 [fe80::232:56ff:fe95:315%lnc0]:4000
504 Scoped address are not supported yet.
508 6.3.2. Tests configuration
509 --------------------------
510 Tests 1,2,3 run on a single dual stack machine.
511 IPv4 Address: 127.0.0.1, 10.0.0.6
512 IPv6 Address: ::1, 3ffe:0b80:0002:f9c1:0000:0000:500b:0ea5
514 Tests 4,5,6 run on two dual stack machine.
516 IPv4 Address: 10.0.0.6
517 IPv6 Address: ::1, 3ffe:0b80:0002:f9c1:0000:0000:500b:0ea5
519 IPv4 Address: 10.0.0.8
520 IPv6 Address: ::1, 3ffe:0b80:0002:f9c1:0000:0000:500b:0eb6
524 6.3.3. Test 1: IPv4 <--> IPv4 local call
525 ----------------------------------------
526 This test checks the backward compatibility with IPv4
528 In first shell/command window, listen on 127.0.0.1, wait for a call.
529 simple.exe -tttt -n -i 127.0.0.1 -l -a
530 In second shell/command window, listen on 10.0.0.6, call 127.0.0.1
531 simple.exe -tttt -n -i 10.0.0.6 -n 127.0.0.1
535 6.3.4. Test 2: IPv6 <--> IPv6 local call
536 ----------------------------------------
537 This test checks the IPv6 support
539 In first shell/command window, listen on ::1, wait for a call.
540 simple.exe -tttt -n -i ::1 -l -a
541 In second shell/command window, listen on IPv6 address, call ::1
542 simple.exe -tttt -n -i 3ffe:0b80:0002:f9c1:0000:0000:500b:0ea5 -n [::1]
545 6.3.5. Test 3: IPv4 <--> IPv6 local call
546 ----------------------------------------
547 This test checks that simultaneous IPv4 and IPv6 calls are supported.
549 In first shell/command window, listen on 127.0.0.1, wait for a call.
550 simple.exe -tttt -n -i 127.0.0.1 -l -a
551 In second shell/command window, listen on IPv6 address, call 127.0.0.1
552 simple.exe -tttt -n -i 3ffe:0b80:0002:f9c1:0000:0000:500b:0ea5 -n 127.0.0.1
556 6.3.6. Test 4: IPv4 <--> IPv4 call between two hosts
557 ----------------------------------------------------
558 This test checks the backward compatibility with IPv4
560 First host, listen on 10.0.0.6, wait for a call.
561 simple.exe -tttt -n -i 127.0.0.1 -l -a
562 Second host, listen on 10.0.0.8, call 10.0.0.6
563 simple.exe -tttt -n -i 10.0.0.8 -n 10.0.0.6
567 6.3.7. Test 5: IPv6 <--> IPv6 call between two hosts
568 ----------------------------------------------------
569 This test checks the IPv6 support
571 First host, listen on 3ffe:0b80:0002:f9c1:0000:0000:500b:0ea5, wait for a call.
572 simple.exe -tttt -n -i 3ffe:0b80:0002:f9c1:0000:0000:500b:0ea5 -l -a
573 Second host, listen on 3ffe:0b80:0002:f9c1:0000:0000:500b:0eb6, call 3ffe:0b80:0002:f9c1:0000:0000:500b:0ea5
574 simple.exe -tttt -n -i 3ffe:0b80:0002:f9c1:0000:0000:500b:0eb6 -n [3ffe:0b80:0002:f9c1:0000:0000:500b:0ea5]
578 6.3.8. Test 6: IPv4 <--> IPv6 call between two hosts
579 ----------------------------------------------------
580 This test checks that simultaneous IPv4 and IPv6 calls are supported.
582 First host, listen on 10.0.0.6, wait for a call.
583 simple.exe -tttt -n -i 10.0.0.6 -l -a
584 Second host, listen on 3ffe:0b80:0002:f9c1:0000:0000:500b:0eb6, call 10.0.0.6
585 simple.exe -tttt -n -i 3ffe:0b80:0002:f9c1:0000:0000:500b:0eb6 -n 10.0.0.6
589 --------------------------------------------------------------------------------
590 6.4. Known limitations
593 You must use IPv6 address with global scope. Tests with IPv6 local link address
598 --------------------------------------------------------------------------------
602 6.5.1. How to patch my VC6 includes files ?
603 -----------------------------------------
605 To patch you Developper studio Visual C++ version 6, just edit the file
606 "C:\Program Files\Microsoft Visual Studio\VC98\Include\ws2tcpip.h", and add
607 the sin6_scope_id field in the sockadd_in6 structure.
608 struct sockaddr_in6 {
609 short sin6_family; /* AF_INET6 */
610 u_short sin6_port; /* Transport level port number */
611 u_long sin6_flowinfo; /* IPv6 flow information */
612 struct in_addr6 sin6_addr; /* IPv6 address */
613 u_long sin6_scope_id; /* scope id (new in RFC2553) */ <--- Add this one
616 This may have an impact on you system stability, use it only on
617 experimental platforms. Using .NET compiler should be a better solution.
621 6.5.2. Why do I need to modify my Visual C++6 include files ?
622 -----------------------------------------------------------
624 Visual Studio C++ version 6 implements the old RFC 2133 in file "ws2tcpip.h".
625 RFC 2133 defines a 24 byte sockaddr_in6 structure.
626 struct sockaddr_in6 {
627 short sin6_family; /* AF_INET6 */
628 u_short sin6_port; /* Transport level port number */
629 u_long sin6_flowinfo; /* IPv6 flow information */
630 struct in_addr6 sin6_addr; /* IPv6 address */
634 This RFC as been replaced by RFC 2553.
635 RFC 2133 defines a 28 byte addsock_in6 structure.
636 struct sockaddr_in6 {
637 short sin6_family; /* AF_INET6 */
638 u_short sin6_port; /* Transport level port number */
639 u_long sin6_flowinfo; /* IPv6 flow information */
640 struct in_addr6 sin6_addr; /* IPv6 address */
641 u_long sin6_scope_id; /* scope id (new in RFC2553) */
646 6.5.3. How to get an ipv6 address with a Global scope ?
647 -----------------------------------------------------
652 Set one manually if you're not connected to IPv4 Internet or IPv6 backbone:
653 #ip -6 addr add 3ffe:0b80:0002:f9c1:0000:0000:500b:0ea5 dev eth0
654 (this address is owned by freenet6.net).
656 Check the address is set.
658 eth0 Lien encap:Ethernet HWaddr 00:08:D5:10:C7:BB
659 inet adr:12.0.0.2 Bcast:12.255.255.255 Masque:255.0.0.0
660 adr inet6: 3ffe:b80:2:f9c1::500b:ea5/128 Scope:Global <- - - Ok, Global scope
661 adr inet6: fe80::208:c7ff:fe59:bbc7/10 Scope:Lien <- - - [ Can't use this one ]
662 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
663 RX packets:0 errors:0 dropped:0 overruns:0 frame:0
664 TX packets:9 errors:0 dropped:0 overruns:9 carrier:0
666 RX bytes:0 (0.0 b) TX bytes:534 (534.0 b)
669 6.5.3.2. Tunnel broker
670 ----------------------
672 Get one from a free IPv6 tunnel broker.
674 http://www.freenet6.net : Canadian tunnel broker
675 http://tb.ngnet.it : Italian tunnel broker (Telecom Italia Research)
678 Note: The current (10/2002) freenet6 windows binary is buggy, use it to get the
679 values, and set manually your tunnel.
683 --------------------------------------------------------------------------------
687 6.6.1. Listen on ::1:1720 failed: Address family not supported by protocol
688 -----------------------------------------------------------------------
689 IPv6 module is not loaded in the kernel.
694 6.6.2. SimpleH323 TCP Could not open H.323 listener port on 1720
695 --------------------------------------------------------------
696 Add some traces: -t on the command line.
700 6.6.3. SimpleH323 TCP Listen on fe80::2b0:d0ff:fedf:d6bf:1720 failed: Invalid argument
701 ------------------------------------------------------------------------------------
702 This address is a local scope address. As the scope_id field is always set to 0,
703 its value is invalid.
705 Use address with global scope.
710 ================================================================================
712 7. Platform Specific Issues
713 ---------------------------
714 PWLib has been ported to several platforms. However on some systems not all of
715 the functionality has been implemented. This could be due to lack of support
716 at the OS level or simply due to lack of time or documentation when developing
720 --------------------------------------------------------------------------------
724 Port Maintained by Roger Hardiman <roger@freebsd.org>
725 GetRouteTable() in socket.cxx has been added. It is used by
726 OenH323Proxy, but is not fully tested.
729 --------------------------------------------------------------------------------
733 Port Maintained by Roger Hardiman <roger@freebsd.org>
734 GetRouteTable() in socket.cxx has been added. It is used by
735 OenH323Proxy, but is not fully tested.
738 --------------------------------------------------------------------------------
742 Port Maintained by Roger Hardiman <roger@freebsd.org>
743 GetRouteTable() in socket.cxx has been added. It is used by
744 OenH323Proxy, but is not fully tested.
746 There are now three ways to do pthreads in NetBSD.
747 a) unproven threads - from the packages tree.
748 b) GNU pth threads - from the packages tree.
749 c) Native pthreads - added to the kernel on 15th January 2003.
751 The choice can be made by editing pwlib/make/unix.mak
752 Native threads is the default and the best solution.
754 --------------------------------------------------------------------------------
755 7.4. Mac OS X (Darwin) Issues
756 -----------------------------
758 Port maintained by Roger Hardiman <roger@freebsd.org> but recently
759 Shawn Pai-Hsiang Hsiao <shawn@eecs.harvard.edu> has been leading
761 Threads cannot be suspended once they are running, and trying to Suspend
762 a running thread will generate an Assertion Error.
763 Theads can be created in 'suspended' mode and then started with Resume
764 This is due to a lack of pthread_kill() in Dawrin 1.2
765 See http://www.publicsource.apple.com/bugs/X/Libraries/2686231.html
767 GetRouteTable() in socket.cxx has been added. It is used by
768 OenH323Proxy, but is not fully tested.
770 localtime_r() and gm_time() are missing.
771 So in osutil.cxx I have implemented os_localtime() and os_gmtime()
772 with localtime() and gm_time() which may not be thread safe.
774 There is also no implementation for dynamic library functions.
776 Audio is supported using the coreaudio library.
778 Video support is being added by Shawn and users interested in this should
779 check Shawn's web site at http://sourceforge.net/projects/xmeeting/
781 --------------------------------------------------------------------------------
785 Port Maintained by Yuri Kiryanov <openh323@kiryanov.com>.
786 Current version supported is BeOS 5.0.2.
788 Most important issue is lack of variable sample frequency from system sound producer node.
789 I made quite a few attempts to implement sound resampler in code,
790 even with help of Be engineers, but eventually decided to wait until new Media Kit
791 with resampler built-in.
792 Also network code needed more things, as OOB, which was promised in BONE.
793 BONE will allow to make less #defines in network code as well.
794 As update will hit the Net, I'll get back to it ASAP.
796 Look for more port-related info on http://www.dogsbone.com/be
799 --------------------------------------------------------------------------------
800 7.6. Windows CE Issues
801 ----------------------
803 Port Maintained by Yuri Kiryanov <openh323@kiryanov.com>.
804 Versions supported is 2.x and 3.x (PocketPC).
805 Look for more port-related info on http://www.pocketbone.com
807 Detailed how-to provided by Frank Naranjo <frank@mivideo.net>.
808 An html version of this readme is available at ;
809 http://www.mivideo.net/videophone
812 7.6.1. HOW-TO build and test Windows CE OpenH323 Port POCKETBONE
813 ----------------------------------------------------------------
814 March 30 2002, Currently, there is NO source available that compiles
815 and Tx/Rx Video and Audio for pocketbone. Only the released binary
816 10b1 in Oct 2001 works! The current CVS version Mar 30 2002,
817 is supposed to be 10b1, but its' internaly noted as 0.9beta1.
819 Since the code in the CVS has not changed much since October when
820 the 10b1 version was released, maybe with the right #ifdef DEFINES
821 and registry keys configured it might work.
823 We will dig into the diffs, and debug this unfinished release.
824 But, maybe Yuri Kiryanov might release source and its related binary
825 for a version that works one day, along with all the required
826 configuration parameters to build it.
828 It would be nice to be in a ZIP file, so it is not subject to changes,
831 7.6.2. Collecting the Required Files
832 ------------------------------------
833 There are three source modules required to build Pocketbone,
834 two of them, openh323 and pwlib libraries and the contributed
835 pocketbone module. Using WinCVS u can get the latest sources
836 from CVS at openh323.org . Using CVS you should 'checkout' the
837 'pwlib', 'openh323' and 'contrib' modules. You can save some
838 time and space and 'checkout' only the 'contrib/pocketbone' module.
839 Make certain when u checkout pwlib and openh323 that the .vcp
840 files are there. If not, u can always access them thru the web
841 interface for CVS at openh323.org. You will also need the eVC
842 ( embedded Visual C 3.0) software from Microsoft to build it.
844 The new eVC version 4.0 is available FREE for 120 day trial
845 now ( since Feb 2002 ). You cannot use MS Visual Studio to
846 build an embedded system. The new eVC 4.0 has not been used
847 to build pocketbone yet from the CVS or herein.
849 Place all three source modules in a single directory. i.e..,
850 contrib,openh323 and pwlib.
851 ( note that pocketbone is in the contrib directory ). Using eVC,
852 open the project workspace located in the contrib/pocketbone
853 (Pocketbone.vcp). It should automatically find the other two
854 modules (openh323 and pwlib ) and load their respective .vcp files.
856 7.6.3. Steps to Build POCKETBONE
857 --------------------------------
858 To build POCKETBONE you first need to build the two libraries,
859 pwlib and openh323. You should build these two libraries using
860 MS Visual C++, they will need to be built with eVC for the embedded
861 solution. It would be a good idea to build the libraries first
862 since it contains 'asnparser.exe' which is NOT built within eVC.
863 Then the latest version of asnparser.exe is used to build the
864 .asn files by eVC. The location of asnparser.exe will need to
865 defined in the 'Executable directory' as shown below in order
866 for eVC to find it. Asnparser.exe is usually in
867 'pwlib/tools/asnparser/release'. Both PWLIB and OPENH323 directories
868 contain a .VCP file included within the POCKETBONE sources.
870 Before you can build POCKETBONE however, you will need to configure
871 your eVC so it knows where to find the required include, library
872 and executable files. A .VCP project file is available within
873 each of the three source modules in the CVS or ZIP files.
875 -When you download the zip files or the versions from the CVS,
876 your source directory tree should look like this:
878 < Your source dir > \ contrib \ Pocketbone
879 < Your source dir > \ pwlib
880 < Your source dir > \ openh323
882 The pockebone.vcw file expects this configuration. Once you start eVC,
883 all you need to do is open the project file;
884 < Your source dir> \ contrib \ pocketbone \ pocketbone.vcw
886 eVC will then find the other project files for PWLIB and OPENH323,
887 otherwise it will ask you. Select which CPU or platform version
888 to create; the emulator version X86EMDbg,or the ARM version.
889 The ARM versions have a DEBUG and RELEASE version.
890 Select the Platform :"Pocket PC", CPUs:" Win32(WCE ARM)" selection.
892 Set of directories which you have to be defined in eVC regardless
895 Tools->Options->Directories, option Include files.
896 -------------------------------------------------
897 < Standard include paths >
898 < Your source dir > \ pwlib \ include \ ptlib \ wince
899 < Your source dir > \ pwlib \ include \ ptlib \ wince \ sys
900 < Your source dir > \ pwlib \ include \ pwlib \ mswin
901 < Your source dir > \ pwlib \ include \ ptlib \ msos
902 < Your source dir > \ pwlib \ include
903 < Your source dir > \ openh323 \ include
904 < Your gapi source dir > \ inc
906 Get Gapi source files at;
907 http://www.microsoft.com/mobile/downloads/developer/gapi.asp
909 Here are some 'fake' functions to avoid needing Platform
910 Builder or loading SNMP libraries for gatekeeper functionality.
911 ( thanks to Jehan Bing ) http://www.mivideo.net/jh_snmp_c.txt
913 Platform Builder 3.0 was free under an 120 day evaluation,
914 just as the new 4.0 platform builder ( since Feb 20002)
915 which also includes the new 4.0 eVC. It is NOT necessary
916 to build pocketbone with the SNMP libraries provided you
917 include the 'fake' calls in Jehan Bing's functions file
920 Tools->Options->Directories, option Executeable AND Library .
921 ------------------------------------------------------------
922 < Your source dir for location of asnparser.exe and ptlib.dll >
923 < Your source dir for location of Gapi files ( gx.dll ) > \ lib
924 < Your source dir > PWLIB \ Lib (even if does not exist )
925 < Your source dir > OPENH323 \ Lib ( even if doesn't exist )
926 < Your source dir for location of snmpapi.lib and snmp_mibii.lib >
928 ( if you have Platform builder )
929 click for Zip file for eVC 4.0 Platform Builder Libraries )
931 Using the BUILD ALL start the build process. The PWLIB library
932 is built first, then the OPENH323 library, then finally the
933 POCKETBONE executable. the EVC will automatically download the
934 executable to the iPAQ should you have activeSync and the iPAQ
935 in the cradle.eVC will copy the executeable to the start menu.
937 To run select POCKETBONE from the 'start' menu . Enter an IP
938 using the keyboard, nit the buttons, since the do not always
939 work right. The keypad buttons only works on the 9a1 version.
941 Make any Option settings required such as gatekeeper, trace,
942 or audio settings. Then press 'Call' to initiate the call.
943 You should hear and see the other party right away.
944 On some versions full screen video is displayed.
945 There will be a button to toggle from this full screen in
946 the future, along with Volume and mute buttons.
947 You are on your own ! Please test and make any comments
948 here regarding any problems or suggestions.
950 In order to build POCKETBONE for other platforms,
951 all you need to do is select the different platforms.
952 Although, there will undoubtedly be changes required
953 in the source for different platforms. These changes can
954 usually be handled with #ifdef statements in the code.
955 In order to maintain a single set of source files for
958 7.6.4. Latest CVS version March 20 2002
959 ---------------------------------------
960 PWLIB.zip ( 7,424 Kb)
961 "http://www.mivideo.net/videophone/cvs 4 20 pwlib.zip"
963 OPENH323.zip ( 22,887 Kb)
964 "http://www.mivideo.net/videophone/cvs 4 20 openh323.zip"
966 CONTRIB.zip ( 5,034 Kb)
967 "http://www.mivideo.net/videophone/cvs 4 20 contrib.zip"
969 These zip files contain Complete! BUILT files for ARM and X86em
970 versions using eVC 3.0 and fake SNMP functions file (link above),
971 to avoid using SNMP libraries.
972 For those who asked for it for comparisons !
974 Noted internally as version 0.9beta1, NOT .10b1 as was stated by
975 Yuri in the archives to be in this CVS version. This version has
976 trace options available along with a ( Remote / Local )
977 functionality and different bitmap to reflect it.
979 http://www.mivideo.net/videophone/420DPocketBone.exe
982 http://www.mivideo.net/videophone/420RPocketBone.exe
984 Note this version NOT size similar to 9a1 or 10b1 !
985 Yet, its the latest from the CVS as of date shown !
986 Other than the different BMPs used in 10b1 what else differs ?
988 testing from 4/22/2002 ;
989 - No Video or Audio Tx/Rx to CuSeeme 5.0.0.43 ( RadVision Stack)
990 - soft reset ! required after calls sometimes to get correct IP
991 - Audio OK when called from Cisco ATA 186
992 - The Remote and Local tabs have no effect.
993 -Talk button appears even though running on a Pocket PC
994 and the 'walkie-talkie is NOT clicked.
997 7.6.5. PocketBone 10b1 Binary zip for iPAQ
998 ------------------------------------------
999 http://www.mivideo.net/videophone/PocketBone10b1.zip
1000 ( 2,317,824 bytes 10/24/2001).
1003 http://www.mivideo.net/videophone/PocketBone.jpg
1005 Notes : Video receiving from NetMeeting has no green stripes.
1006 Transmits test video by default. Internally noted as 0.10beta1.
1007 Audio and Video works fine. No trace options. If Full screen
1008 option is enabled, there is NO way out of it other than 'soft reset'
1010 There is NO known source files for this version ! Neither will
1011 there probably ever be. It is the last release from October 2001
1012 before the Open Source version took a back seat to the commercial
1013 development of iFON at Tabletmedia.com.
1014 http://www.tabletmedia.com/ifon.asp
1016 Unpack the binary zip file and copy PocketBone.exe to
1017 \Windows\Start Menu and gx.dll to \Windows.
1019 7.6.6. PocketBone .9a1 binary ARMREl
1020 ------------------------------------
1021 ( 2,257 Kb 8/9/2001 )
1022 The main bitmap for this version looks like;
1023 http://www.mivideo.net/videophone7alpha3b.jpg
1024 The working .9a1 binary version from the link below
1025 was released as version .9a1.
1026 Internally it is noted as 0.7alpha3. This version transmits
1027 default H261 video color bar screen. It can receive video
1028 and Tx and Rx audio. There are a few problems with this version.
1029 Calling from CuSeeme 5.0 client sending 160x240 video
1030 this version displays video full screen and locks up the display,
1031 so you cannot do anything else to restore except a 'soft reset'.
1032 'Your mileage may vary'. Should you have better luck,
1033 please let me know at nubeus@bellsouth.net.
1035 Also, I have not been able to initiate a call with it.
1036 The display shows the [Remote / Local ] tabs along with
1037 an [FS] switch at the lower right of the display.
1038 It also has an early address book non-working icon where
1039 you enter the IP along with icons for [Dialpad / Calls]
1040 which are not functioning. The number buttons do work correctly !
1041 The ZIP sources above does NOT build
1042 the 0.9a1 version although it was supposed to according to Yuri
1043 and the mailing list. The version it creates is noted internally
1044 only in trace file as 0.7a3. It connects, but does not
1045 transmit video and audio. It crashes when called.
1047 Version .9a1 Binary is at
1048 http://www.mivideo.net/videophone/PocketBone9a1.zip
1049 ( internally noted as 0.7alpha3 !! ) ( 2,250,240 bytes 8/9/2001)
1051 Source Zip files which should, but does NOT match binary above !
1053 Pocketbone source Zip (1,952 Kb )
1054 http://www.mivideo.net/pocketbone.zip
1055 ARMREl ( 2,257 Kb ) ARMDbg ( 4,177 Kb )
1057 PwLib source Zip ( 1,830 Kb )
1058 http://www.mivideo.net/pwlib.zip
1060 OpenH323 source Zip (1,692 Kb)
1061 http://www.mivideo.net/openh323.zip
1063 7.6.7. General Usage Notes
1064 --------------------------
1066 - PocketBone performs best on iPAQ Pocket PC 2002.
1067 An iPAQ 3630 with CE 3.0 and the Pocket PC 2002
1068 update will do fine ! Pocketbone takes up less than 3mb,
1069 and getting smaller every version.
1071 - By default PocketBone connects to NetMeeting using MS-GSM.
1072 If your NetMeeting does not have GSM codec installed,
1073 get it here. What Microsoft calls GSM 6.10 is not what
1074 everyone understands as GSM 6.10 compression. NetMeeting
1075 must be set to "GSM 6.10" (MS-GSM), iPAQ to MS-GSM.
1078 - If you are running PocketBone and you found an error
1079 saying "Missing components", get gx.dll (part of GAPI)
1080 from here and place it to \Windows directory.
1082 - To enable gateway call, e.g. through Cisco AS5300,
1084 Go to Options/Gates, set gateway IP address, set gatekeeper
1085 address, check "Use Gatekeeper", "Require Gatekeeper".
1086 Switch to Options/General, set name, e.g. "ipaq" in "User"
1087 field. Add your extension, e.g. "3620" and your cisco id,
1088 e.g."3620!cisco" to "Aliases". Check "Disable fast-start"
1089 to avoid fast-start problems when call connected earlier
1090 for expense of clarity of first few seconds of call.
1091 You won't be able to receive calls if you are not registered
1092 on gatekeeper .You have to rearrange audio codecs located
1093 at Options/Audio. Move GSM-06.10 and/or G.711 on top of
1094 the list and disable MS-GSM codec. MS-GSM codec is
1095 incompatible with non-MS products.
1097 - If your connection is good enough, try reduce jitter
1098 buffer size ( Options / Audio ). It will decrease audio latency.
1100 - Full-duplex sound driver has been released by Compaq for
1101 Pocket PC 2000. Get it here (look for Full Duplex Driver link).
1102 The off-the-shelf iPaq 2000 is half-duplex. Do not forget to
1103 uncheck Walkie-Talkie in Options/Audio and restart the app.
1105 - Should you get link error : LINK : fatal error LNK1181:
1106 cannot open input file "snmpapi.lib" then the library is not
1107 included in "Object/library modules:" at "Project - Settings -
1110 - Some people reported problems with building code when compiler
1111 reports some SNMP includes missing. You will need to obtain
1112 Platform Builder, and then add include and lib directory to
1113 project settings in order to be able to link snmpapi.lib and
1114 snmp_mibii.lib from the Platform Builder directory.
1115 (\PUBLIC\COMMON\OAK\LIB\ARM\SA1100\CE\RETAIL).
1117 - Video won't work out-of-box on x86 emulator. Get GAPI emulator
1118 and try figuring it out.
1120 - Supports full-screen CIF video. Audio clicking removed
1122 - If you had installed an old version before, please remove
1123 old registry settings located at:
1124 HKEY_CURRENT_USER\Software\OpenH323\PocketBone\CurrentVersion
1126 - To enable video receive with QCIF size, make sure registry
1127 has "VideoSize"=1 and "H261_QCIF"=1.
1129 - If you have problems on connection, go to registry and disable
1130 video receiving.Find following key in registry:
1131 HKEY_CURRENT_USER\Software\OpenH323\PocketBone\CurrentVersion\Options
1132 Then add DWORD value of 0 with name of "VideoSize".
1134 - In order to improve UDP performance ( videoconferencing )
1135 you have to change registry setting on iPAQ value to 16(maximum)
1136 HKEY_LOCAL_MACHINE\Comm\Afd
1137 On NetMeeting go to Video settings,
1138 choose "Better Image".
1140 - If you get following when trying to run PocketBone:
1141 "Cannot find PocketBone or one of it's components. Make sure
1142 the path and file name are correct and all the required
1143 libraries are available...", install GAPI (Game API) gx.h and gx.dll.
1145 - When in Walkie-Talkie mode, re-assign a recorder button on
1146 your iPAQ to PocketBone. It will allow you to use this
1147 recorder button as a switch to change PocketBone from "listen"
1148 mode to "talk" mode and back. Only required when iPAQ is used
1149 in half-duplex. Version .9a1 and .10b1 work fine in full
1150 duplex on a PPC. rfer to;
1151 http://www.mivideo.net/Buttons.jpg
1155 Ohphone can be used to test Pocketbone as well as Netmeeting.
1156 Although Netmeeting does not hold up to the H323 standard well.
1157 and has been forsaken for the new Instant Messenger from Microsoft.
1158 CuSeeme 5.0 on the other hand is built with the RadVision H323 stack,
1159 a better implementation of the H323 standard. Pocketbone adheres
1160 thru the work of many contributors of the openh323.org project
1161 to the H323 v4 standard. It does not have patented codecs
1162 integrated due to licensing restrictions but there are hooks
1163 in it should the codec be recognized in the system. Please refer
1164 to the openh323.org site for details.
1166 Cisco ATA 186 IP phones,
1167 either in H323 or when set to IP phones work quite well .
1168 Testing has been done on HP Jornada and Casio PDAs.
1169 Results will soon follow along with configurations, notes and source Zip files.
1173 Keep in touch with the PDA global activities thru http://www.infosync.no/
1177 Porting to other platforms such as Palm, and other CPUs such as MIPS, SH3,
1178 SH4 are not too difficult.
1180 HOW-TO step-by-step will be provided as new platforms are ported and tested.
1181 If you have ported this to another platform, your configuration info would
1184 Please forward comments of this how-to page to nubeus@bellsouth.net
1185 an html version of this readme is available at ;
1186 http://www.mivideo.net/videophone
1189 --------------------------------------------------------------------------------
1192 On Solaris 8, you need to install GNU Ld (the loader) to get
1193 shared libraries to compile. (otherwise there is an error with -soname)
1194 You can get around this by using the static libraries and
1195 compiling with make optnoshared and make debugnoshared
1197 There is currently no implementation of GetRouteTable() in socket.cxx
1198 so OpenH323Proxy will not work.
1201 --------------------------------------------------------------------------------
1202 7.8. Build libraries under Windows
1203 ----------------------------------
1205 Unfortunately building libraries that were intended for Unix based systems
1206 under Windows can sometimes be difficult. Here are some notes on the subsystems
1209 7.8.1. OpenSSL under Windows
1210 ----------------------------
1211 The standard build for OpenSSL off http://www.openssl.org does work though it
1212 is rather tricky and requires things like Perl to be installed on your
1213 Windows box. However the build does work and is correct for PWlib use. Make
1214 sure you build the non-DLL Debug and Release versions.
1216 7.8.2. EXPAT under Windows
1217 ---------------------------
1218 The easiest way is to get the one in the OpenH323 CVS. This is guranteed to
1219 work. Use the following command to do this:
1221 cvs -d :pserver:anonymous@cvs.sourceforge.net:/cvsroot/openh323 co external/expat
1223 and then use the expat.dsw file to build the Debug and Release libraries.
1225 7.8.3. OpenLDAP under Windows
1226 ---------------------------
1227 To use OpenLDAP with PWLib you have to compile the OpenLDAP library as a DLL.
1228 Unfortunately, the standard distribution does not do this. So there is a file in
1229 PWLib called pwlib/tools/openldap-2.1.12-win32.zip which contains altered build
1230 files for that version of OpenLDAP. Note if you have a different version these
1235 1 Get OpenLDAP v 2.1.17 via tar file at
1236 ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-2.1.17.tgz
1237 or anonymous CVS using tag at
1238 :pserver:anonymous@cvs.OpenLDAP.org:/repo/OpenLDAP
1239 using tag OPENLDAP_REL_ENG_2_1_17
1240 2 Unpack it somewhere, eg c:\work\openldap
1241 3 Unzip the openldap-2.1.17-win32.zip file that directory
1242 4 Open openldap/build/main.dsw
1243 5 use Batch build to and select the "dll" project and build the "DLL Debug"
1244 and "DLL Release" targets.
1245 6 Put the resulting openldap/DLLRelease/openldap.dll and
1246 openldap/DLLDebug/openldapd.dll files in your path.
1248 7.8.4 SDL under Windows
1249 -----------------------
1250 Version 1.2.5 has support for Windows and MSVC so you just need to download it
1251 from http://www.libsdl.org/ and follow the build instructions.
1254 --------------------------------------------------------------------------------
1258 Most targets come with native sound support.
1259 However there is also support for the ESD (esound) daemon which provides
1260 full duplex audio via network sockets.
1261 To compile pwlib to use ESD, you need to set the ESDDIR environment variable
1262 to point to the directory you have installed ESD into.
1266 ================================================================================
1271 This package is far from a "product". There is very limited documentation and
1272 support will be on an ad-hoc basis, send us an e-mail and we will probably
1273 answer your question if it isn't too difficult.
1275 It is supplied mainly to support the open H323 project, but that shouldn't stop
1276 you from using it in whatever project you have in mind if you so desire. We like
1277 it and use it all the time, and we don't want to get into any religious wars of
1278 this class library over that one.
1283 ================================================================================
1288 The bulk of this library is licensed under the MPL (Mozilla Public License)
1289 version 1.0. In simple terms this license allows you to use the library for
1290 any purpose, commercial or otherwise, provided the library is kept in tact
1291 as a separate entity and any changes made to the library are made publicly
1292 available under the same (MPL) license. It is important to realise that that
1293 refers to changes to the library and not your application that is merely
1294 linked to the library.
1296 Note that due to a restriction in the GPL, any application you write that
1297 uses anything another than GPL, eg our library with MPL, is technically in
1298 breach of the GPL license. However, it should be noted that MPL does not
1299 care about the license of the final application, and as only the author of
1300 the GPL application is in breach of his own license and is unlikely to sue
1301 themselves for that breach, in practice there is no problem with a GPL
1302 application using an MPL or any other commercial library.
1305 The random number generator is based on code originally by Bob Jenkins.
1308 Portions of this library are from the REGEX library and is under the
1311 Copyright 1992, 1993, 1994, 1997 Henry Spencer. All rights reserved.
1312 This software is not subject to any license of the American Telephone
1313 and Telegraph Company or of the Regents of the University of California.
1315 Permission is granted to anyone to use this software for any purpose on
1316 any computer system, and to alter it and redistribute it, subject
1317 to the following restrictions:
1319 1. The author is not responsible for the consequences of use of this
1320 software, no matter how awful, even if they arise from flaws in it.
1322 2. The origin of this software must not be misrepresented, either by
1323 explicit claim or by omission. Since few users ever read sources,
1324 credits must appear in the documentation.
1326 3. Altered versions must be plainly marked as such, and must not be
1327 misrepresented as being the original software. Since few users
1328 ever read sources, credits must appear in the documentation.
1330 4. This notice may not be removed or altered.
1333 The in-band DTMF decoding code was taken from FreeBSD's dtmfdecode.c
1334 application written by Poul-Henning Kamp. It has the following
1336 * ----------------------------------------------------------------------------
1337 * "THE BEER-WARE LICENSE" (Revision 42):
1338 * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you
1339 * can do whatever you want with this stuff. If we meet some day, and you think
1340 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
1341 * ----------------------------------------------------------------------------
1345 ================================================================================
1346 Equivalence Pty. Ltd.
1347 Home of OpenH323 and the Open Phone Abstraction Library (OPAL)
1349 support@equival.com.au
1350 http://www.equival.com.au (US Mirror - http://www.equival.com)
1351 Fax: +61 2 4368 1395 Voice: +61 2 4368 2118
1353 ================================================================================