From 59735f71e70d5cb979920dbeedfa85471f5823df Mon Sep 17 00:00:00 2001 From: Augusto Campos Date: Wed, 18 Dec 2013 11:12:53 +0000 Subject: [PATCH 01/47] Create LICENSE --- LICENSE | 202 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e06d208 --- /dev/null +++ b/LICENSE @@ -0,0 +1,202 @@ +Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + From 35f8414edf154bcbb9b4e5ed88a74f965c0ff7f5 Mon Sep 17 00:00:00 2001 From: 3kthor3adward <3kthor3adward@gmail.com> Date: Sun, 8 Feb 2015 18:45:46 -0600 Subject: [PATCH 02/47] Include ManagerResponse header. --- asterisk-cpp/asteriskcpp/manager/responses/CoreStatusResponse.h | 2 ++ .../asteriskcpp/manager/responses/ExtensionStateResponse.h | 2 ++ asterisk-cpp/asteriskcpp/manager/responses/GetConfigResponse.h | 2 ++ asterisk-cpp/asteriskcpp/manager/responses/GetVarResponse.h | 2 ++ .../asteriskcpp/manager/responses/MailboxCountResponse.h | 2 ++ .../asteriskcpp/manager/responses/MailboxStatusResponse.h | 2 ++ .../asteriskcpp/manager/responses/ModuleCheckResponse.h | 2 ++ asterisk-cpp/asteriskcpp/manager/responses/PingResponse.h | 2 ++ asterisk-cpp/asteriskcpp/manager/responses/SkypeBuddyResponse.h | 2 ++ 9 files changed, 18 insertions(+) diff --git a/asterisk-cpp/asteriskcpp/manager/responses/CoreStatusResponse.h b/asterisk-cpp/asteriskcpp/manager/responses/CoreStatusResponse.h index fbb2bc9..dbd59e6 100644 --- a/asterisk-cpp/asteriskcpp/manager/responses/CoreStatusResponse.h +++ b/asterisk-cpp/asteriskcpp/manager/responses/CoreStatusResponse.h @@ -8,6 +8,8 @@ #ifndef CORESTATUSRESPONSE_H #define CORESTATUSRESPONSE_H +#include "asteriskcpp/manager/responses/ManagerResponse.h" + namespace asteriskcpp { /** diff --git a/asterisk-cpp/asteriskcpp/manager/responses/ExtensionStateResponse.h b/asterisk-cpp/asteriskcpp/manager/responses/ExtensionStateResponse.h index 490f63a..627e173 100644 --- a/asterisk-cpp/asteriskcpp/manager/responses/ExtensionStateResponse.h +++ b/asterisk-cpp/asteriskcpp/manager/responses/ExtensionStateResponse.h @@ -8,6 +8,8 @@ #ifndef EXTENSIONSTATERESPONSE_H #define EXTENSIONSTATERESPONSE_H +#include "asteriskcpp/manager/responses/ManagerResponse.h" + namespace asteriskcpp { /** diff --git a/asterisk-cpp/asteriskcpp/manager/responses/GetConfigResponse.h b/asterisk-cpp/asteriskcpp/manager/responses/GetConfigResponse.h index cb5b709..af5a2ac 100644 --- a/asterisk-cpp/asteriskcpp/manager/responses/GetConfigResponse.h +++ b/asterisk-cpp/asteriskcpp/manager/responses/GetConfigResponse.h @@ -8,6 +8,8 @@ #ifndef GETCONFIGRESPONSE_H #define GETCONFIGRESPONSE_H +#include "asteriskcpp/manager/responses/ManagerResponse.h" + namespace asteriskcpp { /** diff --git a/asterisk-cpp/asteriskcpp/manager/responses/GetVarResponse.h b/asterisk-cpp/asteriskcpp/manager/responses/GetVarResponse.h index 6c329d6..7f31010 100644 --- a/asterisk-cpp/asteriskcpp/manager/responses/GetVarResponse.h +++ b/asterisk-cpp/asteriskcpp/manager/responses/GetVarResponse.h @@ -8,6 +8,8 @@ #ifndef GETVARRESPONSE_H #define GETVARRESPONSE_H +#include "asteriskcpp/manager/responses/ManagerResponse.h" + namespace asteriskcpp { /** diff --git a/asterisk-cpp/asteriskcpp/manager/responses/MailboxCountResponse.h b/asterisk-cpp/asteriskcpp/manager/responses/MailboxCountResponse.h index 1a62abb..607efd8 100644 --- a/asterisk-cpp/asteriskcpp/manager/responses/MailboxCountResponse.h +++ b/asterisk-cpp/asteriskcpp/manager/responses/MailboxCountResponse.h @@ -8,6 +8,8 @@ #ifndef MAILBOXCOUNTRESPONSE_H #define MAILBOXCOUNTRESPONSE_H +#include "asteriskcpp/manager/responses/ManagerResponse.h" + namespace asteriskcpp { /** diff --git a/asterisk-cpp/asteriskcpp/manager/responses/MailboxStatusResponse.h b/asterisk-cpp/asteriskcpp/manager/responses/MailboxStatusResponse.h index 8a5e010..98608b8 100644 --- a/asterisk-cpp/asteriskcpp/manager/responses/MailboxStatusResponse.h +++ b/asterisk-cpp/asteriskcpp/manager/responses/MailboxStatusResponse.h @@ -8,6 +8,8 @@ #ifndef MAILBOXSTATUSRESPONSE_H #define MAILBOXSTATUSRESPONSE_H +#include "asteriskcpp/manager/responses/ManagerResponse.h" + namespace asteriskcpp { /** diff --git a/asterisk-cpp/asteriskcpp/manager/responses/ModuleCheckResponse.h b/asterisk-cpp/asteriskcpp/manager/responses/ModuleCheckResponse.h index 1a3739a..c19fbda 100644 --- a/asterisk-cpp/asteriskcpp/manager/responses/ModuleCheckResponse.h +++ b/asterisk-cpp/asteriskcpp/manager/responses/ModuleCheckResponse.h @@ -8,6 +8,8 @@ #ifndef MODULECHECKRESPONSE_H #define MODULECHECKRESPONSE_H +#include "asteriskcpp/manager/responses/ManagerResponse.h" + namespace asteriskcpp { /** diff --git a/asterisk-cpp/asteriskcpp/manager/responses/PingResponse.h b/asterisk-cpp/asteriskcpp/manager/responses/PingResponse.h index 09ddb1d..96093f3 100644 --- a/asterisk-cpp/asteriskcpp/manager/responses/PingResponse.h +++ b/asterisk-cpp/asteriskcpp/manager/responses/PingResponse.h @@ -8,6 +8,8 @@ #ifndef PINGRESPONSE_H #define PINGRESPONSE_H +#include "asteriskcpp/manager/responses/ManagerResponse.h" + namespace asteriskcpp { /** diff --git a/asterisk-cpp/asteriskcpp/manager/responses/SkypeBuddyResponse.h b/asterisk-cpp/asteriskcpp/manager/responses/SkypeBuddyResponse.h index 53394e2..7a9195c 100644 --- a/asterisk-cpp/asteriskcpp/manager/responses/SkypeBuddyResponse.h +++ b/asterisk-cpp/asteriskcpp/manager/responses/SkypeBuddyResponse.h @@ -8,6 +8,8 @@ #ifndef SKYPEBUDDYRESPONSE_H #define SKYPEBUDDYRESPONSE_H +#include "asteriskcpp/manager/responses/ManagerResponse.h" + namespace asteriskcpp { /** From fba1e589ad2d43cc1b54710c73b71f50d020c9e5 Mon Sep 17 00:00:00 2001 From: 3kthor3adward <3kthor3adward@gmail.com> Date: Sun, 8 Feb 2015 18:46:31 -0600 Subject: [PATCH 03/47] Fix path to LogHandler header. --- asterisk-cpp/src/exceptions/Exception.cpp | 2 +- asterisk-cpp/src/structs/Thread.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/asterisk-cpp/src/exceptions/Exception.cpp b/asterisk-cpp/src/exceptions/Exception.cpp index 8048c76..e057414 100644 --- a/asterisk-cpp/src/exceptions/Exception.cpp +++ b/asterisk-cpp/src/exceptions/Exception.cpp @@ -7,7 +7,7 @@ #include "asteriskcpp/exceptions/ExceptionHandler.h" #include "asteriskcpp/exceptions/Exception.h" -#include "asteriskcpp//utils/LogHandler.h" +#include "asteriskcpp/utils/LogHandler.h" namespace asteriskcpp { Exception::Exception(const std::string& message) { diff --git a/asterisk-cpp/src/structs/Thread.cpp b/asterisk-cpp/src/structs/Thread.cpp index 206a357..1a1401b 100644 --- a/asterisk-cpp/src/structs/Thread.cpp +++ b/asterisk-cpp/src/structs/Thread.cpp @@ -7,7 +7,7 @@ #include "asteriskcpp/structs/Thread.h" #include -#include "asteriskcpp//utils/LogHandler.h" +#include "asteriskcpp/utils/LogHandler.h" namespace asteriskcpp { From d86af2cf1b238eb9546edc40bec05ce5a370b0ed Mon Sep 17 00:00:00 2001 From: 3kthor3adward <3kthor3adward@gmail.com> Date: Sun, 8 Feb 2015 18:48:48 -0600 Subject: [PATCH 04/47] Fix various *Reponse headers paths --- asterisk-cpp/src/manager/responses/ModuleCheckResponse.cpp | 2 +- asterisk-cpp/src/manager/responses/PingResponse.cpp | 2 +- .../src/manager/responses/SkypeLicenseStatusResponse.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/asterisk-cpp/src/manager/responses/ModuleCheckResponse.cpp b/asterisk-cpp/src/manager/responses/ModuleCheckResponse.cpp index 3becc6d..03dcf0f 100644 --- a/asterisk-cpp/src/manager/responses/ModuleCheckResponse.cpp +++ b/asterisk-cpp/src/manager/responses/ModuleCheckResponse.cpp @@ -5,7 +5,7 @@ * Created on July 16, 2013, 2:01 AM */ -#include "ModuleCheckResponse.h" +#include "asteriskcpp/manager/responses/ModuleCheckResponse.h" namespace asteriskcpp { diff --git a/asterisk-cpp/src/manager/responses/PingResponse.cpp b/asterisk-cpp/src/manager/responses/PingResponse.cpp index 34ea3cd..846bef4 100644 --- a/asterisk-cpp/src/manager/responses/PingResponse.cpp +++ b/asterisk-cpp/src/manager/responses/PingResponse.cpp @@ -5,7 +5,7 @@ * Created on July 16, 2013, 2:28 AM */ -#include "PingResponse.h" +#include "asteriskcpp/manager/responses/PingResponse.h" namespace asteriskcpp { diff --git a/asterisk-cpp/src/manager/responses/SkypeLicenseStatusResponse.cpp b/asterisk-cpp/src/manager/responses/SkypeLicenseStatusResponse.cpp index f1e5ded..9e2a06b 100644 --- a/asterisk-cpp/src/manager/responses/SkypeLicenseStatusResponse.cpp +++ b/asterisk-cpp/src/manager/responses/SkypeLicenseStatusResponse.cpp @@ -5,7 +5,7 @@ * Created on July 17, 2013, 1:41 AM */ -#include "SkypeLicenseStatusResponse.h" +#include "asteriskcpp/manager/responses/SkypeLicenseStatusResponse.h" namespace asteriskcpp { From 1bf8e0263e3343ff0277821b394218820e84c4a5 Mon Sep 17 00:00:00 2001 From: 3kthor3adward <3kthor3adward@gmail.com> Date: Sun, 8 Feb 2015 18:49:40 -0600 Subject: [PATCH 05/47] Include loggingmacros header. --- asterisk-cpp/src/utils/LogHandler.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/asterisk-cpp/src/utils/LogHandler.cpp b/asterisk-cpp/src/utils/LogHandler.cpp index 2994792..f7756a4 100644 --- a/asterisk-cpp/src/utils/LogHandler.cpp +++ b/asterisk-cpp/src/utils/LogHandler.cpp @@ -7,6 +7,7 @@ #include #include +#include #include "asteriskcpp/utils/LogHandler.h" From fd9cfbe9637e16b1a1ab1e4d8df32ad2441c1069 Mon Sep 17 00:00:00 2001 From: 3kthor3adward <3kthor3adward@gmail.com> Date: Sun, 8 Feb 2015 18:50:04 -0600 Subject: [PATCH 06/47] Fix build. --- .../asteriskcpp/manager/EventBuilder.h | 2 +- .../manager/responses/SipShowPeerResponse.h | 5 +- .../responses/SkypeLicenseStatusResponse.h | 3 + .../manager/responses/CoreStatusResponse.cpp | 2 +- .../manager/responses/GetConfigResponse.cpp | 6 +- .../src/manager/responses/GetVarResponse.cpp | 4 - .../manager/responses/SipShowPeerResponse.cpp | 125 +++++++++--------- .../manager/responses/SkypeBuddyResponse.cpp | 22 +-- 8 files changed, 86 insertions(+), 83 deletions(-) diff --git a/asterisk-cpp/asteriskcpp/manager/EventBuilder.h b/asterisk-cpp/asteriskcpp/manager/EventBuilder.h index 19ecf13..a1ba404 100644 --- a/asterisk-cpp/asteriskcpp/manager/EventBuilder.h +++ b/asterisk-cpp/asteriskcpp/manager/EventBuilder.h @@ -43,7 +43,7 @@ namespace asteriskcpp { void RegisterClass() { //LOG_TRACE_DATA("REGISTER EVENT CLASS " << C::getEventName()); C tmlEvent(""); - eventFactoryMap.insert(std::make_pair(tmlEvent.getEventName(), new factory())); + eventFactoryMap.insert(std::make_pair(tmlEvent.getEventName(), boost::shared_ptr(new factory()))); } template diff --git a/asterisk-cpp/asteriskcpp/manager/responses/SipShowPeerResponse.h b/asterisk-cpp/asteriskcpp/manager/responses/SipShowPeerResponse.h index 4102697..03808d7 100644 --- a/asterisk-cpp/asteriskcpp/manager/responses/SipShowPeerResponse.h +++ b/asterisk-cpp/asteriskcpp/manager/responses/SipShowPeerResponse.h @@ -8,6 +8,8 @@ #ifndef SIPSHOWPEERRESPONSE_H #define SIPSHOWPEERRESPONSE_H +#include "asteriskcpp/manager/responses/ManagerResponse.h" + namespace asteriskcpp { /** @@ -78,7 +80,8 @@ namespace asteriskcpp { const std::string& getParkingLot() const; const std::string& getRegContact() const; int getQualifyFreq() const; - std::map getChanVariable() const; + //std::map + const std::string getChanVariable() const; private: }; diff --git a/asterisk-cpp/asteriskcpp/manager/responses/SkypeLicenseStatusResponse.h b/asterisk-cpp/asteriskcpp/manager/responses/SkypeLicenseStatusResponse.h index 5c5c9e8..a1c049d 100644 --- a/asterisk-cpp/asteriskcpp/manager/responses/SkypeLicenseStatusResponse.h +++ b/asterisk-cpp/asteriskcpp/manager/responses/SkypeLicenseStatusResponse.h @@ -8,6 +8,8 @@ #ifndef SKYPELICENSESTATUSRESPONSE_H #define SKYPELICENSESTATUSRESPONSE_H +#include "asteriskcpp/manager/responses/ManagerResponse.h" + namespace asteriskcpp { /** @@ -28,6 +30,7 @@ namespace asteriskcpp { */ int getCallsLicensed() const; + int getSkypename() const; private: diff --git a/asterisk-cpp/src/manager/responses/CoreStatusResponse.cpp b/asterisk-cpp/src/manager/responses/CoreStatusResponse.cpp index 4e4d12f..659a79e 100644 --- a/asterisk-cpp/src/manager/responses/CoreStatusResponse.cpp +++ b/asterisk-cpp/src/manager/responses/CoreStatusResponse.cpp @@ -29,7 +29,7 @@ namespace asteriskcpp { return (getGetterValue(__FUNCTION__)); } - long CoreStatusResponse::getCoreReloadDateTimeAsDate() const { + long CoreStatusResponse::getCoreReloadDateTimeAsDate(long timezone) const { return (getGetterValue(__FUNCTION__)); } diff --git a/asterisk-cpp/src/manager/responses/GetConfigResponse.cpp b/asterisk-cpp/src/manager/responses/GetConfigResponse.cpp index 5559db2..7b2fa45 100644 --- a/asterisk-cpp/src/manager/responses/GetConfigResponse.cpp +++ b/asterisk-cpp/src/manager/responses/GetConfigResponse.cpp @@ -17,13 +17,13 @@ namespace asteriskcpp { } const std::map& GetConfigResponse::getCategories() const { - std::map rt = new std::map(); + std::map rt; return rt; } - const std::map& getLines(int categoryNumber) const { - std::map rt = new std::map(); + const std::map& GetConfigResponse::getLines(int categoryNumber) const { + std::map rt; return rt; } diff --git a/asterisk-cpp/src/manager/responses/GetVarResponse.cpp b/asterisk-cpp/src/manager/responses/GetVarResponse.cpp index bb883bd..e88ab2a 100644 --- a/asterisk-cpp/src/manager/responses/GetVarResponse.cpp +++ b/asterisk-cpp/src/manager/responses/GetVarResponse.cpp @@ -8,10 +8,6 @@ #include "asteriskcpp/manager/responses/GetVarResponse.h" namespace asteriskcpp { - - GetVarResponse::GetVarResponse() { - } - GetVarResponse::GetVarResponse(const std::string& responseStr) : ManagerResponse(responseStr) { } diff --git a/asterisk-cpp/src/manager/responses/SipShowPeerResponse.cpp b/asterisk-cpp/src/manager/responses/SipShowPeerResponse.cpp index 6694b90..19a08d0 100644 --- a/asterisk-cpp/src/manager/responses/SipShowPeerResponse.cpp +++ b/asterisk-cpp/src/manager/responses/SipShowPeerResponse.cpp @@ -5,7 +5,7 @@ * Created on July 16, 2013, 5:05 AM */ -#include "SipShowPeerResponse.h" +#include "asteriskcpp/manager/responses/SipShowPeerResponse.h" namespace asteriskcpp { @@ -16,227 +16,228 @@ namespace asteriskcpp { SipShowPeerResponse::~SipShowPeerResponse() { } - const std::string& getChannelType() const { + const std::string& SipShowPeerResponse::getChannelType() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getObjectName() const { + const std::string& SipShowPeerResponse::getObjectName() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getChanObjectType() const { + const std::string& SipShowPeerResponse::getChanObjectType() const { return (getGetterValue(__FUNCTION__)); } - bool getSecretExist() const { - return (getGetterValue(__FUNCTION__)); + bool SipShowPeerResponse::getSecretExist() const { + return (getGetterValue(__FUNCTION__)); } - bool getMd5SecretExist() const { - return (getGetterValue(__FUNCTION__)); + bool SipShowPeerResponse::getMd5SecretExist() const { + return (getGetterValue(__FUNCTION__)); } - bool getRemoteSecretExist() const { - return (getGetterValue(__FUNCTION__)); + bool SipShowPeerResponse::getRemoteSecretExist() const { + return (getGetterValue(__FUNCTION__)); } - const std::string& getContext() const { + const std::string& SipShowPeerResponse::getContext() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getLanguage() const { + const std::string& SipShowPeerResponse::getLanguage() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getAccountCode() const { + const std::string& SipShowPeerResponse::getAccountCode() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getAmaFlags() const { + const std::string& SipShowPeerResponse::getAmaFlags() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getCidCallingPres() const { + const std::string& SipShowPeerResponse::getCidCallingPres() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getSipFromUser() const { + const std::string& SipShowPeerResponse::getSipFromUser() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getSipFromDomain() const { + const std::string& SipShowPeerResponse::getSipFromDomain() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getCallGroup() const { + const std::string& SipShowPeerResponse::getCallGroup() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getPickupGroup() const { + const std::string& SipShowPeerResponse::getPickupGroup() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getVoiceMailbox() const { + const std::string& SipShowPeerResponse::getVoiceMailbox() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getTransferMode() const { + const std::string& SipShowPeerResponse::getTransferMode() const { return (getGetterValue(__FUNCTION__)); } - int getLastMsgsSent() const { + int SipShowPeerResponse::getLastMsgsSent() const { return (getGetterValue(__FUNCTION__)); } - int getCallLimit() const { + int SipShowPeerResponse::getCallLimit() const { return (getGetterValue(__FUNCTION__)); } - int getBusyLevel() const { + int SipShowPeerResponse::getBusyLevel() const { return (getGetterValue(__FUNCTION__)); } - int getMaxCallBr() const { + int SipShowPeerResponse::getMaxCallBr() const { return (getGetterValue(__FUNCTION__)); } - bool getDynamic() const { + bool SipShowPeerResponse::getDynamic() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getCallerId() const { + const std::string& SipShowPeerResponse::getCallerId() const { return (getGetterValue(__FUNCTION__)); } - long getRegExpire() const { + long SipShowPeerResponse::getRegExpire() const { return (getGetterValue(__FUNCTION__)); } - bool getSipAuthInsecure() const { + bool SipShowPeerResponse::getSipAuthInsecure() const { return (getGetterValue(__FUNCTION__)); } - bool getSipNatSupport() const { + bool SipShowPeerResponse::getSipNatSupport() const { return (getGetterValue(__FUNCTION__)); } - bool getAcl() const { + bool SipShowPeerResponse::getAcl() const { return (getGetterValue(__FUNCTION__)); } - bool getSipT38support() const { + bool SipShowPeerResponse::getSipT38support() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getSipT38ec() const { + const std::string& SipShowPeerResponse::getSipT38ec() const { return (getGetterValue(__FUNCTION__)); } - int getSipT38MaxDtgrm() const { + int SipShowPeerResponse::getSipT38MaxDtgrm() const { return (getGetterValue(__FUNCTION__)); } - bool getSipDirectMedia() const { + bool SipShowPeerResponse::getSipDirectMedia() const { return (getGetterValue(__FUNCTION__)); } - bool getSipCanReinvite() const { + bool SipShowPeerResponse::getSipCanReinvite() const { return (getGetterValue(__FUNCTION__)); } - bool getSipPromiscRedir() const { + bool SipShowPeerResponse::getSipPromiscRedir() const { return (getGetterValue(__FUNCTION__)); } - bool getSipUserPhone() const { + bool SipShowPeerResponse::getSipUserPhone() const { return (getGetterValue(__FUNCTION__)); } - bool getSipVideoSupport() const { + bool SipShowPeerResponse::getSipVideoSupport() const { return (getGetterValue(__FUNCTION__)); } - bool getSipTextSupport() const { + bool SipShowPeerResponse::getSipTextSupport() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getSipSessTimers() const { + const std::string& SipShowPeerResponse::getSipSessTimers() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getSipSessRefresh() const { + const std::string& SipShowPeerResponse::getSipSessRefresh() const { return (getGetterValue(__FUNCTION__)); } - int getSipSessExpires() const { + int SipShowPeerResponse::getSipSessExpires() const { return (getGetterValue(__FUNCTION__)); } - int getSipSessMin() const { + int SipShowPeerResponse::getSipSessMin() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getSipDtmfMode() const { + const std::string& SipShowPeerResponse::getSipDtmfMode() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getToHost() const { + const std::string& SipShowPeerResponse::getToHost() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getAddressIp() const { + const std::string& SipShowPeerResponse::getAddressIp() const { return (getGetterValue(__FUNCTION__)); } - int getAddressPort() const { + int SipShowPeerResponse::getAddressPort() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getDefaultAddrIp() const { + const std::string& SipShowPeerResponse::getDefaultAddrIp() const { return (getGetterValue(__FUNCTION__)); } - int getDefaultAddrPort() const { - return (getGetterValue(__FUNCTION__)); + int SipShowPeerResponse::getDefaultAddrPort() const { + return (getGetterValue(__FUNCTION__)); } - const std::string& getDefaultUsername() const { + const std::string& SipShowPeerResponse::getDefaultUsername() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getRegExtension() const { + const std::string& SipShowPeerResponse::getRegExtension() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getCodecs() const { + const std::string& SipShowPeerResponse::getCodecs() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getCodecOrder() const { + const std::string& SipShowPeerResponse::getCodecOrder() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getStatus() const { + const std::string& SipShowPeerResponse::getStatus() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getSipUserAgent() const { + const std::string& SipShowPeerResponse::getSipUserAgent() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getParkingLot() const { + const std::string& SipShowPeerResponse::getParkingLot() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getRegContact() const { + const std::string& SipShowPeerResponse::getRegContact() const { return (getGetterValue(__FUNCTION__)); } - int getQualifyFreq() const { + int SipShowPeerResponse::getQualifyFreq() const { return (getGetterValue(__FUNCTION__)); } - - std::map getChanVariable() const { + + //std::map + const std::string SipShowPeerResponse::getChanVariable() const { return (getGetterValue(__FUNCTION__)); } } \ No newline at end of file diff --git a/asterisk-cpp/src/manager/responses/SkypeBuddyResponse.cpp b/asterisk-cpp/src/manager/responses/SkypeBuddyResponse.cpp index 56ebaf2..e953386 100644 --- a/asterisk-cpp/src/manager/responses/SkypeBuddyResponse.cpp +++ b/asterisk-cpp/src/manager/responses/SkypeBuddyResponse.cpp @@ -5,7 +5,7 @@ * Created on July 17, 2013, 1:29 AM */ -#include "SkypeBuddyResponse.h" +#include "asteriskcpp/manager/responses/SkypeBuddyResponse.h" namespace asteriskcpp { @@ -16,43 +16,43 @@ namespace asteriskcpp { SkypeBuddyResponse::~SkypeBuddyResponse() { } - const std::string& getSkypename() const { + const std::string& SkypeBuddyResponse::getSkypename() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getTimezone() const { + const std::string& SkypeBuddyResponse::getTimezone() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getAvailability() const { + const std::string& SkypeBuddyResponse::getAvailability() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getFullname() const { + const std::string& SkypeBuddyResponse::getFullname() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getLanguage() const { + const std::string& SkypeBuddyResponse::getLanguage() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getCountry() const { + const std::string& SkypeBuddyResponse::getCountry() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getPhoneHome() const { + const std::string& SkypeBuddyResponse::getPhoneHome() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getPhoneOffice() const { + const std::string& SkypeBuddyResponse::getPhoneOffice() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getPhoneMobile() const { + const std::string& SkypeBuddyResponse::getPhoneMobile() const { return (getGetterValue(__FUNCTION__)); } - const std::string& getAbout() const { + const std::string& SkypeBuddyResponse::getAbout() const { return (getGetterValue(__FUNCTION__)); } From 3b5d0ac05a76cc0d65d6e06129f0e5f12baa66a0 Mon Sep 17 00:00:00 2001 From: 3kthor3adward <3kthor3adward@gmail.com> Date: Sun, 8 Feb 2015 19:19:33 -0600 Subject: [PATCH 07/47] Define virtual destructor to avoid 'undefined reference to `vtable for' --- asterisk-cpp/src/manager/actions/BridgeAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ChangeMonitorAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ConfbridgeKickAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ConfbridgeListAction.cpp | 3 +++ .../src/manager/actions/ConfbridgeListRoomsAction.cpp | 4 ++++ asterisk-cpp/src/manager/actions/ConfbridgeLockAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ConfbridgeMuteAction.cpp | 3 +++ .../src/manager/actions/ConfbridgeSetSingleVideoSrcAction.cpp | 3 +++ .../src/manager/actions/ConfbridgeStartRecordAction.cpp | 3 +++ .../src/manager/actions/ConfbridgeStopRecordAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ConfbridgeUnlockAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ConfbridgeUnmuteAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/CoreSettingsAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/CoreShowChannelsAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/CoreStatusAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/DahdiShowChannelsAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/DbDelAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/DbDelTreeAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/DbGetAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/DbPutAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ExtensionStateAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/GetConfigAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/GetVarAction.cpp | 2 ++ asterisk-cpp/src/manager/actions/HangupAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/IaxPeerListAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/JabberSendAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/LocalOptimizeAwayAction.cpp | 4 +++- asterisk-cpp/src/manager/actions/MailboxCountAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/MailboxStatusAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/MeetMeMuteAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/MeetMeUnmuteAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/MixMonitorMuteAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ModuleCheckAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ModuleLoadAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/MonitorAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ParkAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ParkedCallsAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/PauseMixMonitorAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/PauseMonitorAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/PingAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/PlayDtmfAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/QueueAddAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/QueueLogAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/QueuePauseAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/QueuePenaltyAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/QueueRemoveAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/QueueResetAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/QueueStatusAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/QueueSummaryAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/RedirectAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/SendTextAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/SetCdrUserFieldAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/SetVarAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ShowDialplanAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/SipPeersAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/SipShowPeerAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/SipShowRegistryAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/SkypeAddBuddyAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/SkypeBuddiesAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/SkypeBuddyAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/SkypeChatSendAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/SkypeLicenseListAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/SkypeLicenseStatusAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/SkypeRemoveBuddyAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/StatusAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/StopMonitorAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/UnpauseMonitorAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/UserEventAction.cpp | 2 ++ asterisk-cpp/src/manager/actions/VoicemailUsersListAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ZapDialOffhookAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ZapDndOffAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ZapDndOnAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ZapHangupAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ZapRestartAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ZapShowChannelsAction.cpp | 3 +++ asterisk-cpp/src/manager/actions/ZapTransferAction.cpp | 3 +++ 76 files changed, 227 insertions(+), 1 deletion(-) diff --git a/asterisk-cpp/src/manager/actions/BridgeAction.cpp b/asterisk-cpp/src/manager/actions/BridgeAction.cpp index 6c6c8b1..9c3a401 100644 --- a/asterisk-cpp/src/manager/actions/BridgeAction.cpp +++ b/asterisk-cpp/src/manager/actions/BridgeAction.cpp @@ -14,6 +14,9 @@ namespace asteriskcpp { */ BridgeAction::BridgeAction() { } + + BridgeAction::~BridgeAction() { + } /** * Creates a new BridgeAction that bridges the two given channels. diff --git a/asterisk-cpp/src/manager/actions/ChangeMonitorAction.cpp b/asterisk-cpp/src/manager/actions/ChangeMonitorAction.cpp index c8e3d01..18ac1f2 100644 --- a/asterisk-cpp/src/manager/actions/ChangeMonitorAction.cpp +++ b/asterisk-cpp/src/manager/actions/ChangeMonitorAction.cpp @@ -14,6 +14,9 @@ namespace asteriskcpp { */ ChangeMonitorAction::ChangeMonitorAction() { } + + ChangeMonitorAction::~ChangeMonitorAction() { + } /** * Creates a new ChangeMonitorAction that causes monitoring data for the diff --git a/asterisk-cpp/src/manager/actions/ConfbridgeKickAction.cpp b/asterisk-cpp/src/manager/actions/ConfbridgeKickAction.cpp index e4afc2f..e49e4ec 100644 --- a/asterisk-cpp/src/manager/actions/ConfbridgeKickAction.cpp +++ b/asterisk-cpp/src/manager/actions/ConfbridgeKickAction.cpp @@ -14,6 +14,9 @@ namespace asteriskcpp { */ ConfbridgeKickAction::ConfbridgeKickAction() { } + + ConfbridgeKickAction::~ConfbridgeKickAction() { + } /** * Creates a new ConfbridgeKickAction. diff --git a/asterisk-cpp/src/manager/actions/ConfbridgeListAction.cpp b/asterisk-cpp/src/manager/actions/ConfbridgeListAction.cpp index 8b6bffb..bda2441 100644 --- a/asterisk-cpp/src/manager/actions/ConfbridgeListAction.cpp +++ b/asterisk-cpp/src/manager/actions/ConfbridgeListAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { ConfbridgeListAction::ConfbridgeListAction() { } + + ConfbridgeListAction::~ConfbridgeListAction() { + } ConfbridgeListAction::ConfbridgeListAction(const std::string& conference) { this->setConference(conference); diff --git a/asterisk-cpp/src/manager/actions/ConfbridgeListRoomsAction.cpp b/asterisk-cpp/src/manager/actions/ConfbridgeListRoomsAction.cpp index 3fd272a..456ffdc 100644 --- a/asterisk-cpp/src/manager/actions/ConfbridgeListRoomsAction.cpp +++ b/asterisk-cpp/src/manager/actions/ConfbridgeListRoomsAction.cpp @@ -8,6 +8,10 @@ #include "asteriskcpp/manager/actions/ConfbridgeListRoomsAction.h" namespace asteriskcpp { + + ConfbridgeListRoomsAction::~ConfbridgeListRoomsAction(){ + + } } //NAMESPACE diff --git a/asterisk-cpp/src/manager/actions/ConfbridgeLockAction.cpp b/asterisk-cpp/src/manager/actions/ConfbridgeLockAction.cpp index 75eb2f8..1a65efe 100644 --- a/asterisk-cpp/src/manager/actions/ConfbridgeLockAction.cpp +++ b/asterisk-cpp/src/manager/actions/ConfbridgeLockAction.cpp @@ -14,6 +14,9 @@ namespace asteriskcpp { */ ConfbridgeLockAction::ConfbridgeLockAction() { } + + ConfbridgeLockAction::~ConfbridgeLockAction() { + } /** * Creates a new ConfbridgeLockAction for a specific conference. diff --git a/asterisk-cpp/src/manager/actions/ConfbridgeMuteAction.cpp b/asterisk-cpp/src/manager/actions/ConfbridgeMuteAction.cpp index 5ac65fe..198d477 100644 --- a/asterisk-cpp/src/manager/actions/ConfbridgeMuteAction.cpp +++ b/asterisk-cpp/src/manager/actions/ConfbridgeMuteAction.cpp @@ -14,6 +14,9 @@ namespace asteriskcpp { */ ConfbridgeMuteAction::ConfbridgeMuteAction() { } + + ConfbridgeMuteAction::~ConfbridgeMuteAction() { + } /** * Creates a new ConfbridgeMuteAction. diff --git a/asterisk-cpp/src/manager/actions/ConfbridgeSetSingleVideoSrcAction.cpp b/asterisk-cpp/src/manager/actions/ConfbridgeSetSingleVideoSrcAction.cpp index c334693..8c59fe6 100644 --- a/asterisk-cpp/src/manager/actions/ConfbridgeSetSingleVideoSrcAction.cpp +++ b/asterisk-cpp/src/manager/actions/ConfbridgeSetSingleVideoSrcAction.cpp @@ -14,6 +14,9 @@ namespace asteriskcpp { */ ConfbridgeSetSingleVideoSrcAction::ConfbridgeSetSingleVideoSrcAction() { } + + ConfbridgeSetSingleVideoSrcAction::~ConfbridgeSetSingleVideoSrcAction() { + } /** * Sets the id of the conference for which the video source is to be set. diff --git a/asterisk-cpp/src/manager/actions/ConfbridgeStartRecordAction.cpp b/asterisk-cpp/src/manager/actions/ConfbridgeStartRecordAction.cpp index e36fa15..6519896 100644 --- a/asterisk-cpp/src/manager/actions/ConfbridgeStartRecordAction.cpp +++ b/asterisk-cpp/src/manager/actions/ConfbridgeStartRecordAction.cpp @@ -15,6 +15,9 @@ namespace asteriskcpp { ConfbridgeStartRecordAction::ConfbridgeStartRecordAction() { } + ConfbridgeStartRecordAction::~ConfbridgeStartRecordAction() { + } + /** * Creates a new ConfbridgeStartRecordAction for a specific conference. */ diff --git a/asterisk-cpp/src/manager/actions/ConfbridgeStopRecordAction.cpp b/asterisk-cpp/src/manager/actions/ConfbridgeStopRecordAction.cpp index 7459519..554fe63 100644 --- a/asterisk-cpp/src/manager/actions/ConfbridgeStopRecordAction.cpp +++ b/asterisk-cpp/src/manager/actions/ConfbridgeStopRecordAction.cpp @@ -14,6 +14,9 @@ namespace asteriskcpp { */ ConfbridgeStopRecordAction::ConfbridgeStopRecordAction() { } + + ConfbridgeStopRecordAction::~ConfbridgeStopRecordAction() { + } /** * Creates a new ConfbridgeStopRecordAction for a specific conference. diff --git a/asterisk-cpp/src/manager/actions/ConfbridgeUnlockAction.cpp b/asterisk-cpp/src/manager/actions/ConfbridgeUnlockAction.cpp index 63987fa..0fecb18 100644 --- a/asterisk-cpp/src/manager/actions/ConfbridgeUnlockAction.cpp +++ b/asterisk-cpp/src/manager/actions/ConfbridgeUnlockAction.cpp @@ -14,6 +14,9 @@ namespace asteriskcpp { */ ConfbridgeUnlockAction::ConfbridgeUnlockAction() { } + + ConfbridgeUnlockAction::~ConfbridgeUnlockAction() { + } /** * Creates a new ConfbridgeUnlockAction for a specific conference. diff --git a/asterisk-cpp/src/manager/actions/ConfbridgeUnmuteAction.cpp b/asterisk-cpp/src/manager/actions/ConfbridgeUnmuteAction.cpp index 89ded46..0c57f61 100644 --- a/asterisk-cpp/src/manager/actions/ConfbridgeUnmuteAction.cpp +++ b/asterisk-cpp/src/manager/actions/ConfbridgeUnmuteAction.cpp @@ -14,6 +14,9 @@ namespace asteriskcpp { */ ConfbridgeUnmuteAction::ConfbridgeUnmuteAction() { } + + ConfbridgeUnmuteAction::~ConfbridgeUnmuteAction() { + } /** * Creates a new ConfbridgeUnmuteAction. diff --git a/asterisk-cpp/src/manager/actions/CoreSettingsAction.cpp b/asterisk-cpp/src/manager/actions/CoreSettingsAction.cpp index 1a9e1a6..9b5f89d 100644 --- a/asterisk-cpp/src/manager/actions/CoreSettingsAction.cpp +++ b/asterisk-cpp/src/manager/actions/CoreSettingsAction.cpp @@ -16,6 +16,9 @@ namespace asteriskcpp { CoreSettingsAction::CoreSettingsAction() { } + CoreSettingsAction::~CoreSettingsAction() { + } + ManagerResponse *CoreSettingsAction::expectedResponce(const std::string & response) { return (new CoreSettingsResponse(response)); diff --git a/asterisk-cpp/src/manager/actions/CoreShowChannelsAction.cpp b/asterisk-cpp/src/manager/actions/CoreShowChannelsAction.cpp index e986d60..9921db3 100644 --- a/asterisk-cpp/src/manager/actions/CoreShowChannelsAction.cpp +++ b/asterisk-cpp/src/manager/actions/CoreShowChannelsAction.cpp @@ -11,5 +11,8 @@ namespace asteriskcpp { CoreShowChannelsAction::CoreShowChannelsAction() { } + + CoreShowChannelsAction::~CoreShowChannelsAction() { + } } //NAMESPACE diff --git a/asterisk-cpp/src/manager/actions/CoreStatusAction.cpp b/asterisk-cpp/src/manager/actions/CoreStatusAction.cpp index 8224a99..60eb6ee 100644 --- a/asterisk-cpp/src/manager/actions/CoreStatusAction.cpp +++ b/asterisk-cpp/src/manager/actions/CoreStatusAction.cpp @@ -15,6 +15,9 @@ namespace asteriskcpp { */ CoreStatusAction::CoreStatusAction() { } + + CoreStatusAction::~CoreStatusAction() { + } ManagerResponse* CoreStatusAction::expectedResponce(const std::string & response) { return (new CoreStatusResponse(response)); diff --git a/asterisk-cpp/src/manager/actions/DahdiShowChannelsAction.cpp b/asterisk-cpp/src/manager/actions/DahdiShowChannelsAction.cpp index 925ee68..66b953f 100644 --- a/asterisk-cpp/src/manager/actions/DahdiShowChannelsAction.cpp +++ b/asterisk-cpp/src/manager/actions/DahdiShowChannelsAction.cpp @@ -14,5 +14,8 @@ namespace asteriskcpp { */ DahdiShowChannelsAction::DahdiShowChannelsAction() { } + + DahdiShowChannelsAction::~DahdiShowChannelsAction() { + } } //NAMESPACE diff --git a/asterisk-cpp/src/manager/actions/DbDelAction.cpp b/asterisk-cpp/src/manager/actions/DbDelAction.cpp index 8b80161..5f564f3 100644 --- a/asterisk-cpp/src/manager/actions/DbDelAction.cpp +++ b/asterisk-cpp/src/manager/actions/DbDelAction.cpp @@ -14,6 +14,9 @@ namespace asteriskcpp { */ DbDelAction::DbDelAction() { } + + DbDelAction::~DbDelAction() { + } /** * Creates a new DbDelAction that deletes the value of the database diff --git a/asterisk-cpp/src/manager/actions/DbDelTreeAction.cpp b/asterisk-cpp/src/manager/actions/DbDelTreeAction.cpp index 9ba54ad..df8dfa0 100644 --- a/asterisk-cpp/src/manager/actions/DbDelTreeAction.cpp +++ b/asterisk-cpp/src/manager/actions/DbDelTreeAction.cpp @@ -15,6 +15,9 @@ namespace asteriskcpp { DbDelTreeAction::DbDelTreeAction() { } + DbDelTreeAction::~DbDelTreeAction() { + } + /** * Creates a new DbDelTreeAction. * diff --git a/asterisk-cpp/src/manager/actions/DbGetAction.cpp b/asterisk-cpp/src/manager/actions/DbGetAction.cpp index 901c436..f1554b2 100644 --- a/asterisk-cpp/src/manager/actions/DbGetAction.cpp +++ b/asterisk-cpp/src/manager/actions/DbGetAction.cpp @@ -14,6 +14,9 @@ namespace asteriskcpp { */ DbGetAction::DbGetAction() { } + + DbGetAction::~DbGetAction() { + } /** * Creates a new DbGetAction that retrieves the value of the database entry diff --git a/asterisk-cpp/src/manager/actions/DbPutAction.cpp b/asterisk-cpp/src/manager/actions/DbPutAction.cpp index 84bca11..47b3cbe 100644 --- a/asterisk-cpp/src/manager/actions/DbPutAction.cpp +++ b/asterisk-cpp/src/manager/actions/DbPutAction.cpp @@ -14,6 +14,9 @@ namespace asteriskcpp { */ DbPutAction::DbPutAction() { } + + DbPutAction::~DbPutAction() { + } /** * Creates a new DbPutAction that sets the value of the database entry with diff --git a/asterisk-cpp/src/manager/actions/ExtensionStateAction.cpp b/asterisk-cpp/src/manager/actions/ExtensionStateAction.cpp index 66bd392..bb19d3c 100644 --- a/asterisk-cpp/src/manager/actions/ExtensionStateAction.cpp +++ b/asterisk-cpp/src/manager/actions/ExtensionStateAction.cpp @@ -16,6 +16,9 @@ namespace asteriskcpp { ExtensionStateAction::ExtensionStateAction() { } + ExtensionStateAction::~ExtensionStateAction() { + } + ManagerResponse* ExtensionStateAction::expectedResponce(const std::string & response) { return (new ExtensionStateResponse(response)); } diff --git a/asterisk-cpp/src/manager/actions/GetConfigAction.cpp b/asterisk-cpp/src/manager/actions/GetConfigAction.cpp index 938e3f7..9ef1895 100644 --- a/asterisk-cpp/src/manager/actions/GetConfigAction.cpp +++ b/asterisk-cpp/src/manager/actions/GetConfigAction.cpp @@ -15,6 +15,9 @@ namespace asteriskcpp { */ GetConfigAction::GetConfigAction() { } + + GetConfigAction::~GetConfigAction() { + } ManagerResponse* GetConfigAction::expectedResponce(const std::string & response) { return (new GetConfigResponse(response)); diff --git a/asterisk-cpp/src/manager/actions/GetVarAction.cpp b/asterisk-cpp/src/manager/actions/GetVarAction.cpp index ab7b310..1575c93 100644 --- a/asterisk-cpp/src/manager/actions/GetVarAction.cpp +++ b/asterisk-cpp/src/manager/actions/GetVarAction.cpp @@ -16,6 +16,8 @@ namespace asteriskcpp { GetVarAction::GetVarAction() { } + GetVarAction::~GetVarAction() { + } GetVarAction::GetVarAction(const std::string& variable) { this->setVariable(variable); diff --git a/asterisk-cpp/src/manager/actions/HangupAction.cpp b/asterisk-cpp/src/manager/actions/HangupAction.cpp index 6d32bee..46ac4d8 100644 --- a/asterisk-cpp/src/manager/actions/HangupAction.cpp +++ b/asterisk-cpp/src/manager/actions/HangupAction.cpp @@ -12,6 +12,9 @@ namespace asteriskcpp { HangupAction::HangupAction() { } + HangupAction::~HangupAction() { + } + HangupAction::HangupAction(const std::string& channel) { this->setChannel(channel); } diff --git a/asterisk-cpp/src/manager/actions/IaxPeerListAction.cpp b/asterisk-cpp/src/manager/actions/IaxPeerListAction.cpp index 7df47c5..4b72b4e 100644 --- a/asterisk-cpp/src/manager/actions/IaxPeerListAction.cpp +++ b/asterisk-cpp/src/manager/actions/IaxPeerListAction.cpp @@ -11,5 +11,8 @@ namespace asteriskcpp { IaxPeerListAction::IaxPeerListAction() { } + + IaxPeerListAction::~IaxPeerListAction() { + } } //NAMESPACE diff --git a/asterisk-cpp/src/manager/actions/JabberSendAction.cpp b/asterisk-cpp/src/manager/actions/JabberSendAction.cpp index df8ce3f..b0cec81 100644 --- a/asterisk-cpp/src/manager/actions/JabberSendAction.cpp +++ b/asterisk-cpp/src/manager/actions/JabberSendAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { JabberSendAction::JabberSendAction() { } + + JabberSendAction::~JabberSendAction() { + } JabberSendAction::JabberSendAction(const std::string& message) { this->setMessage(message); diff --git a/asterisk-cpp/src/manager/actions/LocalOptimizeAwayAction.cpp b/asterisk-cpp/src/manager/actions/LocalOptimizeAwayAction.cpp index 8596783..613cbce 100644 --- a/asterisk-cpp/src/manager/actions/LocalOptimizeAwayAction.cpp +++ b/asterisk-cpp/src/manager/actions/LocalOptimizeAwayAction.cpp @@ -13,7 +13,9 @@ namespace asteriskcpp { LocalOptimizeAwayAction::LocalOptimizeAwayAction() { } - + LocalOptimizeAwayAction::~LocalOptimizeAwayAction() { + } + LocalOptimizeAwayAction::LocalOptimizeAwayAction(const std::string& channel) { this->setChannel(channel); } diff --git a/asterisk-cpp/src/manager/actions/MailboxCountAction.cpp b/asterisk-cpp/src/manager/actions/MailboxCountAction.cpp index 8f1fe81..788cc60 100644 --- a/asterisk-cpp/src/manager/actions/MailboxCountAction.cpp +++ b/asterisk-cpp/src/manager/actions/MailboxCountAction.cpp @@ -12,6 +12,9 @@ namespace asteriskcpp { MailboxCountAction::MailboxCountAction() { } + + MailboxCountAction::~MailboxCountAction() { + } MailboxCountAction::MailboxCountAction(const std::string& mailbox) { this->setMailbox(mailbox); diff --git a/asterisk-cpp/src/manager/actions/MailboxStatusAction.cpp b/asterisk-cpp/src/manager/actions/MailboxStatusAction.cpp index cf100db..4856c6e 100644 --- a/asterisk-cpp/src/manager/actions/MailboxStatusAction.cpp +++ b/asterisk-cpp/src/manager/actions/MailboxStatusAction.cpp @@ -12,6 +12,9 @@ namespace asteriskcpp { MailboxStatusAction::MailboxStatusAction() { } + + MailboxStatusAction::~MailboxStatusAction() { + } MailboxStatusAction::MailboxStatusAction(const std::string& mailbox) { this->setMailbox(mailbox); diff --git a/asterisk-cpp/src/manager/actions/MeetMeMuteAction.cpp b/asterisk-cpp/src/manager/actions/MeetMeMuteAction.cpp index 30c9321..a1c565f 100644 --- a/asterisk-cpp/src/manager/actions/MeetMeMuteAction.cpp +++ b/asterisk-cpp/src/manager/actions/MeetMeMuteAction.cpp @@ -14,6 +14,9 @@ namespace asteriskcpp { */ MeetMeMuteAction::MeetMeMuteAction() { } + + MeetMeMuteAction::~MeetMeMuteAction() { + } /** * Creates a new MeetMeMuteAction. diff --git a/asterisk-cpp/src/manager/actions/MeetMeUnmuteAction.cpp b/asterisk-cpp/src/manager/actions/MeetMeUnmuteAction.cpp index 9f66473..e9f5dc5 100644 --- a/asterisk-cpp/src/manager/actions/MeetMeUnmuteAction.cpp +++ b/asterisk-cpp/src/manager/actions/MeetMeUnmuteAction.cpp @@ -14,6 +14,9 @@ namespace asteriskcpp { */ MeetMeUnmuteAction::MeetMeUnmuteAction() { } + + MeetMeUnmuteAction::~MeetMeUnmuteAction() { + } /** * Creates a new MeetMeUnmuteAction. diff --git a/asterisk-cpp/src/manager/actions/MixMonitorMuteAction.cpp b/asterisk-cpp/src/manager/actions/MixMonitorMuteAction.cpp index 3512aab..478d8ba 100644 --- a/asterisk-cpp/src/manager/actions/MixMonitorMuteAction.cpp +++ b/asterisk-cpp/src/manager/actions/MixMonitorMuteAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { MixMonitorMuteAction::MixMonitorMuteAction() { } + + MixMonitorMuteAction::~MixMonitorMuteAction() { + } MixMonitorMuteAction::MixMonitorMuteAction(const std::string& channel) { this->setChannel(channel); diff --git a/asterisk-cpp/src/manager/actions/ModuleCheckAction.cpp b/asterisk-cpp/src/manager/actions/ModuleCheckAction.cpp index 82ac743..3596242 100644 --- a/asterisk-cpp/src/manager/actions/ModuleCheckAction.cpp +++ b/asterisk-cpp/src/manager/actions/ModuleCheckAction.cpp @@ -15,6 +15,9 @@ namespace asteriskcpp { */ ModuleCheckAction::ModuleCheckAction() { } + + ModuleCheckAction::~ModuleCheckAction() { + } ManagerResponse* ModuleCheckAction::expectedResponce(const std::string & response) { return (new ModuleCheckResponse(response)); diff --git a/asterisk-cpp/src/manager/actions/ModuleLoadAction.cpp b/asterisk-cpp/src/manager/actions/ModuleLoadAction.cpp index 465fc43..5ce1115 100644 --- a/asterisk-cpp/src/manager/actions/ModuleLoadAction.cpp +++ b/asterisk-cpp/src/manager/actions/ModuleLoadAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { ModuleLoadAction::ModuleLoadAction() { } + + ModuleLoadAction::~ModuleLoadAction() { + } ModuleLoadAction::ModuleLoadAction(const std::string& loadType) { this->setLoadType(loadType); diff --git a/asterisk-cpp/src/manager/actions/MonitorAction.cpp b/asterisk-cpp/src/manager/actions/MonitorAction.cpp index 86da905..9ef84ed 100644 --- a/asterisk-cpp/src/manager/actions/MonitorAction.cpp +++ b/asterisk-cpp/src/manager/actions/MonitorAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { MonitorAction::MonitorAction() { } + + MonitorAction::~MonitorAction() { + } MonitorAction::MonitorAction(const std::string& channel, const std::string& file) { this->setChannel(channel); diff --git a/asterisk-cpp/src/manager/actions/ParkAction.cpp b/asterisk-cpp/src/manager/actions/ParkAction.cpp index e60c0d9..1207fa6 100644 --- a/asterisk-cpp/src/manager/actions/ParkAction.cpp +++ b/asterisk-cpp/src/manager/actions/ParkAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { ParkAction::ParkAction() { } + + ParkAction::~ParkAction() { + } ParkAction::ParkAction(const std::string& channel2) { this->setChannel2(channel2); diff --git a/asterisk-cpp/src/manager/actions/ParkedCallsAction.cpp b/asterisk-cpp/src/manager/actions/ParkedCallsAction.cpp index d012529..8ac5056 100644 --- a/asterisk-cpp/src/manager/actions/ParkedCallsAction.cpp +++ b/asterisk-cpp/src/manager/actions/ParkedCallsAction.cpp @@ -14,5 +14,8 @@ namespace asteriskcpp { */ ParkedCallsAction::ParkedCallsAction() { } + + ParkedCallsAction::~ParkedCallsAction() { + } } //NAMESPACE diff --git a/asterisk-cpp/src/manager/actions/PauseMixMonitorAction.cpp b/asterisk-cpp/src/manager/actions/PauseMixMonitorAction.cpp index d42279f..36215fb 100644 --- a/asterisk-cpp/src/manager/actions/PauseMixMonitorAction.cpp +++ b/asterisk-cpp/src/manager/actions/PauseMixMonitorAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { PauseMixMonitorAction::PauseMixMonitorAction() { } + + PauseMixMonitorAction::~PauseMixMonitorAction() { + } PauseMixMonitorAction::PauseMixMonitorAction(const std::string& direction, int state) { this->setDirection(direction); diff --git a/asterisk-cpp/src/manager/actions/PauseMonitorAction.cpp b/asterisk-cpp/src/manager/actions/PauseMonitorAction.cpp index 87bdb44..747557e 100644 --- a/asterisk-cpp/src/manager/actions/PauseMonitorAction.cpp +++ b/asterisk-cpp/src/manager/actions/PauseMonitorAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { PauseMonitorAction::PauseMonitorAction() { } + + PauseMonitorAction::~PauseMonitorAction() { + } PauseMonitorAction::PauseMonitorAction(const std::string& channel) { this->setChannel(channel); diff --git a/asterisk-cpp/src/manager/actions/PingAction.cpp b/asterisk-cpp/src/manager/actions/PingAction.cpp index 9e9be5b..8a37a56 100644 --- a/asterisk-cpp/src/manager/actions/PingAction.cpp +++ b/asterisk-cpp/src/manager/actions/PingAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { PingAction::PingAction() { } + + PingAction::~PingAction() { + } ManagerResponse* PingAction::expectedResponce(const std::string & response) { return (new PingResponse(response)); diff --git a/asterisk-cpp/src/manager/actions/PlayDtmfAction.cpp b/asterisk-cpp/src/manager/actions/PlayDtmfAction.cpp index 3db5cef..3a21b23 100644 --- a/asterisk-cpp/src/manager/actions/PlayDtmfAction.cpp +++ b/asterisk-cpp/src/manager/actions/PlayDtmfAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { PlayDtmfAction::PlayDtmfAction() { } + + PlayDtmfAction::~PlayDtmfAction() { + } PlayDtmfAction::PlayDtmfAction(const std::string& digit) { this->setDigit(digit); diff --git a/asterisk-cpp/src/manager/actions/QueueAddAction.cpp b/asterisk-cpp/src/manager/actions/QueueAddAction.cpp index 65698d6..8d567c6 100644 --- a/asterisk-cpp/src/manager/actions/QueueAddAction.cpp +++ b/asterisk-cpp/src/manager/actions/QueueAddAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { QueueAddAction::QueueAddAction() { } + + QueueAddAction::~QueueAddAction() { + } QueueAddAction::QueueAddAction(const std::string& iface) { this->setInterface(iface); diff --git a/asterisk-cpp/src/manager/actions/QueueLogAction.cpp b/asterisk-cpp/src/manager/actions/QueueLogAction.cpp index 356ac21..4f3fdda 100644 --- a/asterisk-cpp/src/manager/actions/QueueLogAction.cpp +++ b/asterisk-cpp/src/manager/actions/QueueLogAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { QueueLogAction::QueueLogAction() { } + + QueueLogAction::~QueueLogAction() { + } QueueLogAction::QueueLogAction(const std::string& queue, const std::string& event) { this->setQueue(queue); diff --git a/asterisk-cpp/src/manager/actions/QueuePauseAction.cpp b/asterisk-cpp/src/manager/actions/QueuePauseAction.cpp index 63fa7b3..5af675b 100644 --- a/asterisk-cpp/src/manager/actions/QueuePauseAction.cpp +++ b/asterisk-cpp/src/manager/actions/QueuePauseAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { QueuePauseAction::QueuePauseAction() { } + + QueuePauseAction::~QueuePauseAction() { + } QueuePauseAction::QueuePauseAction(const std::string& iface) { this->setInterface(iface); diff --git a/asterisk-cpp/src/manager/actions/QueuePenaltyAction.cpp b/asterisk-cpp/src/manager/actions/QueuePenaltyAction.cpp index 7bf57e1..535b61d 100644 --- a/asterisk-cpp/src/manager/actions/QueuePenaltyAction.cpp +++ b/asterisk-cpp/src/manager/actions/QueuePenaltyAction.cpp @@ -12,6 +12,9 @@ namespace asteriskcpp { QueuePenaltyAction::QueuePenaltyAction() { } + QueuePenaltyAction::~QueuePenaltyAction() { + } + QueuePenaltyAction::QueuePenaltyAction(int penalty, const std::string& iface) { this->setPenalty(penalty); this->setInterface(iface); diff --git a/asterisk-cpp/src/manager/actions/QueueRemoveAction.cpp b/asterisk-cpp/src/manager/actions/QueueRemoveAction.cpp index 0f6e3f1..d79ae68 100644 --- a/asterisk-cpp/src/manager/actions/QueueRemoveAction.cpp +++ b/asterisk-cpp/src/manager/actions/QueueRemoveAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { QueueRemoveAction::QueueRemoveAction() { } + + QueueRemoveAction::~QueueRemoveAction() { + } QueueRemoveAction::QueueRemoveAction(const std::string& queue, const std::string& iface) { this->setQueue(queue); diff --git a/asterisk-cpp/src/manager/actions/QueueResetAction.cpp b/asterisk-cpp/src/manager/actions/QueueResetAction.cpp index 7b9fc3e..c277673 100644 --- a/asterisk-cpp/src/manager/actions/QueueResetAction.cpp +++ b/asterisk-cpp/src/manager/actions/QueueResetAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { QueueResetAction::QueueResetAction() { } + + QueueResetAction::~QueueResetAction() { + } QueueResetAction::QueueResetAction(const std::string& queue) { this->setQueue(queue); diff --git a/asterisk-cpp/src/manager/actions/QueueStatusAction.cpp b/asterisk-cpp/src/manager/actions/QueueStatusAction.cpp index 6ce5ca5..859eeed 100644 --- a/asterisk-cpp/src/manager/actions/QueueStatusAction.cpp +++ b/asterisk-cpp/src/manager/actions/QueueStatusAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { QueueStatusAction::QueueStatusAction() { } + + QueueStatusAction::~QueueStatusAction() { + } const std::string& QueueStatusAction::getQueue() const { return (getGetterValue(__FUNCTION__)); diff --git a/asterisk-cpp/src/manager/actions/QueueSummaryAction.cpp b/asterisk-cpp/src/manager/actions/QueueSummaryAction.cpp index 1688c99..c12971a 100644 --- a/asterisk-cpp/src/manager/actions/QueueSummaryAction.cpp +++ b/asterisk-cpp/src/manager/actions/QueueSummaryAction.cpp @@ -12,6 +12,9 @@ namespace asteriskcpp { QueueSummaryAction::QueueSummaryAction() { } + QueueSummaryAction::~QueueSummaryAction() { + } + QueueSummaryAction::QueueSummaryAction(const std::string& queue) { this->setQueue(queue); } diff --git a/asterisk-cpp/src/manager/actions/RedirectAction.cpp b/asterisk-cpp/src/manager/actions/RedirectAction.cpp index 8265b56..bfd6d52 100644 --- a/asterisk-cpp/src/manager/actions/RedirectAction.cpp +++ b/asterisk-cpp/src/manager/actions/RedirectAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { RedirectAction::RedirectAction() { } + + RedirectAction::~RedirectAction() { + } RedirectAction::RedirectAction(const std::string& channel, const std::string& context, const std::string& exten, int priority) { this->setChannel(channel); diff --git a/asterisk-cpp/src/manager/actions/SendTextAction.cpp b/asterisk-cpp/src/manager/actions/SendTextAction.cpp index 23c30f0..c8ff20b 100644 --- a/asterisk-cpp/src/manager/actions/SendTextAction.cpp +++ b/asterisk-cpp/src/manager/actions/SendTextAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { SendTextAction::SendTextAction() { } + + SendTextAction::~SendTextAction() { + } SendTextAction::SendTextAction(const std::string& channel, const std::string& message) { this->setChannel(channel); diff --git a/asterisk-cpp/src/manager/actions/SetCdrUserFieldAction.cpp b/asterisk-cpp/src/manager/actions/SetCdrUserFieldAction.cpp index 2eb4ec2..e391fff 100644 --- a/asterisk-cpp/src/manager/actions/SetCdrUserFieldAction.cpp +++ b/asterisk-cpp/src/manager/actions/SetCdrUserFieldAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { SetCdrUserFieldAction::SetCdrUserFieldAction() { } + + SetCdrUserFieldAction::~SetCdrUserFieldAction() { + } SetCdrUserFieldAction::SetCdrUserFieldAction(const std::string& channel, const std::string& userField) { this->setChannel(channel); diff --git a/asterisk-cpp/src/manager/actions/SetVarAction.cpp b/asterisk-cpp/src/manager/actions/SetVarAction.cpp index cd99ea4..fc02dd5 100644 --- a/asterisk-cpp/src/manager/actions/SetVarAction.cpp +++ b/asterisk-cpp/src/manager/actions/SetVarAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { SetVarAction::SetVarAction() { } + + SetVarAction::~SetVarAction() { + } SetVarAction::SetVarAction(const std::string& variable, const std::string& value) { this->setVariable(variable); diff --git a/asterisk-cpp/src/manager/actions/ShowDialplanAction.cpp b/asterisk-cpp/src/manager/actions/ShowDialplanAction.cpp index 956357a..8b32d6b 100644 --- a/asterisk-cpp/src/manager/actions/ShowDialplanAction.cpp +++ b/asterisk-cpp/src/manager/actions/ShowDialplanAction.cpp @@ -11,5 +11,8 @@ namespace asteriskcpp { ShowDialplanAction::ShowDialplanAction() { } + + ShowDialplanAction::~ShowDialplanAction() { + } } //NAMESPACE diff --git a/asterisk-cpp/src/manager/actions/SipPeersAction.cpp b/asterisk-cpp/src/manager/actions/SipPeersAction.cpp index 2eaf220..894d42c 100644 --- a/asterisk-cpp/src/manager/actions/SipPeersAction.cpp +++ b/asterisk-cpp/src/manager/actions/SipPeersAction.cpp @@ -11,5 +11,8 @@ namespace asteriskcpp { SipPeersAction::SipPeersAction() { } + + SipPeersAction::~SipPeersAction() { + } } //NAMESPACE diff --git a/asterisk-cpp/src/manager/actions/SipShowPeerAction.cpp b/asterisk-cpp/src/manager/actions/SipShowPeerAction.cpp index 457bfde..26bc3d0 100644 --- a/asterisk-cpp/src/manager/actions/SipShowPeerAction.cpp +++ b/asterisk-cpp/src/manager/actions/SipShowPeerAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { SipShowPeerAction::SipShowPeerAction() { } + + SipShowPeerAction::~SipShowPeerAction() { + } SipShowPeerAction::SipShowPeerAction(const std::string& peer) { this->setPeer(peer); diff --git a/asterisk-cpp/src/manager/actions/SipShowRegistryAction.cpp b/asterisk-cpp/src/manager/actions/SipShowRegistryAction.cpp index 1e5d133..e7901e5 100644 --- a/asterisk-cpp/src/manager/actions/SipShowRegistryAction.cpp +++ b/asterisk-cpp/src/manager/actions/SipShowRegistryAction.cpp @@ -11,5 +11,8 @@ namespace asteriskcpp { SipShowRegistryAction::SipShowRegistryAction() { } + + SipShowRegistryAction::~SipShowRegistryAction() { + } } //NAMESPACE diff --git a/asterisk-cpp/src/manager/actions/SkypeAddBuddyAction.cpp b/asterisk-cpp/src/manager/actions/SkypeAddBuddyAction.cpp index 11aad3d..f4d8b13 100644 --- a/asterisk-cpp/src/manager/actions/SkypeAddBuddyAction.cpp +++ b/asterisk-cpp/src/manager/actions/SkypeAddBuddyAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { SkypeAddBuddyAction::SkypeAddBuddyAction() { } + + SkypeAddBuddyAction::~SkypeAddBuddyAction() { + } SkypeAddBuddyAction::SkypeAddBuddyAction(const std::string& user, const std::string& buddy) { this->setUser(user); diff --git a/asterisk-cpp/src/manager/actions/SkypeBuddiesAction.cpp b/asterisk-cpp/src/manager/actions/SkypeBuddiesAction.cpp index c25417c..3ca82a6 100644 --- a/asterisk-cpp/src/manager/actions/SkypeBuddiesAction.cpp +++ b/asterisk-cpp/src/manager/actions/SkypeBuddiesAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { SkypeBuddiesAction::SkypeBuddiesAction() { } + + SkypeBuddiesAction::~SkypeBuddiesAction() { + } SkypeBuddiesAction::SkypeBuddiesAction(const std::string& user) { this->setUser(user); diff --git a/asterisk-cpp/src/manager/actions/SkypeBuddyAction.cpp b/asterisk-cpp/src/manager/actions/SkypeBuddyAction.cpp index 94ab204..661cc4d 100644 --- a/asterisk-cpp/src/manager/actions/SkypeBuddyAction.cpp +++ b/asterisk-cpp/src/manager/actions/SkypeBuddyAction.cpp @@ -12,6 +12,9 @@ namespace asteriskcpp { SkypeBuddyAction::SkypeBuddyAction() { } + + SkypeBuddyAction::~SkypeBuddyAction() { + } SkypeBuddyAction::SkypeBuddyAction(const std::string& buddy) { this->setBuddy(buddy); diff --git a/asterisk-cpp/src/manager/actions/SkypeChatSendAction.cpp b/asterisk-cpp/src/manager/actions/SkypeChatSendAction.cpp index f95cc64..255eb88 100644 --- a/asterisk-cpp/src/manager/actions/SkypeChatSendAction.cpp +++ b/asterisk-cpp/src/manager/actions/SkypeChatSendAction.cpp @@ -12,6 +12,9 @@ namespace asteriskcpp { SkypeChatSendAction::SkypeChatSendAction() { } + + SkypeChatSendAction::~SkypeChatSendAction() { + } SkypeChatSendAction::SkypeChatSendAction(const std::string& message) { diff --git a/asterisk-cpp/src/manager/actions/SkypeLicenseListAction.cpp b/asterisk-cpp/src/manager/actions/SkypeLicenseListAction.cpp index cdf6f01..4c333c5 100644 --- a/asterisk-cpp/src/manager/actions/SkypeLicenseListAction.cpp +++ b/asterisk-cpp/src/manager/actions/SkypeLicenseListAction.cpp @@ -14,5 +14,8 @@ namespace asteriskcpp { */ SkypeLicenseListAction::SkypeLicenseListAction() { } + + SkypeLicenseListAction::~SkypeLicenseListAction() { + } } //NAMESPACE diff --git a/asterisk-cpp/src/manager/actions/SkypeLicenseStatusAction.cpp b/asterisk-cpp/src/manager/actions/SkypeLicenseStatusAction.cpp index ee017ef..6bd5b94 100644 --- a/asterisk-cpp/src/manager/actions/SkypeLicenseStatusAction.cpp +++ b/asterisk-cpp/src/manager/actions/SkypeLicenseStatusAction.cpp @@ -16,6 +16,9 @@ namespace asteriskcpp { SkypeLicenseStatusAction::SkypeLicenseStatusAction() { } + SkypeLicenseStatusAction::~SkypeLicenseStatusAction() { + } + ManagerResponse *SkypeLicenseStatusAction::expectedResponce(const std::string & response) { return (new SkypeLicenseStatusResponse(response)); } diff --git a/asterisk-cpp/src/manager/actions/SkypeRemoveBuddyAction.cpp b/asterisk-cpp/src/manager/actions/SkypeRemoveBuddyAction.cpp index e9b291e..ab8c1db 100644 --- a/asterisk-cpp/src/manager/actions/SkypeRemoveBuddyAction.cpp +++ b/asterisk-cpp/src/manager/actions/SkypeRemoveBuddyAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { SkypeRemoveBuddyAction::SkypeRemoveBuddyAction() { } + + SkypeRemoveBuddyAction::~SkypeRemoveBuddyAction() { + } SkypeRemoveBuddyAction::SkypeRemoveBuddyAction(const std::string& user, const std::string& buddy) { this->setUser(user); diff --git a/asterisk-cpp/src/manager/actions/StatusAction.cpp b/asterisk-cpp/src/manager/actions/StatusAction.cpp index e2bd9c5..fc2be67 100644 --- a/asterisk-cpp/src/manager/actions/StatusAction.cpp +++ b/asterisk-cpp/src/manager/actions/StatusAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { StatusAction::StatusAction() { } + + StatusAction::~StatusAction() { + } StatusAction::StatusAction(const std::string& channel) { this->setChannel(channel); diff --git a/asterisk-cpp/src/manager/actions/StopMonitorAction.cpp b/asterisk-cpp/src/manager/actions/StopMonitorAction.cpp index 5524325..3ab8b86 100644 --- a/asterisk-cpp/src/manager/actions/StopMonitorAction.cpp +++ b/asterisk-cpp/src/manager/actions/StopMonitorAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { StopMonitorAction::StopMonitorAction() { } + + StopMonitorAction::~StopMonitorAction() { + } StopMonitorAction::StopMonitorAction(const std::string& channel) { this->setChannel(channel); diff --git a/asterisk-cpp/src/manager/actions/UnpauseMonitorAction.cpp b/asterisk-cpp/src/manager/actions/UnpauseMonitorAction.cpp index e192837..63e0cfa 100644 --- a/asterisk-cpp/src/manager/actions/UnpauseMonitorAction.cpp +++ b/asterisk-cpp/src/manager/actions/UnpauseMonitorAction.cpp @@ -15,6 +15,9 @@ namespace asteriskcpp { UnpauseMonitorAction::UnpauseMonitorAction(const std::string& channel) { this->setChannel(channel); } + + UnpauseMonitorAction::~UnpauseMonitorAction() { + } const std::string& UnpauseMonitorAction::getChannel() const { return (getGetterValue(__FUNCTION__)); diff --git a/asterisk-cpp/src/manager/actions/UserEventAction.cpp b/asterisk-cpp/src/manager/actions/UserEventAction.cpp index d98a8c2..f537524 100644 --- a/asterisk-cpp/src/manager/actions/UserEventAction.cpp +++ b/asterisk-cpp/src/manager/actions/UserEventAction.cpp @@ -18,6 +18,8 @@ namespace asteriskcpp { //this->setUserEvent(userEvent); } + UserEventAction::~UserEventAction() { + } /* * TODO: Implement diff --git a/asterisk-cpp/src/manager/actions/VoicemailUsersListAction.cpp b/asterisk-cpp/src/manager/actions/VoicemailUsersListAction.cpp index 0b5407a..96a9087 100644 --- a/asterisk-cpp/src/manager/actions/VoicemailUsersListAction.cpp +++ b/asterisk-cpp/src/manager/actions/VoicemailUsersListAction.cpp @@ -11,5 +11,8 @@ namespace asteriskcpp { VoicemailUsersListAction::VoicemailUsersListAction() { } + + VoicemailUsersListAction::~VoicemailUsersListAction() { + } } //NAMESPACE diff --git a/asterisk-cpp/src/manager/actions/ZapDialOffhookAction.cpp b/asterisk-cpp/src/manager/actions/ZapDialOffhookAction.cpp index fba2bf4..a307c88 100644 --- a/asterisk-cpp/src/manager/actions/ZapDialOffhookAction.cpp +++ b/asterisk-cpp/src/manager/actions/ZapDialOffhookAction.cpp @@ -16,6 +16,9 @@ namespace asteriskcpp { this->setNumber(number); this->setZapChannel(zapChannel); } + + ZapDialOffhookAction::~ZapDialOffhookAction() { + } int ZapDialOffhookAction::getZapChannel() const { return (getGetterValue(__FUNCTION__)); diff --git a/asterisk-cpp/src/manager/actions/ZapDndOffAction.cpp b/asterisk-cpp/src/manager/actions/ZapDndOffAction.cpp index cb35d23..d4e6a69 100644 --- a/asterisk-cpp/src/manager/actions/ZapDndOffAction.cpp +++ b/asterisk-cpp/src/manager/actions/ZapDndOffAction.cpp @@ -15,6 +15,9 @@ namespace asteriskcpp { ZapDndOffAction::ZapDndOffAction(int zapChannel) { this->setZapChannel(zapChannel); } + + ZapDndOffAction::~ZapDndOffAction() { + } int ZapDndOffAction::getZapChannel() const { return (getGetterValue(__FUNCTION__)); diff --git a/asterisk-cpp/src/manager/actions/ZapDndOnAction.cpp b/asterisk-cpp/src/manager/actions/ZapDndOnAction.cpp index 2dc942a..58462cb 100644 --- a/asterisk-cpp/src/manager/actions/ZapDndOnAction.cpp +++ b/asterisk-cpp/src/manager/actions/ZapDndOnAction.cpp @@ -12,6 +12,9 @@ namespace asteriskcpp { ZapDndOnAction::ZapDndOnAction() { } + ZapDndOnAction::~ZapDndOnAction() { + } + ZapDndOnAction::ZapDndOnAction(int zapChannel) { this->setZapChannel(zapChannel); } diff --git a/asterisk-cpp/src/manager/actions/ZapHangupAction.cpp b/asterisk-cpp/src/manager/actions/ZapHangupAction.cpp index 46f4320..fb2d6b0 100644 --- a/asterisk-cpp/src/manager/actions/ZapHangupAction.cpp +++ b/asterisk-cpp/src/manager/actions/ZapHangupAction.cpp @@ -16,6 +16,9 @@ namespace asteriskcpp { this->setZapChannel(zapChannel); } + ZapHangupAction::~ZapHangupAction() { + } + int ZapHangupAction::getZapChannel() const { return (getGetterValue(__FUNCTION__)); } diff --git a/asterisk-cpp/src/manager/actions/ZapRestartAction.cpp b/asterisk-cpp/src/manager/actions/ZapRestartAction.cpp index dfc314e..d796a05 100644 --- a/asterisk-cpp/src/manager/actions/ZapRestartAction.cpp +++ b/asterisk-cpp/src/manager/actions/ZapRestartAction.cpp @@ -11,5 +11,8 @@ namespace asteriskcpp { ZapRestartAction::ZapRestartAction() { } + + ZapRestartAction::~ZapRestartAction() { + } } //NAMESPACE diff --git a/asterisk-cpp/src/manager/actions/ZapShowChannelsAction.cpp b/asterisk-cpp/src/manager/actions/ZapShowChannelsAction.cpp index 09a546a..4cacdd9 100644 --- a/asterisk-cpp/src/manager/actions/ZapShowChannelsAction.cpp +++ b/asterisk-cpp/src/manager/actions/ZapShowChannelsAction.cpp @@ -14,5 +14,8 @@ namespace asteriskcpp { */ ZapShowChannelsAction::ZapShowChannelsAction() { } + + ZapShowChannelsAction::~ZapShowChannelsAction() { + } } //NAMESPACE diff --git a/asterisk-cpp/src/manager/actions/ZapTransferAction.cpp b/asterisk-cpp/src/manager/actions/ZapTransferAction.cpp index 75985d2..081724c 100644 --- a/asterisk-cpp/src/manager/actions/ZapTransferAction.cpp +++ b/asterisk-cpp/src/manager/actions/ZapTransferAction.cpp @@ -11,6 +11,9 @@ namespace asteriskcpp { ZapTransferAction::ZapTransferAction() { } + + ZapTransferAction::~ZapTransferAction() { + } int ZapTransferAction::getZapChannel() const { return (getGetterValue(__FUNCTION__)); From 343fa951be8861475fc2d0cefedeb1dcedc096df Mon Sep 17 00:00:00 2001 From: 3kthor3adward <3kthor3adward@gmail.com> Date: Fri, 13 Feb 2015 12:29:34 -0600 Subject: [PATCH 08/47] Avoid "hides overloaded virtual function" warning --- asterisk-cpp/asteriskcpp/manager/Reader.h | 1 + asterisk-cpp/asteriskcpp/manager/Writer.h | 1 + .../asteriskcpp/manager/actions/AbstractManagerAction.h | 3 +-- asterisk-cpp/asteriskcpp/manager/actions/ManagerAction.h | 2 +- asterisk-cpp/asteriskcpp/structs/PropertyMap.h | 2 +- asterisk-cpp/src/structs/PropertyMap.cpp | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/asterisk-cpp/asteriskcpp/manager/Reader.h b/asterisk-cpp/asteriskcpp/manager/Reader.h index 1d339db..5e90af1 100644 --- a/asterisk-cpp/asteriskcpp/manager/Reader.h +++ b/asterisk-cpp/asteriskcpp/manager/Reader.h @@ -23,6 +23,7 @@ namespace asteriskcpp { void run(); private: + using Thread::start; TCPSocket* connectionSocket; Dispatcher* dispatcher; std::string unprocessedStr; diff --git a/asterisk-cpp/asteriskcpp/manager/Writer.h b/asterisk-cpp/asteriskcpp/manager/Writer.h index a15f524..aad6de7 100644 --- a/asterisk-cpp/asteriskcpp/manager/Writer.h +++ b/asterisk-cpp/asteriskcpp/manager/Writer.h @@ -23,6 +23,7 @@ namespace asteriskcpp { void run(); private: + using Thread::start; TCPSocket* m_connectionSocket; SynchronisedQueue* m_WriteQueue; }; diff --git a/asterisk-cpp/asteriskcpp/manager/actions/AbstractManagerAction.h b/asterisk-cpp/asteriskcpp/manager/actions/AbstractManagerAction.h index 25304a9..c36abbe 100644 --- a/asterisk-cpp/asteriskcpp/manager/actions/AbstractManagerAction.h +++ b/asterisk-cpp/asteriskcpp/manager/actions/AbstractManagerAction.h @@ -24,7 +24,7 @@ namespace asteriskcpp { virtual ~AbstractManagerAction(); - virtual const std::string& toString(); + virtual const std::string toString() const; const std::string& generateID(); @@ -57,7 +57,6 @@ namespace asteriskcpp { private: std::string actionID; - std::string to_string; }; } diff --git a/asterisk-cpp/asteriskcpp/manager/actions/ManagerAction.h b/asterisk-cpp/asteriskcpp/manager/actions/ManagerAction.h index b29af74..bf1caaf 100644 --- a/asterisk-cpp/asteriskcpp/manager/actions/ManagerAction.h +++ b/asterisk-cpp/asteriskcpp/manager/actions/ManagerAction.h @@ -50,7 +50,7 @@ namespace asteriskcpp { * Returns the action string representation action. * @return the action string representation action. */ - virtual const std::string& toString() = 0; + virtual const std::string toString() const = 0; virtual ManagerResponse* expectedResponce(const std::string& response); diff --git a/asterisk-cpp/asteriskcpp/structs/PropertyMap.h b/asterisk-cpp/asteriskcpp/structs/PropertyMap.h index 86cc3c3..0603330 100644 --- a/asterisk-cpp/asteriskcpp/structs/PropertyMap.h +++ b/asterisk-cpp/asteriskcpp/structs/PropertyMap.h @@ -48,7 +48,7 @@ namespace asteriskcpp { PropertyMap(const std::string& str); virtual ~PropertyMap(); - virtual std::string toString() const; + virtual const std::string toString() const; std::string toLog() const; const std::string& getGetterValue(const char *functionName) const; diff --git a/asterisk-cpp/src/structs/PropertyMap.cpp b/asterisk-cpp/src/structs/PropertyMap.cpp index 838bc45..47c119f 100644 --- a/asterisk-cpp/src/structs/PropertyMap.cpp +++ b/asterisk-cpp/src/structs/PropertyMap.cpp @@ -37,7 +37,7 @@ namespace asteriskcpp { return std::string(str, 0, i); } - std::string PropertyMap::toString() const { + const std::string PropertyMap::toString() const { std::stringstream stream; for (propertyIndex::const_iterator it = index.begin(); it != index.end(); it++) { stream << makeStdLine(*it, getProperty(*it)); From 61923ab1974419403c489b25b73e7eb65659ad67 Mon Sep 17 00:00:00 2001 From: 3kthor3adward <3kthor3adward@gmail.com> Date: Fri, 13 Feb 2015 12:30:25 -0600 Subject: [PATCH 09/47] remove unused member variable --- asterisk-cpp/asteriskcpp/manager/AsteriskVersion.h | 1 - 1 file changed, 1 deletion(-) diff --git a/asterisk-cpp/asteriskcpp/manager/AsteriskVersion.h b/asterisk-cpp/asteriskcpp/manager/AsteriskVersion.h index 5477ba9..f1b6b98 100644 --- a/asterisk-cpp/asteriskcpp/manager/AsteriskVersion.h +++ b/asterisk-cpp/asteriskcpp/manager/AsteriskVersion.h @@ -24,7 +24,6 @@ namespace asteriskcpp { private: ManagerType type; float managerVersion; - float version; }; } From 14b4b75ee1c822785ce0b90d416a9d421f2fa083 Mon Sep 17 00:00:00 2001 From: 3kthor3adward <3kthor3adward@gmail.com> Date: Fri, 13 Feb 2015 12:30:34 -0600 Subject: [PATCH 10/47] Restore comma. --- asterisk-cpp/src/manager/EventBuilder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asterisk-cpp/src/manager/EventBuilder.cpp b/asterisk-cpp/src/manager/EventBuilder.cpp index 2e5e17f..9ad6306 100644 --- a/asterisk-cpp/src/manager/EventBuilder.cpp +++ b/asterisk-cpp/src/manager/EventBuilder.cpp @@ -174,7 +174,7 @@ namespace asteriskcpp { if (it != eventFactoryMap.end()) { return ((it->second)->create(eventStr)); } else { - LOG_WARN_STR("EVENT:INVALID OR NOT IMPLEMENTED \n" + str2Log(eventStr)) + LOG_WARN_STR("EVENT:INVALID OR NOT IMPLEMENTED \n" + str2Log(eventStr)); return (new ManagerEvent(eventStr)); } } From ab5786cf710cccf61b6542a0fda925bf7f9d0a0b Mon Sep 17 00:00:00 2001 From: 3kthor3adward <3kthor3adward@gmail.com> Date: Fri, 13 Feb 2015 12:30:48 -0600 Subject: [PATCH 11/47] toString const is not allowed to change class members. --- asterisk-cpp/src/manager/actions/AbstractManagerAction.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/asterisk-cpp/src/manager/actions/AbstractManagerAction.cpp b/asterisk-cpp/src/manager/actions/AbstractManagerAction.cpp index f41b83c..b094d07 100644 --- a/asterisk-cpp/src/manager/actions/AbstractManagerAction.cpp +++ b/asterisk-cpp/src/manager/actions/AbstractManagerAction.cpp @@ -34,14 +34,14 @@ namespace asteriskcpp { return (this->actionID); } - const std::string& AbstractManagerAction::toString() { + const std::string AbstractManagerAction::toString() const { std::stringstream stream; stream << makeStdLine(ACTION, this->getAction()); stream << makeStdLine(ACTION_ID, this->getActionId()); stream << PropertyMap::toString(); - this->to_string = stream.str(); - return (this->to_string); + std::string to_string = stream.str(); + return (to_string); } } From 2a3f446f867be4bdd7ea24f416599ae86bb04360 Mon Sep 17 00:00:00 2001 From: 3kthor3adward <3kthor3adward@gmail.com> Date: Fri, 13 Feb 2015 12:31:50 -0600 Subject: [PATCH 12/47] Avoid potential undefined behavior and "reference to stack memory" warnings --- .../asteriskcpp/manager/responses/GetConfigResponse.h | 2 ++ asterisk-cpp/src/manager/responses/GetConfigResponse.cpp | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/asterisk-cpp/asteriskcpp/manager/responses/GetConfigResponse.h b/asterisk-cpp/asteriskcpp/manager/responses/GetConfigResponse.h index af5a2ac..b8cff27 100644 --- a/asterisk-cpp/asteriskcpp/manager/responses/GetConfigResponse.h +++ b/asterisk-cpp/asteriskcpp/manager/responses/GetConfigResponse.h @@ -49,6 +49,8 @@ namespace asteriskcpp { const std::map& getLines(int categoryNumber) const; private: + std::map categories; + std::map lines; }; } diff --git a/asterisk-cpp/src/manager/responses/GetConfigResponse.cpp b/asterisk-cpp/src/manager/responses/GetConfigResponse.cpp index 7b2fa45..0878216 100644 --- a/asterisk-cpp/src/manager/responses/GetConfigResponse.cpp +++ b/asterisk-cpp/src/manager/responses/GetConfigResponse.cpp @@ -17,14 +17,10 @@ namespace asteriskcpp { } const std::map& GetConfigResponse::getCategories() const { - std::map rt; - - return rt; + return categories; } const std::map& GetConfigResponse::getLines(int categoryNumber) const { - std::map rt; - - return rt; + return lines; } } From 7b1ae3f91921b729a36bc39d4d61f9d9e16f32e8 Mon Sep 17 00:00:00 2001 From: 3kthor3adward <3kthor3adward@gmail.com> Date: Mon, 16 Feb 2015 12:22:34 -0600 Subject: [PATCH 13/47] Avoid duplicated calls to disconnected() Fix managerconnection state transitions --- .../src/manager/ManagerConnection.cpp | 53 ++++++++++++------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/asterisk-cpp/src/manager/ManagerConnection.cpp b/asterisk-cpp/src/manager/ManagerConnection.cpp index 978a6c5..611a03c 100644 --- a/asterisk-cpp/src/manager/ManagerConnection.cpp +++ b/asterisk-cpp/src/manager/ManagerConnection.cpp @@ -58,9 +58,11 @@ namespace asteriskcpp { } void ManagerConnection::disconnect() { - this->setState(DISCONNECTED); - if (this->socket != NULL) { - delete (socket); + if (state != DISCONNECTED) { + this->setState(DISCONNECTED); + if (this->socket != NULL) { + delete (socket); + } } } @@ -155,32 +157,45 @@ namespace asteriskcpp { if (this->state == newState) return; - LOG_DEBUG_DATA(status[state] << " => " << status[newState]); + std::stringstream transition; + transition << status[state] << " => " << status[newState]; + LOG_DEBUG_DATA(transition.str()); - switch (newState) { + switch (state) { //from state.. case DISCONNECTED: - { - this->reader.stop(); - ManagerResponsesHandler::stop(); - } + if (newState != CONNECTED) { + throw new Exception(transition.str()); + } + //transition to connected + LOG_INFO_STR("CONNECTED"); + this->reader.start(socket, this); + ManagerResponsesHandler::start(); break; case CONNECTED: - { - if (state == DISCONNECTED) { - this->reader.start(socket, this); - ManagerResponsesHandler::start(); - } else { - this->reader.stop(); + if (newState == DISCONNECTED) { + //to disconnected + LOG_INFO_STR("DISCONNECTED"); ManagerResponsesHandler::stop(); + this->reader.stop(); + } else { + //to authenticated + LOG_INFO_STR("AUTHENTICATED"); } - } break; case AUTHENTICATED: - { - - } + if (newState == CONNECTED) { + // to connected, i.e. logoff + LOG_INFO_STR("CONNECTED:=DEAUTHENTICATED"); + } else { + //to disconnected + LOG_INFO_STR("DISCONNECTED"); + //logoff()¿? + setState(CONNECTED); + setState(DISCONNECTED); + } break; } + this->state = newState; } From 6a130f4d79b5e4699cb3ba11affac87aa2ce3da4 Mon Sep 17 00:00:00 2001 From: iijima Date: Mon, 29 Jun 2015 15:03:33 +0900 Subject: [PATCH 14/47] add necessary file --- asterisk-cpp/Makefile.am | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/asterisk-cpp/Makefile.am b/asterisk-cpp/Makefile.am index 85b2d66..fec83fc 100644 --- a/asterisk-cpp/Makefile.am +++ b/asterisk-cpp/Makefile.am @@ -155,6 +155,17 @@ libasteriskcpp_la_SOURCES= \ src/manager/responses/ManagerResponse.cpp \ src/manager/responses/ManagerError.cpp \ src/manager/responses/CommandResponse.cpp \ + src/manager/responses/GetConfigResponse.cpp \ + src/manager/responses/ModuleCheckResponse.cpp \ + src/manager/responses/SkypeBuddyResponse.cpp \ + src/manager/responses/PingResponse.cpp \ + src/manager/responses/GetVarResponse.cpp \ + src/manager/responses/MailboxCountResponse.cpp \ + src/manager/responses/ExtensionStateResponse.cpp \ + src/manager/responses/SkypeLicenseStatusResponse.cpp \ + src/manager/responses/MailboxStatusResponse.cpp \ + src/manager/responses/CoreSettingsResponse.cpp \ + src/manager/responses/CoreStatusResponse.cpp \ src/manager/actions/AbsoluteTimeoutAction.cpp \ src/manager/actions/AbstractManagerAction.cpp \ src/manager/actions/AbstractMeetMeMuteAction.cpp \ @@ -427,6 +438,17 @@ nobase_inst_HEADERS= \ asteriskcpp/manager/responses/CommandResponse.h \ asteriskcpp/manager/responses/ChallengeResponse.h \ asteriskcpp/manager/responses/ManagerResponse.h \ + asteriskcpp/manager/responses/GetConfigResponse.h \ + asteriskcpp/manager/responses/ModuleCheckResponse.h \ + asteriskcpp/manager/responses/SkypeBuddyResponse.h \ + asteriskcpp/manager/responses/PingResponse.h \ + asteriskcpp/manager/responses/GetVarResponse.h \ + asteriskcpp/manager/responses/MailboxCountResponse.h \ + asteriskcpp/manager/responses/ExtensionStateResponse.h \ + asteriskcpp/manager/responses/SkypeLicenseStatusResponse.h \ + asteriskcpp/manager/responses/MailboxStatusResponse.h \ + asteriskcpp/manager/responses/CoreSettingsResponse.h \ + asteriskcpp/manager/responses/CoreStatusResponse.h \ asteriskcpp/manager/actions/AbsoluteTimeoutAction.h \ asteriskcpp/manager/actions/AbstractManagerAction.h \ asteriskcpp/manager/actions/AbstractMeetMeMuteAction.h \ @@ -517,4 +539,4 @@ nobase_inst_HEADERS= \ asteriskcpp/manager/actions/ZapHangupAction.h \ asteriskcpp/manager/actions/ZapRestartAction.h \ asteriskcpp/manager/actions/ZapShowChannelsAction.h \ - asteriskcpp/manager/actions/ZapTransferAction.h \ No newline at end of file + asteriskcpp/manager/actions/ZapTransferAction.h From 240451f903cc2c3b7d86aca40db8749127021661 Mon Sep 17 00:00:00 2001 From: iijima Date: Mon, 29 Jun 2015 15:14:22 +0900 Subject: [PATCH 15/47] I added isReady not to stop in stoll() even if fireCallBack() was called earlier --- asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h | 1 + asterisk-cpp/src/manager/ManagerResponsesHandler.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h b/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h index 3409e68..1761cdb 100644 --- a/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h +++ b/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h @@ -51,6 +51,7 @@ namespace asteriskcpp { class SyncResponseCallBack : public ResponseCallBack { boost::mutex m_mutex; boost::condition_variable m_cond; + bool isReady; public: virtual ~SyncResponseCallBack(); diff --git a/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp b/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp index 0958008..5fc2f0c 100644 --- a/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp +++ b/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp @@ -36,7 +36,7 @@ namespace asteriskcpp { } SyncResponseCallBack::SyncResponseCallBack(ManagerAction* a, unsigned int timeOut) : - ResponseCallBack(a, timeOut) { + ResponseCallBack(a, timeOut), isReady(false) { } SyncResponseCallBack::~SyncResponseCallBack() { @@ -48,7 +48,9 @@ namespace asteriskcpp { void SyncResponseCallBack::stoll() { boost::unique_lock lock(this->m_mutex); LOG_TRACE_STR(""); - this->m_cond.wait(lock); + if (this->isReady == false) { + this->m_cond.wait(lock); + } LOG_TRACE_STR("OUT"); } @@ -56,6 +58,7 @@ namespace asteriskcpp { boost::lock_guard lock(this->m_mutex); this->response = mr; LOG_TRACE_STR("SyncResponseCallBack : " + (*mr).toLog()); + this->isReady = true; this->m_cond.notify_all(); } From 319d81cc78af2a5ac836f59d99311e6398413345 Mon Sep 17 00:00:00 2001 From: iijima Date: Mon, 29 Jun 2015 15:39:58 +0900 Subject: [PATCH 16/47] add the notice for changes of state --- asterisk-cpp/asteriskcpp/manager/Dispatcher.h | 1 + .../asteriskcpp/manager/ManagerConnection.h | 1 + asterisk-cpp/src/manager/ManagerConnection.cpp | 16 +++++++++++++++- asterisk-cpp/src/manager/Reader.cpp | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/asterisk-cpp/asteriskcpp/manager/Dispatcher.h b/asterisk-cpp/asteriskcpp/manager/Dispatcher.h index 939e33a..b384d3d 100644 --- a/asterisk-cpp/asteriskcpp/manager/Dispatcher.h +++ b/asterisk-cpp/asteriskcpp/manager/Dispatcher.h @@ -23,6 +23,7 @@ namespace asteriskcpp { virtual void dispatchAsteriskVersion(AsteriskVersion* version) = 0; virtual void dispatchResponse(const std::string& response) = 0; virtual void dispatchEvent(const std::string& event) = 0; + virtual void notifyDisconnect() = 0; }; } diff --git a/asterisk-cpp/asteriskcpp/manager/ManagerConnection.h b/asterisk-cpp/asteriskcpp/manager/ManagerConnection.h index 6439147..50ca5b1 100644 --- a/asterisk-cpp/asteriskcpp/manager/ManagerConnection.h +++ b/asterisk-cpp/asteriskcpp/manager/ManagerConnection.h @@ -68,6 +68,7 @@ namespace asteriskcpp { void dispatchAsteriskVersion(AsteriskVersion* version); void dispatchResponse(const std::string& response); void dispatchEvent(const std::string& event); + void notifyDisconnect(); private: diff --git a/asterisk-cpp/src/manager/ManagerConnection.cpp b/asterisk-cpp/src/manager/ManagerConnection.cpp index 611a03c..960bfc1 100644 --- a/asterisk-cpp/src/manager/ManagerConnection.cpp +++ b/asterisk-cpp/src/manager/ManagerConnection.cpp @@ -28,7 +28,7 @@ static const char* status[] = {"Disconnected", "Connected", "Authenticated"}; namespace asteriskcpp { ManagerConnection::ManagerConnection() : - state(DISCONNECTED), hostname(DEFAULT_HOSTNAME), port(DEFAULT_PORT), ssl(false), defaultResponseTimeout(DEFAULT_TIMEOUT) { + state(DISCONNECTED), hostname(DEFAULT_HOSTNAME), port(DEFAULT_PORT), ssl(false), defaultResponseTimeout(DEFAULT_TIMEOUT), socket(NULL) { } ManagerConnection::~ManagerConnection() { @@ -68,6 +68,12 @@ namespace asteriskcpp { void ManagerConnection::send(const std::string& data) { LOG_DEBUG_STR(str2Log(data)); + + if (this->state == DISCONNECTED) { + LOG_TRACE_STR("OUT :state is DISCONNECTED"); + return; + } + this->socket->writeData(data); LOG_TRACE_STR("OUT"); } @@ -245,6 +251,14 @@ namespace asteriskcpp { delete (me); } + void ManagerConnection::notifyDisconnect() { + LOG_ERROR_STR("Disconnected"); + this->state = DISCONNECTED; + if (this->socket != NULL) { + delete (socket); + } + } + bool ManagerConnection::login() { return (this->login(NULL)); } diff --git a/asterisk-cpp/src/manager/Reader.cpp b/asterisk-cpp/src/manager/Reader.cpp index 655c815..5ef3a02 100644 --- a/asterisk-cpp/src/manager/Reader.cpp +++ b/asterisk-cpp/src/manager/Reader.cpp @@ -32,6 +32,7 @@ namespace asteriskcpp { void Reader::stop() { Thread::stop(); + dispatcher->notifyDisconnect(); dispatcher = NULL; connectionSocket = NULL; } From 9641855060593d83c0dbd52b1923baa81ae44952 Mon Sep 17 00:00:00 2001 From: iijima Date: Mon, 29 Jun 2015 16:00:15 +0900 Subject: [PATCH 17/47] substr() throws std::out_of_range in some cases --- asterisk-cpp/src/structs/PropertyMap.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/asterisk-cpp/src/structs/PropertyMap.cpp b/asterisk-cpp/src/structs/PropertyMap.cpp index 47c119f..eef39a4 100644 --- a/asterisk-cpp/src/structs/PropertyMap.cpp +++ b/asterisk-cpp/src/structs/PropertyMap.cpp @@ -90,8 +90,9 @@ namespace asteriskcpp { knull.append(line); } + std::string::size_type tmpLastPos = lastPos; lastPos = propertyStr.find_first_not_of(NEWLINE, pos); - pos = propertyStr.find(NEWLINE, lastPos); + pos = propertyStr.find(NEWLINE, tmpLastPos); } if (knull.size()) From 50be5ea1950058e29613ef0fd5f77a31fd3cf87e Mon Sep 17 00:00:00 2001 From: iijima Date: Mon, 29 Jun 2015 16:26:18 +0900 Subject: [PATCH 18/47] not want to handle an event in parallel --- asterisk-cpp/asteriskcpp/manager/ManagerEventsHandler.h | 2 +- asterisk-cpp/src/manager/ManagerEventsHandler.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/asterisk-cpp/asteriskcpp/manager/ManagerEventsHandler.h b/asterisk-cpp/asteriskcpp/manager/ManagerEventsHandler.h index c7a43f9..8ec3155 100644 --- a/asterisk-cpp/asteriskcpp/manager/ManagerEventsHandler.h +++ b/asterisk-cpp/asteriskcpp/manager/ManagerEventsHandler.h @@ -35,7 +35,7 @@ namespace asteriskcpp { protected: EventListenersList listeners; - void fireEvent(const ManagerEvent& me); + void fireEvent(ManagerEvent& me); private: void internalFireEvent(ManagerEvent& me); diff --git a/asterisk-cpp/src/manager/ManagerEventsHandler.cpp b/asterisk-cpp/src/manager/ManagerEventsHandler.cpp index e48f663..993ce61 100644 --- a/asterisk-cpp/src/manager/ManagerEventsHandler.cpp +++ b/asterisk-cpp/src/manager/ManagerEventsHandler.cpp @@ -42,8 +42,9 @@ namespace asteriskcpp { listeners.erase(&mel); } - void ManagerEventsHandler::fireEvent(const ManagerEvent& me) { - boost::thread t(boost::bind(&ManagerEventsHandler::internalFireEvent, this, me)); + void ManagerEventsHandler::fireEvent(ManagerEvent& me) { +//TODO boost::thread t(boost::bind(&ManagerEventsHandler::internalFireEvent, this, me)); + this->internalFireEvent(me); } void ManagerEventsHandler::internalFireEvent(ManagerEvent& me) { From 496421f3e6c1d550fdf69fb2244d842c1612d3a0 Mon Sep 17 00:00:00 2001 From: iijima Date: Mon, 29 Jun 2015 16:27:01 +0900 Subject: [PATCH 19/47] add ignore file --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 407ea3e..dffa3bf 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,5 @@ /asterisk-cpp/nbproject/private/private.xml /asterisk-cpp/examples/Test /asterisk-cpp/install-sh -/asterisk-cpp/examples/Makefile \ No newline at end of file +/asterisk-cpp/examples/Makefile +/asterisk-cpp/*.lo From 22b98099b7c261e91426d9179015fd69a45726ff Mon Sep 17 00:00:00 2001 From: iijima Date: Mon, 29 Jun 2015 16:59:06 +0900 Subject: [PATCH 20/47] add delete instance --- asterisk-cpp/src/structs/Thread.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/asterisk-cpp/src/structs/Thread.cpp b/asterisk-cpp/src/structs/Thread.cpp index 1a1401b..023270b 100644 --- a/asterisk-cpp/src/structs/Thread.cpp +++ b/asterisk-cpp/src/structs/Thread.cpp @@ -25,6 +25,9 @@ namespace asteriskcpp { void Thread::start() { setMustStop(false); + if (m_thread != NULL) { + delete (m_thread); + } // Create thread and start it with myself as argument. Pass myself as reference since I don't want a copy m_thread = new boost::thread(boost::ref(*this)); } From b471c11668426fcbc0f393cb2bb5e52f76ac3a92 Mon Sep 17 00:00:00 2001 From: iijima Date: Mon, 29 Jun 2015 17:01:08 +0900 Subject: [PATCH 21/47] prevent double deletion --- asterisk-cpp/src/manager/ManagerConnection.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/asterisk-cpp/src/manager/ManagerConnection.cpp b/asterisk-cpp/src/manager/ManagerConnection.cpp index 960bfc1..61f99da 100644 --- a/asterisk-cpp/src/manager/ManagerConnection.cpp +++ b/asterisk-cpp/src/manager/ManagerConnection.cpp @@ -62,6 +62,7 @@ namespace asteriskcpp { this->setState(DISCONNECTED); if (this->socket != NULL) { delete (socket); + this->socket = NULL; } } } @@ -256,6 +257,7 @@ namespace asteriskcpp { this->state = DISCONNECTED; if (this->socket != NULL) { delete (socket); + this->socket = NULL; } } From 413763fad87968c3ea9cce8ac839feef06005f77 Mon Sep 17 00:00:00 2001 From: iijima Date: Mon, 29 Jun 2015 19:01:20 +0900 Subject: [PATCH 22/47] not execute thread of own --- asterisk-cpp/src/structs/Thread.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/asterisk-cpp/src/structs/Thread.cpp b/asterisk-cpp/src/structs/Thread.cpp index 023270b..8191d7e 100644 --- a/asterisk-cpp/src/structs/Thread.cpp +++ b/asterisk-cpp/src/structs/Thread.cpp @@ -38,8 +38,12 @@ namespace asteriskcpp { // Wait for the thread to finish. if (m_thread != NULL) { - m_thread->interrupt(); - m_thread->join(); + if (m_thread->get_id() != boost::this_thread::get_id()) { + m_thread->interrupt(); + m_thread->join(); + delete (m_thread); + m_thread = NULL; + } } } From 32965a2e3f77174a98931d3b57165b5682ef9bd3 Mon Sep 17 00:00:00 2001 From: iijima Date: Tue, 30 Jun 2015 21:34:28 +0900 Subject: [PATCH 23/47] substr() throws std::out_of_range in some cases --- asterisk-cpp/src/structs/PropertyMap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asterisk-cpp/src/structs/PropertyMap.cpp b/asterisk-cpp/src/structs/PropertyMap.cpp index eef39a4..a81124c 100644 --- a/asterisk-cpp/src/structs/PropertyMap.cpp +++ b/asterisk-cpp/src/structs/PropertyMap.cpp @@ -79,7 +79,7 @@ namespace asteriskcpp { std::string knull; std::string::size_type lastPos = propertyStr.find_first_not_of(NEWLINE, 0); std::string::size_type pos = propertyStr.find(NEWLINE); - while (std::string::npos != pos || std::string::npos != lastPos) { + while (std::string::npos != pos && std::string::npos != lastPos) { std::string line = propertyStr.substr(lastPos, pos - lastPos); size_t sep = line.find(SEP); From 619010c75064e05483af5be4962163703be65018 Mon Sep 17 00:00:00 2001 From: iijima Date: Wed, 1 Jul 2015 11:03:21 +0900 Subject: [PATCH 24/47] fix memory leak problem --- .../asteriskcpp/manager/ManagerConnection.h | 4 ++-- .../manager/ManagerEventsHandler.h | 4 ++-- .../manager/ManagerResponsesHandler.h | 1 + .../src/manager/ManagerConnection.cpp | 21 ++++++++-------- .../src/manager/ManagerEventsHandler.cpp | 13 +++++----- .../src/manager/ManagerResponsesHandler.cpp | 24 +++++++++++++------ 6 files changed, 39 insertions(+), 28 deletions(-) diff --git a/asterisk-cpp/asteriskcpp/manager/ManagerConnection.h b/asterisk-cpp/asteriskcpp/manager/ManagerConnection.h index 50ca5b1..34def65 100644 --- a/asterisk-cpp/asteriskcpp/manager/ManagerConnection.h +++ b/asterisk-cpp/asteriskcpp/manager/ManagerConnection.h @@ -41,8 +41,8 @@ namespace asteriskcpp { bool isConnected() const; bool isAuthenticated() const; - void sendAction(ManagerAction& action); - void sendAction(ManagerAction& action, responseCallbackFunction_t rcbf); + void sendAction(ManagerAction* action); + void sendAction(ManagerAction* action, responseCallbackFunction_t rcbf); ManagerResponse* syncSendAction(ManagerAction& action); ManagerResponse* syncSendAction(ManagerAction& action, unsigned int timeout); diff --git a/asterisk-cpp/asteriskcpp/manager/ManagerEventsHandler.h b/asterisk-cpp/asteriskcpp/manager/ManagerEventsHandler.h index 8ec3155..0e0dabb 100644 --- a/asterisk-cpp/asteriskcpp/manager/ManagerEventsHandler.h +++ b/asterisk-cpp/asteriskcpp/manager/ManagerEventsHandler.h @@ -35,10 +35,10 @@ namespace asteriskcpp { protected: EventListenersList listeners; - void fireEvent(ManagerEvent& me); + void fireEvent(ManagerEvent* me); private: - void internalFireEvent(ManagerEvent& me); + void internalFireEvent(ManagerEvent* me); }; diff --git a/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h b/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h index 1761cdb..e7895ef 100644 --- a/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h +++ b/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h @@ -42,6 +42,7 @@ namespace asteriskcpp { class ASyncResponseCallBack : public ResponseCallBack { public: ASyncResponseCallBack(ManagerAction* a, unsigned int tout, responseCallbackFunction_t f); + virtual ~ASyncResponseCallBack(); virtual void fireCallBack(ManagerResponse* mr); protected: diff --git a/asterisk-cpp/src/manager/ManagerConnection.cpp b/asterisk-cpp/src/manager/ManagerConnection.cpp index 61f99da..fc99a5e 100644 --- a/asterisk-cpp/src/manager/ManagerConnection.cpp +++ b/asterisk-cpp/src/manager/ManagerConnection.cpp @@ -79,14 +79,14 @@ namespace asteriskcpp { LOG_TRACE_STR("OUT"); } - void ManagerConnection::sendAction(ManagerAction & action) { + void ManagerConnection::sendAction(ManagerAction* action) { sendAction(action, NULL); } - void ManagerConnection::sendAction(ManagerAction & action, responseCallbackFunction_t rcbf) { - ASyncResponseCallBack *asrcb = new ASyncResponseCallBack(&action, defaultResponseTimeout, rcbf); - addResponsetListener(action.generateID(), asrcb); - send(action.toString()); + void ManagerConnection::sendAction(ManagerAction* action, responseCallbackFunction_t rcbf) { + ASyncResponseCallBack *asrcb = new ASyncResponseCallBack(action, defaultResponseTimeout, rcbf); + addResponsetListener(action->generateID(), asrcb); + send(action->toString()); } ManagerResponse* ManagerConnection::syncSendAction(ManagerAction& action) { @@ -95,11 +95,11 @@ namespace asteriskcpp { ManagerResponse* ManagerConnection::syncSendAction(ManagerAction& action, unsigned int timeout) { LOG_TRACE_STR("IN"); - SyncResponseCallBack srcb(&action, timeout); - addResponsetListener(action.generateID(), &srcb); + SyncResponseCallBack *srcb = new SyncResponseCallBack(&action, timeout); + addResponsetListener(action.generateID(), srcb); send(action.toString()); - srcb.stoll(); - return (srcb.response); + srcb->stoll(); + return (srcb->response); } void ManagerConnection::addEventCallback(onManagerEventCallback_t callback) { @@ -247,9 +247,8 @@ namespace asteriskcpp { LOG_TRACE_STR(str2Log(event)); ManagerEvent *me = this->eventBuilder.buildEvent(event); if (me != NULL) { - this->fireEvent(*me); + this->fireEvent(me); } - delete (me); } void ManagerConnection::notifyDisconnect() { diff --git a/asterisk-cpp/src/manager/ManagerEventsHandler.cpp b/asterisk-cpp/src/manager/ManagerEventsHandler.cpp index 993ce61..8902b5e 100644 --- a/asterisk-cpp/src/manager/ManagerEventsHandler.cpp +++ b/asterisk-cpp/src/manager/ManagerEventsHandler.cpp @@ -42,21 +42,22 @@ namespace asteriskcpp { listeners.erase(&mel); } - void ManagerEventsHandler::fireEvent(ManagerEvent& me) { -//TODO boost::thread t(boost::bind(&ManagerEventsHandler::internalFireEvent, this, me)); - this->internalFireEvent(me); + void ManagerEventsHandler::fireEvent(ManagerEvent* me) { + boost::thread t(boost::bind(&ManagerEventsHandler::internalFireEvent, this, me)); } - void ManagerEventsHandler::internalFireEvent(ManagerEvent& me) { - LOG_DEBUG_STR("FIRE EVENT " + me.getEventName() + ":: " + me.toLog()); + void ManagerEventsHandler::internalFireEvent(ManagerEvent* me) { + LOG_DEBUG_STR("FIRE EVENT " + me->getEventName() + ":: " + me->toLog()); for (EventListenersList::const_iterator iter = listeners.begin(); iter != listeners.end(); ++iter) { try { - (const_cast (*iter))->onManagerEvent(me); + (const_cast (*iter))->onManagerEvent(*me); } catch (Exception& E) { LOG_ERROR_STR(E.getMessage()); } } + + delete me; } } diff --git a/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp b/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp index 5fc2f0c..fbf57a8 100644 --- a/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp +++ b/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp @@ -27,16 +27,23 @@ namespace asteriskcpp { this->function = f; } + ASyncResponseCallBack::~ASyncResponseCallBack() { + LOG_TRACE_STR("IN"); + delete this->action; + LOG_TRACE_STR("OUT"); + } + void ASyncResponseCallBack::fireCallBack(ManagerResponse* mr) { LOG_TRACE_STR("ASyncResponseCallBack :" + mr->toLog()); if (this->function != NULL) { (this->function)(mr); } + delete mr; LOG_TRACE_STR("OUT"); } SyncResponseCallBack::SyncResponseCallBack(ManagerAction* a, unsigned int timeOut) : - ResponseCallBack(a, timeOut), isReady(false) { + ResponseCallBack(a, timeOut), response(NULL), isReady(false) { } SyncResponseCallBack::~SyncResponseCallBack() { @@ -90,13 +97,14 @@ namespace asteriskcpp { } void ManagerResponsesHandler::removeResponseListener(const std::string& key) { + std::string keytmp = key; LOG_TRACE_STR("REMOVE RESPONSE Listener " + key); ResponseCallBack* m = getListener(key); this->listeners.erase(key); if (m) { - //delete (m); + delete (m); } - LOG_TRACE_STR("OUT" + key); + LOG_TRACE_STR("OUT" + keytmp); } bool ManagerResponsesHandler::isEmpty() { @@ -123,11 +131,13 @@ namespace asteriskcpp { { if (!isEmpty()) { - for (listenersList_t::const_iterator it = this->listeners.begin(); it != this->listeners.end(); it++) { + for (listenersList_t::const_iterator it = this->listeners.begin(); it != this->listeners.end(); ) { ResponseCallBack* m = (*it).second; if (boost::get_system_time() >= m->timeout) { m->fireTimeout(); - removeResponseListener((*it).first); + removeResponseListener((*it++).first); + } else { + ++it; } } } @@ -138,8 +148,8 @@ namespace asteriskcpp { void ManagerResponsesHandler::clear() { boost::lock_guard lock(this->m_mutex); - for (listenersList_t::const_iterator it = this->listeners.begin(); it != this->listeners.end(); it++) { - removeResponseListener((*it).first); + for (listenersList_t::const_iterator it = this->listeners.begin(); it != this->listeners.end(); ) { + removeResponseListener((*it++).first); } this->m_cond.notify_all(); LOG_TRACE_STR("OUT"); From ba78cc2c08e74a4727c19d86b150e1f735fefb71 Mon Sep 17 00:00:00 2001 From: iijima Date: Tue, 7 Jul 2015 16:45:05 +0900 Subject: [PATCH 25/47] added thread synchronize --- .../asteriskcpp/manager/ManagerResponsesHandler.h | 1 + asterisk-cpp/src/manager/ManagerResponsesHandler.cpp | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h b/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h index e7895ef..037169a 100644 --- a/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h +++ b/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h @@ -53,6 +53,7 @@ namespace asteriskcpp { boost::mutex m_mutex; boost::condition_variable m_cond; bool isReady; + bool isStollEnd; public: virtual ~SyncResponseCallBack(); diff --git a/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp b/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp index fbf57a8..b847f4a 100644 --- a/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp +++ b/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp @@ -43,12 +43,15 @@ namespace asteriskcpp { } SyncResponseCallBack::SyncResponseCallBack(ManagerAction* a, unsigned int timeOut) : - ResponseCallBack(a, timeOut), response(NULL), isReady(false) { + ResponseCallBack(a, timeOut), response(NULL), isReady(false), isStollEnd(false) { } SyncResponseCallBack::~SyncResponseCallBack() { - boost::lock_guard lock(this->m_mutex); + boost::unique_lock lock(this->m_mutex); this->m_cond.notify_all(); + if (this->isStollEnd == false) { + this->m_cond.wait(lock); + } LOG_TRACE_STR("OUT"); } @@ -58,6 +61,8 @@ namespace asteriskcpp { if (this->isReady == false) { this->m_cond.wait(lock); } + this->isStollEnd = true; + this->m_cond.notify_all(); LOG_TRACE_STR("OUT"); } From 08ede5fbd38e5046ce0da29e040852ca73c39664 Mon Sep 17 00:00:00 2001 From: iijima Date: Tue, 7 Jul 2015 17:13:12 +0900 Subject: [PATCH 26/47] performed a change to follow the outbreak order of event, and to handle it --- asterisk-cpp/src/manager/ManagerEventsHandler.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/asterisk-cpp/src/manager/ManagerEventsHandler.cpp b/asterisk-cpp/src/manager/ManagerEventsHandler.cpp index 8902b5e..4d880c3 100644 --- a/asterisk-cpp/src/manager/ManagerEventsHandler.cpp +++ b/asterisk-cpp/src/manager/ManagerEventsHandler.cpp @@ -43,7 +43,9 @@ namespace asteriskcpp { } void ManagerEventsHandler::fireEvent(ManagerEvent* me) { - boost::thread t(boost::bind(&ManagerEventsHandler::internalFireEvent, this, me)); + //The outbreak order of event cannot work when I make thread here + //boost::thread t(boost::bind(&ManagerEventsHandler::internalFireEvent, this, me)); + this->internalFireEvent(me); } void ManagerEventsHandler::internalFireEvent(ManagerEvent* me) { @@ -58,6 +60,7 @@ namespace asteriskcpp { } delete me; + LOG_DEBUG_STR("OUT"); } } From 5d7413dd8d02f2d6c8f86766a8e7287630801a5a Mon Sep 17 00:00:00 2001 From: iijima Date: Wed, 22 Jul 2015 18:50:44 +0900 Subject: [PATCH 27/47] fix memory leak probrem --- asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h | 3 ++- asterisk-cpp/src/manager/ManagerConnection.cpp | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h b/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h index 037169a..47d6595 100644 --- a/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h +++ b/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h @@ -68,7 +68,6 @@ namespace asteriskcpp { typedef std::map listenersList_t; boost::mutex m_mutex; boost::condition_variable m_cond; - ResponseCallBack* getListener(const std::string& key); public: virtual ~ManagerResponsesHandler(); @@ -79,6 +78,8 @@ namespace asteriskcpp { virtual void stop(); virtual void run(); + ResponseCallBack* getListener(const std::string& key); + protected: listenersList_t listeners; void clear(); diff --git a/asterisk-cpp/src/manager/ManagerConnection.cpp b/asterisk-cpp/src/manager/ManagerConnection.cpp index fc99a5e..f92793e 100644 --- a/asterisk-cpp/src/manager/ManagerConnection.cpp +++ b/asterisk-cpp/src/manager/ManagerConnection.cpp @@ -234,13 +234,12 @@ namespace asteriskcpp { ManagerAction *action = NULL; std::string actionId = extractActionID(response); if (!actionId.empty()) { - ResponseCallBack *cb = ManagerResponsesHandler::listeners[actionId]; + ResponseCallBack *cb = this->getListener(actionId); if (cb != NULL) { action = cb->getAction(); + this->fireResponseCallback(this->responseBuilder.buildResponse(action, response)); } } - - this->fireResponseCallback(this->responseBuilder.buildResponse(action, response)); } void ManagerConnection::dispatchEvent(const std::string& event) { From d95416ed329615fe8205c12679d60840ffe1bba3 Mon Sep 17 00:00:00 2001 From: iijima Date: Wed, 29 Jul 2015 19:39:00 +0900 Subject: [PATCH 28/47] fix some probrems --- asterisk-cpp/Makefile.am | 1 + asterisk-cpp/asteriskcpp/manager/Dispatcher.h | 56 +++++++++++++++++ .../asteriskcpp/manager/ManagerConnection.h | 1 + .../manager/ManagerResponsesHandler.h | 8 ++- asterisk-cpp/asteriskcpp/manager/Reader.h | 9 +++ asterisk-cpp/src/manager/Dispatcher.cpp | 63 +++++++++++++++++++ asterisk-cpp/src/manager/EventBuilder.cpp | 2 +- .../src/manager/ManagerConnection.cpp | 8 ++- .../src/manager/ManagerResponsesHandler.cpp | 15 +++-- asterisk-cpp/src/manager/Reader.cpp | 33 +++++++++- 10 files changed, 181 insertions(+), 15 deletions(-) create mode 100644 asterisk-cpp/src/manager/Dispatcher.cpp diff --git a/asterisk-cpp/Makefile.am b/asterisk-cpp/Makefile.am index fec83fc..e908474 100644 --- a/asterisk-cpp/Makefile.am +++ b/asterisk-cpp/Makefile.am @@ -38,6 +38,7 @@ libasteriskcpp_la_SOURCES= \ src/manager/ManagerEventListener.cpp \ src/manager/ManagerEventsHandler.cpp \ src/manager/ManagerConnection.cpp \ + src/manager/Dispatcher.cpp \ src/manager/EventBuilder.cpp \ src/manager/events/SkypeBuddyEntryEvent.cpp \ src/manager/events/AsyncAgiEvent.cpp \ diff --git a/asterisk-cpp/asteriskcpp/manager/Dispatcher.h b/asterisk-cpp/asteriskcpp/manager/Dispatcher.h index b384d3d..9450311 100644 --- a/asterisk-cpp/asteriskcpp/manager/Dispatcher.h +++ b/asterisk-cpp/asteriskcpp/manager/Dispatcher.h @@ -11,6 +11,9 @@ #include "events/ManagerEvent.h" #include "responses/ManagerResponse.h" #include "AsteriskVersion.h" +#include "../structs/Thread.h" + +#include namespace asteriskcpp { @@ -26,6 +29,59 @@ namespace asteriskcpp { virtual void notifyDisconnect() = 0; }; + class MessageTable { + private: + std::queue messageQueue; + boost::mutex mutex; + boost::condition_variable condition; + + public: + MessageTable() {} + ~MessageTable(); + void put(std::string message); + std::string take(); + }; + + class DispatchThread : public Thread { + private: + boost::mutex m_mutex; + boost::condition_variable m_cond; + + MessageTable* messageTable; + + public: + DispatchThread(MessageTable* mt, Dispatcher* f); + virtual ~DispatchThread(); + + virtual void stop(); + virtual void run(); + + protected: + Dispatcher* dispatcher; + virtual void fireDispatch(std::string message) = 0; + }; + + class ResponseDispatchThread : public DispatchThread { + public: + ResponseDispatchThread(MessageTable* mt, Dispatcher* f) + : DispatchThread(mt, f) {} + virtual ~ResponseDispatchThread() {} + protected: + virtual void fireDispatch(std::string message) { + this->dispatcher->dispatchResponse(message); + } + }; + + class EventDispatchThread : public DispatchThread { + public: + EventDispatchThread(MessageTable* mt, Dispatcher* f) + : DispatchThread(mt, f) {} + virtual ~EventDispatchThread() {} + protected: + virtual void fireDispatch(std::string message) { + this->dispatcher->dispatchEvent(message); + } + }; } #endif /* DISPATCHER_H_ */ diff --git a/asterisk-cpp/asteriskcpp/manager/ManagerConnection.h b/asterisk-cpp/asteriskcpp/manager/ManagerConnection.h index 34def65..574e337 100644 --- a/asterisk-cpp/asteriskcpp/manager/ManagerConnection.h +++ b/asterisk-cpp/asteriskcpp/manager/ManagerConnection.h @@ -69,6 +69,7 @@ namespace asteriskcpp { void dispatchResponse(const std::string& response); void dispatchEvent(const std::string& event); void notifyDisconnect(); + virtual void notifyResponseMessage(const std::string& responseMessage); private: diff --git a/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h b/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h index 47d6595..7f749d6 100644 --- a/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h +++ b/asterisk-cpp/asteriskcpp/manager/ManagerResponsesHandler.h @@ -25,6 +25,7 @@ namespace asteriskcpp { class ResponseCallBack { public: boost::system_time timeout; + bool isTimeout; ResponseCallBack(ManagerAction* a, unsigned int tout); virtual ~ResponseCallBack(); @@ -42,7 +43,7 @@ namespace asteriskcpp { class ASyncResponseCallBack : public ResponseCallBack { public: ASyncResponseCallBack(ManagerAction* a, unsigned int tout, responseCallbackFunction_t f); - virtual ~ASyncResponseCallBack(); + virtual ~ASyncResponseCallBack(); virtual void fireCallBack(ManagerResponse* mr); protected: @@ -60,13 +61,13 @@ namespace asteriskcpp { ManagerResponse *response; SyncResponseCallBack(ManagerAction* a, unsigned int timeOut); - void stoll(); + ManagerResponse* stoll(); virtual void fireCallBack(ManagerResponse* mr); }; class ManagerResponsesHandler : public Thread { - typedef std::map listenersList_t; boost::mutex m_mutex; + typedef std::map listenersList_t; boost::condition_variable m_cond; public: @@ -84,6 +85,7 @@ namespace asteriskcpp { listenersList_t listeners; void clear(); void fireResponseCallback(ManagerResponse* mr); + virtual void notifyResponseMessage(const std::string& responseMessage) {}; }; diff --git a/asterisk-cpp/asteriskcpp/manager/Reader.h b/asterisk-cpp/asteriskcpp/manager/Reader.h index 5e90af1..2edbba8 100644 --- a/asterisk-cpp/asteriskcpp/manager/Reader.h +++ b/asterisk-cpp/asteriskcpp/manager/Reader.h @@ -21,6 +21,10 @@ namespace asteriskcpp { void start(TCPSocket* s, Dispatcher* d); void stop(); void run(); + virtual ~Reader(); + + void delegeteResponseMessage(const std::string& responseMessage); + void delegeteEventMessage(const std::string& eventMessage); private: using Thread::start; @@ -28,6 +32,11 @@ namespace asteriskcpp { Dispatcher* dispatcher; std::string unprocessedStr; + MessageTable* responseMessageTable; + MessageTable* eventMessageTable; + DispatchThread* responseThread; + DispatchThread* eventThread; + void processIncomming(const std::string& newStr); }; diff --git a/asterisk-cpp/src/manager/Dispatcher.cpp b/asterisk-cpp/src/manager/Dispatcher.cpp new file mode 100644 index 0000000..27a9555 --- /dev/null +++ b/asterisk-cpp/src/manager/Dispatcher.cpp @@ -0,0 +1,63 @@ + +#include "asteriskcpp/manager/Dispatcher.h" +#include "asteriskcpp/utils/LogHandler.h" + +namespace asteriskcpp { + + MessageTable::~MessageTable() { + boost::mutex::scoped_lock lock(this->mutex); + this->condition.notify_all(); + } + + void MessageTable::put(std::string message) { + static int MAX_COMMAND = 10000; + boost::mutex::scoped_lock lock(this->mutex); + while (this->messageQueue.size() >= MAX_COMMAND) { + this->condition.wait(lock); + } + this->messageQueue.push(message); + this->condition.notify_all(); + } + + std::string MessageTable::take() { + boost::mutex::scoped_lock lock(this->mutex); + + while (this->messageQueue.size() <= 0) { + this->condition.wait(lock); + } + + std::string message = this->messageQueue.front(); + this->messageQueue.pop(); + this->condition.notify_all(); + + return message; + } + + + DispatchThread::DispatchThread(MessageTable* mt, Dispatcher* d) + : messageTable(mt), dispatcher(d) + { + } + + DispatchThread::~DispatchThread() { + } + + void DispatchThread::stop() { + if (!Thread::isStoped()) { + Thread::stop(); + } + } + + void DispatchThread::run() { + static int LOOP_INTERVAL = 10; + boost::posix_time::milliseconds duration(LOOP_INTERVAL); + boost::this_thread::sleep(duration); + { + //boost::this_thread::disable_interruption di; + { + std::string message = this->messageTable->take(); + this->fireDispatch(message); + } + } + } +} diff --git a/asterisk-cpp/src/manager/EventBuilder.cpp b/asterisk-cpp/src/manager/EventBuilder.cpp index 9ad6306..98907db 100644 --- a/asterisk-cpp/src/manager/EventBuilder.cpp +++ b/asterisk-cpp/src/manager/EventBuilder.cpp @@ -174,7 +174,7 @@ namespace asteriskcpp { if (it != eventFactoryMap.end()) { return ((it->second)->create(eventStr)); } else { - LOG_WARN_STR("EVENT:INVALID OR NOT IMPLEMENTED \n" + str2Log(eventStr)); + //LOG_WARN_STR("EVENT:INVALID OR NOT IMPLEMENTED \n" + str2Log(eventStr)); return (new ManagerEvent(eventStr)); } } diff --git a/asterisk-cpp/src/manager/ManagerConnection.cpp b/asterisk-cpp/src/manager/ManagerConnection.cpp index f92793e..5fcab3e 100644 --- a/asterisk-cpp/src/manager/ManagerConnection.cpp +++ b/asterisk-cpp/src/manager/ManagerConnection.cpp @@ -98,8 +98,8 @@ namespace asteriskcpp { SyncResponseCallBack *srcb = new SyncResponseCallBack(&action, timeout); addResponsetListener(action.generateID(), srcb); send(action.toString()); - srcb->stoll(); - return (srcb->response); + ManagerResponse* mr = srcb->stoll(); + return mr; } void ManagerConnection::addEventCallback(onManagerEventCallback_t callback) { @@ -259,6 +259,10 @@ namespace asteriskcpp { } } + void ManagerConnection::notifyResponseMessage(const std::string& responseMessage) { + this->reader.delegeteResponseMessage(responseMessage); + } + bool ManagerConnection::login() { return (this->login(NULL)); } diff --git a/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp b/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp index b847f4a..52742c2 100644 --- a/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp +++ b/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp @@ -13,7 +13,8 @@ namespace asteriskcpp { - ResponseCallBack::ResponseCallBack(ManagerAction* a, unsigned int tout) { + ResponseCallBack::ResponseCallBack(ManagerAction* a, unsigned int tout) + : isTimeout(false) { setAction(a); this->timeout = boost::get_system_time() + boost::posix_time::milliseconds(tout); } @@ -55,15 +56,17 @@ namespace asteriskcpp { LOG_TRACE_STR("OUT"); } - void SyncResponseCallBack::stoll() { + ManagerResponse* SyncResponseCallBack::stoll() { boost::unique_lock lock(this->m_mutex); LOG_TRACE_STR(""); if (this->isReady == false) { this->m_cond.wait(lock); } + ManagerResponse* mr = this->response; this->isStollEnd = true; this->m_cond.notify_all(); LOG_TRACE_STR("OUT"); + return response; } void SyncResponseCallBack::fireCallBack(ManagerResponse* mr) { @@ -135,12 +138,12 @@ namespace asteriskcpp { boost::this_thread::disable_interruption di; { if (!isEmpty()) { - for (listenersList_t::const_iterator it = this->listeners.begin(); it != this->listeners.end(); ) { ResponseCallBack* m = (*it).second; - if (boost::get_system_time() >= m->timeout) { - m->fireTimeout(); - removeResponseListener((*it++).first); + if ((boost::get_system_time() >= m->timeout) && (m->isTimeout == false)) { + m->isTimeout = true; + std::string msg = "Response: Error\r\nActionID: " + m->getAction()->getActionId() + "\r\nMessage: Time Out\r\n\r\n"; + this->notifyResponseMessage(msg); } else { ++it; } diff --git a/asterisk-cpp/src/manager/Reader.cpp b/asterisk-cpp/src/manager/Reader.cpp index 5ef3a02..38f9c07 100644 --- a/asterisk-cpp/src/manager/Reader.cpp +++ b/asterisk-cpp/src/manager/Reader.cpp @@ -27,12 +27,29 @@ namespace asteriskcpp { void Reader::start(TCPSocket* s, Dispatcher* d) { connectionSocket = s; dispatcher = d; + + this->responseMessageTable = new MessageTable(); + this->responseThread = new ResponseDispatchThread(this->responseMessageTable, d); + this->responseThread->start(); + this->eventMessageTable = new MessageTable(); + this->eventThread = new EventDispatchThread(this->eventMessageTable, d); + this->eventThread->start(); + Thread::start(); } + Reader::~Reader() { + this->responseThread->stop(); + this->eventThread->stop(); + delete this->responseThread; + delete this->eventThread; + delete this->responseMessageTable; + delete this->eventMessageTable; + } + void Reader::stop() { Thread::stop(); - dispatcher->notifyDisconnect(); + dispatcher->notifyDisconnect(); dispatcher = NULL; connectionSocket = NULL; } @@ -48,6 +65,8 @@ namespace asteriskcpp { processIncomming(rsv); rsv.clear(); } + } else { + usleep(5000); } } catch (SocketException& e) { stop(); @@ -60,6 +79,14 @@ namespace asteriskcpp { } } + void Reader::delegeteResponseMessage(const std::string& responseMessage) { + this->responseMessageTable->put(responseMessage); + } + + void Reader::delegeteEventMessage(const std::string& eventMessage) { + this->eventMessageTable->put(eventMessage); + } + void Reader::processIncomming(const std::string& newStr) { size_t cutAt, endAt; @@ -110,12 +137,12 @@ namespace asteriskcpp { case 2: case 3: { - dispatcher->dispatchResponse(nstr); + this->responseMessageTable->put(nstr); } break; case 4: { - dispatcher->dispatchEvent(nstr); + this->eventMessageTable->put(nstr); } break; default: From d71f3e3455efd40a1694132d01ababe812d62dc4 Mon Sep 17 00:00:00 2001 From: iijima Date: Fri, 21 Aug 2015 09:29:26 +0900 Subject: [PATCH 29/47] fix segmentation fault --- asterisk-cpp/src/manager/ManagerResponsesHandler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp b/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp index 52742c2..b55128a 100644 --- a/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp +++ b/asterisk-cpp/src/manager/ManagerResponsesHandler.cpp @@ -93,7 +93,6 @@ namespace asteriskcpp { } ManagerResponsesHandler::~ManagerResponsesHandler() { - this->stop(); } void ManagerResponsesHandler::addResponsetListener(const std::string& key, ResponseCallBack* bcb) { @@ -105,6 +104,7 @@ namespace asteriskcpp { } void ManagerResponsesHandler::removeResponseListener(const std::string& key) { + boost::lock_guard lock(this->m_mutex); std::string keytmp = key; LOG_TRACE_STR("REMOVE RESPONSE Listener " + key); ResponseCallBack* m = getListener(key); @@ -135,9 +135,10 @@ namespace asteriskcpp { boost::posix_time::milliseconds duration(LOOP_INTERVAL); boost::this_thread::sleep(duration); { - boost::this_thread::disable_interruption di; + //boost::this_thread::disable_interruption di; { - if (!isEmpty()) { + boost::lock_guard lock(this->m_mutex); + if (!this->listeners.empty()) { for (listenersList_t::const_iterator it = this->listeners.begin(); it != this->listeners.end(); ) { ResponseCallBack* m = (*it).second; if ((boost::get_system_time() >= m->timeout) && (m->isTimeout == false)) { @@ -149,7 +150,6 @@ namespace asteriskcpp { } } } - } } } From 01493ab0f3a93107aedcd328af97fca17c5f3278 Mon Sep 17 00:00:00 2001 From: iijima Date: Mon, 29 Feb 2016 19:54:32 +0900 Subject: [PATCH 30/47] add reopen log file method --- asterisk-cpp/asteriskcpp/utils/LogHandler.h | 3 +++ asterisk-cpp/src/utils/LogHandler.cpp | 25 ++++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/asterisk-cpp/asteriskcpp/utils/LogHandler.h b/asterisk-cpp/asteriskcpp/utils/LogHandler.h index 15df8bb..38ca316 100644 --- a/asterisk-cpp/asteriskcpp/utils/LogHandler.h +++ b/asterisk-cpp/asteriskcpp/utils/LogHandler.h @@ -84,9 +84,12 @@ namespace asteriskcpp { void log(const std::string& line, LogLevel level); + void reopenFile(); + private: LogHandler(); LogHandler(const std::string& confFile); + void setup(); }; } diff --git a/asterisk-cpp/src/utils/LogHandler.cpp b/asterisk-cpp/src/utils/LogHandler.cpp index f7756a4..a1dd289 100644 --- a/asterisk-cpp/src/utils/LogHandler.cpp +++ b/asterisk-cpp/src/utils/LogHandler.cpp @@ -13,6 +13,8 @@ namespace asteriskcpp { + boost::mutex lockLogger; + LogHandler::LogHandler() { log4cplus::BasicConfigurator::doConfigure(); log4cplus::Logger::getRoot().setLogLevel(log4cplus::TRACE_LOG_LEVEL); @@ -20,12 +22,7 @@ namespace asteriskcpp { LogHandler::LogHandler(const std::string& confFile) : confFile(confFile) { - if (confFile.empty()) { - log4cplus::BasicConfigurator::doConfigure(); - log4cplus::Logger::getRoot().setLogLevel(log4cplus::TRACE_LOG_LEVEL); - } else { - log4cplus::PropertyConfigurator::doConfigure(confFile); - } + this->setup(); } LogHandler::~LogHandler() { @@ -33,6 +30,7 @@ namespace asteriskcpp { } void LogHandler::setLevel(const LogLevel& level) { + boost::mutex::scoped_lock lock(lockLogger); switch (level) { case LL_TRACE: { @@ -73,6 +71,7 @@ namespace asteriskcpp { } void LogHandler::log(const std::string& line, LogLevel level) { + boost::mutex::scoped_lock lock(lockLogger); switch (level) { case LL_TRACE: { @@ -112,4 +111,18 @@ namespace asteriskcpp { } } + void LogHandler::setup() { + if (confFile.empty()) { + log4cplus::BasicConfigurator::doConfigure(); + log4cplus::Logger::getRoot().setLogLevel(log4cplus::TRACE_LOG_LEVEL); + } else { + log4cplus::PropertyConfigurator::doConfigure(confFile); + } + } + + void LogHandler::reopenFile() { + boost::mutex::scoped_lock lock(lockLogger); + log4cplus::Logger::shutdown(); + this->setup(); + } } From 21c3ee011280bbf8b1d7f1d75656d091e3ef640c Mon Sep 17 00:00:00 2001 From: iijima Date: Thu, 3 Mar 2016 14:06:23 +0900 Subject: [PATCH 31/47] fix segmentation fault --- asterisk-cpp/src/manager/ManagerConnection.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/asterisk-cpp/src/manager/ManagerConnection.cpp b/asterisk-cpp/src/manager/ManagerConnection.cpp index 5fcab3e..23e2065 100644 --- a/asterisk-cpp/src/manager/ManagerConnection.cpp +++ b/asterisk-cpp/src/manager/ManagerConnection.cpp @@ -75,7 +75,14 @@ namespace asteriskcpp { return; } - this->socket->writeData(data); + try { + this->socket->writeData(data); + } catch (Exception& E) { + LOG_ERROR_STR(E.getMessage()); + this->reader.stop(); + this->notifyDisconnect(); + } + LOG_TRACE_STR("OUT"); } From 7d68835914526b42a371a2bf4865e601a2a0afa0 Mon Sep 17 00:00:00 2001 From: iijima Date: Mon, 7 Mar 2016 11:01:09 +0900 Subject: [PATCH 32/47] fix problem make plural event process thread --- asterisk-cpp/src/manager/ManagerConnection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asterisk-cpp/src/manager/ManagerConnection.cpp b/asterisk-cpp/src/manager/ManagerConnection.cpp index 23e2065..bd54d2e 100644 --- a/asterisk-cpp/src/manager/ManagerConnection.cpp +++ b/asterisk-cpp/src/manager/ManagerConnection.cpp @@ -29,9 +29,11 @@ namespace asteriskcpp { ManagerConnection::ManagerConnection() : state(DISCONNECTED), hostname(DEFAULT_HOSTNAME), port(DEFAULT_PORT), ssl(false), defaultResponseTimeout(DEFAULT_TIMEOUT), socket(NULL) { + ManagerResponsesHandler::start(); } ManagerConnection::~ManagerConnection() { + ManagerResponsesHandler::stop(); disconnect(); } @@ -183,13 +185,11 @@ namespace asteriskcpp { //transition to connected LOG_INFO_STR("CONNECTED"); this->reader.start(socket, this); - ManagerResponsesHandler::start(); break; case CONNECTED: if (newState == DISCONNECTED) { //to disconnected LOG_INFO_STR("DISCONNECTED"); - ManagerResponsesHandler::stop(); this->reader.stop(); } else { //to authenticated From d4be88725d1953fc0eaf3e6f2fa805e6a2c23d87 Mon Sep 17 00:00:00 2001 From: iijima Date: Tue, 5 Apr 2016 15:21:00 +0900 Subject: [PATCH 33/47] deleted upper limit of recv buffer --- asterisk-cpp/src/manager/Dispatcher.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/asterisk-cpp/src/manager/Dispatcher.cpp b/asterisk-cpp/src/manager/Dispatcher.cpp index 27a9555..b3ffd41 100644 --- a/asterisk-cpp/src/manager/Dispatcher.cpp +++ b/asterisk-cpp/src/manager/Dispatcher.cpp @@ -10,12 +10,12 @@ namespace asteriskcpp { } void MessageTable::put(std::string message) { - static int MAX_COMMAND = 10000; boost::mutex::scoped_lock lock(this->mutex); - while (this->messageQueue.size() >= MAX_COMMAND) { - this->condition.wait(lock); + try { + this->messageQueue.push(message); + } catch (std::bad_alloc& e) { + LOG_ERROR_STR("catch bad_alloc."); } - this->messageQueue.push(message); this->condition.notify_all(); } From e47902592b222646f389d2c6a2bc9cef2c8cb059 Mon Sep 17 00:00:00 2001 From: iijima Date: Mon, 3 Oct 2016 15:13:33 +0900 Subject: [PATCH 34/47] fix memory leak --- asterisk-cpp/asteriskcpp/manager/Reader.h | 1 + .../src/manager/ManagerConnection.cpp | 2 +- asterisk-cpp/src/manager/Reader.cpp | 30 +++++++++++++++---- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/asterisk-cpp/asteriskcpp/manager/Reader.h b/asterisk-cpp/asteriskcpp/manager/Reader.h index 2edbba8..4cf1001 100644 --- a/asterisk-cpp/asteriskcpp/manager/Reader.h +++ b/asterisk-cpp/asteriskcpp/manager/Reader.h @@ -18,6 +18,7 @@ namespace asteriskcpp { class Reader : public Thread { public: + Reader(); void start(TCPSocket* s, Dispatcher* d); void stop(); void run(); diff --git a/asterisk-cpp/src/manager/ManagerConnection.cpp b/asterisk-cpp/src/manager/ManagerConnection.cpp index bd54d2e..3b357de 100644 --- a/asterisk-cpp/src/manager/ManagerConnection.cpp +++ b/asterisk-cpp/src/manager/ManagerConnection.cpp @@ -180,7 +180,7 @@ namespace asteriskcpp { switch (state) { //from state.. case DISCONNECTED: if (newState != CONNECTED) { - throw new Exception(transition.str()); + Throw(Exception(transition.str())); } //transition to connected LOG_INFO_STR("CONNECTED"); diff --git a/asterisk-cpp/src/manager/Reader.cpp b/asterisk-cpp/src/manager/Reader.cpp index 38f9c07..0b2eb08 100644 --- a/asterisk-cpp/src/manager/Reader.cpp +++ b/asterisk-cpp/src/manager/Reader.cpp @@ -24,16 +24,34 @@ const unsigned int RCVBUFSIZE = 65536; namespace asteriskcpp { + Reader::Reader() + : connectionSocket(NULL) + , dispatcher(NULL) + , responseMessageTable(NULL) + , eventMessageTable(NULL) + , responseThread(NULL) + , eventThread(NULL) + { + } + void Reader::start(TCPSocket* s, Dispatcher* d) { connectionSocket = s; dispatcher = d; - this->responseMessageTable = new MessageTable(); - this->responseThread = new ResponseDispatchThread(this->responseMessageTable, d); - this->responseThread->start(); - this->eventMessageTable = new MessageTable(); - this->eventThread = new EventDispatchThread(this->eventMessageTable, d); - this->eventThread->start(); + if (this->responseMessageTable == NULL) { + this->responseMessageTable = new MessageTable(); + } + if (this->responseThread == NULL) { + this->responseThread = new ResponseDispatchThread(this->responseMessageTable, d); + this->responseThread->start(); + } + if (this->eventMessageTable == NULL) { + this->eventMessageTable = new MessageTable(); + } + if (this->eventThread == NULL) { + this->eventThread = new EventDispatchThread(this->eventMessageTable, d); + this->eventThread->start(); + } Thread::start(); } From 80b3e9cf7d017aa0df92a00f2aae52ddedf2c426 Mon Sep 17 00:00:00 2001 From: Augusto Campos Date: Tue, 26 Sep 2017 01:14:15 +0100 Subject: [PATCH 35/47] Create .travis.yml --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..41f03a8 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: cpp +compiler: gcc + +install: true + +before_script: cd asterisk-cpp + +script: + - aclocal ; autoheader; automake -a -c; libtoolize --force --copy; autoconf; + - autoconf; automake; ./configure + - make +# - sudo make install From dbd7bfc380274eadd1db64d21a8e0ca9f88d1353 Mon Sep 17 00:00:00 2001 From: Augusto Campos Date: Tue, 26 Sep 2017 01:16:37 +0100 Subject: [PATCH 36/47] Update .travis.yml --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 41f03a8..a58e7bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,10 @@ language: cpp compiler: gcc +before_install: + - sudo apt-get -qq update + - sudo apt-get install -y liblog4cplus-dev libssl-dev libboost-thread-dev libboost-regex-dev + install: true before_script: cd asterisk-cpp From 14587cf208e4c6b32dc9b4da548bcfbd0758c428 Mon Sep 17 00:00:00 2001 From: Augusto Campos Date: Tue, 26 Sep 2017 01:21:48 +0100 Subject: [PATCH 37/47] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b867dec..d5020d3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -asterisk-cpp +asterisk-cpp [![Build Status](https://travis-ci.org/augcampos/asterisk-cpp.svg?branch=master)](https://travis-ci.org/augcampos/asterisk-cpp) ============ The free C++ library for Asterisk PBX integration. (asterisk-java ported) From cf3c02d00c2885badf117edeadd3b6f0b1fc05fe Mon Sep 17 00:00:00 2001 From: Augusto Campos Date: Sun, 11 Feb 2018 02:11:17 +0000 Subject: [PATCH 38/47] Update .travis.yml --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a58e7bc..1e94a5c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,4 +13,5 @@ script: - aclocal ; autoheader; automake -a -c; libtoolize --force --copy; autoconf; - autoconf; automake; ./configure - make -# - sudo make install + - ls -ls + - sudo make install From 2793690faa29e3306c34f4b56138ef812e5fed9e Mon Sep 17 00:00:00 2001 From: Augusto Campos Date: Fri, 1 Jul 2022 02:58:48 +0000 Subject: [PATCH 39/47] fix tests and add Makefile --- Makefile | 37 ++++++++++++++++++++++++++++++++++ asterisk-cpp/examples/Test.cpp | 4 ++-- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100755 Makefile diff --git a/Makefile b/Makefile new file mode 100755 index 0000000..28aa647 --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +#!/usr/bin/env make + +SRC_FOLDER:=asterisk-cpp +EXAMPLE_FOLDER:=asterisk-cpp/examples + +ALL: clean dependencies install + @echo " -- ALL -- " + +clean: + cd $(SRC_FOLDER); make clean + rm -f $(EXAMPLE_FOLDER)/tt + rm -f $(EXAMPLE_FOLDER)/teste + +dependencies: + sudo apt-get -qy install liblog4cplus-dev libssl-dev libboost-thread-dev libboost-regex-dev + +build: + cd $(SRC_FOLDER); aclocal ; autoheader; automake -a -c; libtoolize --force --copy; autoconf + cd $(SRC_FOLDER); autoconf; automake --add-missing; ./configure + cd $(SRC_FOLDER); make + ls -la /usr/local/include/asteriskcpp + +/usr/lib/libasteriskcpp.so: build + cd $(SRC_FOLDER); sudo make install + sudo ln -s /usr/local/lib/libasteriskcpp.so /usr/lib/libasteriskcpp.so + sudo ln -s /usr/local/lib/libasteriskcpp.so.0 /usr/lib/libasteriskcpp.so.0 + +install: /usr/lib/libasteriskcpp.so + + +$(EXAMPLE_FOLDER)/tt: + cd $(EXAMPLE_FOLDER); g++ Test.cpp -o tt -L/usr/local/lib/ -lasteriskcpp -lpthread +$(EXAMPLE_FOLDER)/teste: + cd $(EXAMPLE_FOLDER); sh ./makeTest.sh + +test: $(EXAMPLE_FOLDER)/tt $(EXAMPLE_FOLDER)/teste + $(EXAMPLE_FOLDER)/teste \ No newline at end of file diff --git a/asterisk-cpp/examples/Test.cpp b/asterisk-cpp/examples/Test.cpp index 148a479..4d92afb 100644 --- a/asterisk-cpp/examples/Test.cpp +++ b/asterisk-cpp/examples/Test.cpp @@ -36,9 +36,9 @@ int main() { for (int i = 0; i < 1; i++) { asteriskcpp::EventsAction ea("OFF"); - mc.sendAction(ea); + mc.sendAction(&ea); ea.setEventMask("ON"); - mc.sendAction(ea); + mc.sendAction(&ea); asteriskcpp::ManagerResponse* rpc; asteriskcpp::AbsoluteTimeoutAction ata("SIP/1000", 30); From 8f662338a006cafe3c585ba120bf07ef5b9b6da2 Mon Sep 17 00:00:00 2001 From: Augusto Campos Date: Fri, 1 Jul 2022 03:08:40 +0000 Subject: [PATCH 40/47] fix Makefile clean goal --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 28aa647..27e6652 100755 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ clean: cd $(SRC_FOLDER); make clean rm -f $(EXAMPLE_FOLDER)/tt rm -f $(EXAMPLE_FOLDER)/teste + sudo rm -f /usr/lib/libasteriskcpp.so* dependencies: sudo apt-get -qy install liblog4cplus-dev libssl-dev libboost-thread-dev libboost-regex-dev @@ -34,4 +35,5 @@ $(EXAMPLE_FOLDER)/teste: cd $(EXAMPLE_FOLDER); sh ./makeTest.sh test: $(EXAMPLE_FOLDER)/tt $(EXAMPLE_FOLDER)/teste + $(EXAMPLE_FOLDER)/tt $(EXAMPLE_FOLDER)/teste \ No newline at end of file From a71d306cf8f29abc52c50cb9d15ad83cbf8a1f63 Mon Sep 17 00:00:00 2001 From: Augusto Campos Date: Fri, 1 Jul 2022 03:20:05 +0000 Subject: [PATCH 41/47] Fix Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 27e6652..50bb962 100755 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ ALL: clean dependencies install @echo " -- ALL -- " clean: - cd $(SRC_FOLDER); make clean + cd $(SRC_FOLDER); make clean || true rm -f $(EXAMPLE_FOLDER)/tt rm -f $(EXAMPLE_FOLDER)/teste sudo rm -f /usr/lib/libasteriskcpp.so* From 4426e8a85eab1eb079f7834d7a46ae0c431491e2 Mon Sep 17 00:00:00 2001 From: Augusto Campos Date: Fri, 1 Jul 2022 03:21:53 +0000 Subject: [PATCH 42/47] Fix Makefile --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 50bb962..62ed706 100755 --- a/Makefile +++ b/Makefile @@ -21,7 +21,9 @@ build: cd $(SRC_FOLDER); make ls -la /usr/local/include/asteriskcpp -/usr/lib/libasteriskcpp.so: build +/usr/local/lib/libasteriskcpp.so: build build # some times need a 2nd build + +/usr/lib/libasteriskcpp.so: /usr/local/lib/libasteriskcpp.so cd $(SRC_FOLDER); sudo make install sudo ln -s /usr/local/lib/libasteriskcpp.so /usr/lib/libasteriskcpp.so sudo ln -s /usr/local/lib/libasteriskcpp.so.0 /usr/lib/libasteriskcpp.so.0 From 0302dc8a1ccca9a9aec7c34fc9229a2bc6f81de1 Mon Sep 17 00:00:00 2001 From: Augusto Campos Date: Fri, 1 Jul 2022 03:23:04 +0000 Subject: [PATCH 43/47] Fix Makefile --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 62ed706..c92a45d 100755 --- a/Makefile +++ b/Makefile @@ -1,5 +1,9 @@ #!/usr/bin/env make +# Makefile to build and test c++ asteriskcpp lib +# optimized for ubuntu, needs sudo pervileges + + SRC_FOLDER:=asterisk-cpp EXAMPLE_FOLDER:=asterisk-cpp/examples From 921423e0d1b6042d0ce2be6d7b9d98af4feb7460 Mon Sep 17 00:00:00 2001 From: Augusto Campos Date: Fri, 1 Jul 2022 03:51:25 +0000 Subject: [PATCH 44/47] Fix Makefile --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c92a45d..fb53722 100755 --- a/Makefile +++ b/Makefile @@ -23,8 +23,7 @@ build: cd $(SRC_FOLDER); aclocal ; autoheader; automake -a -c; libtoolize --force --copy; autoconf cd $(SRC_FOLDER); autoconf; automake --add-missing; ./configure cd $(SRC_FOLDER); make - ls -la /usr/local/include/asteriskcpp - + /usr/local/lib/libasteriskcpp.so: build build # some times need a 2nd build /usr/lib/libasteriskcpp.so: /usr/local/lib/libasteriskcpp.so @@ -40,6 +39,6 @@ $(EXAMPLE_FOLDER)/tt: $(EXAMPLE_FOLDER)/teste: cd $(EXAMPLE_FOLDER); sh ./makeTest.sh -test: $(EXAMPLE_FOLDER)/tt $(EXAMPLE_FOLDER)/teste +test: install $(EXAMPLE_FOLDER)/tt $(EXAMPLE_FOLDER)/teste $(EXAMPLE_FOLDER)/tt $(EXAMPLE_FOLDER)/teste \ No newline at end of file From 26a8e6fd7a68ccd2c0e6f9085a4ef180982eff44 Mon Sep 17 00:00:00 2001 From: Rekord <1324596506@qq.com> Date: Fri, 28 Jun 2024 08:40:09 +0000 Subject: [PATCH 45/47] chore: fix typo --- asterisk-cpp/asteriskcpp/manager/EventBuilder.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asterisk-cpp/asteriskcpp/manager/EventBuilder.h b/asterisk-cpp/asteriskcpp/manager/EventBuilder.h index a1ba404..d7f1b6d 100644 --- a/asterisk-cpp/asteriskcpp/manager/EventBuilder.h +++ b/asterisk-cpp/asteriskcpp/manager/EventBuilder.h @@ -47,7 +47,7 @@ namespace asteriskcpp { } template - void UnegisterClass() { + void UnregisterClass() { C tmpEvent(""); LOG_TRACE_STR("UNREGISTER EVENT CLASS " + tmpEvent.getEventName()); EnventFactoryMapType::iterator it = eventFactoryMap.find(tmpEvent.getEventName()); From 8b9bbbefc989d99c52074c4802ab04016f32c1d4 Mon Sep 17 00:00:00 2001 From: Rekord <1324596506@qq.com> Date: Fri, 28 Jun 2024 08:47:17 +0000 Subject: [PATCH 46/47] fix: fix the unregisterClass do not really effect --- asterisk-cpp/asteriskcpp/manager/EventBuilder.h | 1 - 1 file changed, 1 deletion(-) diff --git a/asterisk-cpp/asteriskcpp/manager/EventBuilder.h b/asterisk-cpp/asteriskcpp/manager/EventBuilder.h index d7f1b6d..53e5cfa 100644 --- a/asterisk-cpp/asteriskcpp/manager/EventBuilder.h +++ b/asterisk-cpp/asteriskcpp/manager/EventBuilder.h @@ -54,7 +54,6 @@ namespace asteriskcpp { if (it != eventFactoryMap.end()) { eventFactoryMap.erase(it); } - eventFactoryMap.insert(std::make_pair(tmpEvent.getEventName(), new factory())); } ManagerEvent* buildEvent(const std::string& eventStr); From e1ccaee410731920459003446dd870dd1f05f36b Mon Sep 17 00:00:00 2001 From: Rekord <1324596506@qq.com> Date: Sat, 29 Jun 2024 06:21:39 +0000 Subject: [PATCH 47/47] fix: fix example program coredump --- asterisk-cpp/examples/Test.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/asterisk-cpp/examples/Test.cpp b/asterisk-cpp/examples/Test.cpp index 4d92afb..cc68970 100644 --- a/asterisk-cpp/examples/Test.cpp +++ b/asterisk-cpp/examples/Test.cpp @@ -9,6 +9,7 @@ #include #include +#include using namespace asteriskcpp; @@ -35,10 +36,10 @@ int main() { if (mc.login("administrator", "secret")) { for (int i = 0; i < 1; i++) { - asteriskcpp::EventsAction ea("OFF"); - mc.sendAction(&ea); - ea.setEventMask("ON"); - mc.sendAction(&ea); + asteriskcpp::EventsAction *ea = new asteriskcpp::EventsAction("OFF"); + mc.sendAction(ea); + asteriskcpp::EventsAction *ea2 = new asteriskcpp::EventsAction("ON"); + mc.sendAction(ea2); asteriskcpp::ManagerResponse* rpc; asteriskcpp::AbsoluteTimeoutAction ata("SIP/1000", 30); @@ -50,12 +51,18 @@ int main() { delete (rpc); asteriskcpp::CommandAction coma("sip show peers"); - asteriskcpp::CommandResponse* cr = (asteriskcpp::CommandResponse*) (mc.syncSendAction(coma)); - std::cout << std::endl << "ZZZZZZ" << cr->toLog() << std::endl; - for (std::vector::const_iterator it = cr->getResult().begin(); it != cr->getResult().end(); it++) { - std::cout << "[" << (*it) << "]" << std::endl; + asteriskcpp::ManagerResponse* mr = mc.syncSendAction(coma); + if (mr->getType() == asteriskcpp::ManagerResponse::Type_ERROR) { + asteriskcpp::ManagerError *me = (asteriskcpp::ManagerError*)mr; + std::cout << std::endl << "XXXXXX" << me->toLog() << std::endl; + } else { + asteriskcpp::CommandResponse* cr = (asteriskcpp::CommandResponse*)mr; + std::cout << std::endl << "ZZZZZZ" << cr->toLog() << std::endl; + for (std::vector::const_iterator it = cr->getResult().begin(); it != cr->getResult().end(); it++) { + std::cout << "[" << (*it) << "]" << std::endl; + } } - delete (cr); + delete mr; } mc.logoff(); }