Opened 13 years ago

Closed 11 years ago

Last modified 11 years ago

#1519 closed enhancement (fixed)

pjsua2: New high level API in C++ on top of PJSUA-LIB

Reported by: bennylp Owned by: bennylp
Priority: normal Milestone: release-2.2
Component: pjsua-lib Version:
Keywords: android, pjsua2 Cc:
Backport to 1.x milestone: Backported: no

Description (last modified by bennylp)

A new object oriented (C++) API on top of PJSUA-LIB. Currently lives in pjsua2 branch.

Change History (64)

comment:1 Changed 12 years ago by ming

  • Milestone changed from release-2.0.1 to release-2.1

comment:2 Changed 11 years ago by bennylp

Created branch in r4595

comment:3 Changed 11 years ago by bennylp

In 4597:

Re #1519: initial implementation (incomplete) to demonstrate the API style/pattern

comment:4 Changed 11 years ago by bennylp

In 4598:

More re #1519: fixed some build errors

comment:5 Changed 11 years ago by bennylp

In 4600:

More re #1519: fixed build errors and added svn ignore for output files in java and python dirs

comment:6 Changed 11 years ago by bennylp

In 4608:

Re #1519:

  • Account API (prototype)
  • Account config implementation
  • Refactoring in types, endpoint, etc for better consistency
  • Should compile ok with make but not running yet

comment:7 Changed 11 years ago by nanang

In 4619:

Re #1519:

  • allow build on mingw32
  • fixed tests

comment:8 Changed 11 years ago by bennylp

In 4631:

More re #1519:

  • account API implementation (incomplete, callback is still not called)
  • using callback class design pattern (observer?)
  • after this, it might be changed to use inheritance pattern instead

comment:9 Changed 11 years ago by bennylp

  • Description modified (diff)
  • Keywords pjsua2 added
  • Summary changed from New high level API in C++ on top of PJSUA-LIB to pjsua2: New high level API in C++ on top of PJSUA-LIB
  • Version trunk deleted

comment:10 Changed 11 years ago by bennylp

In 4638:

Re #1519: Implementation of Account API, with inheritance approach:

  • With small demo app (samples/pjsua2_demo.cpp)
  • Endpoint changed to use inheritance approach too
  • Simple account registration demo and callback works
  • Further tests will be done in high level app (Python GUI?)
  • Temporary build setting fixes (Makefile) to allow linking with pjsua2 and libstdc++
  • Temporary hacks in Makefile to ignore other build targets to speed up build. This should be fixed during integration.

Issues:

  • incomplete Endpoint::on_incoming_subscribe() implementation. There is no Account::presNotify() yet.
  • incomplete Endpoint::on_pager2(), on_pager_status2(), to handle call's pager rather than account's pager
  • some SWIGTYPE (unknown type by Swig) still unresolved

comment:11 Changed 11 years ago by bennylp

In 4639:

