Ring Daemon 16.0.0
Loading...
Searching...
No Matches
instant_messaging.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#include <string>
20#include <vector>
21#include <map>
22#include <list>
23#include <stdexcept>
24
25#ifdef HAVE_CONFIG_H
26#include "config.h"
27#endif
28
29extern "C" {
30struct pjsip_inv_session;
31struct pjsip_rx_data;
32struct pjsip_msg;
33struct pjsip_tx_data;
34}
35
36namespace jami {
37namespace im {
38
39struct InstantMessageException : std::runtime_error
40{
41 InstantMessageException(const std::string& str = "")
42 : std::runtime_error("InstantMessageException occurred: " + str)
43 {}
44};
45
64void sendSipMessage(pjsip_inv_session* session, const std::map<std::string, std::string>& payloads);
65
74std::map<std::string, std::string> parseSipMessage(const pjsip_msg* msg);
75
76void fillPJSIPMessageBody(pjsip_tx_data& tdata, const std::map<std::string, std::string>& payloads);
77
78} // namespace im
79} // namespace jami
void fillPJSIPMessageBody(pjsip_tx_data &tdata, const std::map< std::string, std::string > &payloads)
std::map< std::string, std::string > parseSipMessage(const pjsip_msg *msg)
Parses given SIP message into a map where the key is the contents of the Content-Type header (along w...
void sendSipMessage(pjsip_inv_session *session, const std::map< std::string, std::string > &payloads)
Constructs and sends a SIP message.
void emitSignal(Args... args)
Definition ring_signal.h:64
InstantMessageException(const std::string &str="")