Hello all, during the last weeks, I worked hard on the patch for PJSUA2 and C++ 17 compatibility again. For those who have forgotten: Currently the PJSUA2 headers cannot be compiled with C++ 17 because C++ 17 removes support for exception specifications. But unfortunately PJSUA2 makes have use of exception specifications. The open issue with my last patch was that SWIG no longer
generates catch handlers that catch "pj::Error", as Ming pointed
out. I have now updated the patch so that SWIG also generates the
required catch handlers. Doing so has been a quite difficult,
tedious and time-consuming task. But finally I am done and I am
happy to share the resulting patch for inclusion into pjsip. The
updated patch is attached to this mail. The magic on the SWIG side is done with the "%exception"
directive, which installs a default global exception handler. In
my updated patch, I am now using this "%exception" directive to
generate the catch handler for "pj::Error" (see the new file
"pjsip-apps/src/swig/pj_error.i"). The rationale behind this was
that I really wanted to remove all the "throw (pj::Error)" from
the header files, so I did not want to have a "PJ_THROW" that
would expand to nothing during the compile and expand to the old
"throw (...)" when using SWIG. "throw (...)" is now deprecated
syntax and we should not keep it around for the sake of SWIG in my
opinion. Some basic testing was also done:
I hope that this patch can now be considered for inclusion into PJSIP.
Christian On 25/09/18 10:26, Max Truxa wrote:
Hello Christian, how about replacing the throw specifications with a macro that expands to nothing when compiling as C++ but `throw(Error)` when being parsed by SWIG? Something like this: #ifdef SWIG // defined if SWIG is parsing the file # define PJ_CAN_THROW throw(Error) #else # define PJ_CAN_THROW #endif struct Foo { void bar() PJ_CAN_THROW; }; Regards, - Max On Tue, Sep 25, 2018 at 8:30 AM Christian Hoff <christian_hoff@xxxxxxx> wrote:Hello Ming, this is also an interesting idea. But will this actually work..? I am wondering because SWIG only parses the header files of PJSUA2. However the actual function implementation is in the ".cpp" source files and in these files you can find the code that throws the exceptions and that could use "PJ_THROW()". But to my knowledge SWIG does not parse the source files and would thus not know which functions may call "PJ_THROW". Or am I wrong about this? Best regards, Christian On 25/09/18 03:08, Ming wrote:Hi Christian, We haven't found a good way either. Our idea is to put PJ_THROW() macro to replace throw(), which can somehow be used by SWIG to generate the exception specs. Regards, Ming On Tue, Sep 25, 2018 at 4:21 AM Christian Hoff <christian_hoff@xxxxxxx> wrote:Hello Ming and all, I have now done some research into SWIG and exceptions. After reading the SWIG documentation, I found out that SWIG indeed parses the C++ exception specification to figure out for what types of exceptions "catch(..)" should be generated (see http://www.swig.org/Doc3.0/SWIGDocumentation.html#SWIGPlus_exception_specifications ). Exception types that are specified in the exception specification are automatically propagated to the higher language (Java, C# etc.). Now that we need to remove the exception specification, we lose that capability. Thanks to Ming for the hint. However there is the possibility to adapt the SWIG interface file ("pjsip-apps/src/swig/pjsua2.i") and to add explicit "%catches" statements for each method that describe which types of exceptions the method could possibility throw. So I guess I need to rework my patch for this. I just hope that I will find some way to avoid having to annotate every method with "%catches".... I'll see. Or if someone knows how to do it, then I would be very grateful for a reply. Best regards, Christian On 24/09/18 12:43, Christian Hoff wrote:Hello Ming, thanks for your reply! I will have a look into the SWIG topic this evening and will let you know my findings. Best regards, Christian On 24/09/18 09:03, Ming wrote:Hi Christian, We apologize for the delay in response. We're currently reviewing it and have also managed to do some testing. While for C/C++, this seems to be okay, we're still considering how to best handle this for our Android and Java (via SWIG binding), which may still need the "throw" specifications in order for the developers to know that the functions may throw some exceptions. If you have any feedback regarding this, please let us know. Best regards, Ming On Mon, Sep 24, 2018 at 2:32 PM Christian Hoff <christian_hoff@xxxxxxx> wrote:Hello all, some feedback for this patch is still appreciated. In general I am getting somewhat frustrated about the collaboration with people who want to contribute to the project. Already in the past other people have posted patches here to this list, but did not get any response - not even a response what needs to be changed for the patch to be accepted. I think this is not a good mode of collaboration. Everyone who posts a patch here to this mailing list has done this with the intention to help the project PJSIP to move along (and has spent much time developing the patch), so you should at least return the favour and review the patch. This particular issue that I am trying to address with my patch (that the PJSUA2 headers don't compile against C++17) is an issue that you will eventually need to fix anyhow, so why not fix it right now? As of now, modern versions of GCC use C++ 14 by default, it is only a matter of time until C++ 17 will become the default and people will start complaining that there are compile errors from the PJSUA2 headers. Besides this, my own app uses PJSUA2 with C++ 17 features, so I would have to revert back to C++14 if this patch is not accepted upstream. This would be really unnecessary. So I would really appreciate a patch review. Best regards, Christian On 18/09/18 20:57, Christian Hoff wrote:Hello all, Hello Ming & Riza, do you have any feedback regarding this patch for C++ 17 support? I am also willing to rework it if required, but some feedback would be nice. Thanks in advance and kind regards, Christian On 12/09/18 18:23, Christian Hoff wrote:Hello all, currently it is not possible to compile a pjsua2 application with C++17. The reason is that C++17 removes support for dynamic exception specifications (that is "throws ..." declarations at the end of a function). Unfortunately PJSUA2 makes heavy use of exception specifications and most PJSUA2 functions are declared as "throw (Error)" - meaning that they can throw an exception of type "Error" that the programmer is supposed to catch. The consequence is that a lot of compile errors can be observed when compiling a pjsua2 application with C++17. The compile errors look as follows: /usr/local/include/pjsua2/json.hpp:80:33: error: ISO C++17 does not allow dynamic exception specifications virtual string saveString() throw(Error); ^~~~~ The compile of the same application worked fine when using the C++14 standard, but it got broken when I switched from C++14 to the C++17 standard. See https://www.bfilipek.com/2017/05/cpp17-details-fixes-deprecation.html#removing-deprecated-exception-specifications-from-c17 and http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0003r0.html for more background about the removal of exception specifications. To make the application compile again, I had to remove "throw(Error)" in the whole PJSUA2 source code and include files. This seems to be the only viable and good fix for this issue. I wrote my own "sed" script to do that and made some cosmetic corrections afterwards. Then I generated the attached patch file. Could you please apply this patch to the code base or give me feedback what I still need to improve? I verified that pjsip compiles fine with the patch applied. Thank you very much! Best regards, Christian_______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@xxxxxxxxxxxxxxx http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org_______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@xxxxxxxxxxxxxxx http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org_______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@xxxxxxxxxxxxxxx http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org_______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@xxxxxxxxxxxxxxx http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org_______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@xxxxxxxxxxxxxxx http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org_______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@xxxxxxxxxxxxxxx http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org_______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@xxxxxxxxxxxxxxx http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org |
Index: pjsip/include/pjsua2/account.hpp =================================================================== --- pjsip/include/pjsua2/account.hpp (revision 5896) +++ pjsip/include/pjsua2/account.hpp (working copy) @@ -174,7 +174,7 @@ * * @param node Container to read values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container node. @@ -181,7 +181,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; @@ -273,7 +273,7 @@ * * @param node Container to read values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container node. @@ -280,7 +280,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; /** @@ -331,7 +331,7 @@ * * @param node Container to read values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container node. @@ -338,7 +338,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; /** @@ -398,7 +398,7 @@ * * @param node Container to read values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container node. @@ -405,7 +405,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; /** @@ -438,7 +438,7 @@ * * @param node Container to read values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container node. @@ -445,7 +445,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; /** @@ -692,7 +692,7 @@ * * @param node Container to read values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container node. @@ -699,7 +699,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; /** @@ -781,7 +781,7 @@ * * @param node Container to read values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container node. @@ -788,7 +788,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; /** @@ -884,7 +884,7 @@ * * @param node Container to read values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container node. @@ -891,7 +891,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; /** @@ -971,7 +971,7 @@ * * @param node Container to read values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container node. @@ -978,7 +978,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; /** @@ -1077,7 +1077,7 @@ * * @param node Container to read values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container node. @@ -1084,7 +1084,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; /** @@ -1132,7 +1132,7 @@ * * @param node Container to read values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container node. @@ -1139,7 +1139,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; } AccountIpChangeConfig; @@ -1234,7 +1234,7 @@ * * @param node Container to read values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container node. @@ -1241,7 +1241,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; @@ -1642,7 +1642,7 @@ * @param make_default Make this the default account. */ void create(const AccountConfig &cfg, - bool make_default=false) throw(Error); + bool make_default=false); /** * Shutdown the account. This will initiate unregistration if needed, @@ -1664,7 +1664,7 @@ * @param cfg New account config to be applied to the * account. */ - void modify(const AccountConfig &cfg) throw(Error); + void modify(const AccountConfig &cfg); /** * Check if this account is still valid. @@ -1677,7 +1677,7 @@ * Set this as default account to be used when incoming and outgoing * requests don't match any accounts. */ - void setDefault() throw(Error); + void setDefault(); /** * Check if this account is the default account. Default account will be @@ -1709,7 +1709,7 @@ * * @return Account info. */ - AccountInfo getInfo() const throw(Error); + AccountInfo getInfo() const; /** * Update registration or perform unregistration. Application normally @@ -1719,7 +1719,7 @@ * @param renew If False, this will start unregistration * process. */ - void setRegistration(bool renew) throw(Error); + void setRegistration(bool renew); /** * Set or modify account's presence online status to be advertised to @@ -1730,7 +1730,7 @@ * * @param pres_st Presence online status. */ - void setOnlineStatus(const PresenceStatus &pres_st) throw(Error); + void setOnlineStatus(const PresenceStatus &pres_st); /** * Lock/bind this account to a specific transport/listener. Normally @@ -1746,7 +1746,7 @@ * * @param tp_id The transport ID. */ - void setTransport(TransportId tp_id) throw(Error); + void setTransport(TransportId tp_id); /** * Send NOTIFY to inform account presence status or to terminate server @@ -1756,7 +1756,7 @@ * * @param prm The sending NOTIFY parameter. */ - void presNotify(const PresNotifyParam &prm) throw(Error); + void presNotify(const PresNotifyParam &prm); /** * Enumerate all buddies of the account. @@ -1763,7 +1763,7 @@ * * @return The buddy list. */ - const BuddyVector& enumBuddies() const throw(Error); + const BuddyVector& enumBuddies() const; /** * Find a buddy in the buddy list with the specified URI. @@ -1776,7 +1776,7 @@ * @return The pointer to buddy. */ Buddy* findBuddy(string uri, FindBuddyMatch *buddy_match = NULL) const - throw(Error); + ; public: /* Index: pjsip/include/pjsua2/call.hpp =================================================================== --- pjsip/include/pjsua2/call.hpp (revision 5896) +++ pjsip/include/pjsua2/call.hpp (working copy) @@ -1245,7 +1245,7 @@ * * @return Call info. */ - CallInfo getInfo() const throw(Error); + CallInfo getInfo() const; /** * Check if this call has active INVITE session and the INVITE @@ -1344,7 +1344,7 @@ * * @see Endpoint::natGetType(), natTypeInSdp */ - pj_stun_nat_type getRemNatType() throw(Error); + pj_stun_nat_type getRemNatType(); /** * Make outgoing call to the specified URI. @@ -1355,7 +1355,7 @@ * @param prm.txOption Optional headers etc to be added to outgoing INVITE * request. */ - void makeCall(const string &dst_uri, const CallOpParam &prm) throw(Error); + void makeCall(const string &dst_uri, const CallOpParam &prm); /** * Send response to incoming INVITE request with call setting param. @@ -1379,7 +1379,7 @@ * be persistent in all next answers/responses for this * INVITE request. */ - void answer(const CallOpParam &prm) throw(Error); + void answer(const CallOpParam &prm); /** * Hangup call by using method that is appropriate according to the @@ -1399,7 +1399,7 @@ * @param prm.txOption Optional list of headers etc to be added to outgoing * request/response message. */ - void hangup(const CallOpParam &prm) throw(Error); + void hangup(const CallOpParam &prm); /** * Put the specified call on hold. This will send re-INVITE with the @@ -1413,7 +1413,7 @@ * @param prm.txOption Optional message components to be sent with * the request. */ - void setHold(const CallOpParam &prm) throw(Error); + void setHold(const CallOpParam &prm); /** * Send re-INVITE. @@ -1428,7 +1428,7 @@ * @param prm.txOption Optional message components to be sent with * the request. */ - void reinvite(const CallOpParam &prm) throw(Error); + void reinvite(const CallOpParam &prm); /** * Send UPDATE request. @@ -1438,7 +1438,7 @@ * @param prm.txOption Optional message components to be sent with * the request. */ - void update(const CallOpParam &prm) throw(Error); + void update(const CallOpParam &prm); /** * Initiate call transfer to the specified address. This function will send @@ -1455,7 +1455,7 @@ * @param prm.txOption Optional message components to be sent with * the request. */ - void xfer(const string &dest, const CallOpParam &prm) throw(Error); + void xfer(const string &dest, const CallOpParam &prm); /** * Initiate attended call transfer. This function will send REFER request @@ -1473,7 +1473,7 @@ * the request. */ void xferReplaces(const Call& dest_call, - const CallOpParam &prm) throw(Error); + const CallOpParam &prm); /** * Accept or reject redirection response. Application MUST call this @@ -1497,7 +1497,7 @@ * callback, except that the PJSIP_REDIRECT_PENDING is * not accepted here. */ - void processRedirect(pjsip_redirect_op cmd) throw(Error); + void processRedirect(pjsip_redirect_op cmd); /** * Send DTMF digits to remote using RFC 2833 payload formats. @@ -1504,7 +1504,7 @@ * * @param digits DTMF string digits to be sent. */ - void dialDtmf(const string &digits) throw(Error); + void dialDtmf(const string &digits); /** * Send DTMF digits to remote. @@ -1511,7 +1511,7 @@ * * @param param The send DTMF parameter. */ - void sendDtmf(const CallSendDtmfParam ¶m) throw (Error); + void sendDtmf(const CallSendDtmfParam ¶m); /** * Send instant messaging inside INVITE session. @@ -1525,7 +1525,7 @@ * @param prm.userData Optional user data, which will be given back when * the IM callback is called. */ - void sendInstantMessage(const SendInstantMessageParam& prm) throw(Error); + void sendInstantMessage(const SendInstantMessageParam& prm); /** * Send IM typing indication inside INVITE session. @@ -1536,7 +1536,7 @@ * outgoing request. */ void sendTypingIndication(const SendTypingIndicationParam &prm) - throw(Error); + ; /** * Send arbitrary request with the call. This is useful for example to send @@ -1548,7 +1548,7 @@ * @param prm.txOption Optional message body and/or list of headers to be * included in outgoing request. */ - void sendRequest(const CallSendRequestParam &prm) throw(Error); + void sendRequest(const CallSendRequestParam &prm); /** * Dump call and media statistics to string. @@ -1558,7 +1558,7 @@ * * @return Call dump and media statistics string. */ - string dump(bool with_media, const string indent) throw(Error); + string dump(bool with_media, const string indent); /** * Get the media stream index of the default video stream in the call. @@ -1596,7 +1596,7 @@ * (see CallVidSetStreamParam). */ void vidSetStream(pjsua_call_vid_strm_op op, - const CallVidSetStreamParam ¶m) throw(Error); + const CallVidSetStreamParam ¶m); /** * Get media stream info for the specified media index. @@ -1605,7 +1605,7 @@ * * @return The stream info. */ - StreamInfo getStreamInfo(unsigned med_idx) const throw(Error); + StreamInfo getStreamInfo(unsigned med_idx) const; /** * Get media stream statistic for the specified media index. @@ -1614,7 +1614,7 @@ * * @return The stream statistic. */ - StreamStat getStreamStat(unsigned med_idx) const throw(Error); + StreamStat getStreamStat(unsigned med_idx) const; /** * Get media transport info for the specified media index. @@ -1623,7 +1623,7 @@ * * @return The transport info. */ - MediaTransportInfo getMedTransportInfo(unsigned med_idx) const throw(Error); + MediaTransportInfo getMedTransportInfo(unsigned med_idx) const; /** * Internal function (callled by Endpoint( to process update to call Index: pjsip/include/pjsua2/endpoint.hpp =================================================================== --- pjsip/include/pjsua2/endpoint.hpp (revision 5896) +++ pjsip/include/pjsua2/endpoint.hpp (working copy) @@ -560,7 +560,7 @@ * * @param node Container to write values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container. @@ -567,7 +567,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; @@ -660,7 +660,7 @@ * * @param node Container to write values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container. @@ -667,7 +667,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; @@ -879,7 +879,7 @@ * * @param node Container to write values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container. @@ -886,7 +886,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; @@ -909,7 +909,7 @@ * * @param node Container to write values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container. @@ -916,7 +916,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; @@ -941,7 +941,7 @@ { public: /** Retrieve the singleton instance of the endpoint */ - static Endpoint &instance() throw(Error); + static Endpoint &instance(); /** Default constructor */ Endpoint(); @@ -965,7 +965,7 @@ * are properly initialized. Once this function has returned success, * application must call libDestroy() before quitting. */ - void libCreate() throw(Error); + void libCreate(); /** * Get library state. @@ -983,7 +983,7 @@ * * @param prmEpConfig Endpoint configurations */ - void libInit( const EpConfig &prmEpConfig) throw(Error); + void libInit( const EpConfig &prmEpConfig); /** * Call this function after all initialization is done, so that the @@ -990,7 +990,7 @@ * library can do additional checking set up. Application may call this * function any time after init(). */ - void libStart() throw(Error); + void libStart(); /** * Register a thread that was created by external or native API to the @@ -1000,7 +1000,7 @@ * * @param name The optional name to be assigned to the thread. */ - void libRegisterThread(const string &name) throw(Error); + void libRegisterThread(const string &name); /** * Check if this thread has been registered to the library. Note that @@ -1049,7 +1049,7 @@ * * @param prmFlags Combination of pjsua_destroy_flag enumeration. */ - void libDestroy(unsigned prmFlags=0) throw(Error); + void libDestroy(unsigned prmFlags=0); /************************************************************************* @@ -1122,7 +1122,7 @@ * given to utilTimerCancel(). */ Token utilTimerSchedule(unsigned prmMsecDelay, - Token prmUserData) throw (Error); + Token prmUserData); /** * Cancel previously scheduled timer with the specified timer token. @@ -1144,7 +1144,7 @@ /** * Get cipher list supported by SSL/TLS backend. */ - IntVector utilSslGetAvailableCiphers() throw (Error); + IntVector utilSslGetAvailableCiphers(); /************************************************************************* * NAT operations @@ -1161,7 +1161,7 @@ * * Note that STUN must be enabled to run this function successfully. */ - void natDetectType(void) throw(Error); + void natDetectType(void); /** * Get the NAT type as detected by natDetectType() function. This @@ -1172,7 +1172,7 @@ * Exception: if this function is called while detection is in progress, * PJ_EPENDING exception will be raised. */ - pj_stun_nat_type natGetType() throw(Error); + pj_stun_nat_type natGetType(); /** * Update the STUN servers list. The libInit() must have been called @@ -1198,7 +1198,7 @@ * */ void natUpdateStunServers(const StringVector &prmServers, - bool prmWait) throw(Error); + bool prmWait); /** * Auxiliary function to resolve and contact each of the STUN server @@ -1228,7 +1228,7 @@ */ void natCheckStunServers(const StringVector &prmServers, bool prmWait, - Token prmUserData) throw(Error); + Token prmUserData); /** * Cancel pending STUN resolution which match the specified token. @@ -1243,7 +1243,7 @@ * Exception: PJ_ENOTFOUND if there is no matching one, or other error. */ void natCancelCheckStunServers(Token token, - bool notify_cb = false) throw(Error); + bool notify_cb = false); /************************************************************************* * Transport operations @@ -1259,7 +1259,7 @@ * @return The transport ID. */ TransportId transportCreate(pjsip_transport_type_e type, - const TransportConfig &cfg) throw(Error); + const TransportConfig &cfg); /** * Enumerate all transports currently created in the system. This @@ -1269,7 +1269,7 @@ * * @return Array of transport IDs. */ - IntVector transportEnum() throw(Error); + IntVector transportEnum(); /** * Get information about transport. @@ -1278,7 +1278,7 @@ * * @return Transport info. */ - TransportInfo transportGetInfo(TransportId id) throw(Error); + TransportInfo transportGetInfo(TransportId id); /** * Disable a transport or re-enable it. By default transport is always @@ -1290,7 +1290,7 @@ * @param enabled Enable or disable the transport. * */ - void transportSetEnable(TransportId id, bool enabled) throw(Error); + void transportSetEnable(TransportId id, bool enabled); /** * Close the transport. The system will wait until all transactions are @@ -1299,7 +1299,7 @@ * * @param id Transport ID. */ - void transportClose(TransportId id) throw(Error); + void transportClose(TransportId id); /** * Start graceful shutdown procedure for this transport handle. After @@ -1314,7 +1314,7 @@ * * @param tp The transport. */ - void transportShutdown(TransportHandle tp) throw(Error); + void transportShutdown(TransportHandle tp); /************************************************************************* * Call operations @@ -1372,7 +1372,7 @@ * * @return The list of media port. */ - const AudioMediaVector &mediaEnumPorts() const throw(Error); + const AudioMediaVector &mediaEnumPorts() const; /** * Get the instance of Audio Device Manager. @@ -1397,7 +1397,7 @@ * * @return Array of codec info. */ - const CodecInfoVector &codecEnum() throw(Error); + const CodecInfoVector &codecEnum(); /** * Change codec priority. @@ -1409,7 +1409,7 @@ * */ void codecSetPriority(const string &codec_id, - pj_uint8_t priority) throw(Error); + pj_uint8_t priority); /** * Get codec parameters. @@ -1420,7 +1420,7 @@ * will be thrown. * */ - CodecParam codecGetParam(const string &codec_id) const throw(Error); + CodecParam codecGetParam(const string &codec_id) const; /** * Set codec parameters. @@ -1431,7 +1431,7 @@ * */ void codecSetParam(const string &codec_id, - const CodecParam param) throw(Error); + const CodecParam param); /** * Enum all supported video codecs in the system. @@ -1438,7 +1438,7 @@ * * @return Array of video codec info. */ - const CodecInfoVector &videoCodecEnum() throw(Error); + const CodecInfoVector &videoCodecEnum(); /** * Change video codec priority. @@ -1451,7 +1451,7 @@ * */ void videoCodecSetPriority(const string &codec_id, - pj_uint8_t priority) throw(Error); + pj_uint8_t priority); /** * Get video codec parameters. @@ -1462,7 +1462,7 @@ * will be thrown. * */ - VidCodecParam getVideoCodecParam(const string &codec_id) const throw(Error); + VidCodecParam getVideoCodecParam(const string &codec_id) const; /** * Set video codec parameters. @@ -1472,7 +1472,7 @@ * */ void setVideoCodecParam(const string &codec_id, - const VidCodecParam ¶m) throw(Error); + const VidCodecParam ¶m); /** * Reset video codec parameters to library default settings. @@ -1480,7 +1480,7 @@ * @param codec_id Codec ID. * */ - void resetVideoCodecParam(const string &codec_id) throw(Error); + void resetVideoCodecParam(const string &codec_id); /** * Enumerate all SRTP crypto-suite names. @@ -1487,7 +1487,7 @@ * * @return The list of SRTP crypto-suite name. */ - StringVector srtpCryptoEnum() throw(Error); + StringVector srtpCryptoEnum(); /************************************************************************* * IP Change @@ -1512,7 +1512,7 @@ * * @return PJ_SUCCESS on success, other on error. */ - void handleIpChange(const IpChangeParam ¶m) throw(Error); + void handleIpChange(const IpChangeParam ¶m); public: /* Index: pjsip/include/pjsua2/json.hpp =================================================================== --- pjsip/include/pjsua2/json.hpp (revision 5896) +++ pjsip/include/pjsua2/json.hpp (working copy) @@ -58,7 +58,7 @@ * * @param filename The file name. */ - virtual void loadFile(const string &filename) throw(Error); + virtual void loadFile(const string &filename); /** * Load this document from string. @@ -65,7 +65,7 @@ * * @param input The string. */ - virtual void loadString(const string &input) throw(Error); + virtual void loadString(const string &input); /** * Write this document to a file. @@ -72,12 +72,12 @@ * * @param filename The file name. */ - virtual void saveFile(const string &filename) throw(Error); + virtual void saveFile(const string &filename); /** * Write this document to string. */ - virtual string saveString() throw(Error); + virtual string saveString(); /** * Get the root container node for this document Index: pjsip/include/pjsua2/media.hpp =================================================================== --- pjsip/include/pjsua2/media.hpp (revision 5896) +++ pjsip/include/pjsua2/media.hpp (working copy) @@ -221,7 +221,7 @@ /** * Get information about the specified conference port. */ - ConfPortInfo getPortInfo() const throw(Error); + ConfPortInfo getPortInfo() const; /** * Get port Id. @@ -231,7 +231,7 @@ /** * Get information from specific port id. */ - static ConfPortInfo getPortInfoFromId(int port_id) throw(Error); + static ConfPortInfo getPortInfoFromId(int port_id); /** * Establish unidirectional media flow to sink. This media port @@ -246,7 +246,7 @@ * * @param sink The destination Media. */ - void startTransmit(const AudioMedia &sink) const throw(Error); + void startTransmit(const AudioMedia &sink) const; /** * Establish unidirectional media flow to sink. This media port @@ -274,8 +274,7 @@ * @param param The parameter. */ void startTransmit2(const AudioMedia &sink, - const AudioMediaTransmitParam ¶m) const - throw(Error); + const AudioMediaTransmitParam ¶m) const; /** * Stop media flow to destination/sink port. @@ -283,7 +282,7 @@ * @param sink The destination media. * */ - void stopTransmit(const AudioMedia &sink) const throw(Error); + void stopTransmit(const AudioMedia &sink) const; /** * Adjust the signal level to be transmitted from the bridge to this @@ -293,7 +292,7 @@ * level adjustment, while value 0 means to mute * the port. */ - void adjustRxLevel(float level) throw(Error); + void adjustRxLevel(float level); /** * Adjust the signal level to be received from this media port (to @@ -303,7 +302,7 @@ * level adjustment, while value 0 means to mute * the port. */ - void adjustTxLevel(float level) throw(Error); + void adjustTxLevel(float level); /** * Get the last received signal level. @@ -310,7 +309,7 @@ * * @return Signal level in percent. */ - unsigned getRxLevel() const throw(Error); + unsigned getRxLevel() const; /** * Get the last transmitted signal level. @@ -317,7 +316,7 @@ * * @return Signal level in percent. */ - unsigned getTxLevel() const throw(Error); + unsigned getTxLevel() const; /** * Typecast from base class Media. This is useful for application written @@ -354,7 +353,7 @@ * param port the media port to be registered to the conference bridge. * */ - void registerMediaPort(MediaPort port) throw(Error); + void registerMediaPort(MediaPort port); /** * This method needs to be called by descendants of this class to remove @@ -422,7 +421,7 @@ * PJMEDIA_FILE_NO_LOOP to prevent playback loop. */ void createPlayer(const string &file_name, - unsigned options=0) throw(Error); + unsigned options=0); /** * Create a file playlist media port, and automatically add the port @@ -437,7 +436,7 @@ */ void createPlaylist(const StringVector &file_names, const string &label="", - unsigned options=0) throw(Error); + unsigned options=0); /** * Get additional info about the player. This operation is only valid @@ -445,7 +444,7 @@ * * @return the info. */ - AudioMediaPlayerInfo getInfo() const throw(Error); + AudioMediaPlayerInfo getInfo() const; /** * Get current playback position in samples. This operation is not valid @@ -453,7 +452,7 @@ * * @return Current playback position, in samples. */ - pj_uint32_t getPos() const throw(Error); + pj_uint32_t getPos() const; /** * Set playback position in samples. This operation is not valid for @@ -461,7 +460,7 @@ * * @param samples The desired playback position, in samples. */ - void setPos(pj_uint32_t samples) throw(Error); + void setPos(pj_uint32_t samples); /** * Typecast from base class AudioMedia. This is useful for application @@ -546,7 +545,7 @@ void createRecorder(const string &file_name, unsigned enc_type=0, pj_ssize_t max_size=0, - unsigned options=0) throw(Error); + unsigned options=0); /** * Typecast from base class AudioMedia. This is useful for application @@ -642,7 +641,7 @@ * Create tone generator. */ void createToneGenerator(unsigned clock_rate = 16000, - unsigned channel_count = 1) throw(Error); + unsigned channel_count = 1); /** * Check if the tone generator is still busy producing some tones. @@ -653,13 +652,13 @@ /** * Instruct the tone generator to stop current processing. */ - void stop() throw(Error); + void stop(); /** * Rewind the playback. This will start the playback to the first * tone in the playback list. */ - void rewind() throw(Error); + void rewind(); /** * Instruct the tone generator to play single or dual frequency tones @@ -672,7 +671,7 @@ * @param loop Play the tone in a loop. */ void play(const ToneDescVector &tones, - bool loop=false) throw(Error); + bool loop=false); /** * Instruct the tone generator to play multiple MF digits with each of @@ -686,7 +685,7 @@ * @param loop Play the tone in a loop. */ void playDigits(const ToneDigitVector &digits, - bool loop=false) throw(Error); + bool loop=false); /** * Get the digit-map currently used by this tone generator. @@ -693,7 +692,7 @@ * * @return The digitmap currently used by the tone generator */ - ToneDigitMapVector getDigitMap() const throw(Error); + ToneDigitMapVector getDigitMap() const; /** * Set digit map to be used by the tone generator. @@ -700,7 +699,7 @@ * * @param digit_map Digitmap to be used by the tone generator. */ - void setDigitMap(const ToneDigitMapVector &digit_map) throw(Error); + void setDigitMap(const ToneDigitMapVector &digit_map); private: pj_pool_t *pool; @@ -790,7 +789,7 @@ * * @return Device ID of the capture device. */ - int getCaptureDev() const throw(Error); + int getCaptureDev() const; /** * Get the AudioMedia of the capture audio device. @@ -797,7 +796,7 @@ * * @return Audio media for the capture device. */ - AudioMedia &getCaptureDevMedia() throw(Error); + AudioMedia &getCaptureDevMedia(); /** * Get currently active playback sound devices. If sound devices has not @@ -805,7 +804,7 @@ * * @return Device ID of the playback device. */ - int getPlaybackDev() const throw(Error); + int getPlaybackDev() const; /** * Get the AudioMedia of the speaker/playback audio device. @@ -812,7 +811,7 @@ * * @return Audio media for the speaker/playback device. */ - AudioMedia &getPlaybackDevMedia() throw(Error); + AudioMedia &getPlaybackDevMedia(); /** * Select or change capture sound device. Application may call this @@ -822,7 +821,7 @@ * * @param capture_dev Device ID of the capture device. */ - void setCaptureDev(int capture_dev) const throw(Error); + void setCaptureDev(int capture_dev) const; /** * Select or change playback sound device. Application may call this @@ -832,7 +831,7 @@ * * @param playback_dev Device ID of the playback device. */ - void setPlaybackDev(int playback_dev) const throw(Error); + void setPlaybackDev(int playback_dev) const; /** * Enum all audio devices installed in the system. @@ -839,7 +838,7 @@ * * @return The list of audio device info. */ - const AudioDevInfoVector &enumDev() throw(Error); + const AudioDevInfoVector &enumDev(); /** * Set pjsua to use null sound device. The null sound device only provides @@ -847,7 +846,7 @@ * any hardware. * */ - void setNullDev() throw(Error); + void setNullDev(); /** * Disconnect the main conference bridge from any sound devices, and let @@ -866,7 +865,7 @@ * of #pjsua_snd_dev_mode * */ - void setSndDevMode(unsigned mode) const throw(Error); + void setSndDevMode(unsigned mode) const; /** * Change the echo cancellation settings. @@ -892,7 +891,7 @@ * Normally the value should be zero. * */ - void setEcOptions(unsigned tail_msec, unsigned options) throw(Error); + void setEcOptions(unsigned tail_msec, unsigned options); /** * Get current echo canceller tail length. @@ -900,7 +899,7 @@ * @return The EC tail length in milliseconds, * If AEC is disabled, the value will be zero. */ - unsigned getEcTail() const throw(Error); + unsigned getEcTail() const; /** * Check whether the sound device is currently active. The sound device @@ -919,7 +918,7 @@ * any method that accepts audio device index as its parameter. * */ - void refreshDevs() throw(Error); + void refreshDevs(); /** * Get the number of sound devices installed in the system. @@ -938,7 +937,7 @@ * @return The device information which will be filled in * by this method once it returns successfully. */ - AudioDevInfo getDevInfo(int id) const throw(Error); + AudioDevInfo getDevInfo(int id) const; /** * Lookup device index based on the driver and device name. @@ -950,7 +949,7 @@ * Error will be thrown. */ int lookupDev(const string &drv_name, - const string &dev_name) const throw(Error); + const string &dev_name) const; /** * Get string info for the specified capability. @@ -981,7 +980,7 @@ * */ void - setExtFormat(const MediaFormatAudio &format, bool keep=true) throw(Error); + setExtFormat(const MediaFormatAudio &format, bool keep=true); /** * Get the audio format capability (other than PCM) of the sound device @@ -998,7 +997,7 @@ * @return The audio format. * */ - MediaFormatAudio getExtFormat() const throw(Error); + MediaFormatAudio getExtFormat() const; /** * This will configure audio input latency control or query capability to @@ -1019,7 +1018,7 @@ * for future use. */ void - setInputLatency(unsigned latency_msec, bool keep=true) throw(Error); + setInputLatency(unsigned latency_msec, bool keep=true); /** * Get the audio input latency control or query capability of the sound @@ -1036,7 +1035,7 @@ * @return The audio input latency. * */ - unsigned getInputLatency() const throw(Error); + unsigned getInputLatency() const; /** * This will configure audio output latency control or query capability to @@ -1058,7 +1057,7 @@ * */ void - setOutputLatency(unsigned latency_msec, bool keep=true) throw(Error); + setOutputLatency(unsigned latency_msec, bool keep=true); /** * Get the audio output latency control or query capability of the sound @@ -1075,7 +1074,7 @@ * @return The audio output latency. * */ - unsigned getOutputLatency() const throw(Error); + unsigned getOutputLatency() const; /** * This will configure audio input volume level capability to the @@ -1097,7 +1096,7 @@ * future use. * */ - void setInputVolume(unsigned volume, bool keep=true) throw(Error); + void setInputVolume(unsigned volume, bool keep=true); /** * Get the audio input volume level capability of the sound device being @@ -1114,7 +1113,7 @@ * @return The audio input volume level, in percent. * */ - unsigned getInputVolume() const throw(Error); + unsigned getInputVolume() const; /** * This will configure audio output volume level capability to the sound @@ -1135,7 +1134,7 @@ * for future use. * */ - void setOutputVolume(unsigned volume, bool keep=true) throw(Error); + void setOutputVolume(unsigned volume, bool keep=true); /** * Get the audio output volume level capability of the sound device being @@ -1152,7 +1151,7 @@ * @return The audio output volume level, in percent. * */ - unsigned getOutputVolume() const throw(Error); + unsigned getOutputVolume() const; /** * Get the audio input signal level capability of the sound device being @@ -1169,7 +1168,7 @@ * @return The audio input signal level, in percent. * */ - unsigned getInputSignal() const throw(Error); + unsigned getInputSignal() const; /** * Get the audio output signal level capability of the sound device being @@ -1186,7 +1185,7 @@ * @return The audio output signal level, in percent. * */ - unsigned getOutputSignal() const throw(Error); + unsigned getOutputSignal() const; /** * This will configure audio input route capability to the sound device @@ -1208,7 +1207,7 @@ * */ void - setInputRoute(pjmedia_aud_dev_route route, bool keep=true) throw(Error); + setInputRoute(pjmedia_aud_dev_route route, bool keep=true); /** * Get the audio input route capability of the sound device being used. @@ -1225,7 +1224,7 @@ * @return The audio input route. * */ - pjmedia_aud_dev_route getInputRoute() const throw(Error); + pjmedia_aud_dev_route getInputRoute() const; /** * This will configure audio output route capability to the sound device @@ -1247,7 +1246,7 @@ * */ void - setOutputRoute(pjmedia_aud_dev_route route, bool keep=true) throw(Error); + setOutputRoute(pjmedia_aud_dev_route route, bool keep=true); /** * Get the audio output route capability of the sound device being used. @@ -1264,7 +1263,7 @@ * @return The audio output route. * */ - pjmedia_aud_dev_route getOutputRoute() const throw(Error); + pjmedia_aud_dev_route getOutputRoute() const; /** * This will configure audio voice activity detection capability to @@ -1285,7 +1284,7 @@ * future use. * */ - void setVad(bool enable, bool keep=true) throw(Error); + void setVad(bool enable, bool keep=true); /** * Get the audio voice activity detection capability of the sound device @@ -1301,7 +1300,7 @@ * @return The audio voice activity detection feature. * */ - bool getVad() const throw(Error); + bool getVad() const; /** * This will configure audio comfort noise generation capability to @@ -1322,7 +1321,7 @@ * future use. * */ - void setCng(bool enable, bool keep=true) throw(Error); + void setCng(bool enable, bool keep=true); /** * Get the audio comfort noise generation capability of the sound device @@ -1338,7 +1337,7 @@ * @return The audio comfort noise generation feature. * */ - bool getCng() const throw(Error); + bool getCng() const; /** * This will configure audio packet loss concealment capability to @@ -1359,7 +1358,7 @@ * future use. * */ - void setPlc(bool enable, bool keep=true) throw(Error); + void setPlc(bool enable, bool keep=true); /** * Get the audio packet loss concealment capability of the sound device @@ -1375,7 +1374,7 @@ * @return The audio packet loss concealment feature. * */ - bool getPlc() const throw(Error); + bool getPlc() const; private: AudioDevInfoVector audioDevList; @@ -1392,7 +1391,7 @@ ~AudDevManager(); void clearAudioDevList(); - int getActiveDev(bool is_capture) const throw(Error); + int getActiveDev(bool is_capture) const; friend class Endpoint; }; @@ -1551,7 +1550,7 @@ * * @return video window info. */ - VideoWindowInfo getInfo() const throw(Error); + VideoWindowInfo getInfo() const; /** * Show or hide window. This operation is not valid for native windows @@ -1562,7 +1561,7 @@ * hide the window. * */ - void Show(bool show) throw(Error); + void Show(bool show); /** * Set video window position. This operation is not valid for native windows @@ -1572,7 +1571,7 @@ * @param pos The window position. * */ - void setPos(const MediaCoordinate &pos) throw(Error); + void setPos(const MediaCoordinate &pos); /** * Resize window. This operation is not valid for native windows @@ -1582,7 +1581,7 @@ * @param size The new window size. * */ - void setSize(const MediaSize &size) throw(Error); + void setSize(const MediaSize &size); /** * Rotate the video window. This function will change the video orientation @@ -1595,7 +1594,7 @@ * Specify positive value for clockwise rotation or * negative value for counter-clockwise rotation. */ - void rotate(int angle) throw(Error); + void rotate(int angle); /** * Set output window. This operation is valid only when the underlying @@ -1605,7 +1604,7 @@ * * @param win The new output window. */ - void setWindow(const VideoWindowHandle &win) throw(Error); + void setWindow(const VideoWindowHandle &win); private: pjsua_vid_win_id winId; @@ -1694,12 +1693,12 @@ * * @param p Video preview parameters. */ - void start(const VideoPreviewOpParam ¶m) throw(Error); + void start(const VideoPreviewOpParam ¶m); /** * Stop video preview. */ - void stop() throw(Error); + void stop(); /* * Get the preview window handle associated with the capture device,if any. @@ -1788,7 +1787,7 @@ * variables of type pjmedia_vid_dev_index) before calling any function * that accepts video device index as its parameter. */ - void refreshDevs() throw(Error); + void refreshDevs(); /** * Get the number of video devices installed in the system. @@ -1804,7 +1803,7 @@ * * @return The list of video device info */ - VideoDevInfo getDevInfo(int dev_id) const throw(Error); + VideoDevInfo getDevInfo(int dev_id) const; /** * Enum all video devices installed in the system. @@ -1811,7 +1810,7 @@ * * @return The list of video device info */ - const VideoDevInfoVector &enumDev() throw(Error); + const VideoDevInfoVector &enumDev(); /** * Lookup device index based on the driver and device name. @@ -1823,7 +1822,7 @@ * Error will be thrown. */ int lookupDev(const string &drv_name, - const string &dev_name) const throw(Error); + const string &dev_name) const; /** * Get string info for the specified capability. @@ -1855,7 +1854,7 @@ */ void setFormat(int dev_id, const MediaFormatVideo &format, - bool keep) throw(Error); + bool keep); /** * Get the video format capability to the video device. @@ -1872,7 +1871,7 @@ * @param dev_id The video device id. * @return keep The video format. */ - MediaFormatVideo getFormat(int dev_id) const throw(Error); + MediaFormatVideo getFormat(int dev_id) const; /** * This will configure video format capability to the video device. @@ -1895,7 +1894,7 @@ */ void setInputScale(int dev_id, const MediaSize &scale, - bool keep) throw(Error); + bool keep); /** * Get the video input scale capability to the video device. @@ -1912,7 +1911,7 @@ * @param dev_id The video device id. * @return keep The video format. */ - MediaSize getInputScale(int dev_id) const throw(Error); + MediaSize getInputScale(int dev_id) const; /** * This will configure fast switching to another video device. @@ -1933,7 +1932,7 @@ * @param keep Specify whether the setting is to be kept for * future use. */ - void setOutputWindowFlags(int dev_id, int flags, bool keep) throw(Error); + void setOutputWindowFlags(int dev_id, int flags, bool keep); /** * Get the window output flags capability to the video device. @@ -1950,7 +1949,7 @@ * @param dev_id The video device id. * @return keep The video format. */ - int getOutputWindowFlags(int dev_id) throw(Error); + int getOutputWindowFlags(int dev_id); /** * This will configure fast switching to another video device. @@ -1966,7 +1965,7 @@ * @param param The video switch param. */ void switchDev(int dev_id, - const VideoSwitchParam ¶m) throw(Error); + const VideoSwitchParam ¶m); /** * Check whether the video capture device is currently active, i.e. if @@ -1999,7 +1998,7 @@ */ void setCaptureOrient(pjmedia_vid_dev_index dev_id, pjmedia_orient orient, - bool keep=true) throw(Error); + bool keep=true); private: VideoDevInfoVector videoDevList; Index: pjsip/include/pjsua2/persistent.hpp =================================================================== --- pjsip/include/pjsua2/persistent.hpp (revision 5896) +++ pjsip/include/pjsua2/persistent.hpp (working copy) @@ -68,7 +68,7 @@ * * @param node Container to read values from. */ - virtual void readObject(const ContainerNode &node) throw(Error) = 0; + virtual void readObject(const ContainerNode &node) = 0; /** * Write this object to a container node. @@ -75,7 +75,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error) = 0; + virtual void writeObject(ContainerNode &node) const = 0; }; @@ -110,7 +110,7 @@ * * @param filename The file name. */ - virtual void loadFile(const string &filename) throw(Error) = 0; + virtual void loadFile(const string &filename) = 0; /** * Load this document from string. @@ -117,7 +117,7 @@ * * @param input The string. */ - virtual void loadString(const string &input) throw(Error) = 0; + virtual void loadString(const string &input) = 0; /** * Write this document to a file. @@ -124,7 +124,7 @@ * * @param filename The file name. */ - virtual void saveFile(const string &filename) throw(Error) = 0; + virtual void saveFile(const string &filename) = 0; /** * Write this document to string. @@ -131,7 +131,7 @@ * * @return The string document. */ - virtual string saveString() throw(Error) = 0; + virtual string saveString() = 0; /** * Get the root container node for this document @@ -160,7 +160,7 @@ * * @return The name of the next element . */ - string unreadName() const throw(Error); + string unreadName() const; /** * Read an integer value from the document and return the value. @@ -173,7 +173,7 @@ * * @return The value. */ - int readInt(const string &name="") const throw(Error); + int readInt(const string &name="") const; /** * Read a float value from the document and return the value. @@ -186,7 +186,7 @@ * * @return The value. */ - float readNumber(const string &name="") const throw(Error); + float readNumber(const string &name="") const; /** * Read a boolean value from the container and return the value. @@ -199,7 +199,7 @@ * * @return The value. */ - bool readBool(const string &name="") const throw(Error); + bool readBool(const string &name="") const; /** * Read a string value from the container and return the value. @@ -212,7 +212,7 @@ * * @return The value. */ - string readString(const string &name="") const throw(Error); + string readString(const string &name="") const; /** * Read a string array from the container. This will throw Error @@ -225,8 +225,7 @@ * * @return The value. */ - StringVector readStringVector(const string &name="") const - throw(Error); + StringVector readStringVector(const string &name="") const; /** * Read the specified object from the container. This is equal to @@ -234,7 +233,7 @@ * * @param obj The object to read. */ - void readObject(PersistentObject &obj) const throw(Error); + void readObject(PersistentObject &obj) const; /** * Read a container from the container. This will throw Error if the @@ -247,8 +246,7 @@ * * @return Container object. */ - ContainerNode readContainer(const string &name="") const - throw(Error); + ContainerNode readContainer(const string &name="") const; /** * Read array container from the container. This will throw Error if the @@ -261,8 +259,7 @@ * * @return Container object. */ - ContainerNode readArray(const string &name="") const - throw(Error); + ContainerNode readArray(const string &name="") const; /** * Write a number value to the container. @@ -271,7 +268,7 @@ * @param num The value to be written. */ void writeNumber(const string &name, - float num) throw(Error); + float num); /** * Write a number value to the container. @@ -280,7 +277,7 @@ * @param num The value to be written. */ void writeInt(const string &name, - int num) throw(Error); + int num); /** * Write a boolean value to the container. @@ -289,7 +286,7 @@ * @param value The value to be written. */ void writeBool(const string &name, - bool value) throw(Error); + bool value); /** * Write a string value to the container. @@ -298,7 +295,7 @@ * @param value The value to be written. */ void writeString(const string &name, - const string &value) throw(Error); + const string &value); /** * Write string vector to the container. @@ -307,8 +304,7 @@ * @param arr The vector to be written. */ void writeStringVector(const string &name, - const StringVector &arr) - throw(Error); + const StringVector &arr); /** * Write an object to the container. This is equal to calling @@ -316,7 +312,7 @@ * * @param obj The object to be written */ - void writeObject(const PersistentObject &obj) throw(Error); + void writeObject(const PersistentObject &obj); /** * Create and write an empty Object node that can be used as parent @@ -326,8 +322,7 @@ * * @return A sub-container. */ - ContainerNode writeNewContainer(const string &name) - throw(Error); + ContainerNode writeNewContainer(const string &name); /** * Create and write an empty array node that can be used as parent @@ -337,8 +332,7 @@ * * @return A sub-container. */ - ContainerNode writeNewArray(const string &name) - throw(Error); + ContainerNode writeNewArray(const string &name); }; @@ -422,7 +416,7 @@ /** * Get the name of the next unread element. */ - string unreadName() const throw(Error); + string unreadName() const; /** * Read an integer value from the document and return the value. @@ -435,7 +429,7 @@ * * @return The value. */ - int readInt(const string &name="") const throw(Error); + int readInt(const string &name="") const; /** * Read a number value from the document and return the value. @@ -448,7 +442,7 @@ * * @return The value. */ - float readNumber(const string &name="") const throw(Error); + float readNumber(const string &name="") const; /** * Read a boolean value from the container and return the value. @@ -461,7 +455,7 @@ * * @return The value. */ - bool readBool(const string &name="") const throw(Error); + bool readBool(const string &name="") const; /** * Read a string value from the container and return the value. @@ -474,7 +468,7 @@ * * @return The value. */ - string readString(const string &name="") const throw(Error); + string readString(const string &name="") const; /** * Read a string array from the container. This will throw Error @@ -487,8 +481,7 @@ * * @return The value. */ - StringVector readStringVector(const string &name="") const - throw(Error); + StringVector readStringVector(const string &name="") const; /** * Read the specified object from the container. This is equal to @@ -496,7 +489,7 @@ * * @param obj The object to read. */ - void readObject(PersistentObject &obj) const throw(Error); + void readObject(PersistentObject &obj) const; /** * Read a container from the container. This will throw Error if the @@ -509,8 +502,7 @@ * * @return Container object. */ - ContainerNode readContainer(const string &name="") const - throw(Error); + ContainerNode readContainer(const string &name="") const; /** * Read array container from the container. This will throw Error if the @@ -523,8 +515,7 @@ * * @return Container object. */ - ContainerNode readArray(const string &name="") const - throw(Error); + ContainerNode readArray(const string &name="") const; /** * Write a number value to the container. @@ -533,7 +524,7 @@ * @param num The value to be written. */ void writeNumber(const string &name, - float num) throw(Error); + float num); /** * Write a number value to the container. @@ -542,7 +533,7 @@ * @param num The value to be written. */ void writeInt(const string &name, - int num) throw(Error); + int num); /** * Write a boolean value to the container. @@ -551,7 +542,7 @@ * @param value The value to be written. */ void writeBool(const string &name, - bool value) throw(Error); + bool value); /** * Write a string value to the container. @@ -560,7 +551,7 @@ * @param value The value to be written. */ void writeString(const string &name, - const string &value) throw(Error); + const string &value); /** * Write string vector to the container. @@ -569,8 +560,7 @@ * @param arr The vector to be written. */ void writeStringVector(const string &name, - const StringVector &arr) - throw(Error); + const StringVector &arr); /** * Write an object to the container. This is equal to calling @@ -578,7 +568,7 @@ * * @param obj The object to be written */ - void writeObject(const PersistentObject &obj) throw(Error); + void writeObject(const PersistentObject &obj); /** * Create and write an empty Object node that can be used as parent @@ -588,8 +578,7 @@ * * @return A sub-container. */ - ContainerNode writeNewContainer(const string &name) - throw(Error); + ContainerNode writeNewContainer(const string &name); /** * Create and write an empty array node that can be used as parent @@ -599,8 +588,7 @@ * * @return A sub-container. */ - ContainerNode writeNewArray(const string &name) - throw(Error); + ContainerNode writeNewArray(const string &name); public: /* internal data */ @@ -617,48 +605,35 @@ struct container_node_op { bool (*hasUnread)(const ContainerNode*); - string (*unreadName)(const ContainerNode*) - throw(Error); + string (*unreadName)(const ContainerNode*); float (*readNumber)(const ContainerNode*, - const string&) - throw(Error); + const string&); bool (*readBool)(const ContainerNode*, - const string&) - throw(Error); + const string&); string (*readString)(const ContainerNode*, - const string&) - throw(Error); + const string&); StringVector (*readStringVector)(const ContainerNode*, - const string&) - throw(Error); + const string&); ContainerNode (*readContainer)(const ContainerNode*, - const string &) - throw(Error); + const string &); ContainerNode (*readArray)(const ContainerNode*, - const string &) - throw(Error); + const string &); void (*writeNumber)(ContainerNode*, const string &name, - float num) - throw(Error); + float num); void (*writeBool)(ContainerNode*, const string &name, - bool value) - throw(Error); + bool value); void (*writeString)(ContainerNode*, const string &name, - const string &value) - throw(Error); + const string &value); void (*writeStringVector)(ContainerNode*, const string &name, - const StringVector &value) - throw(Error); + const StringVector &value); ContainerNode (*writeNewContainer)(ContainerNode*, - const string &name) - throw(Error); + const string &name); ContainerNode (*writeNewArray)(ContainerNode*, - const string &name) - throw(Error); + const string &name); }; /* Index: pjsip/include/pjsua2/presence.hpp =================================================================== --- pjsip/include/pjsua2/presence.hpp (revision 5896) +++ pjsip/include/pjsua2/presence.hpp (working copy) @@ -100,7 +100,7 @@ * * @param node Container to read values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container node. @@ -107,7 +107,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; @@ -210,7 +210,7 @@ * @param acc The account for this buddy. * @param cfg The buddy config. */ - void create(Account &acc, const BuddyConfig &cfg) throw(Error); + void create(Account &acc, const BuddyConfig &cfg); /** * Check if this buddy is valid. @@ -224,7 +224,7 @@ * * @return Buddy info. */ - BuddyInfo getInfo() const throw(Error); + BuddyInfo getInfo() const; /** * Enable/disable buddy's presence monitoring. Once buddy's presence is @@ -234,7 +234,7 @@ * @param subscribe Specify true to activate presence * subscription. */ - void subscribePresence(bool subscribe) throw(Error); + void subscribePresence(bool subscribe); /** * Update the presence information for the buddy. Although the library @@ -252,7 +252,7 @@ * application will be notified about the buddy's presence status in the * \a onBuddyState() callback. */ - void updatePresence(void) throw(Error); + void updatePresence(void); /** * Send instant messaging outside dialog, using this buddy's specified @@ -260,7 +260,7 @@ * * @param prm Sending instant message parameter. */ - void sendInstantMessage(const SendInstantMessageParam &prm) throw(Error); + void sendInstantMessage(const SendInstantMessageParam &prm); /** * Send typing indication outside dialog. @@ -267,8 +267,7 @@ * * @param prm Sending instant message parameter. */ - void sendTypingIndication(const SendTypingIndicationParam &prm) - throw(Error); + void sendTypingIndication(const SendTypingIndicationParam &prm); public: /* Index: pjsip/include/pjsua2/siptypes.hpp =================================================================== --- pjsip/include/pjsua2/siptypes.hpp (revision 5896) +++ pjsip/include/pjsua2/siptypes.hpp (working copy) @@ -104,7 +104,7 @@ * * @param node Container to read values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container node. @@ -111,7 +111,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; @@ -287,7 +287,7 @@ * * @param node Container to read values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container node. @@ -294,7 +294,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; @@ -384,7 +384,7 @@ * * @param node Container to read values from. */ - virtual void readObject(const ContainerNode &node) throw(Error); + virtual void readObject(const ContainerNode &node); /** * Write this object to a container node. @@ -391,7 +391,7 @@ * * @param node Container to write values to. */ - virtual void writeObject(ContainerNode &node) const throw(Error); + virtual void writeObject(ContainerNode &node) const; }; /** @@ -744,7 +744,7 @@ /** * Initiaize from PJSIP header. */ - void fromPj(const pjsip_hdr *) throw(Error); + void fromPj(const pjsip_hdr *); /** * Convert to PJSIP header. @@ -784,7 +784,7 @@ /** * Initiaize from PJSIP's pjsip_multipart_part. */ - void fromPj(const pjsip_multipart_part &prm) throw(Error); + void fromPj(const pjsip_multipart_part &prm); /** * Convert to PJSIP's pjsip_multipart_part. @@ -859,7 +859,7 @@ /** * Initiaize from PJSUA's pjsua_msg_data. */ - void fromPj(const pjsua_msg_data &prm) throw(Error); + void fromPj(const pjsua_msg_data &prm); /** * Convert to PJSUA's pjsua_msg_data. @@ -932,20 +932,20 @@ //! @cond Doxygen_Suppress void readIntVector( ContainerNode &node, const string &array_name, - IntVector &v) throw(Error); + IntVector &v); void writeIntVector(ContainerNode &node, const string &array_name, - const IntVector &v) throw(Error); + const IntVector &v); void readQosParams( ContainerNode &node, - pj_qos_params &qos) throw(Error); + pj_qos_params &qos); void writeQosParams( ContainerNode &node, - const pj_qos_params &qos) throw(Error); + const pj_qos_params &qos); void readSipHeaders( const ContainerNode &node, const string &array_name, - SipHeaderVector &headers) throw(Error); + SipHeaderVector &headers); void writeSipHeaders(ContainerNode &node, const string &array_name, - const SipHeaderVector &headers) throw(Error); + const SipHeaderVector &headers); //! @endcond #endif // SWIG Index: pjsip/src/pjsua2/account.cpp =================================================================== --- pjsip/src/pjsua2/account.cpp (revision 5896) +++ pjsip/src/pjsua2/account.cpp (working copy) @@ -84,7 +84,7 @@ return setting; } -void RtcpFbConfig::readObject(const ContainerNode &node) throw(Error) +void RtcpFbConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("RtcpFbConfig"); NODE_READ_BOOL (this_node, dontUseAvpf); @@ -101,7 +101,7 @@ } } -void RtcpFbConfig::writeObject(ContainerNode &node) const throw(Error) +void RtcpFbConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("RtcpFbConfig"); NODE_WRITE_BOOL (this_node, dontUseAvpf); @@ -179,7 +179,7 @@ return opt; } -void SrtpOpt::readObject(const ContainerNode &node) throw(Error) +void SrtpOpt::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("SrtpOpt"); @@ -202,7 +202,7 @@ } } -void SrtpOpt::writeObject(ContainerNode &node) const throw(Error) +void SrtpOpt::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("SrtpOpt"); @@ -221,7 +221,7 @@ /////////////////////////////////////////////////////////////////////////////// -void AccountRegConfig::readObject(const ContainerNode &node) throw(Error) +void AccountRegConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("AccountRegConfig"); @@ -240,7 +240,7 @@ readSipHeaders(this_node, "headers", headers); } -void AccountRegConfig::writeObject(ContainerNode &node) const throw(Error) +void AccountRegConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("AccountRegConfig"); @@ -261,7 +261,7 @@ /////////////////////////////////////////////////////////////////////////////// -void AccountSipConfig::readObject(const ContainerNode &node) throw(Error) +void AccountSipConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("AccountSipConfig"); @@ -282,7 +282,7 @@ } } -void AccountSipConfig::writeObject(ContainerNode &node) const throw(Error) +void AccountSipConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("AccountSipConfig"); @@ -302,7 +302,7 @@ /////////////////////////////////////////////////////////////////////////////// -void AccountCallConfig::readObject(const ContainerNode &node) throw(Error) +void AccountCallConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("AccountCallConfig"); @@ -313,7 +313,7 @@ NODE_READ_UNSIGNED( this_node, timerSessExpiresSec); } -void AccountCallConfig::writeObject(ContainerNode &node) const throw(Error) +void AccountCallConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("AccountCallConfig"); @@ -326,7 +326,7 @@ /////////////////////////////////////////////////////////////////////////////// -void AccountPresConfig::readObject(const ContainerNode &node) throw(Error) +void AccountPresConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("AccountPresConfig"); @@ -338,7 +338,7 @@ readSipHeaders(this_node, "headers", headers); } -void AccountPresConfig::writeObject(ContainerNode &node) const throw(Error) +void AccountPresConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("AccountPresConfig"); @@ -352,7 +352,7 @@ /////////////////////////////////////////////////////////////////////////////// -void AccountMwiConfig::readObject(const ContainerNode &node) throw(Error) +void AccountMwiConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("AccountMwiConfig"); @@ -360,7 +360,7 @@ NODE_READ_UNSIGNED( this_node, expirationSec); } -void AccountMwiConfig::writeObject(ContainerNode &node) const throw(Error) +void AccountMwiConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("AccountMwiConfig"); @@ -370,7 +370,7 @@ /////////////////////////////////////////////////////////////////////////////// -void AccountNatConfig::readObject(const ContainerNode &node) throw(Error) +void AccountNatConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("AccountNatConfig"); @@ -402,7 +402,7 @@ NODE_READ_INT ( this_node, contactUseSrcPort); } -void AccountNatConfig::writeObject(ContainerNode &node) const throw(Error) +void AccountNatConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("AccountNatConfig"); @@ -436,7 +436,7 @@ /////////////////////////////////////////////////////////////////////////////// -void AccountMediaConfig::readObject(const ContainerNode &node) throw(Error) +void AccountMediaConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("AccountMediaConfig"); @@ -450,7 +450,7 @@ NODE_READ_BOOL ( this_node, rtcpMuxEnabled); } -void AccountMediaConfig::writeObject(ContainerNode &node) const throw(Error) +void AccountMediaConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("AccountMediaConfig"); @@ -466,7 +466,7 @@ /////////////////////////////////////////////////////////////////////////////// -void AccountVideoConfig::readObject(const ContainerNode &node) throw(Error) +void AccountVideoConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("AccountVideoConfig"); @@ -481,7 +481,7 @@ NODE_READ_UNSIGNED( this_node, startKeyframeInterval); } -void AccountVideoConfig::writeObject(ContainerNode &node) const throw(Error) +void AccountVideoConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("AccountVideoConfig"); @@ -497,7 +497,7 @@ } /////////////////////////////////////////////////////////////////////////////// -void AccountIpChangeConfig::readObject(const ContainerNode &node) throw(Error) +void AccountIpChangeConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("AccountIpChangeConfig"); @@ -506,7 +506,7 @@ NODE_READ_UNSIGNED( this_node, reinviteFlags); } -void AccountIpChangeConfig::writeObject(ContainerNode &node) const throw(Error) +void AccountIpChangeConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("AccountIpChangeConfig"); @@ -847,7 +847,7 @@ ipChangeConfig.reinviteFlags = prm.ip_change_cfg.reinvite_flags; } -void AccountConfig::readObject(const ContainerNode &node) throw(Error) +void AccountConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("AccountConfig"); @@ -863,7 +863,7 @@ NODE_READ_OBJ ( this_node, videoConfig); } -void AccountConfig::writeObject(ContainerNode &node) const throw(Error) +void AccountConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("AccountConfig"); @@ -914,7 +914,7 @@ } void Account::create(const AccountConfig &acc_cfg, - bool make_default) throw(Error) + bool make_default) { pjsua_acc_config pj_acc_cfg; @@ -940,7 +940,7 @@ } } -void Account::modify(const AccountConfig &acc_cfg) throw(Error) +void Account::modify(const AccountConfig &acc_cfg) { pjsua_acc_config pj_acc_cfg; @@ -954,7 +954,7 @@ return pjsua_acc_is_valid(id) != 0; } -void Account::setDefault() throw(Error) +void Account::setDefault() { PJSUA2_CHECK_EXPR( pjsua_acc_set_default(id) ); } @@ -974,7 +974,7 @@ return (Account*)pjsua_acc_get_user_data(acc_id); } -AccountInfo Account::getInfo() const throw(Error) +AccountInfo Account::getInfo() const { pjsua_acc_info pj_ai; AccountInfo ai; @@ -984,13 +984,13 @@ return ai; } -void Account::setRegistration(bool renew) throw(Error) +void Account::setRegistration(bool renew) { PJSUA2_CHECK_EXPR( pjsua_acc_set_registration(id, renew) ); } void -Account::setOnlineStatus(const PresenceStatus &pres_st) throw(Error) +Account::setOnlineStatus(const PresenceStatus &pres_st) { pjrpid_element pj_rpid; @@ -1005,12 +1005,12 @@ &pj_rpid) ); } -void Account::setTransport(TransportId tp_id) throw(Error) +void Account::setTransport(TransportId tp_id) { PJSUA2_CHECK_EXPR( pjsua_acc_set_transport(id, tp_id) ); } -void Account::presNotify(const PresNotifyParam &prm) throw(Error) +void Account::presNotify(const PresNotifyParam &prm) { pj_str_t pj_state_str = str2Pj(prm.stateStr); pj_str_t pj_reason = str2Pj(prm.reason); @@ -1023,13 +1023,12 @@ &msg_data) ); } -const BuddyVector& Account::enumBuddies() const throw(Error) +const BuddyVector& Account::enumBuddies() const { return buddyList; } Buddy* Account::findBuddy(string uri, FindBuddyMatch *buddy_match) const - throw(Error) { if (!buddy_match) { static FindBuddyMatch def_bm; Index: pjsip/src/pjsua2/call.cpp =================================================================== --- pjsip/src/pjsua2/call.cpp (revision 5896) +++ pjsip/src/pjsua2/call.cpp (working copy) @@ -476,7 +476,7 @@ } } -CallInfo Call::getInfo() const throw(Error) +CallInfo Call::getInfo() const { pjsua_call_info pj_ci; CallInfo ci; @@ -547,7 +547,7 @@ return userData; } -pj_stun_nat_type Call::getRemNatType() throw(Error) +pj_stun_nat_type Call::getRemNatType() { pj_stun_nat_type nat; @@ -556,7 +556,7 @@ return nat; } -void Call::makeCall(const string &dst_uri, const CallOpParam &prm) throw(Error) +void Call::makeCall(const string &dst_uri, const CallOpParam &prm) { pj_str_t pj_dst_uri = str2Pj(dst_uri); call_param param(prm.txOption, prm.opt, prm.reason); @@ -566,7 +566,7 @@ param.p_msg_data, &id) ); } -void Call::answer(const CallOpParam &prm) throw(Error) +void Call::answer(const CallOpParam &prm) { call_param param(prm.txOption, prm.opt, prm.reason, sdp_pool, prm.sdp.wholeSdp); @@ -583,7 +583,7 @@ } } -void Call::hangup(const CallOpParam &prm) throw(Error) +void Call::hangup(const CallOpParam &prm) { call_param param(prm.txOption, prm.opt, prm.reason); @@ -591,7 +591,7 @@ param.p_msg_data) ); } -void Call::setHold(const CallOpParam &prm) throw(Error) +void Call::setHold(const CallOpParam &prm) { call_param param(prm.txOption, prm.opt, prm.reason); @@ -598,7 +598,7 @@ PJSUA2_CHECK_EXPR( pjsua_call_set_hold2(id, prm.options, param.p_msg_data)); } -void Call::reinvite(const CallOpParam &prm) throw(Error) +void Call::reinvite(const CallOpParam &prm) { call_param param(prm.txOption, prm.opt, prm.reason); @@ -605,7 +605,7 @@ PJSUA2_CHECK_EXPR( pjsua_call_reinvite2(id, param.p_opt, param.p_msg_data)); } -void Call::update(const CallOpParam &prm) throw(Error) +void Call::update(const CallOpParam &prm) { call_param param(prm.txOption, prm.opt, prm.reason); @@ -612,7 +612,7 @@ PJSUA2_CHECK_EXPR( pjsua_call_update2(id, param.p_opt, param.p_msg_data) ); } -void Call::xfer(const string &dest, const CallOpParam &prm) throw(Error) +void Call::xfer(const string &dest, const CallOpParam &prm) { call_param param(prm.txOption); pj_str_t pj_dest = str2Pj(dest); @@ -621,7 +621,7 @@ } void Call::xferReplaces(const Call& dest_call, - const CallOpParam &prm) throw(Error) + const CallOpParam &prm) { call_param param(prm.txOption); @@ -629,12 +629,12 @@ prm.options, param.p_msg_data) ); } -void Call::processRedirect(pjsip_redirect_op cmd) throw(Error) +void Call::processRedirect(pjsip_redirect_op cmd) { PJSUA2_CHECK_EXPR(pjsua_call_process_redirect(id, cmd)); } -void Call::dialDtmf(const string &digits) throw(Error) +void Call::dialDtmf(const string &digits) { pj_str_t pj_digits = str2Pj(digits); @@ -641,7 +641,7 @@ PJSUA2_CHECK_EXPR(pjsua_call_dial_dtmf(id, &pj_digits)); } -void Call::sendDtmf(const CallSendDtmfParam ¶m) throw (Error) +void Call::sendDtmf(const CallSendDtmfParam ¶m) { pjsua_call_send_dtmf_param pj_param = param.toPj(); @@ -650,7 +650,6 @@ void Call::sendInstantMessage(const SendInstantMessageParam& prm) - throw(Error) { pj_str_t mime_type = str2Pj(prm.contentType); pj_str_t content = str2Pj(prm.content); @@ -661,7 +660,6 @@ } void Call::sendTypingIndication(const SendTypingIndicationParam &prm) - throw(Error) { call_param param(prm.txOption); @@ -671,7 +669,7 @@ param.p_msg_data) ); } -void Call::sendRequest(const CallSendRequestParam &prm) throw(Error) +void Call::sendRequest(const CallSendRequestParam &prm) { pj_str_t method = str2Pj(prm.method); call_param param(prm.txOption); @@ -679,7 +677,7 @@ PJSUA2_CHECK_EXPR(pjsua_call_send_request(id, &method, param.p_msg_data) ); } -string Call::dump(bool with_media, const string indent) throw(Error) +string Call::dump(bool with_media, const string indent) { #if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0) char buffer[1024 * 10]; @@ -715,7 +713,7 @@ } void Call::vidSetStream(pjsua_call_vid_strm_op op, - const CallVidSetStreamParam ¶m) throw(Error) + const CallVidSetStreamParam ¶m) { #if PJSUA_HAS_VIDEO pjsua_call_vid_strm_op_param prm; @@ -731,7 +729,7 @@ #endif } -StreamInfo Call::getStreamInfo(unsigned med_idx) const throw(Error) +StreamInfo Call::getStreamInfo(unsigned med_idx) const { pjsua_stream_info pj_si; StreamInfo si; @@ -741,7 +739,7 @@ return si; } -StreamStat Call::getStreamStat(unsigned med_idx) const throw(Error) +StreamStat Call::getStreamStat(unsigned med_idx) const { pjsua_stream_stat pj_ss; StreamStat ss; @@ -752,7 +750,6 @@ } MediaTransportInfo Call::getMedTransportInfo(unsigned med_idx) const - throw(Error) { pjmedia_transport_info pj_mti; MediaTransportInfo mti; Index: pjsip/src/pjsua2/endpoint.cpp =================================================================== --- pjsip/src/pjsua2/endpoint.cpp (revision 5896) +++ pjsip/src/pjsua2/endpoint.cpp (working copy) @@ -223,7 +223,7 @@ return pua_cfg; } -void UaConfig::readObject(const ContainerNode &node) throw(Error) +void UaConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("UaConfig"); @@ -239,7 +239,7 @@ NODE_READ_BOOL ( this_node, mwiUnsolicitedEnabled); } -void UaConfig::writeObject(ContainerNode &node) const throw(Error) +void UaConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("UaConfig"); @@ -292,7 +292,7 @@ return lc; } -void LogConfig::readObject(const ContainerNode &node) throw(Error) +void LogConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("LogConfig"); @@ -304,7 +304,7 @@ NODE_READ_UNSIGNED( this_node, fileFlags); } -void LogConfig::writeObject(ContainerNode &node) const throw(Error) +void LogConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("LogConfig"); @@ -386,7 +386,7 @@ return mcfg; } -void MediaConfig::readObject(const ContainerNode &node) throw(Error) +void MediaConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("MediaConfig"); @@ -415,7 +415,7 @@ NODE_READ_BOOL ( this_node, vidPreviewEnableNative); } -void MediaConfig::writeObject(ContainerNode &node) const throw(Error) +void MediaConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("MediaConfig"); @@ -446,7 +446,7 @@ /////////////////////////////////////////////////////////////////////////////// -void EpConfig::readObject(const ContainerNode &node) throw(Error) +void EpConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("EpConfig"); NODE_READ_OBJ( this_node, uaConfig); @@ -454,7 +454,7 @@ NODE_READ_OBJ( this_node, medConfig); } -void EpConfig::writeObject(ContainerNode &node) const throw(Error) +void EpConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("EpConfig"); NODE_WRITE_OBJ( this_node, uaConfig); @@ -488,7 +488,7 @@ instance_ = this; } -Endpoint& Endpoint::instance() throw(Error) +Endpoint& Endpoint::instance() { if (!instance_) { PJSUA2_RAISE_ERROR(PJ_ENOTFOUND); @@ -1569,7 +1569,7 @@ return ver; } -void Endpoint::libCreate() throw(Error) +void Endpoint::libCreate() { PJSUA2_CHECK_EXPR( pjsua_create() ); mainThread = pj_thread_this(); @@ -1583,7 +1583,7 @@ return pjsua_get_state(); } -void Endpoint::libInit(const EpConfig &prmEpConfig) throw(Error) +void Endpoint::libInit(const EpConfig &prmEpConfig) { pjsua_config ua_cfg; pjsua_logging_config log_cfg; @@ -1663,12 +1663,12 @@ } } -void Endpoint::libStart() throw(Error) +void Endpoint::libStart() { PJSUA2_CHECK_EXPR(pjsua_start()); } -void Endpoint::libRegisterThread(const string &name) throw(Error) +void Endpoint::libRegisterThread(const string &name) { pj_thread_t *thread; pj_thread_desc *desc; @@ -1711,7 +1711,7 @@ return pjsua_handle_events(msec_timeout); } -void Endpoint::libDestroy(unsigned flags) throw(Error) +void Endpoint::libDestroy(unsigned flags) { pj_status_t status; @@ -1778,7 +1778,7 @@ } Token Endpoint::utilTimerSchedule(unsigned prmMsecDelay, - Token prmUserData) throw (Error) + Token prmUserData) { UserTimer *ut; pj_time_val delay; @@ -1820,7 +1820,7 @@ delete ut; } -IntVector Endpoint::utilSslGetAvailableCiphers() throw (Error) +IntVector Endpoint::utilSslGetAvailableCiphers() { #if PJ_HAS_SSL_SOCK pj_ssl_cipher ciphers[PJ_SSL_SOCK_MAX_CIPHERS]; @@ -1838,12 +1838,12 @@ /* * Endpoint NAT operations */ -void Endpoint::natDetectType(void) throw(Error) +void Endpoint::natDetectType(void) { PJSUA2_CHECK_EXPR( pjsua_detect_nat_type() ); } -pj_stun_nat_type Endpoint::natGetType() throw(Error) +pj_stun_nat_type Endpoint::natGetType() { pj_stun_nat_type type; @@ -1853,7 +1853,7 @@ } void Endpoint::natUpdateStunServers(const StringVector &servers, - bool wait) throw(Error) + bool wait) { pj_str_t srv[MAX_STUN_SERVERS]; unsigned i, count = 0; @@ -1869,7 +1869,7 @@ void Endpoint::natCheckStunServers(const StringVector &servers, bool wait, - Token token) throw(Error) + Token token) { pj_str_t srv[MAX_STUN_SERVERS]; unsigned i, count = 0; @@ -1885,7 +1885,7 @@ } void Endpoint::natCancelCheckStunServers(Token token, - bool notify_cb) throw(Error) + bool notify_cb) { PJSUA2_CHECK_EXPR( pjsua_cancel_stun_resolution(token, notify_cb) ); } @@ -1895,7 +1895,7 @@ * Transport API */ TransportId Endpoint::transportCreate(pjsip_transport_type_e type, - const TransportConfig &cfg) throw(Error) + const TransportConfig &cfg) { pjsua_transport_config tcfg; pjsua_transport_id tid; @@ -1907,7 +1907,7 @@ return tid; } -IntVector Endpoint::transportEnum() throw(Error) +IntVector Endpoint::transportEnum() { pjsua_transport_id tids[32]; unsigned count = PJ_ARRAY_SIZE(tids); @@ -1917,7 +1917,7 @@ return IntVector(tids, tids+count); } -TransportInfo Endpoint::transportGetInfo(TransportId id) throw(Error) +TransportInfo Endpoint::transportGetInfo(TransportId id) { pjsua_transport_info pj_tinfo; TransportInfo tinfo; @@ -1928,17 +1928,17 @@ return tinfo; } -void Endpoint::transportSetEnable(TransportId id, bool enabled) throw(Error) +void Endpoint::transportSetEnable(TransportId id, bool enabled) { PJSUA2_CHECK_EXPR( pjsua_transport_set_enable(id, enabled) ); } -void Endpoint::transportClose(TransportId id) throw(Error) +void Endpoint::transportClose(TransportId id) { PJSUA2_CHECK_EXPR( pjsua_transport_close(id, PJ_FALSE) ); } -void Endpoint::transportShutdown(TransportHandle tp) throw(Error) +void Endpoint::transportShutdown(TransportHandle tp) { PJSUA2_CHECK_EXPR( pjsip_transport_shutdown((pjsip_transport *)tp) ); } @@ -1967,7 +1967,7 @@ return pjsua_conf_get_active_ports(); } -const AudioMediaVector &Endpoint::mediaEnumPorts() const throw(Error) +const AudioMediaVector &Endpoint::mediaEnumPorts() const { return mediaList; } @@ -2013,7 +2013,7 @@ /* * Codec operations. */ -const CodecInfoVector &Endpoint::codecEnum() throw(Error) +const CodecInfoVector &Endpoint::codecEnum() { pjsua_codec_info pj_codec[MAX_CODEC_NUM]; unsigned count = MAX_CODEC_NUM; @@ -2025,13 +2025,13 @@ } void Endpoint::codecSetPriority(const string &codec_id, - pj_uint8_t priority) throw(Error) + pj_uint8_t priority) { pj_str_t codec_str = str2Pj(codec_id); PJSUA2_CHECK_EXPR( pjsua_codec_set_priority(&codec_str, priority) ); } -CodecParam Endpoint::codecGetParam(const string &codec_id) const throw(Error) +CodecParam Endpoint::codecGetParam(const string &codec_id) const { CodecParam param; pjmedia_codec_param pj_param; @@ -2044,7 +2044,7 @@ } void Endpoint::codecSetParam(const string &codec_id, - const CodecParam param) throw(Error) + const CodecParam param) { pj_str_t codec_str = str2Pj(codec_id); pjmedia_codec_param pj_param = param.toPj(); @@ -2074,7 +2074,7 @@ pj_leave_critical_section(); } -const CodecInfoVector &Endpoint::videoCodecEnum() throw(Error) +const CodecInfoVector &Endpoint::videoCodecEnum() { #if PJSUA_HAS_VIDEO pjsua_codec_info pj_codec[MAX_CODEC_NUM]; @@ -2088,7 +2088,7 @@ } void Endpoint::videoCodecSetPriority(const string &codec_id, - pj_uint8_t priority) throw(Error) + pj_uint8_t priority) { #if PJSUA_HAS_VIDEO pj_str_t codec_str = str2Pj(codec_id); @@ -2100,7 +2100,6 @@ } VidCodecParam Endpoint::getVideoCodecParam(const string &codec_id) const - throw(Error) { VidCodecParam codec_param; #if PJSUA_HAS_VIDEO @@ -2116,7 +2115,7 @@ } void Endpoint::setVideoCodecParam(const string &codec_id, - const VidCodecParam ¶m) throw(Error) + const VidCodecParam ¶m) { #if PJSUA_HAS_VIDEO pj_str_t codec_str = str2Pj(codec_id); @@ -2129,7 +2128,7 @@ #endif } -void Endpoint::resetVideoCodecParam(const string &codec_id) throw(Error) +void Endpoint::resetVideoCodecParam(const string &codec_id) { #if PJSUA_HAS_VIDEO pj_str_t codec_str = str2Pj(codec_id); @@ -2143,7 +2142,7 @@ /* * Enumerate all SRTP crypto-suite names. */ -StringVector Endpoint::srtpCryptoEnum() throw(Error) +StringVector Endpoint::srtpCryptoEnum() { StringVector result; #if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) @@ -2159,7 +2158,7 @@ return result; } -void Endpoint::handleIpChange(const IpChangeParam ¶m) throw(Error) +void Endpoint::handleIpChange(const IpChangeParam ¶m) { pjsua_ip_change_param ip_change_param = param.toPj(); PJSUA2_CHECK_EXPR(pjsua_handle_ip_change(&ip_change_param)); Index: pjsip/src/pjsua2/json.cpp =================================================================== --- pjsip/src/pjsua2/json.cpp (revision 5896) +++ pjsip/src/pjsua2/json.cpp (working copy) @@ -28,48 +28,35 @@ /* Json node operations */ static bool jsonNode_hasUnread(const ContainerNode*); -static string jsonNode_unreadName(const ContainerNode*n) - throw(Error); +static string jsonNode_unreadName(const ContainerNode*n); static float jsonNode_readNumber(const ContainerNode*, - const string&) - throw(Error); + const string&); static bool jsonNode_readBool(const ContainerNode*, - const string&) - throw(Error); + const string&); static string jsonNode_readString(const ContainerNode*, - const string&) - throw(Error); + const string&); static StringVector jsonNode_readStringVector(const ContainerNode*, - const string&) - throw(Error); + const string&); static ContainerNode jsonNode_readContainer(const ContainerNode*, - const string &) - throw(Error); + const string &); static ContainerNode jsonNode_readArray(const ContainerNode*, - const string &) - throw(Error); + const string &); static void jsonNode_writeNumber(ContainerNode*, const string &name, - float num) - throw(Error); + float num); static void jsonNode_writeBool(ContainerNode*, const string &name, - bool value) - throw(Error); + bool value); static void jsonNode_writeString(ContainerNode*, const string &name, - const string &value) - throw(Error); + const string &value); static void jsonNode_writeStringVector(ContainerNode*, const string &name, - const StringVector &value) - throw(Error); + const StringVector &value); static ContainerNode jsonNode_writeNewContainer(ContainerNode*, - const string &name) - throw(Error); + const string &name); static ContainerNode jsonNode_writeNewArray(ContainerNode*, - const string &name) - throw(Error); + const string &name); static container_node_op json_op = { @@ -114,7 +101,7 @@ rootNode.data.data2 = root->value.children.next; } -void JsonDocument::loadFile(const string &filename) throw(Error) +void JsonDocument::loadFile(const string &filename) { if (root) PJSUA2_RAISE_ERROR3(PJ_EINVALIDOP, "JsonDocument.loadString()", @@ -174,7 +161,7 @@ PJSUA2_RAISE_ERROR(status); } -void JsonDocument::loadString(const string &input) throw(Error) +void JsonDocument::loadString(const string &input) { if (root) PJSUA2_RAISE_ERROR3(PJ_EINVALIDOP, "JsonDocument.loadString()", @@ -214,7 +201,7 @@ return pj_file_write(sd->fd, s, &ssize); } -void JsonDocument::saveFile(const string &filename) throw(Error) +void JsonDocument::saveFile(const string &filename) { struct save_file_data sd; pj_status_t status; @@ -247,7 +234,7 @@ return PJ_SUCCESS; } -string JsonDocument::saveString() throw(Error) +string JsonDocument::saveString() { struct save_string_data sd; pj_status_t status; @@ -333,7 +320,6 @@ } static string jsonNode_unreadName(const ContainerNode *node) - throw(Error) { json_node_data *jdat = (json_node_data*)&node->data; json_verify(jdat, "unreadName()", "", PJ_JSON_VAL_NULL); @@ -342,7 +328,6 @@ static float jsonNode_readNumber(const ContainerNode *node, const string &name) - throw(Error) { json_node_data *jdat = (json_node_data*)&node->data; json_verify(jdat, "readNumber()", name, PJ_JSON_VAL_NUMBER); @@ -352,7 +337,6 @@ static bool jsonNode_readBool(const ContainerNode *node, const string &name) - throw(Error) { json_node_data *jdat = (json_node_data*)&node->data; json_verify(jdat, "readBool()", name, PJ_JSON_VAL_BOOL); @@ -362,7 +346,6 @@ static string jsonNode_readString(const ContainerNode *node, const string &name) - throw(Error) { json_node_data *jdat = (json_node_data*)&node->data; json_verify(jdat, "readString()", name, PJ_JSON_VAL_STRING); @@ -372,7 +355,6 @@ static StringVector jsonNode_readStringVector(const ContainerNode *node, const string &name) - throw(Error) { json_node_data *jdat = (json_node_data*)&node->data; json_verify(jdat, "readStringVector()", name, PJ_JSON_VAL_ARRAY); @@ -398,7 +380,6 @@ static ContainerNode jsonNode_readContainer(const ContainerNode *node, const string &name) - throw(Error) { json_node_data *jdat = (json_node_data*)&node->data; json_verify(jdat, "readContainer()", name, PJ_JSON_VAL_OBJ); @@ -416,7 +397,6 @@ static ContainerNode jsonNode_readArray(const ContainerNode *node, const string &name) - throw(Error) { json_node_data *jdat = (json_node_data*)&node->data; json_verify(jdat, "readArray()", name, PJ_JSON_VAL_ARRAY); @@ -442,7 +422,6 @@ static void jsonNode_writeNumber(ContainerNode *node, const string &name, float num) - throw(Error) { json_node_data *jdat = (json_node_data*)&node->data; pj_json_elem *el = jdat->doc->allocElement(); @@ -454,7 +433,6 @@ static void jsonNode_writeBool(ContainerNode *node, const string &name, bool value) - throw(Error) { json_node_data *jdat = (json_node_data*)&node->data; pj_json_elem *el = jdat->doc->allocElement(); @@ -466,7 +444,6 @@ static void jsonNode_writeString(ContainerNode *node, const string &name, const string &value) - throw(Error) { json_node_data *jdat = (json_node_data*)&node->data; pj_json_elem *el = jdat->doc->allocElement(); @@ -481,7 +458,6 @@ static void jsonNode_writeStringVector(ContainerNode *node, const string &name, const StringVector &value) - throw(Error) { json_node_data *jdat = (json_node_data*)&node->data; pj_json_elem *el = jdat->doc->allocElement(); @@ -502,7 +478,6 @@ static ContainerNode jsonNode_writeNewContainer(ContainerNode *node, const string &name) - throw(Error) { json_node_data *jdat = (json_node_data*)&node->data; pj_json_elem *el = jdat->doc->allocElement(); @@ -523,7 +498,6 @@ static ContainerNode jsonNode_writeNewArray(ContainerNode *node, const string &name) - throw(Error) { json_node_data *jdat = (json_node_data*)&node->data; pj_json_elem *el = jdat->doc->allocElement(); Index: pjsip/src/pjsua2/media.cpp =================================================================== --- pjsip/src/pjsua2/media.cpp (revision 5896) +++ pjsip/src/pjsua2/media.cpp (working copy) @@ -128,7 +128,7 @@ } -void AudioMedia::registerMediaPort(MediaPort port) throw(Error) +void AudioMedia::registerMediaPort(MediaPort port) { /* Check if media already added to Conf bridge. */ pj_assert(!Endpoint::instance().mediaExists(*this)); @@ -178,7 +178,7 @@ unregisterMediaPort(); } -ConfPortInfo AudioMedia::getPortInfo() const throw(Error) +ConfPortInfo AudioMedia::getPortInfo() const { return AudioMedia::getPortInfoFromId(id); } @@ -188,7 +188,7 @@ return id; } -ConfPortInfo AudioMedia::getPortInfoFromId(int port_id) throw(Error) +ConfPortInfo AudioMedia::getPortInfoFromId(int port_id) { pjsua_conf_port_info pj_info; ConfPortInfo pi; @@ -198,7 +198,7 @@ return pi; } -void AudioMedia::startTransmit(const AudioMedia &sink) const throw(Error) +void AudioMedia::startTransmit(const AudioMedia &sink) const { PJSUA2_CHECK_EXPR( pjsua_conf_connect(id, sink.id) ); } @@ -205,7 +205,6 @@ void AudioMedia::startTransmit2(const AudioMedia &sink, const AudioMediaTransmitParam ¶m) const - throw(Error) { pjsua_conf_connect_param pj_param; @@ -214,22 +213,22 @@ PJSUA2_CHECK_EXPR( pjsua_conf_connect2(id, sink.id, &pj_param) ); } -void AudioMedia::stopTransmit(const AudioMedia &sink) const throw(Error) +void AudioMedia::stopTransmit(const AudioMedia &sink) const { PJSUA2_CHECK_EXPR( pjsua_conf_disconnect(id, sink.id) ); } -void AudioMedia::adjustRxLevel(float level) throw(Error) +void AudioMedia::adjustRxLevel(float level) { PJSUA2_CHECK_EXPR( pjsua_conf_adjust_tx_level(id, level) ); } -void AudioMedia::adjustTxLevel(float level) throw(Error) +void AudioMedia::adjustTxLevel(float level) { PJSUA2_CHECK_EXPR( pjsua_conf_adjust_rx_level(id, level) ); } -unsigned AudioMedia::getRxLevel() const throw(Error) +unsigned AudioMedia::getRxLevel() const { unsigned level; PJSUA2_CHECK_EXPR( pjsua_conf_get_signal_level(id, &level, NULL) ); @@ -236,7 +235,7 @@ return level * 100 / 255; } -unsigned AudioMedia::getTxLevel() const throw(Error) +unsigned AudioMedia::getTxLevel() const { unsigned level; PJSUA2_CHECK_EXPR( pjsua_conf_get_signal_level(id, NULL, &level) ); @@ -266,7 +265,6 @@ void AudioMediaPlayer::createPlayer(const string &file_name, unsigned options) - throw(Error) { if (playerId != PJSUA_INVALID_ID) { PJSUA2_RAISE_ERROR(PJ_EEXISTS); @@ -302,7 +300,6 @@ void AudioMediaPlayer::createPlaylist(const StringVector &file_names, const string &label, unsigned options) - throw(Error) { if (playerId != PJSUA_INVALID_ID) { PJSUA2_RAISE_ERROR(PJ_EEXISTS); @@ -347,7 +344,7 @@ registerMediaPort(NULL); } -AudioMediaPlayerInfo AudioMediaPlayer::getInfo() const throw(Error) +AudioMediaPlayerInfo AudioMediaPlayer::getInfo() const { AudioMediaPlayerInfo info; pjmedia_wav_player_info pj_info; @@ -363,7 +360,7 @@ return info; } -pj_uint32_t AudioMediaPlayer::getPos() const throw(Error) +pj_uint32_t AudioMediaPlayer::getPos() const { pj_ssize_t pos = pjsua_player_get_pos(playerId); if (pos < 0) { @@ -372,7 +369,7 @@ return (pj_uint32_t)pos; } -void AudioMediaPlayer::setPos(pj_uint32_t samples) throw(Error) +void AudioMediaPlayer::setPos(pj_uint32_t samples) { PJSUA2_CHECK_EXPR( pjsua_player_set_pos(playerId, samples) ); } @@ -410,7 +407,7 @@ unsigned enc_type, pj_ssize_t max_size, unsigned options) - throw(Error) + { PJ_UNUSED_ARG(max_size); @@ -460,7 +457,7 @@ } void ToneGenerator::createToneGenerator(unsigned clock_rate, - unsigned channel_count) throw(Error) + unsigned channel_count) { pj_status_t status; @@ -488,7 +485,7 @@ return tonegen && pjmedia_tonegen_is_busy(tonegen) != 0; } -void ToneGenerator::stop() throw(Error) +void ToneGenerator::stop() { pj_status_t status; @@ -500,7 +497,7 @@ PJSUA2_CHECK_RAISE_ERROR2(status, "ToneGenerator::stop()"); } -void ToneGenerator::rewind() throw(Error) +void ToneGenerator::rewind() { pj_status_t status; @@ -513,7 +510,7 @@ } void ToneGenerator::play(const ToneDescVector &tones, - bool loop) throw(Error) + bool loop) { pj_status_t status; @@ -530,7 +527,7 @@ } void ToneGenerator::playDigits(const ToneDigitVector &digits, - bool loop) throw(Error) + bool loop) { pj_status_t status; @@ -546,7 +543,7 @@ PJSUA2_CHECK_RAISE_ERROR2(status, "ToneGenerator::playDigits()"); } -ToneDigitMapVector ToneGenerator::getDigitMap() const throw(Error) +ToneDigitMapVector ToneGenerator::getDigitMap() const { const pjmedia_tone_digit_map *pdm; ToneDigitMapVector tdm; @@ -578,7 +575,6 @@ } void ToneGenerator::setDigitMap(const ToneDigitMapVector &digit_map) - throw(Error) { unsigned i; pj_status_t status; @@ -665,12 +661,12 @@ clearAudioDevList(); } -int AudDevManager::getCaptureDev() const throw(Error) +int AudDevManager::getCaptureDev() const { return getActiveDev(true); } -AudioMedia &AudDevManager::getCaptureDevMedia() throw(Error) +AudioMedia &AudDevManager::getCaptureDevMedia() { if (!devMedia) devMedia = new DevAudioMedia; @@ -677,12 +673,12 @@ return *devMedia; } -int AudDevManager::getPlaybackDev() const throw(Error) +int AudDevManager::getPlaybackDev() const { return getActiveDev(false); } -AudioMedia &AudDevManager::getPlaybackDevMedia() throw(Error) +AudioMedia &AudDevManager::getPlaybackDevMedia() { if (!devMedia) devMedia = new DevAudioMedia; @@ -689,7 +685,7 @@ return *devMedia; } -void AudDevManager::setCaptureDev(int capture_dev) const throw(Error) +void AudDevManager::setCaptureDev(int capture_dev) const { pjsua_snd_dev_param param; pjsua_snd_dev_param_default(¶m); @@ -704,7 +700,7 @@ PJSUA2_CHECK_EXPR( pjsua_set_snd_dev2(¶m) ); } -void AudDevManager::setPlaybackDev(int playback_dev) const throw(Error) +void AudDevManager::setPlaybackDev(int playback_dev) const { pjsua_snd_dev_param param; pjsua_snd_dev_param_default(¶m); @@ -719,7 +715,7 @@ PJSUA2_CHECK_EXPR( pjsua_set_snd_dev2(¶m) ); } -const AudioDevInfoVector &AudDevManager::enumDev() throw(Error) +const AudioDevInfoVector &AudDevManager::enumDev() { pjmedia_aud_dev_info pj_info[MAX_DEV_COUNT]; unsigned count = MAX_DEV_COUNT; @@ -737,7 +733,7 @@ return audioDevList; } -void AudDevManager::setNullDev() throw(Error) +void AudDevManager::setNullDev() { PJSUA2_CHECK_EXPR( pjsua_set_null_snd_dev() ); } @@ -747,7 +743,7 @@ return (MediaPort*)pjsua_set_no_snd_dev(); } -void AudDevManager::setSndDevMode(unsigned mode) const throw(Error) +void AudDevManager::setSndDevMode(unsigned mode) const { int capture_dev = 0, playback_dev = 0; pjsua_snd_dev_param param; @@ -763,12 +759,12 @@ } void AudDevManager::setEcOptions(unsigned tail_msec, - unsigned options) throw(Error) + unsigned options) { PJSUA2_CHECK_EXPR( pjsua_set_ec(tail_msec, options) ); } -unsigned AudDevManager::getEcTail() const throw(Error) +unsigned AudDevManager::getEcTail() const { unsigned tail_msec = 0; @@ -782,7 +778,7 @@ return PJ2BOOL(pjsua_snd_is_active()); } -void AudDevManager::refreshDevs() throw(Error) +void AudDevManager::refreshDevs() { PJSUA2_CHECK_EXPR( pjmedia_aud_dev_refresh() ); } @@ -793,7 +789,7 @@ } AudioDevInfo -AudDevManager::getDevInfo(int id) const throw(Error) +AudDevManager::getDevInfo(int id) const { AudioDevInfo dev_info; pjmedia_aud_dev_info pj_info; @@ -805,7 +801,7 @@ } int AudDevManager::lookupDev(const string &drv_name, - const string &dev_name) const throw(Error) + const string &dev_name) const { pjmedia_aud_dev_index pj_idx = 0; @@ -824,7 +820,7 @@ void AudDevManager::setExtFormat(const MediaFormatAudio &format, - bool keep) throw(Error) + bool keep) { pjmedia_format pj_format = format.toPj(); @@ -833,7 +829,7 @@ keep) ); } -MediaFormatAudio AudDevManager::getExtFormat() const throw(Error) +MediaFormatAudio AudDevManager::getExtFormat() const { pjmedia_format pj_format; MediaFormatAudio format; @@ -847,7 +843,7 @@ } void AudDevManager::setInputLatency(unsigned latency_msec, - bool keep) throw(Error) + bool keep) { PJSUA2_CHECK_EXPR( pjsua_snd_set_setting(PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY, &latency_msec, @@ -854,7 +850,7 @@ keep) ); } -unsigned AudDevManager::getInputLatency() const throw(Error) +unsigned AudDevManager::getInputLatency() const { unsigned latency_msec = 0; @@ -866,7 +862,7 @@ void AudDevManager::setOutputLatency(unsigned latency_msec, - bool keep) throw(Error) + bool keep) { PJSUA2_CHECK_EXPR( pjsua_snd_set_setting(PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY, &latency_msec, @@ -873,7 +869,7 @@ keep) ); } -unsigned AudDevManager::getOutputLatency() const throw(Error) +unsigned AudDevManager::getOutputLatency() const { unsigned latency_msec = 0; @@ -883,7 +879,7 @@ return latency_msec; } -void AudDevManager::setInputVolume(unsigned volume, bool keep) throw(Error) +void AudDevManager::setInputVolume(unsigned volume, bool keep) { PJSUA2_CHECK_EXPR( pjsua_snd_set_setting(PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING, @@ -891,7 +887,7 @@ keep) ); } -unsigned AudDevManager::getInputVolume() const throw(Error) +unsigned AudDevManager::getInputVolume() const { unsigned volume = 0; @@ -902,7 +898,7 @@ return volume; } -void AudDevManager::setOutputVolume(unsigned volume, bool keep) throw(Error) +void AudDevManager::setOutputVolume(unsigned volume, bool keep) { PJSUA2_CHECK_EXPR( pjsua_snd_set_setting(PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, @@ -910,7 +906,7 @@ keep) ); } -unsigned AudDevManager::getOutputVolume() const throw(Error) +unsigned AudDevManager::getOutputVolume() const { unsigned volume = 0; @@ -921,7 +917,7 @@ return volume; } -unsigned AudDevManager::getInputSignal() const throw(Error) +unsigned AudDevManager::getInputSignal() const { unsigned signal = 0; @@ -932,7 +928,7 @@ return signal; } -unsigned AudDevManager::getOutputSignal() const throw(Error) +unsigned AudDevManager::getOutputSignal() const { unsigned signal = 0; @@ -945,7 +941,7 @@ void AudDevManager::setInputRoute(pjmedia_aud_dev_route route, - bool keep) throw(Error) + bool keep) { PJSUA2_CHECK_EXPR( pjsua_snd_set_setting(PJMEDIA_AUD_DEV_CAP_INPUT_ROUTE, &route, @@ -952,7 +948,7 @@ keep) ); } -pjmedia_aud_dev_route AudDevManager::getInputRoute() const throw(Error) +pjmedia_aud_dev_route AudDevManager::getInputRoute() const { pjmedia_aud_dev_route route = PJMEDIA_AUD_DEV_ROUTE_DEFAULT; @@ -964,7 +960,7 @@ void AudDevManager::setOutputRoute(pjmedia_aud_dev_route route, - bool keep) throw(Error) + bool keep) { PJSUA2_CHECK_EXPR( pjsua_snd_set_setting(PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, &route, @@ -971,7 +967,7 @@ keep) ); } -pjmedia_aud_dev_route AudDevManager::getOutputRoute() const throw(Error) +pjmedia_aud_dev_route AudDevManager::getOutputRoute() const { pjmedia_aud_dev_route route = PJMEDIA_AUD_DEV_ROUTE_DEFAULT; @@ -981,7 +977,7 @@ return route; } -void AudDevManager::setVad(bool enable, bool keep) throw(Error) +void AudDevManager::setVad(bool enable, bool keep) { PJSUA2_CHECK_EXPR( pjsua_snd_set_setting(PJMEDIA_AUD_DEV_CAP_VAD, &enable, @@ -988,7 +984,7 @@ keep) ); } -bool AudDevManager::getVad() const throw(Error) +bool AudDevManager::getVad() const { bool enable = false; @@ -998,7 +994,7 @@ return enable; } -void AudDevManager::setCng(bool enable, bool keep) throw(Error) +void AudDevManager::setCng(bool enable, bool keep) { PJSUA2_CHECK_EXPR( pjsua_snd_set_setting(PJMEDIA_AUD_DEV_CAP_CNG, &enable, @@ -1005,7 +1001,7 @@ keep) ); } -bool AudDevManager::getCng() const throw(Error) +bool AudDevManager::getCng() const { bool enable = false; @@ -1015,7 +1011,7 @@ return enable; } -void AudDevManager::setPlc(bool enable, bool keep) throw(Error) +void AudDevManager::setPlc(bool enable, bool keep) { PJSUA2_CHECK_EXPR( pjsua_snd_set_setting(PJMEDIA_AUD_DEV_CAP_PLC, &enable, @@ -1022,7 +1018,7 @@ keep) ); } -bool AudDevManager::getPlc() const throw(Error) +bool AudDevManager::getPlc() const { bool enable = false; @@ -1040,7 +1036,7 @@ audioDevList.clear(); } -int AudDevManager::getActiveDev(bool is_capture) const throw(Error) +int AudDevManager::getActiveDev(bool is_capture) const { int capture_dev = 0, playback_dev = 0; PJSUA2_CHECK_EXPR( pjsua_get_snd_dev(&capture_dev, &playback_dev) ); @@ -1128,7 +1124,7 @@ #endif } -VideoWindowInfo VideoWindow::getInfo() const throw(Error) +VideoWindowInfo VideoWindow::getInfo() const { VideoWindowInfo vwi; pj_bzero(&vwi, sizeof(vwi)); @@ -1150,7 +1146,7 @@ return vwi; } -void VideoWindow::Show(bool show) throw(Error) +void VideoWindow::Show(bool show) { #if PJSUA_HAS_VIDEO PJSUA2_CHECK_EXPR( pjsua_vid_win_set_show(winId, show) ); @@ -1159,7 +1155,7 @@ #endif } -void VideoWindow::setPos(const MediaCoordinate &pos) throw(Error) +void VideoWindow::setPos(const MediaCoordinate &pos) { #if PJSUA_HAS_VIDEO pjmedia_coord pj_pos; @@ -1172,7 +1168,7 @@ #endif } -void VideoWindow::setSize(const MediaSize &size) throw(Error) +void VideoWindow::setSize(const MediaSize &size) { #if PJSUA_HAS_VIDEO pjmedia_rect_size pj_size; @@ -1185,7 +1181,7 @@ #endif } -void VideoWindow::rotate(int angle) throw(Error) +void VideoWindow::rotate(int angle) { #if PJSUA_HAS_VIDEO PJSUA2_CHECK_EXPR( pjsua_vid_win_rotate(winId, angle) ); @@ -1194,7 +1190,7 @@ #endif } -void VideoWindow::setWindow(const VideoWindowHandle &win) throw(Error) +void VideoWindow::setWindow(const VideoWindowHandle &win) { #if PJSUA_HAS_VIDEO pjmedia_vid_dev_hwnd vhwnd; @@ -1263,7 +1259,7 @@ #endif } -void VideoPreview::start(const VideoPreviewOpParam ¶m) throw(Error) +void VideoPreview::start(const VideoPreviewOpParam ¶m) { #if PJSUA_HAS_VIDEO pjsua_vid_preview_param prm = param.toPj(); @@ -1274,7 +1270,7 @@ #endif } -void VideoPreview::stop() throw(Error) +void VideoPreview::stop() { #if PJSUA_HAS_VIDEO pjsua_vid_preview_stop(devId); @@ -1364,7 +1360,7 @@ } /////////////////////////////////////////////////////////////////////////////// -void VidDevManager::refreshDevs() throw(Error) +void VidDevManager::refreshDevs() { #if PJSUA_HAS_VIDEO PJSUA2_CHECK_EXPR(pjmedia_vid_dev_refresh()); @@ -1380,7 +1376,7 @@ #endif } -VideoDevInfo VidDevManager::getDevInfo(int dev_id) const throw(Error) +VideoDevInfo VidDevManager::getDevInfo(int dev_id) const { VideoDevInfo dev_info; #if PJSUA_HAS_VIDEO @@ -1395,7 +1391,7 @@ return dev_info; } -const VideoDevInfoVector &VidDevManager::enumDev() throw(Error) +const VideoDevInfoVector &VidDevManager::enumDev() { #if PJSUA_HAS_VIDEO pjmedia_vid_dev_info pj_info[MAX_DEV_COUNT]; @@ -1416,7 +1412,7 @@ } int VidDevManager::lookupDev(const string &drv_name, - const string &dev_name) const throw(Error) + const string &dev_name) const { pjmedia_vid_dev_index pj_idx = 0; #if PJSUA_HAS_VIDEO @@ -1443,7 +1439,7 @@ void VidDevManager::setFormat(int dev_id, const MediaFormatVideo &format, - bool keep) throw(Error) + bool keep) { #if PJSUA_HAS_VIDEO pjmedia_format pj_format = format.toPj(); @@ -1459,7 +1455,7 @@ #endif } -MediaFormatVideo VidDevManager::getFormat(int dev_id) const throw(Error) +MediaFormatVideo VidDevManager::getFormat(int dev_id) const { MediaFormatVideo vid_format; pj_bzero(&vid_format, sizeof(vid_format)); @@ -1477,7 +1473,7 @@ void VidDevManager::setInputScale(int dev_id, const MediaSize &scale, - bool keep) throw(Error) + bool keep) { #if PJSUA_HAS_VIDEO pjmedia_rect_size pj_size; @@ -1494,7 +1490,7 @@ #endif } -MediaSize VidDevManager::getInputScale(int dev_id) const throw(Error) +MediaSize VidDevManager::getInputScale(int dev_id) const { MediaSize scale; pj_bzero(&scale, sizeof(scale)); @@ -1514,7 +1510,7 @@ void VidDevManager::setOutputWindowFlags(int dev_id, int flags, - bool keep) throw(Error) + bool keep) { #if PJSUA_HAS_VIDEO PJSUA2_CHECK_EXPR(pjsua_vid_dev_set_setting(dev_id, @@ -1528,7 +1524,7 @@ #endif } -int VidDevManager::getOutputWindowFlags(int dev_id) throw(Error) +int VidDevManager::getOutputWindowFlags(int dev_id) { int flags = 0; @@ -1543,7 +1539,7 @@ } void VidDevManager::switchDev(int dev_id, - const VideoSwitchParam ¶m) throw(Error) + const VideoSwitchParam ¶m) { #if PJSUA_HAS_VIDEO pjmedia_vid_dev_switch_param pj_param; @@ -1581,7 +1577,7 @@ void VidDevManager::setCaptureOrient(pjmedia_vid_dev_index dev_id, pjmedia_orient orient, - bool keep) throw(Error) + bool keep) { #if PJSUA_HAS_VIDEO PJSUA2_CHECK_EXPR(pjsua_vid_dev_set_setting(dev_id, Index: pjsip/src/pjsua2/persistent.cpp =================================================================== --- pjsip/src/pjsua2/persistent.cpp (revision 5896) +++ pjsip/src/pjsua2/persistent.cpp (working copy) @@ -27,74 +27,71 @@ return getRootContainer().hasUnread(); } -string PersistentDocument::unreadName() const throw(Error) +string PersistentDocument::unreadName() const { return getRootContainer().unreadName(); } -int PersistentDocument::readInt(const string &name) const throw(Error) +int PersistentDocument::readInt(const string &name) const { return (int)getRootContainer().readNumber(name); } -float PersistentDocument::readNumber(const string &name) const throw(Error) +float PersistentDocument::readNumber(const string &name) const { return getRootContainer().readNumber(name); } -bool PersistentDocument::readBool(const string &name) const throw(Error) +bool PersistentDocument::readBool(const string &name) const { return getRootContainer().readBool(name); } -string PersistentDocument::readString(const string &name) const throw(Error) +string PersistentDocument::readString(const string &name) const { return getRootContainer().readString(name); } StringVector PersistentDocument::readStringVector(const string &name) const - throw(Error) { return getRootContainer().readStringVector(name); } -void PersistentDocument::readObject(PersistentObject &obj) const throw(Error) +void PersistentDocument::readObject(PersistentObject &obj) const { getRootContainer().readObject(obj); } ContainerNode PersistentDocument::readContainer(const string &name) const - throw(Error) { return getRootContainer().readContainer(name); } ContainerNode PersistentDocument::readArray(const string &name) const - throw(Error) { return getRootContainer().readArray(name); } void PersistentDocument::writeNumber(const string &name, - float num) throw(Error) + float num) { getRootContainer().writeNumber(name, num); } void PersistentDocument::writeInt(const string &name, - int num) throw(Error) + int num) { getRootContainer().writeNumber(name, (float)num); } void PersistentDocument::writeBool(const string &name, - bool value) throw(Error) + bool value) { getRootContainer().writeBool(name, value); } void PersistentDocument::writeString(const string &name, - const string &value) throw(Error) + const string &value) { getRootContainer().writeString(name, value); } @@ -101,24 +98,21 @@ void PersistentDocument::writeStringVector(const string &name, const StringVector &value) - throw(Error) { getRootContainer().writeStringVector(name, value); } -void PersistentDocument::writeObject(const PersistentObject &obj) throw(Error) +void PersistentDocument::writeObject(const PersistentObject &obj) { getRootContainer().writeObject(obj); } ContainerNode PersistentDocument::writeNewContainer(const string &name) - throw(Error) { return getRootContainer().writeNewContainer(name); } ContainerNode PersistentDocument::writeNewArray(const string &name) - throw(Error) { return getRootContainer().writeNewArray(name); } @@ -130,74 +124,74 @@ return op->hasUnread(this); } -string ContainerNode::unreadName() const throw(Error) +string ContainerNode::unreadName() const { return op->unreadName(this); } -int ContainerNode::readInt(const string &name) const throw(Error) +int ContainerNode::readInt(const string &name) const { return (int)op->readNumber(this, name); } -float ContainerNode::readNumber(const string &name) const throw(Error) +float ContainerNode::readNumber(const string &name) const { return op->readNumber(this, name); } -bool ContainerNode::readBool(const string &name) const throw(Error) +bool ContainerNode::readBool(const string &name) const { return op->readBool(this, name); } -string ContainerNode::readString(const string &name) const throw(Error) +string ContainerNode::readString(const string &name) const { return op->readString(this, name); } StringVector ContainerNode::readStringVector(const string &name) const - throw(Error) + { return op->readStringVector(this, name); } -void ContainerNode::readObject(PersistentObject &obj) const throw(Error) +void ContainerNode::readObject(PersistentObject &obj) const { obj.readObject(*this); } ContainerNode ContainerNode::readContainer(const string &name) const - throw(Error) + { return op->readContainer(this, name); } ContainerNode ContainerNode::readArray(const string &name) const - throw(Error) + { return op->readArray(this, name); } void ContainerNode::writeNumber(const string &name, - float num) throw(Error) + float num) { return op->writeNumber(this, name, num); } void ContainerNode::writeInt(const string &name, - int num) throw(Error) + int num) { return op->writeNumber(this, name, (float)num); } void ContainerNode::writeBool(const string &name, - bool value) throw(Error) + bool value) { return op->writeBool(this, name, value); } void ContainerNode::writeString(const string &name, - const string &value) throw(Error) + const string &value) { return op->writeString(this, name, value); } @@ -204,24 +198,21 @@ void ContainerNode::writeStringVector(const string &name, const StringVector &value) - throw(Error) { return op->writeStringVector(this, name, value); } -void ContainerNode::writeObject(const PersistentObject &obj) throw(Error) +void ContainerNode::writeObject(const PersistentObject &obj) { obj.writeObject(*this); } ContainerNode ContainerNode::writeNewContainer(const string &name) - throw(Error) { return op->writeNewContainer(this, name); } ContainerNode ContainerNode::writeNewArray(const string &name) - throw(Error) { return op->writeNewArray(this, name); } Index: pjsip/src/pjsua2/presence.cpp =================================================================== --- pjsip/src/pjsua2/presence.cpp (revision 5896) +++ pjsip/src/pjsua2/presence.cpp (working copy) @@ -36,7 +36,7 @@ /////////////////////////////////////////////////////////////////////////////// -void BuddyConfig::readObject(const ContainerNode &node) throw(Error) +void BuddyConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("BuddyConfig"); @@ -44,7 +44,7 @@ NODE_READ_BOOL ( this_node, subscribe); } -void BuddyConfig::writeObject(ContainerNode &node) const throw(Error) +void BuddyConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("BuddyConfig"); @@ -99,7 +99,7 @@ /* * Create buddy and register the buddy to PJSUA-LIB. */ -void Buddy::create(Account &account, const BuddyConfig &cfg) throw(Error) +void Buddy::create(Account &account, const BuddyConfig &cfg) { pjsua_buddy_config pj_cfg; pjsua_buddy_config_default(&pj_cfg); @@ -127,7 +127,7 @@ /* * Get detailed buddy info. */ -BuddyInfo Buddy::getInfo() const throw(Error) +BuddyInfo Buddy::getInfo() const { pjsua_buddy_info pj_bi; BuddyInfo bi; @@ -140,7 +140,7 @@ /* * Enable/disable buddy's presence monitoring. */ -void Buddy::subscribePresence(bool subscribe) throw(Error) +void Buddy::subscribePresence(bool subscribe) { PJSUA2_CHECK_EXPR( pjsua_buddy_subscribe_pres(id, subscribe) ); } @@ -149,7 +149,7 @@ /* * Update the presence information for the buddy. */ -void Buddy::updatePresence(void) throw(Error) +void Buddy::updatePresence(void) { PJSUA2_CHECK_EXPR( pjsua_buddy_update_pres(id) ); } @@ -157,7 +157,7 @@ /* * Send instant messaging outside dialog. */ -void Buddy::sendInstantMessage(const SendInstantMessageParam &prm) throw(Error) +void Buddy::sendInstantMessage(const SendInstantMessageParam &prm) { BuddyInfo bi = getInfo(); @@ -176,7 +176,6 @@ * Send typing indication outside dialog. */ void Buddy::sendTypingIndication(const SendTypingIndicationParam &prm) - throw(Error) { BuddyInfo bi = getInfo(); Index: pjsip/src/pjsua2/siptypes.cpp =================================================================== --- pjsip/src/pjsua2/siptypes.cpp (revision 5896) +++ pjsip/src/pjsua2/siptypes.cpp (working copy) @@ -30,7 +30,7 @@ { void readIntVector( ContainerNode &node, const string &array_name, - IntVector &v) throw(Error) + IntVector &v) { ContainerNode array_node = node.readArray(array_name); v.resize(0); @@ -41,7 +41,7 @@ void writeIntVector(ContainerNode &node, const string &array_name, - const IntVector &v) throw(Error) + const IntVector &v) { ContainerNode array_node = node.writeNewArray(array_name); for (unsigned i=0; i<v.size(); ++i) { @@ -50,7 +50,7 @@ } void readQosParams( ContainerNode &node, - pj_qos_params &qos) throw(Error) + pj_qos_params &qos) { ContainerNode this_node = node.readContainer("qosParams"); @@ -61,7 +61,7 @@ } void writeQosParams( ContainerNode &node, - const pj_qos_params &qos) throw(Error) + const pj_qos_params &qos) { ContainerNode this_node = node.writeNewContainer("qosParams"); @@ -73,7 +73,7 @@ void readSipHeaders( const ContainerNode &node, const string &array_name, - SipHeaderVector &headers) throw(Error) + SipHeaderVector &headers) { ContainerNode headers_node = node.readArray(array_name); headers.resize(0); @@ -89,7 +89,7 @@ void writeSipHeaders(ContainerNode &node, const string &array_name, - const SipHeaderVector &headers) throw(Error) + const SipHeaderVector &headers) { ContainerNode headers_node = node.writeNewArray(array_name); for (unsigned i=0; i<headers.size(); ++i) { @@ -117,7 +117,7 @@ { } -void AuthCredInfo::readObject(const ContainerNode &node) throw(Error) +void AuthCredInfo::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("AuthCredInfo"); @@ -131,7 +131,7 @@ NODE_READ_STRING( this_node, akaAmf); } -void AuthCredInfo::writeObject(ContainerNode &node) const throw(Error) +void AuthCredInfo::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("AuthCredInfo"); @@ -208,7 +208,7 @@ this->qosIgnoreError = PJ2BOOL(prm.qos_ignore_error); } -void TlsConfig::readObject(const ContainerNode &node) throw(Error) +void TlsConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("TlsConfig"); @@ -230,7 +230,7 @@ NODE_READ_BOOL ( this_node, qosIgnoreError); } -void TlsConfig::writeObject(ContainerNode &node) const throw(Error) +void TlsConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("TlsConfig"); @@ -288,7 +288,7 @@ return tc; } -void TransportConfig::readObject(const ContainerNode &node) throw(Error) +void TransportConfig::readObject(const ContainerNode &node) { ContainerNode this_node = node.readContainer("TransportConfig"); @@ -301,7 +301,7 @@ NODE_READ_OBJ ( this_node, tlsConfig); } -void TransportConfig::writeObject(ContainerNode &node) const throw(Error) +void TransportConfig::writeObject(ContainerNode &node) const { ContainerNode this_node = node.writeNewContainer("TransportConfig"); @@ -378,7 +378,7 @@ /////////////////////////////////////////////////////////////////////////////// -void SipHeader::fromPj(const pjsip_hdr *hdr) throw(Error) +void SipHeader::fromPj(const pjsip_hdr *hdr) { char *buf = NULL; int len = 0; @@ -435,7 +435,7 @@ /////////////////////////////////////////////////////////////////////////////// -void SipMultipartPart::fromPj(const pjsip_multipart_part &prm) throw(Error) +void SipMultipartPart::fromPj(const pjsip_multipart_part &prm) { headers.clear(); pjsip_hdr* pj_hdr = prm.hdr.next; @@ -574,7 +574,7 @@ multipartContentType.subType == "" && multipartParts.size() == 0); } -void SipTxOption::fromPj(const pjsua_msg_data &prm) throw(Error) +void SipTxOption::fromPj(const pjsua_msg_data &prm) { targetUri = pj2Str(prm.target_uri); Index: pjsip-apps/src/samples/pjsua2_demo.cpp =================================================================== --- pjsip-apps/src/samples/pjsua2_demo.cpp (revision 5896) +++ pjsip-apps/src/samples/pjsua2_demo.cpp (working copy) @@ -105,7 +105,7 @@ } } -static void mainProg1(Endpoint &ep) throw(Error) +static void mainProg1(Endpoint &ep) { // Init library EpConfig ep_cfg; @@ -151,7 +151,7 @@ delete acc; } -static void mainProg2() throw(Error) +static void mainProg2() { string json_str; { @@ -197,7 +197,7 @@ } -static void mainProg3(Endpoint &ep) throw(Error) +static void mainProg3(Endpoint &ep) { const char *paths[] = { "../../../../tests/pjsua/wavs/input.16.wav", "../../tests/pjsua/wavs/input.16.wav", @@ -256,7 +256,7 @@ } -static void mainProg() throw(Error) +static void mainProg() { string json_str; @@ -308,7 +308,7 @@ } -static void mainProg4(Endpoint &ep) throw(Error) +static void mainProg4(Endpoint &ep) { // Init library EpConfig ep_cfg; Index: pjsip-apps/src/swig/pj_error.i =================================================================== --- pjsip-apps/src/swig/pj_error.i (nonexistent) +++ pjsip-apps/src/swig/pj_error.i (working copy) @@ -0,0 +1,77 @@ +%exceptionclass Error; + +#ifdef SWIGJAVA +// Allow C++ exceptions to be handled in Java +// Force the Error Java class to extend java.lang.Exception +%typemap(javabase) pj::Error "java.lang.Exception"; + +%typemap(javacode) pj::Error %{ + + // Override getMessage() + public String getMessage() { + return getTitle(); + } + + // Disable serialization (check ticket #1868) + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + throw new java.io.NotSerializableException("Check ticket #1868!"); + } + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException { + throw new java.io.NotSerializableException("Check ticket #1868!"); + } + +%} +#endif + + +/* + * Generate catch handlers for all generated methods for exceptions of type + * "pj::Error". The catch handler rethrows the "pj::Error" into an exception + * from the target language. The code inside the catch handler depends on the + * target language. + */ +#ifdef SWIGPYTHON +%define %handlePjError + %exception { + try { + $action + } catch (pj::Error &err) { + pj::Error *errcopy = new pj::Error(err); + PyObject *errpy = SWIG_NewPointerObj(errcopy, SWIGTYPE_p_pj__Error, SWIG_POINTER_OWN); + SWIG_Python_Raise(errpy, "pj::Error", SWIGTYPE_p_pj__Error); + SWIG_fail; + } + } +%enddef +#else +#ifdef SWIGJAVA +%define %handlePjError + %exception { + try { + $action + } catch (pj::Error &err) { + jclass excep = jenv->FindClass("java/lang/Exception"); + if (excep) { + jenv->ThrowNew(excep, err.info(true).c_str()); + return $null; + } + } + } +%enddef +#else +#ifdef SWIGCSHARP +%define %handlePjError + %exception { + try { + $action + } catch (pj::Error &err) { + SWIG_CSharpSetPendingException(SWIG_CSharpApplicationException, err.info(true).c_str()); + return $null; + } + } +%enddef +#else +#error Unsupported target language +#endif +#endif +#endif Index: pjsip-apps/src/swig/pjsua2.i =================================================================== --- pjsip-apps/src/swig/pjsua2.i (revision 5896) +++ pjsip-apps/src/swig/pjsua2.i (working copy) @@ -26,40 +26,10 @@ } #endif -// Allow C++ exceptions to be handled in Java -#ifdef SWIGJAVA - %typemap(throws, throws="java.lang.Exception") pj::Error { - jclass excep = jenv->FindClass("java/lang/Exception"); - if (excep) - jenv->ThrowNew(excep, $1.info(true).c_str()); - return $null; -} - - // Force the Error Java class to extend java.lang.Exception - %typemap(javabase) pj::Error "java.lang.Exception"; - - %typemap(javacode) pj::Error %{ - - // Override getMessage() - public String getMessage() { - return getTitle(); - } - - // Disable serialization (check ticket #1868) - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - throw new java.io.NotSerializableException("Check ticket #1868!"); - } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException { - throw new java.io.NotSerializableException("Check ticket #1868!"); - } - -%} -#endif - - // Constants from PJSIP libraries %include "symbols.i" +%include "pj_error.i" // // Classes that can be extended in the target language @@ -87,6 +57,9 @@ %ignore fromPj; %ignore toPj; +%handlePjError; +%noallowexception; + // // Now include the API itself. // @@ -100,20 +73,6 @@ %include "pjsua2/siptypes.hpp" -%template(SipHeaderVector) std::vector<pj::SipHeader>; -%template(AuthCredInfoVector) std::vector<pj::AuthCredInfo>; -%template(SrtpCryptoVector) std::vector<pj::SrtpCrypto>; -%template(SipMultipartPartVector) std::vector<pj::SipMultipartPart>; -%template(BuddyVector) std::vector<pj::Buddy*>; -%template(AudioMediaVector) std::vector<pj::AudioMedia*>; -%template(ToneDescVector) std::vector<pj::ToneDesc>; -%template(ToneDigitVector) std::vector<pj::ToneDigit>; -%template(ToneDigitMapVector) std::vector<pj::ToneDigitMapDigit>; -%template(MediaFormatVector) std::vector<pj::MediaFormat*>; -%template(AudioDevInfoVector) std::vector<pj::AudioDevInfo*>; -%template(CodecInfoVector) std::vector<pj::CodecInfo*>; -%template(VideoDevInfoVector) std::vector<pj::VideoDevInfo*>; -%template(CodecFmtpVector) std::vector<pj::CodecFmtp>; %ignore pj::WindowHandle::display; %ignore pj::WindowHandle::window; @@ -170,3 +129,20 @@ %include "pjsua2/endpoint.hpp" +// Uninstall error handler for pj::Error because it is not needed for the following templates +%exception; + +%template(SipHeaderVector) std::vector<pj::SipHeader>; +%template(AuthCredInfoVector) std::vector<pj::AuthCredInfo>; +%template(SrtpCryptoVector) std::vector<pj::SrtpCrypto>; +%template(SipMultipartPartVector) std::vector<pj::SipMultipartPart>; +%template(BuddyVector) std::vector<pj::Buddy*>; +%template(AudioMediaVector) std::vector<pj::AudioMedia*>; +%template(ToneDescVector) std::vector<pj::ToneDesc>; +%template(ToneDigitVector) std::vector<pj::ToneDigit>; +%template(ToneDigitMapVector) std::vector<pj::ToneDigitMapDigit>; +%template(MediaFormatVector) std::vector<pj::MediaFormat*>; +%template(AudioDevInfoVector) std::vector<pj::AudioDevInfo*>; +%template(CodecInfoVector) std::vector<pj::CodecInfo*>; +%template(VideoDevInfoVector) std::vector<pj::VideoDevInfo*>; +%template(CodecFmtpVector) std::vector<pj::CodecFmtp>;
_______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list pjsip@xxxxxxxxxxxxxxx http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org