Ring Daemon
Loading...
Searching...
No Matches
instant_messaging.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2004-2026 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 <map>
21#include <stdexcept>
22
23#ifdef HAVE_CONFIG_H
24#include "config.h"
25#endif
26
27extern "C" {
28struct pjsip_inv_session;
29struct pjsip_rx_data;
30struct pjsip_msg;
31struct pjsip_tx_data;
32}
33
34namespace jami {
35namespace im {
36
37struct InstantMessageException : std::runtime_error
38{
39 InstantMessageException(const std::string& str = "")
40 : std::runtime_error("InstantMessageException occurred: " + str)
41 {}
42};
43
62void sendSipMessage(pjsip_inv_session* session, const std::map<std::string, std::string>& payloads);
63
72std::map<std::string, std::string> parseSipMessage(const pjsip_msg* msg);
73
74void fillPJSIPMessageBody(pjsip_tx_data& tdata, const std::map<std::string, std::string>& payloads);
75
76} // namespace im
77} // 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 jami_signal.h:64
InstantMessageException(const std::string &str="")