Ring Daemon 16.0.0
Loading...
Searching...
No Matches
sipvoiplink.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2025 Savoir-faire Linux Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19#ifdef HAVE_CONFIG_H
20#include "config.h"
21#endif
22
23#include "ring_types.h"
24#include "noncopyable.h"
25
26#include <dhtnet/ip_utils.h>
27
28#include <pjsip.h>
29#include <pjlib.h>
30#include <pjsip_ua.h>
31#include <pjlib-util.h>
32#include <pjnath.h>
33#include <pjnath/stun_config.h>
34
35#ifdef ENABLE_VIDEO
36#include <queue>
37#endif
38#include <map>
39#include <mutex>
40#include <memory>
41#include <functional>
42#include <thread>
43#include <atomic>
44
45namespace jami {
46
47class SIPCall;
48class SIPAccountBase;
49class SIPVoIPLink;
50class SipTransportBroker;
51
58{
59public:
62
66 void shutdown();
67
71 void handleEvents();
72
77
82
87
92
93public:
95
99 std::unique_ptr<SipTransportBroker> sipTransportBroker;
100
101 typedef std::function<void(std::vector<dhtnet::IpAddr>)> SrvResolveCallback;
102 void resolveSrvName(const std::string& name,
105
109 std::shared_ptr<SIPAccountBase> guessAccount(std::string_view userName,
110 std::string_view server,
111 std::string_view fromUri) const;
112
113 int getModId();
116
119
130 const std::string& host,
131 std::string& address,
133
136 int stunPort,
137 std::string& address,
139
146 {
149 tp.u.transport = transport;
150 return tp;
151 }
152
153private:
155
156 mutable pj_caching_pool cp_;
157 std::unique_ptr<pj_pool_t, decltype(pj_pool_release)&> pool_;
158 std::atomic_bool running_ {true};
159 std::thread sipThread_;
160
161 friend class SIPTest;
162};
163
164} // namespace jami
void emitSignal(Args... args)
Definition ring_signal.h:64
Simple macro to hide class' copy constructor and assignment operator.
#define NON_COPYABLE(ClassName)
Definition noncopyable.h:30