diff --git a/src/call.h b/src/call.h index b44843a049e9034508ef7c96b94ce91ccaae5468..463cd9a21b3ee8f38174a76e03c8020f989ee0eb 100644 --- a/src/call.h +++ b/src/call.h @@ -195,39 +195,9 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> { isIPToIP_ = IPToIP; } - /** - * Set local audio port, as seen by me [not protected] - * @param port The local audio port - */ - void setLocalAudioPort(unsigned int port) { - localAudioPort_ = port; - } - - /** - * Set local video port, as seen by me [not protected] - * @param port The local video port - */ - void setLocalVideoPort(unsigned int port) { - localVideoPort_ = port; - } - - /** - * Return port used locally (for my machine) [mutex protected] - * @return unsigned int The local audio port - */ - unsigned int getLocalAudioPort() const; - - /** - * Return port used locally (for my machine) [mutex protected] - * @return unsigned int The local video port - */ - unsigned int getLocalVideoPort() const; - virtual std::map<std::string, std::string> getDetails() const; static std::map<std::string, std::string> getNullDetails(); - virtual bool toggleRecording(); - /** * Answer the call */ @@ -239,8 +209,6 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> { */ virtual void hangup(int reason) = 0; - virtual void switchInput(const std::string&) {}; - /** * Refuse incoming call */ @@ -271,6 +239,59 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> { */ virtual bool offhold() = 0; + /** + * Peer has hung up a call + */ + virtual void peerHungup(); + + virtual void removeCall(); + + using StateListener = std::function<void(CallState, int)>; + + template<class T> + void addStateListener(T&& list) { + stateChangedListeners_.emplace_back(std::forward<T>(list)); + } + + /** + * Attach subcall to this instance. + * If this subcall is answered, this subcall and this instance will be merged using merge(). + */ + void addSubCall(Call& call); + + public: // media management + /** + * Set local audio port, as seen by me [not protected] + * @param port The local audio port + */ + void setLocalAudioPort(unsigned int port) { + localAudioPort_ = port; + } + + /** + * Set local video port, as seen by me [not protected] + * @param port The local video port + */ + void setLocalVideoPort(unsigned int port) { + localVideoPort_ = port; + } + + /** + * Return port used locally (for my machine) [mutex protected] + * @return unsigned int The local audio port + */ + unsigned int getLocalAudioPort() const; + + /** + * Return port used locally (for my machine) [mutex protected] + * @return unsigned int The local video port + */ + unsigned int getLocalVideoPort() const; + + virtual bool toggleRecording(); + + virtual void switchInput(const std::string&) {}; + /** * mute/unmute a media of a call * @param mediaType type of media @@ -278,11 +299,6 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> { */ virtual void muteMedia(const std::string& mediaType, bool isMuted) = 0; - /** - * Peer has hung up a call - */ - virtual void peerHungup(); - /** * Send DTMF * @param code The char code @@ -301,8 +317,6 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> { void onTextMessage(std::map<std::string, std::string>&& messages); - virtual void removeCall(); - virtual bool initIceTransport(bool master, unsigned channel_num=4); bool isIceRunning() const; @@ -318,20 +332,8 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> { } virtual void restartMediaSender() = 0; - virtual void restartMediaReceiver() = 0; - using StateListener = std::function<void(CallState, int)>; - - template<class T> - void addStateListener(T&& list) { - stateChangedListeners_.emplace_back(std::forward<T>(list)); - } - - /** - * Attach subcall to this instance. - * If this subcall is answered, this subcall and this instance will be merged using merge(). - */ - void addSubCall(Call& call); + virtual void restartMediaReceiver() = 0; protected: virtual void merge(Call& scall);