reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Plugin.cxx
Go to the documentation of this file.
1
2#include <memory>
3
4#include "rutil/Logger.hxx"
5
6#include "repro/Plugin.hxx"
7
8#define RESIPROCATE_SUBSYSTEM resip::Subsystem::REPRO
9
10// in an autotools build, this is defined using pkglibdir
11#ifndef REPRO_DSO_PLUGIN_DIR_DEFAULT
12#define REPRO_DSO_PLUGIN_DIR_DEFAULT ""
13#endif
14
15#define REPRO_DSO_PLUGIN_SYMBOL "reproPluginDesc"
16
17using namespace repro;
18
25
29
30bool
31ReproPluginManager::onPluginLoaded(std::shared_ptr<resip::Plugin> plugin)
32{
33 std::shared_ptr<repro::Plugin> _plugin = std::dynamic_pointer_cast<repro::Plugin>(plugin);
34 if(_plugin)
35 {
36 return _plugin->init(mSipStack, mProxyConfig);
37 }
38 ErrLog(<<"cast failed");
39 return false;
40}
41
42void
44{
45 for(auto plugin : getPlugins())
46 {
47 std::shared_ptr<repro::Plugin> _plugin = std::dynamic_pointer_cast<repro::Plugin>(plugin);
48 if(_plugin)
49 {
50 _plugin->onRequestProcessorChainPopulated(chain);
51 }
52 }
53}
54
55void
57{
58 for(auto plugin : getPlugins())
59 {
60 std::shared_ptr<repro::Plugin> _plugin = std::dynamic_pointer_cast<repro::Plugin>(plugin);
61 if(_plugin)
62 {
63 _plugin->onResponseProcessorChainPopulated(chain);
64 }
65 }
66}
67
68
69void
71{
72 for(auto plugin : getPlugins())
73 {
74 std::shared_ptr<repro::Plugin> _plugin = std::dynamic_pointer_cast<repro::Plugin>(plugin);
75 if(_plugin)
76 {
77 _plugin->onTargetProcessorChainPopulated(chain);
78 }
79 }
80}
81
82/* ====================================================================
83
84 Copyright (c) 2022, Software Freedom Institute https://softwarefreedom.institute
85 Copyright (c) 2022, Daniel Pocock https://danielpocock.com
86 All rights reserved.
87
88 Redistribution and use in source and binary forms, with or without
89 modification, are permitted provided that the following conditions are
90 met:
91
92 1. Redistributions of source code must retain the above copyright
93 notice, this list of conditions and the following disclaimer.
94
95 2. Redistributions in binary form must reproduce the above copyright
96 notice, this list of conditions and the following disclaimer in the
97 documentation and/or other materials provided with the distribution.
98
99 3. Neither the name of Plantronics nor the names of its contributors
100 may be used to endorse or promote products derived from this
101 software without specific prior written permission.
102
103 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
104 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
105 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
106 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
107 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
108 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
109 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
110 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
111 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
112 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
113 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
114
115 ==================================================================== */
#define ErrLog(args_)
Definition Logger.hxx:137
virtual void onResponseProcessorChainPopulated(ProcessorChain &chain)
Definition Plugin.cxx:56
virtual void onRequestProcessorChainPopulated(ProcessorChain &chain)
Definition Plugin.cxx:43
virtual ~ReproPluginManager()
Definition Plugin.cxx:26
virtual bool onPluginLoaded(std::shared_ptr< resip::Plugin > plugin) override
Definition Plugin.cxx:31
ReproPluginManager(resip::SipStack &sipStack, ProxyConfig *proxyConfig)
Definition Plugin.cxx:19
virtual void onTargetProcessorChainPopulated(ProcessorChain &chain)
Definition Plugin.cxx:70
virtual std::vector< std::shared_ptr< Plugin > > getPlugins()
Definition Plugin.hxx:78
This is the primary point of interaction between the app-layer and the stack.
Definition SipStack.hxx:160
This Class is used to implement a primitive form of RPC using loose XML formatting.
#define REPRO_DSO_PLUGIN_DIR_DEFAULT
Definition Plugin.cxx:12
#define REPRO_DSO_PLUGIN_SYMBOL
Definition Plugin.cxx:15
#define REPRO_DSO_PLUGIN_API_VERSION
Definition Plugin.hxx:38
void list()
Definition userAdmin.cxx:66