OPAL
Version 3.14.3
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
iax2con.h
Go to the documentation of this file.
1
/*
2
*
3
* Inter Asterisk Exchange 2
4
*
5
* Open Phone Abstraction Library (OPAL)
6
*
7
* Describes the IAX2 extension of the OpalConnection class.
8
*
9
* Copyright (c) 2005 Indranet Technologies Ltd.
10
*
11
* The contents of this file are subject to the Mozilla Public License
12
* Version 1.0 (the "License"); you may not use this file except in
13
* compliance with the License. You may obtain a copy of the License at
14
* http://www.mozilla.org/MPL/
15
*
16
* Software distributed under the License is distributed on an "AS IS"
17
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
18
* the License for the specific language governing rights and limitations
19
* under the License.
20
*
21
* The Original Code is Open Phone Abstraction Library.
22
*
23
* The Initial Developer of the Original Code is Indranet Technologies Ltd.
24
*
25
* The author of this code is Derek J Smithies
26
*
27
* $Revision: 30917 $
28
* $Author: rjongbloed $
29
* $Date: 2013-11-15 18:29:24 +1100 (Fri, 15 Nov 2013) $
30
*/
31
32
#ifndef OPAL_IAX2_IAX2CON_H
33
#define OPAL_IAX2_IAX2CON_H
34
35
#ifndef _PTLIB_H
36
#include <ptlib.h>
37
#endif
38
39
#include <
opal_config.h
>
40
41
#if OPAL_IAX2
42
43
#include <
opal/connection.h
>
44
#include <
rtp/jitter.h
>
45
46
#include <
iax2/frame.h
>
47
#include <
iax2/iedata.h
>
48
#include <
iax2/processor.h
>
49
#include <
iax2/callprocessor.h
>
50
#include <
iax2/safestrings.h
>
51
#include <
iax2/sound.h
>
52
53
class
IAX2EndPoint
;
54
55
57
63
class
IAX2Connection
:
public
OpalConnection
64
{
65
PCLASSINFO(
IAX2Connection
,
OpalConnection
);
66
67
public
:
70
73
IAX2Connection
(
74
OpalCall
& call,
75
IAX2EndPoint
&
endpoint
,
76
const
PString & token,
77
void
*userData,
78
const
PString & remoteParty,
79
const
PString &
remotePartyName
= PString::Empty()
80
);
81
85
~IAX2Connection
();
87
91
void
StartOperation
();
92
101
virtual
bool
IsNetworkConnection
()
const
{
return
true
; }
102
110
virtual
bool
TransferConnection
(
111
const
PString & remoteParty
112
);
113
132
virtual
void
OnReleased
();
133
144
OpalMediaFormatList
GetMediaFormats
()
const
{
return
remoteMediaFormats
; }
145
147
void
EndCallNow
(
148
CallEndReason reason = EndedByLocalUser
149
);
150
152
void
SendDtmf
(
const
PString & dtmf);
153
155
virtual
PBoolean
SendUserInputString
(
const
PString & value );
156
158
virtual
PBoolean
SendUserInputTone
(
char
tone,
unsigned
duration );
159
161
PBoolean
IsCallTerminating
() {
return
iax2Processor
.
IsCallTerminating
(); }
162
171
virtual
void
AnsweringCall
(
172
AnswerCallResponse response
173
);
174
182
void
OnConnected
();
183
195
virtual
PBoolean
SetConnected
();
196
211
void
OnEstablished
();
212
224
PBoolean
SetAlerting
(
225
const
PString & calleeName,
226
PBoolean withMedia
227
);
228
236
virtual
OpalMediaStream
*
CreateMediaStream
(
237
const
OpalMediaFormat
& mediaFormat,
238
unsigned
sessionID,
239
PBoolean isSource
240
);
241
252
void
SetCallToken
(PString newToken);
253
255
PString
GetCallToken
() {
return
iax2Processor
.
GetCallToken
(); }
256
259
void
TransmitFrameToRemoteEndpoint
(
IAX2Frame
*src);
260
264
void
PutSoundPacketToNetwork
(PBYTEArray *sund);
265
268
void
ReceivedSoundPacketFromNetwork
(
IAX2Frame
*soundFrame);
269
274
PBoolean
ReadSoundPacket
(
RTP_DataFrame
& packet);
275
277
IAX2Remote
&
GetRemoteInfo
() {
return
iax2Processor
.
GetRemoteInfo
(); }
278
280
IAX2SequenceNumbers
&
GetSequenceInfo
() {
return
iax2Processor
.
GetSequenceInfo
(); }
281
283
const
PTimeInterval &
GetCallStartTick
() {
return
iax2Processor
.
GetCallStartTick
(); }
284
289
void
OnSetUp
();
290
291
299
PBoolean
SetUpConnection
();
300
301
305
PINDEX
GetSupportedCodecs
();
306
310
PINDEX
GetPreferredCodec
();
311
314
void
BuildRemoteCapabilityTable
(
unsigned
int
remoteCapability,
unsigned
int
format);
315
316
324
unsigned
int
ChooseCodec
();
325
340
virtual
bool
HoldRemote
(
341
bool
placeOnHold
342
);
343
348
virtual
bool
IsOnHold
(
349
bool
fromRemote
350
)
const
;
351
353
void
RemoteHoldConnection
();
354
356
void
RemoteRetrieveConnection
();
357
364
void
SetUserName
(PString & inUserName) {
userName
= inUserName; };
365
367
PString
GetUserName
()
const
{
return
userName
; };
368
375
void
SetPassword
(PString & inPassword) {
password
= inPassword; };
376
378
PString
GetPassword
()
const
{
return
password
; };
379
380
390
virtual
PBoolean
ForwardCall
(
391
const
PString & forwardParty
392
);
393
397
void
IncomingEthernetFrame
(
IAX2Frame
*frame);
398
402
//static PBoolean IsStatusQueryEthernetFrame(IAX2Frame *frame);
403
405
IAX2EndPoint
&
GetEndPoint
() {
return
endpoint
; }
406
409
void
ReportStatistics
();
410
411
412
protected
:
413
415
PString
userName
;
416
418
PString
password
;
419
423
425
IAX2EndPoint
&
endpoint
;
426
429
OpalMediaFormatList
remoteMediaFormats
;
430
433
OpalMediaFormatList
localMediaFormats
;
434
436
IAX2CallProcessor
&
iax2Processor
;
437
439
PBoolean
local_hold
;
440
442
PBoolean
remote_hold
;
443
445
448
OpalJitterBuffer
jitterBuffer
;
449
457
RTP_DataFrame::PayloadTypes
opalPayloadType
;
458
459
friend
class
IAX2CallProcessor
;
460
};
461
462
464
465
466
#endif // OPAL_IAX2
467
468
#endif // OPAL_IAX2_IAX2CON_H
469
470
/* The comment below is magic for those who use emacs to edit this file.
471
* With the comment below, the tab key does auto indent to 2 spaces.
472
*
473
* Local Variables:
474
* mode:c
475
* c-basic-offset:2
476
* End:
477
*/
include
iax2
iax2con.h
Generated on Fri Oct 10 2014 21:36:58 for OPAL by
1.8.3.1