Stefan Schuermans
adapt to liblinphone 5
Stefan Schuermans commited b052c7d at 2023-08-22 13:31:00
/* Blinker
Copyright 2011-2019 Stefan Schuermans <stefan@blinkenarea.org>
Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
a blinkenarea.org project */
#ifndef BLINKER_SIPPHONE_H
#define BLINKER_SIPPHONE_H
#include <condition_variable>
#include <mutex>
#include <string>
#include <thread>
#include <vector>
#include "Directory.h"
#include "File.h"
#include "Module.h"
#include "NameFile.h"
#include "OpConn.h"
#include "OpConnIf.h"
#include "Time.h"
#include "TimeCallee.h"
namespace Blinker {
/// SIP phone connector
class SipPhone: public Module, public OpConnIf, public TimeCallee
{
public:
/// configuration data for worker
struct ConfigData {
std::vector<Directory> soundDirs; ///< dirs for sound files (1st = hi prio)
std::string logFileName; ///< base name of log file
};
/// data shared between linphone thread and main Blinker thread
struct SharedData {
/// protection for this structure
std::mutex mtx;
/// worker threads waits on this condition, related mutex is g_mtx
std::condition_variable cond;
/// Blinker -> SIP
//@{
bool run; ///< whether to keep worker running (false = exit)
bool reregister; ///< flag to trigger (re-)registration
std::string server; ///< SIP server, empty means invalid
std::string username; ///< SIP username, empty = no auth
std::string password; ///< SIP password, empty = no auth
bool reqPlay; ///< flag to trigger playing sound
std::string reqPlayName; ///< name of sound to play
bool hangup; ///< flag to trigger hangup of phone call
//@}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX