2
* Copyright (C) 2004, 2005, 2006, 2009, 2008, 2009, 2010, 2011 Savoir-Faire Linux Inc.
3
* Author: Alexandre Bourget <alexandre.bourget@savoirfairelinux.com>
4
* Author: Yan Morin <yan.morin@savoirfairelinux.com>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 3 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
* Additional permission under GNU GPL version 3 section 7:
22
* If you modify this program, or any covered work, by linking or
23
* combining it with the OpenSSL project's OpenSSL library (or a
24
* modified version of that library), containing parts covered by the
25
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
26
* grants you additional permission to convey the resulting work.
27
* Corresponding Source for a non-source form of such a combination
28
* shall include the source code for the parts of OpenSSL used as well
29
* as that of the covered work.
35
#include "audio/codecs/codecDescriptor.h"
37
#include <iax-client.h>
42
* @brief IAXCall are IAX implementation of a normal Call
45
class IAXCall : public Call
50
* @param id The unique ID of the call
51
* @param type The type of the call
53
IAXCall (const CallID& id, Call::CallType type);
61
* @return iax_session* The session pointer or NULL
63
struct iax_session* getSession() {
68
* Set the session pointer
69
* @param session the session pointer to assign
71
void setSession (struct iax_session* session) {
76
* Set format (one single bit)
77
* This function sets the _audioCodec variable with the correct
79
* @param format The format representing the codec
81
void setFormat (int format);
84
* Get format for the voice codec used
85
* @return int Bitmask for codecs defined in iax/frame.h
93
* @return int The bitwise list of supported formats
95
int getSupportedFormat (std::string accountID);
98
* Return a format (int) with the first matching codec selected.
100
* This considers the order of the appearance in the CodecMap,
101
* thus, the order of preference.
103
* NOTE: Everything returned is bound to the content of the local
104
* CodecMap, so it won't return format values that aren't valid
105
* in this call context.
107
* @param needles The format(s) (bitwise) you are looking for to match
108
* @return int The matching format, thus 0 if none matches
110
int getFirstMatchingFormat (int needles, std::string accountID);
114
* Set internal codec Map: initialization only, not protected
115
* @param map The codec map
117
void setCodecMap (const CodecDescriptor& map) {
122
* Get internal codec Map: initialization only, not protected
123
* @return CodecDescriptor The codec map
125
CodecDescriptor& getCodecMap();
128
* Return audio codec [mutex protected]
129
* @return AudioCodecType The payload of the codec
131
AudioCodecType getAudioCodec();
134
/** Each call is associated with an iax_session */
135
struct iax_session* _session;
138
* Set the audio codec used. [not protected]
139
* @param audioCodec The payload of the codec
141
void setAudioCodec (AudioCodecType audioCodec) {
142
_audioCodec = audioCodec;
146
CodecDescriptor _codecMap;
149
AudioCodecType _audioCodec;
152
* Format currently in use in the conversation,
153
* sent in each outgoing voice packet.