b052c7d6f85822c63cb294d661b339c271e059b2
Stefan Schuermans implement SIP

Stefan Schuermans authored 5 years ago

1) /* Blinker
Stefan Schuermans update copyright header

Stefan Schuermans authored 5 years ago

2)    Copyright 2011-2019 Stefan Schuermans <stefan@blinkenarea.org>
Stefan Schuermans implement SIP

Stefan Schuermans authored 5 years ago

3)    Copyleft GNU public license - http://www.gnu.org/copyleft/gpl.html
4)    a blinkenarea.org project */
5) 
6) #ifndef BLINKER_SIPPHONE_H
7) #define BLINKER_SIPPHONE_H
8) 
9) #include <condition_variable>
10) #include <mutex>
11) #include <string>
12) #include <thread>
Stefan Schuermans implement common sound dir,...

Stefan Schuermans authored 5 years ago

13) #include <vector>
Stefan Schuermans implement SIP

Stefan Schuermans authored 5 years ago

14) 
Stefan Schuermans implement common sound dir,...

Stefan Schuermans authored 5 years ago

15) #include "Directory.h"
Stefan Schuermans implement SIP

Stefan Schuermans authored 5 years ago

16) #include "File.h"
17) #include "Module.h"
18) #include "NameFile.h"
19) #include "OpConn.h"
20) #include "OpConnIf.h"
21) #include "Time.h"
22) #include "TimeCallee.h"
23) 
24) namespace Blinker {
25) 
26) /// SIP phone connector
27) class SipPhone: public Module, public OpConnIf, public TimeCallee
28) {
29) public:
30)   /// configuration data for worker
31)   struct ConfigData {
Stefan Schuermans implement common sound dir,...

Stefan Schuermans authored 5 years ago

32)     std::vector<Directory> soundDirs; ///< dirs for sound files (1st = hi prio)
Stefan Schuermans implement SIP

Stefan Schuermans authored 5 years ago

33)     std::string logFileName; ///< base name of log file
34)   };
35)   /// data shared between linphone thread and main Blinker thread
36)   struct SharedData {
Stefan Schuermans fix liblinphone threading i...

Stefan Schuermans authored 5 years ago

37)     /// protection for this structure
38)     std::mutex mtx;
39)     /// worker threads waits on this condition, related mutex is g_mtx
40)     std::condition_variable cond;
Stefan Schuermans implement SIP

Stefan Schuermans authored 5 years ago

41)     /// Blinker -> SIP
42)     //@{
43)     bool run; ///< whether to keep worker running (false = exit)
44)     bool reregister; ///< flag to trigger (re-)registration
45)     std::string server; ///< SIP server, empty means invalid
46)     std::string username; ///< SIP username, empty = no auth
47)     std::string password; ///< SIP password, empty = no auth
48)     bool reqPlay; ///< flag to trigger playing sound
49)     std::string reqPlayName; ///< name of sound to play
50)     bool hangup; ///< flag to trigger hangup of phone call
51)     //@}
52)     /// SIP -> Blinker
53)     //@{
54)     bool accepted; ///< flag for incoming/accepted phone call
55)     std::string dtmf; ///< DTMF keys received
56)     bool terminated; ///< flag for phone call is terminated
57)     //@}
58)   };
59) 
60) public:
61)   /**
62)    * @brief global initialization (call once before using this class)
63)    * @param[in] globalLogDir directory for global SIP log files
64)    */
65)   static void init(const Directory &globalLogDir);
66) 
Stefan Schuermans adapt to liblinphone 5

Stefan Schuermans authored 1 year ago

67)   /**
68)    * @brief global cleanup (call once after finishing using this class)
69)    */
70)   static void exit();
71)