Re #1519: Major change in pjsua2.i and etc after actual test in Python:

  • Major changes in SWIG interface file (pjsua2.i).
    • The "ignore" and "unignore" approach caused link error with vector (duplicate symbols because SWIG generates two identical vector functions in the wrapper) so it cannot be used (tried with many combinations and still doesn't work).
    • So scrap that, and now we use "importing" approach, where needed symbols must be listed in symbols.lst file, then use importsym.py to import the symbol declarations to symbols.i. Then include symbols.i in pjsua.i
    • Due to the way importsym.py work, some macros and naked constants need to be placed into a named enumeration, for example:
      • #define PJ_SUCCESS 0 ==> enum pj_constants_ { PJ_SUCCESS=0 }; [types.h]
      • enum { PJMEDIA_VID_DEFAULT_CAPTURE_DEV = -1 } ==> enum pjmedia_vid_dev_std_index { PJMEDIA_VID_DEFAULT_CAPTURE_DEV = -1 }; [videodev.h]
    • Makefile was changed so that symbols.i would be generated if symbols.lst has changed
  • Added "make install" and "make uninstall" targets for swig. Only implemented on Python. This will install to user's lib dir so doesn't need sudo.
  • Deleted approachX.hpp files
  • Added libVersion() method to Endpoint along with Version struct.
  • Fix pjsua2.i to make exception (or redirection?) works in Python
  • Add polling and worker thread related API:
    • PJSUA-LIB: pjsua_register_worker_thread(), pjsua_stop_worker_threads()
    • Endpoint: libRegisterWorkerThread(), libStopWorkerThreads(), libHandleEvents();

comment:12 Changed 11 years ago by bennylp

  • Version set to trunk

comment:13 Changed 11 years ago by bennylp

  • Version trunk deleted

comment:14 Changed 11 years ago by bennylp

In 4642:

Re #1519: added pj_strtof() to convert string to float in PJLIB, as part of pjsua2 persistent API development

comment:15 Changed 11 years ago by bennylp

In 4643:

Re #1519: Added support for JSON (JavaScript? Object Notation, RFC 4627) format in PJLIB-UTIL.

comment:16 Changed 11 years ago by bennylp

In 4644:

Re #1519: Added persistent API in pjsua2, with JSON as the format. The API is extensible to support more formats. All config structures are serializable now. Tested in Python.

comment:17 Changed 11 years ago by bennylp

In 4645:

More re #1519: the previous commit was missing this siptypes.cpp (this is part of persistent API development in pjsua2)

comment:18 Changed 11 years ago by bennylp

In 4646:

Re #1519: Updated SWIG interface file with new headers (persistent.hpp, json.hpp, siptypes.hpp) as part of persistent API development

comment:19 Changed 11 years ago by bennylp

In 4647:

Re #1519: added some C++ snippet to demonstrate or test persistent API in C++

comment:20 Changed 11 years ago by bennylp

In 4648:

Re #1519: persistent support in PyGui? application, making use of the new persistent API in pjsua2

comment:21 Changed 11 years ago by nanang

In 4654:

Re #1519: Minor update on PJ_UINT64() macro for GCC compiler. "LLU" is not recognized by C preproc on mingw/msys.

comment:22 Changed 11 years ago by nanang

In 4655:

Re #1519: Added converter methods, to/from pjsua_msg_data, for SipTxOption?.

comment:23 Changed 11 years ago by nanang

In 4657:

Re #1519: Added presence API in pjsua2.

comment:24 Changed 11 years ago by nanang

In 4658:

Re #1519: Minor fix on TransportInfo?, use fromPj() method to import data from pjsua_transport_info.

comment:25 Changed 11 years ago by nanang

In 4660:

Re #1519: Added VS2005 project for pjsua2.

comment:26 Changed 11 years ago by riza

In 4662:

Re #1519: Added Media API in pjsua2.

comment:27 Changed 11 years ago by ming

In 4663:

Re #1519: Add Call API in pjsua2.

comment:28 Changed 11 years ago by bennylp

In 4664:

Re #1519: Fully configurable account settings (more or less) and other small fixes

comment:29 Changed 11 years ago by bennylp

In 4665:

Re #1519: implemented Settings dialog and reorganization in config variables in Pygui app

comment:30 Changed 11 years ago by ming

In 4666:

Re #1519: Add call media

comment:31 Changed 11 years ago by riza

In 4668:

Re #1519: Added audio device management operations to Media API in pjsua2.

comment:32 Changed 11 years ago by riza

In 4669:

Re #1519: Added codec management operations to Media API in pjsua2.

comment:33 Changed 11 years ago by nanang

In r4670, misc update & fix:

  • added new files (call & media) to VS2005 project
  • fixed compile warnings
  • fixed compile error when video is disabled
  • fixed Makefile when JAVA_HOME env var is set

comment:34 Changed 11 years ago by bennylp

In 4672:

Re #1519: doxygen fixes and other minor fixes

comment:35 Changed 11 years ago by bennylp

In 4673:

Re #1519: fixed compilation error in pjsua2_demo

comment:36 Changed 11 years ago by bennylp

In 4674:

Re #1519: added misc comment to clarify

comment:37 Changed 11 years ago by bennylp

In 4676:

Re #1519: added AudioMedia? for the sound device

comment:38 Changed 11 years ago by bennylp

In 4678:

Re #1519: fixed threading issues on Python. On Python, only threads created by Python can call Python. This creates problem with calling callback from worker thread. The SIP worker thread can be disabled, but we have other worker threads such as the sound device that cannot be disabled. The solution in this patch is to create small framework to post a job to "main thread" during libHandleEvents(). The main thread is thread that calls libCreate().

comment:39 Changed 11 years ago by bennylp

In 4680:

Re #1519: added Tx/Rx? level adjustment in conf port info in pjsua-lib and pjsua2, and format in conf_port_info

comment:40 Changed 11 years ago by bennylp

In 4681:

Re #1519: minor fix to use pjmedia_format_copy() instead of plain assignment, and add return value to pjsua main()

comment:41 Changed 11 years ago by bennylp

In 4682:

Re #1519: fixed crash when receiving typing indication inside a call

comment:42 Changed 11 years ago by bennylp

In 4683:

Re #1519: added some more NULL checking in SIP data types

comment:43 Changed 11 years ago by bennylp

In 4684:

Re #1519: fixed assertion when unable to resolve destination

comment:44 Changed 11 years ago by nanang

In 4685:

Re #1519: Added typecast methods for AudioMedia? & its descendants, as Python cannot downcast among C++ classes, e.g: Media to AudioMedia?.

comment:45 Changed 11 years ago by nanang

In 4692:

Re #1519: Misc fixes in pjsua2:

  • Changed AccountConfig::toPj() signature, because a pjsua_acc_config instance should not be copied/assigned to another pjsua_acc_config instance as it contains list.
  • Fixed assertion in Endpoint destructor caused by access to pjlib mutex after pjlib is destroyed.
  • Changed VS2005 sample_debug project to allow debugging C++ code such as pjsua2_demo.cpp.
  • Compile warnings on VS2005.
  • Fixed SWIG python unit test.

comment:46 Changed 11 years ago by nanang

In 4699:

Re #1519: Fixed assertion and crash in Endpoint destruction caused by late destroy (after pjsua destroyed) and double deletes of audio device media.

comment:47 Changed 11 years ago by nanang

In 4702:

Re #1519: Put back automatic "writer" deletion in Endpoint destructor.

comment:48 Changed 11 years ago by bennylp

  • Resolution set to fixed
  • Status changed from new to closed

comment:49 Changed 11 years ago by nanang

In 4708:

Re #1519 [into SVN trunk]: AudioMedia? objects must not be destroyed before unregistered from conf bridge.

comment:50 Changed 11 years ago by nanang

In 4719:

Re #1519: [SVN trunk]: Misc fix compile warning.

comment:51 Changed 11 years ago by ming

In 4727:

Re #1519 (commited to SVN trunk): Add lib target to build system to enable building the library only (without the executables)

comment:52 Changed 11 years ago by nanang

In 4737:

Re #1519 [SVN trunk]: Updated JAVA_HOME auto-detection for pjsua2 SWIG Java binding, especially for MacOS platforms.

comment:53 Changed 11 years ago by nanang

In 4738:

Re #1519 [SVN trunk]: Related to r4737, for Android, don't override JAVA_HOME when it is already set (via environment variable).

comment:54 Changed 11 years ago by bennylp

In 4740:

More pjsua2 API (re #1519): changed default options value in createPlayer(), createRecorder(), and createPlaylist() to use 0 which is more natural

comment:55 Changed 11 years ago by bennylp

In 4741:

More pjsua2 API (re #1519): removed -static-libstdc++ flags from setup.py

comment:56 Changed 11 years ago by bennylp

In 4742:

More pjsua2 API (re #1519): renamed TimeValue? to TimeVal? due to conflict in iOS SDK

comment:57 Changed 11 years ago by bennylp

In 4743:

More pjsua2 API (re #1519): removed -static-libstdc++ flags from build.mak

comment:58 Changed 11 years ago by nanang

In 4744:

More pjsua2 API (re #1519): added simple tool to check and remove-if-necessary deprecated gcc option '-mno-cygwin' in building pjsua2 python binding on MinGW.

comment:59 Changed 11 years ago by nanang

In 4745:

More pjsua2 API (re #1519): fixed bad strtok() delimiter in the tool added by r4744.

comment:60 Changed 11 years ago by bennylp

In 4746:

More re #1519: removed auto generation of symbols.i from the Makefile because it cannot be run from MacOS X. Also touched symbols.i. Next time, check in symbols.i separately from symbols.lst

comment:61 Changed 11 years ago by nanang

In 4753:

Re #1519: Include user.mak build settings in building pjsua app and pjsua2 SWIG Python binding.

comment:62 Changed 11 years ago by nanang

In 4756:

More pjsua2 SWIG Python (re #1519): Separate library dependencies from Python Extension setting 'extra_link_args', so PJ lib dependencies are specified before Python's (otherwise strange crash happens on MinGW).

comment:63 Changed 11 years ago by nanang

In 4758:

More pjsua2 SWIG Python (re #1519): Fixed 'symbol not found' error in loading pjsua2 (on MacOS) when built with video enabled.

comment:64 Changed 11 years ago by riza

In 4759:

Re #1519: Fix error build (swig java) when JAVA_HOME is set to folder name separated by space (' ')

Note: See TracTickets for help on using tickets.