reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
SipXMediaResourceParticipant.hxx
Go to the documentation of this file.
1#if !defined(SipXMediaResourceParticipant_hxx)
2#define SipXMediaResourceParticipant_hxx
3
4#include <resip/stack/Uri.hxx>
5#include <rutil/Data.hxx>
6
9#include "SipXParticipant.hxx"
10
11// sipX includes
12#include "mp/MpPlayerListener.h"
13
14class MpStreamPlayer;
15class MpPlayerEvent;
16
17// Disable warning 4250
18// VS2019 give a 4250 warning:
19// SipXMediaResourceParticipant.hxx(58,1): warning C4250: 'recon::SipXMediaResourceParticipant': inherits 'recon::MediaResourceParticipant::recon::MediaResourceParticipant::hasInput' via dominance
20#if defined(WIN32) && !defined(__GNUC__)
21#pragma warning( disable : 4250 )
22#endif
23
24namespace recon
25{
26class ConversationManager;
27
28// Recording Formats
29static const resip::Data recordingFormatWAVPCM16("WAV_PCM16");
30static const resip::Data recordingFormatWAVMULAW("WAV_MULAW");
31static const resip::Data recordingFormatWAVALAW("WAV_ALAW");
32static const resip::Data recordingFormatWAVGSM("WAV_GSM");
33static const resip::Data recordingFormatOGGOPUS("OGG_OPUS");
34
35// Special Tones
36static const resip::Data dialtoneTone("dialtone");
37static const resip::Data busyTone("busy");
38static const resip::Data ringbackTone("ringback");
39static const resip::Data ringTone("ring");
40static const resip::Data fastbusyTone("fastbusy");
41static const resip::Data backspaceTone("backspace");
42static const resip::Data callwaitingTone("callwaiting");
43static const resip::Data holdingTone("holding");
44static const resip::Data loudfastbusyTone("loudfastbusy");
45
54class SipXMediaResourceParticipant : public virtual MediaResourceParticipant, public virtual SipXParticipant, public MpPlayerListener
55{
56public:
60 const resip::Uri& mediaUrl,
61 const std::shared_ptr<resip::Data>& playAudioBuffer,
64
65 virtual void startResourceImpl();
66 virtual bool stopResource();
67 virtual int getConnectionPortOnBridge();
68
69 // For Stream Player callbacks
70 virtual void playerRealized(MpPlayerEvent& event);
72 virtual void playerPlaying(MpPlayerEvent& event);
73 virtual void playerPaused(MpPlayerEvent& event);
74 virtual void playerStopped(MpPlayerEvent& event);
75 virtual void playerFailed(MpPlayerEvent& event);
76
77protected:
78
79private:
80 resip::Data mSipXResourceName;
81 MpStreamPlayer* mStreamPlayer;
82 int mPortOnBridge;
83#ifndef SIPX_NO_RECORD
84 CircularBufferPtr* mRecordingCircularBuffer;
85#else
86 void* mRecordingCircularBuffer;
87#endif
88};
89
90}
91
92#endif
93
94
95/* ====================================================================
96
97 Copyright (c) 2021-2022, SIP Spectrum, Inc. www.sipspectrum.com
98 Copyright (c) 2021, Daniel Pocock https://danielpocock.com
99 Copyright (c) 2007-2008, Plantronics, Inc.
100 All rights reserved.
101
102 Redistribution and use in source and binary forms, with or without
103 modification, are permitted provided that the following conditions are
104 met:
105
106 1. Redistributions of source code must retain the above copyright
107 notice, this list of conditions and the following disclaimer.
108
109 2. Redistributions in binary form must reproduce the above copyright
110 notice, this list of conditions and the following disclaimer in the
111 documentation and/or other materials provided with the distribution.
112
113 3. Neither the name of Plantronics nor the names of its contributors
114 may be used to endorse or promote products derived from this
115 software without specific prior written permission.
116
117 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
118 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
119 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
120 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
121 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
122 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
123 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
124 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
125 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
126 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
127 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
128
129 ==================================================================== */
This class is one of two main classes of concern to an application using the UserAgent library.
This class represents a media resource participant.
This class represents a media resource participant.
virtual void playerPrefetched(MpPlayerEvent &event)
virtual void playerStopped(MpPlayerEvent &event)
virtual void playerRealized(MpPlayerEvent &event)
virtual void playerPlaying(MpPlayerEvent &event)
virtual void playerFailed(MpPlayerEvent &event)
virtual void playerPaused(MpPlayerEvent &event)
This class is one of two main classes of concern to an application using the UserAgent library.
This is the base class for a SipXRemoteParticipant, SipXLocalParticipant and a SipXMediaResourceParti...
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
static const resip::Data ringTone("ring")
static const resip::Data recordingFormatWAVGSM("WAV_GSM")
static const resip::Data recordingFormatOGGOPUS("OGG_OPUS")
static const resip::Data recordingFormatWAVMULAW("WAV_MULAW")
static const resip::Data backspaceTone("backspace")
static const resip::Data holdingTone("holding")
unsigned int ParticipantHandle
static const resip::Data busyTone("busy")
static const resip::Data fastbusyTone("fastbusy")
static const resip::Data loudfastbusyTone("loudfastbusy")
static const resip::Data recordingFormatWAVALAW("WAV_ALAW")
static const resip::Data recordingFormatWAVPCM16("WAV_PCM16")
static const resip::Data callwaitingTone("callwaiting")
static const resip::Data ringbackTone("ringback")
static const resip::Data dialtoneTone("dialtone")
void list()
Definition userAdmin.cxx:66