OPAL  Version 3.10.10
IAX2CallProcessor Class Reference

#include <callprocessor.h>

Inheritance diagram for IAX2CallProcessor:
IAX2Processor

Public Member Functions

 IAX2CallProcessor (IAX2EndPoint &ep)
 
virtual ~IAX2CallProcessor ()
 
void AssignConnection (IAX2Connection *_con)
 
void PutSoundPacketToNetwork (PBYTEArray *sund)
 
IAX2EncryptionGetEncryptionInfo ()
 
void ClearCall (OpalConnection::CallEndReason releaseReason=OpalConnection::EndedByLocalUser)
 
virtual void OnReleased ()
 
void SendDtmf (const PString &dtmfs)
 
void SendText (const PString &text)
 
virtual PBoolean SetUpConnection ()
 
PBoolean Matches (IAX2Frame *frame)
 
virtual void PrintOn (ostream &strm) const
 
void ReportStatistics ()
 
PBoolean MatchingLocalCallNumber (PINDEX compare)
 
unsigned short GetSelectedCodec ()
 
void AcceptIncomingCall ()
 
virtual PBoolean SetAlerting (const PString &calleeName, PBoolean withMedia)
 
void Hangup (PString messageToSend)
 
PBoolean IsCallTerminating ()
 
void SendHold ()
 
void SendHoldRelease ()
 
void SetUserName (PString &inUserName)
 
PString GetUserName () const
 
PString GetCallingName () const
 
void SetPassword (PString &inPassword)
 
PString GetPassword () const
 
void SendTransfer (const PString &calledNumber, const PString &calledContext=PString::Empty())
 
void StartStatusCheckTimer (PINDEX msToWait=10000)
 
virtual PBoolean IncomingMessageOutOfOrder (IAX2FullFrame *ff)
 
void SendAnswerMessageToRemoteNode ()
 
- Public Member Functions inherited from IAX2Processor
 IAX2Processor (IAX2EndPoint &ep)
 
virtual ~IAX2Processor ()
 
IAX2SequenceNumbersGetSequenceInfo ()
 
IAX2EncryptionGetEncryptionInfo ()
 
void IncomingEthernetFrame (IAX2Frame *frame)
 
IAX2EndPointGetEndPoint ()
 
void SetCallToken (const PString &newToken)
 
PString GetCallToken ()
 
IAX2RemoteGetRemoteInfo ()
 
const PTimeInterval & GetCallStartTick ()
 
void Main ()
 
PBoolean IsStatusQueryEthernetFrame (IAX2Frame *frame)
 
void SetSpecialPackets (PBoolean newValue)
 
void Terminate ()
 
void Activate ()
 
void ReportLists (PString &answer)
 

Protected Attributes

IAX2Connectioncon
 
- Protected Attributes inherited from IAX2Processor
IAX2EndPointendpoint
 
PTimeInterval callStartTick
 
IAX2Remote remote
 
PTimer noResponseTimer
 
IAX2WaitingForAck nextTask
 
PSyncPoint activate
 
PBoolean endThread
 
IAX2Encryption encryption
 
IAX2SequenceNumbers sequence
 
IAX2ActiveFrameList frameList
 
SafeString callToken
 
PBoolean specialPackets
 
PAtomicInteger controlFramesSent
 
PAtomicInteger controlFramesRcvd
 
IAX2IeData ieData
 
DWORD currentSoundTimeStamp
 

Internal, protected methods, which are invoked only by this

thread

enum  SoundBufferState { BufferToSmall, Normal, BufferToBig }
 
enum  CallStatus {
  callNewed = 1 << 0, callSentRinging = 1 << 1, callRegistered = 1 << 2, callAuthorised = 1 << 3,
  callAccepted = 1 << 4, callRinging = 1 << 5, callAnswered = 1 << 6, callTerminating = 1 << 7
}
 
PAtomicInteger audioFramesSent
 
PAtomicInteger audioFramesRcvd
 
PAtomicInteger videoFramesSent
 
PAtomicInteger videoFramesRcvd
 
SafeString remotePhoneNumber
 
SafeStrings callList
 
SafeString dtmfText
 
SafeStrings textList
 
SafeStrings dtmfNetworkList
 
SafeStrings hangList
 
PBoolean holdCall
 
PBoolean holdReleaseCall
 
IAX2SoundList soundWaitingForTransmission
 
SoundBufferState soundBufferState
 
PINDEX lastFullFrameTimeStamp
 
PBoolean audioCanFlow
 
unsigned int selectedCodec
 
unsigned short callStatus
 
PBoolean firstMediaFrame
 
PBoolean answerCallNow
 
PBoolean statusCheckOtherEnd
 
PTimer statusCheckTimer
 
PINDEX audioFrameDuration
 
PINDEX audioCompressedBytes
 
PBoolean audioFramesNotStarted
 
PString callingName
 
PString callingExtension
 
PString callingDnid
 
PString callingContext
 
PString userName
 
PString password
 
PMutex transferMutex
 
PBoolean doTransfer
 
PString transferCalledNumber
 
PString transferCalledContext
 
PBoolean suppressHangupFrame
 
PBoolean RemoteSelectedCodecOk ()
 
void CheckForHangupMessages ()
 
void ProcessNetworkFrame (IAX2Frame *src)
 
void ProcessNetworkFrame (IAX2MiniFrame *src)
 
void ProcessNetworkFrame (IAX2FullFrame *src)
 
void ProcessNetworkFrame (IAX2FullFrameDtmf *src)
 
void ProcessNetworkFrame (IAX2FullFrameVoice *src)
 
void ProcessNetworkFrame (IAX2FullFrameVideo *src)
 
void ProcessNetworkFrame (IAX2FullFrameSessionControl *src)
 
void ProcessNetworkFrame (IAX2FullFrameNull *src)
 
virtual PBoolean ProcessNetworkFrame (IAX2FullFrameProtocol *src)
 
void ProcessNetworkFrame (IAX2FullFrameText *src)
 
void ProcessNetworkFrame (IAX2FullFrameImage *src)
 
void ProcessNetworkFrame (IAX2FullFrameHtml *src)
 
void ProcessNetworkFrame (IAX2FullFrameCng *src)
 
virtual void ProcessLists ()
 
void ConnectToRemoteNode (PString &destination)
 
void SendDtmfMessage (char message)
 
void SendTextMessage (PString &message)
 
void SendSoundMessage (PBYTEArray *sound)
 
void SendTransferMessage ()
 
void SendQuelchMessage ()
 
void SendUnQuelchMessage ()
 
void IncAudioFramesSent ()
 
void IncAudioFramesRcvd ()
 
void IncVideoFramesSent ()
 
void IncVideoFramesRcvd ()
 
void RemoteNodeHasAnswered ()
 
void CallStopSounds ()
 
void ReceivedHookFlash ()
 
void RemoteNodeIsBusy ()
 
void ProcessIncomingAudioFrame (IAX2Frame *newFrame)
 
void ProcessIncomingVideoFrame (IAX2Frame *newFrame)
 
void ProcessIaxCmdNew (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdAck (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdHangup (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdReject (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdAccept (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdAuthReq (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdAuthRep (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdInval (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdDpReq (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdDpRep (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdDial (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdTxreq (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdTxcnt (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdTxacc (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdTxready (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdTxrel (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdTxrej (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdQuelch (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdUnquelch (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdPage (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdMwi (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdUnsupport (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdTransfer (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdProvision (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdFwDownl (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdFwData (IAX2FullFrameProtocol *src)
 
void ProcessIaxCmdCallToken (IAX2FullFrameProtocol *src)
 
IAX2FullFrameProtocolBuildNewFrameForSending (IAX2FullFrameProtocol *inReplyTo=NULL)
 
void SetCallSentRinging (PBoolean newValue=true)
 
void SetCallNewed (PBoolean newValue=true)
 
void SetCallRegistered (PBoolean newValue=true)
 
void SetCallAuthorised (PBoolean newValue=true)
 
void SetCallAccepted (PBoolean newValue=true)
 
void SetCallRinging (PBoolean newValue=true)
 
void SetCallAnswered (PBoolean newValue=true)
 
void SetCallTerminating (PBoolean newValue=true)
 
PBoolean IsCallHappening ()
 
PBoolean IsCallNewed ()
 
PBoolean IsCallSentRinging ()
 
PBoolean IsCallRegistered ()
 
PBoolean IsCallAuthorised ()
 
PBoolean IsCallAccepted ()
 
PBoolean IsCallRinging ()
 
PBoolean IsCallAnswered ()
 
void OnStatusCheck (PTimer &, INT)
 
void DoStatusCheck ()
 
void RemoteNodeIsRinging ()
 
void RingingWasAcked ()
 
void AnswerWasAcked ()
 
void CheckForRemoteCapabilities (IAX2FullFrameProtocol *src)
 
virtual void OnNoResponseTimeout ()
 
virtual void ProcessFullFrame (IAX2FullFrame &fullFrame)
 

Additional Inherited Members

- Protected Types inherited from IAX2Processor
enum  DefinedNoResponseTimePeriod { NoResponseTimePeriod = 5000 }
 
- Protected Member Functions inherited from IAX2Processor
void StartNoResponseTimer (PINDEX msToWait=60000)
 
void StopNoResponseTimer ()
 
void CleanPendingLists ()
 
PBoolean IsHandlingSpecialPackets ()
 
virtual void ProcessIaxCmdLagRq (IAX2FullFrameProtocol *src)
 
virtual void ProcessIaxCmdLagRp (IAX2FullFrameProtocol *src)
 
virtual void ProcessIaxCmdVnak (IAX2FullFrameProtocol *src)
 
virtual void ProcessIaxCmdPing (IAX2FullFrameProtocol *src)
 
virtual void ProcessIaxCmdPong (IAX2FullFrameProtocol *src)
 
PBoolean ProcessOneIncomingEthernetFrame ()
 
void IncControlFramesSent ()
 
void IncControlFramesRcvd ()
 
void TransmitFrameToRemoteEndpoint (IAX2Frame *src)
 
void TransmitFrameToRemoteEndpoint (IAX2FullFrame *src, IAX2WaitingForAck::ResponseToAck response)
 
void TransmitFrameNow (IAX2Frame *src)
 
void TransmitFrameToRemoteEndpoint (IAX2FullFrameProtocol *src)
 
PBoolean Authenticate (IAX2FullFrameProtocol *reply, PString &password)
 
void SendAckFrame (IAX2FullFrame *inReplyTo)
 
void SendVnakFrame (IAX2FullFrame *inReplyTo)
 
void SendUnsupportedFrame (IAX2FullFrame *inReplyTo)
 

Detailed Description

This class does the work of processing the lists of IAX packets (in and out) that are associated with each call. There is one IAX2CallProcessor per connection.

Member Enumeration Documentation

◆ CallStatus

bit mask of the different flags to indicate call status

Enumerator
callNewed 

we have received a new packet to set this call up.

callSentRinging 

we have sent a packet to indicate that the phone is ringing at our end

callRegistered 

registration with a remote asterisk server has been approved

callAuthorised 

we are waiting on password authentication at the remote endpoint

callAccepted 

call has been accepted, which means that the new request has been approved

callRinging 

Remote end has sent us advice the phone is ringing, awaiting answer

callAnswered 

call setup complete, now do audio

callTerminating 

Flag to indicate call is closing down after iax2 call end commands

◆ SoundBufferState

This is the current state of the sound buffer for the packets that are being recieved. It is used so if a bad event occurs like the buffer gets to big or the buffer gets to small then we can reduce the amount of audiable disturbances.

Enumerator
BufferToSmall 
Normal 

We need more sound packets to come in.

BufferToBig 

Everything is functioning ok.

We need the buffer size to be reduced there is too much latency

Constructor & Destructor Documentation

◆ IAX2CallProcessor()

IAX2CallProcessor::IAX2CallProcessor ( IAX2EndPoint ep)

Construct this class

◆ ~IAX2CallProcessor()

virtual IAX2CallProcessor::~IAX2CallProcessor ( )
virtual

Destructor

Member Function Documentation

◆ AcceptIncomingCall()

void IAX2CallProcessor::AcceptIncomingCall ( )

Send appropriate packets to the remote node to indicate we will accept this call. Note that this method is called from the endpoint thread, (not this IAX2Connection's thread). In other words, the application calls this method.

Referenced by GetSelectedCodec().

◆ AnswerWasAcked()

void IAX2CallProcessor::AnswerWasAcked ( )
protected

We have received an ack message from the remote node. The ack message was sent in response to our Answer message. Since the Answer message has been acked, we have to regard this call as Established();.

Referenced by IsCallAnswered().

◆ AssignConnection()

void IAX2CallProcessor::AssignConnection ( IAX2Connection _con)

Assign a pointer to the connection class to process, and starts thread

◆ BuildNewFrameForSending()

IAX2FullFrameProtocol* IAX2CallProcessor::BuildNewFrameForSending ( IAX2FullFrameProtocol inReplyTo = NULL)
protected

We have to send a new frame to the remote host. This builds the frame, and adds many of the information elements required. does not add the calltoken ie - that is added elsewhere. This method assumes this class already holds the relevant information on the destination box

Referenced by IncVideoFramesRcvd().

◆ CallStopSounds()

void IAX2CallProcessor::CallStopSounds ( )
protected

A stop sounds packet has been received, which means we have moved from waiting for the remote person to answer, to they have answered and media can flow in both directions

Referenced by IncVideoFramesRcvd().

◆ CheckForHangupMessages()

void IAX2CallProcessor::CheckForHangupMessages ( )
protected

Check to see if there is an outstanding request to send a hangup frame. This needs to be done in two places, so we use a routine to see if need to send a hanup frame.

◆ CheckForRemoteCapabilities()

void IAX2CallProcessor::CheckForRemoteCapabilities ( IAX2FullFrameProtocol src)
protected

If the incoming frame has Information Elements defining remote capability, define the list of remote capabilities

◆ ClearCall()

void IAX2CallProcessor::ClearCall ( OpalConnection::CallEndReason  releaseReason = OpalConnection::EndedByLocalUser)

From the IAX2Connection class. CAlling this sends a hangup frame

Referenced by GetEncryptionInfo().

◆ ConnectToRemoteNode()

void IAX2CallProcessor::ConnectToRemoteNode ( PString &  destination)
protected

Make a call to a remote node

◆ DoStatusCheck()

void IAX2CallProcessor::DoStatusCheck ( )
protected

Code to send a PING and a LAGRQ packet to the remote endpoint

Referenced by IsCallAnswered().

◆ GetCallingName()

PString IAX2CallProcessor::GetCallingName ( ) const
inline

Report the calling name - which we send to the remote endpoint when making a call

References callingName.

◆ GetEncryptionInfo()

IAX2Encryption& IAX2CallProcessor::GetEncryptionInfo ( )
inline

◆ GetPassword()

PString IAX2CallProcessor::GetPassword ( ) const
inline

◆ GetSelectedCodec()

unsigned short IAX2CallProcessor::GetSelectedCodec ( )
inline

Get the bit pattern of the selected codec

References AcceptIncomingCall(), Hangup(), selectedCodec, and SetAlerting().

◆ GetUserName()

PString IAX2CallProcessor::GetUserName ( ) const

Get the username

Referenced by SetUserName().

◆ Hangup()

void IAX2CallProcessor::Hangup ( PString  messageToSend)

Cause this thread to hangup the current call, but not die. Death will come soon though. The argument is placed in the iax2 hangup packet as the cause string.

Referenced by GetSelectedCodec().

◆ IncAudioFramesRcvd()

void IAX2CallProcessor::IncAudioFramesRcvd ( )
inlineprotected

Increment the count of audio frames received

References audioFramesRcvd.

◆ IncAudioFramesSent()

void IAX2CallProcessor::IncAudioFramesSent ( )
inlineprotected

Increment the count of audio frames sent

References audioFramesSent.

◆ IncomingMessageOutOfOrder()

virtual PBoolean IAX2CallProcessor::IncomingMessageOutOfOrder ( IAX2FullFrame ff)
virtual

Test the sequence number of the incoming frame. This is only valid for handling a call. If the message is outof order, the supplied fullframe is deleted.

Returns
true if the frame is out of order, which deletes the supplied frame
false, and does not destroy the supplied frame

Implements IAX2Processor.

Referenced by GetPassword().

◆ IncVideoFramesRcvd()

◆ IncVideoFramesSent()

void IAX2CallProcessor::IncVideoFramesSent ( )
inlineprotected

Increment the count of video frames sent

References videoFramesSent.

◆ IsCallAccepted()

PBoolean IAX2CallProcessor::IsCallAccepted ( )
inlineprotected

Get the current value of the call status flag callAccepted

References callAccepted.

◆ IsCallAnswered()

PBoolean IAX2CallProcessor::IsCallAnswered ( )
inlineprotected

Get the current value of the call status flag callAnswered

References AnswerWasAcked(), callAnswered, DoStatusCheck(), OnStatusCheck(), RemoteNodeIsRinging(), and RingingWasAcked().

◆ IsCallAuthorised()

PBoolean IAX2CallProcessor::IsCallAuthorised ( )
inlineprotected

Get the current value of the call status flag callAuthorised

References callAuthorised.

◆ IsCallHappening()

PBoolean IAX2CallProcessor::IsCallHappening ( )
inlineprotected

See if any of the flag bits are on, which indicate this call is actually active

◆ IsCallNewed()

PBoolean IAX2CallProcessor::IsCallNewed ( )
inlineprotected

Get marker to indicate that some packets have flowed etc for this call

References callNewed.

◆ IsCallRegistered()

PBoolean IAX2CallProcessor::IsCallRegistered ( )
inlineprotected

Get the current value of the call status flag callRegistered

References callRegistered.

◆ IsCallRinging()

PBoolean IAX2CallProcessor::IsCallRinging ( )
inlineprotected

Get the current value of the call status flag callRinging

References callRinging.

◆ IsCallSentRinging()

PBoolean IAX2CallProcessor::IsCallSentRinging ( )
inlineprotected

Get marker to indicate that we are waiting on the ack for the iaxcommandringing packet we sent

References callSentRinging.

◆ IsCallTerminating()

PBoolean IAX2CallProcessor::IsCallTerminating ( )
inline

Report the status of the flag callEndingNow, which indicates if the call is terminating under iax2 control

References callStatus, callTerminating, SendHold(), and SendHoldRelease().

Referenced by IAX2Connection::IsCallTerminating().

◆ Matches()

PBoolean IAX2CallProcessor::Matches ( IAX2Frame frame)
inline

Return true if the remote info in the frame matches the remote info in this connection

References IAX2Frame::GetRemoteInfo(), PrintOn(), IAX2Processor::remote, and ReportStatistics().

◆ MatchingLocalCallNumber()

PBoolean IAX2CallProcessor::MatchingLocalCallNumber ( PINDEX  compare)
inline

Return true if the arg matches the source call number for this connection

References IAX2Processor::remote, and IAX2Remote::SourceCallNumber().

◆ OnNoResponseTimeout()

virtual void IAX2CallProcessor::OnNoResponseTimeout ( )
protectedvirtual

A call back when there has been no acknowledgment and the timeout peroid has been reached

Implements IAX2Processor.

◆ OnReleased()

virtual void IAX2CallProcessor::OnReleased ( )
virtual

Call back from the IAX2Connection class. This indicates the IAX2Connection class is in the final stages of destruction. At this point, we can terminate the thread that processors all iax packets

Referenced by GetEncryptionInfo().

◆ OnStatusCheck()

void IAX2CallProcessor::OnStatusCheck ( PTimer &  ,
INT   
)
protected

A pwlib callback function to invoke another status check on the other endpoint

This method runs in a separate thread to the heart of the Connection. It is threadsafe, cause each of the elements in Connection (that are touched) are thread safe

Referenced by IsCallAnswered().

◆ PrintOn()

virtual void IAX2CallProcessor::PrintOn ( ostream &  strm) const
virtual

A method to cause some of the values in this class to be formatted into a printable stream

Implements IAX2Processor.

Referenced by Matches().

◆ ProcessFullFrame()

virtual void IAX2CallProcessor::ProcessFullFrame ( IAX2FullFrame fullFrame)
protectedvirtual

Process a full frame and respond accordingly to it

Implements IAX2Processor.

◆ ProcessIaxCmdAccept()

void IAX2CallProcessor::ProcessIaxCmdAccept ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Allow this call to procee

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdAck()

void IAX2CallProcessor::ProcessIaxCmdAck ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Acknowledge a Reliably sent full frame

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdAuthRep()

void IAX2CallProcessor::ProcessIaxCmdAuthRep ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is A reply, that contains authentication

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdAuthReq()

void IAX2CallProcessor::ProcessIaxCmdAuthReq ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Ask remote end to supply authentication

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdCallToken()

void IAX2CallProcessor::ProcessIaxCmdCallToken ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is CallToken. This is an authentication like packet that IAX2 added in sep 2009 to prevent a DOS attack from too many incoming callers.

Reply with a NEW packet and the calltoken from supplied frame.

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdDial()

void IAX2CallProcessor::ProcessIaxCmdDial ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Request a dial on channel brought up TBD

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdDpRep()

void IAX2CallProcessor::ProcessIaxCmdDpRep ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Request status of a dialplan entry

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdDpReq()

void IAX2CallProcessor::ProcessIaxCmdDpReq ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Request status of a dialplan entry

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdFwData()

void IAX2CallProcessor::ProcessIaxCmdFwData ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Firmware Data

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdFwDownl()

void IAX2CallProcessor::ProcessIaxCmdFwDownl ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Download firmware

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdHangup()

void IAX2CallProcessor::ProcessIaxCmdHangup ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Request to terminate this call

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdInval()

void IAX2CallProcessor::ProcessIaxCmdInval ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Destroy this call immediately

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdMwi()

void IAX2CallProcessor::ProcessIaxCmdMwi ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Stand-alone message waiting indicator

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdNew()

void IAX2CallProcessor::ProcessIaxCmdNew ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Create a new call

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdPage()

void IAX2CallProcessor::ProcessIaxCmdPage ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Paging description

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdProvision()

void IAX2CallProcessor::ProcessIaxCmdProvision ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Provision device

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdQuelch()

void IAX2CallProcessor::ProcessIaxCmdQuelch ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Stop audio/video transmission

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdReject()

void IAX2CallProcessor::ProcessIaxCmdReject ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Refuse to accept this call. May happen if authentication faile

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdTransfer()

void IAX2CallProcessor::ProcessIaxCmdTransfer ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Request remote transfer

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdTxacc()

void IAX2CallProcessor::ProcessIaxCmdTxacc ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Transfer Accepted

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdTxcnt()

void IAX2CallProcessor::ProcessIaxCmdTxcnt ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Transfer Connect

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdTxready()

void IAX2CallProcessor::ProcessIaxCmdTxready ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Transfer ready

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdTxrej()

void IAX2CallProcessor::ProcessIaxCmdTxrej ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Transfer reject

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdTxrel()

void IAX2CallProcessor::ProcessIaxCmdTxrel ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Transfer release

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdTxreq()

void IAX2CallProcessor::ProcessIaxCmdTxreq ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Transfer Request

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdUnquelch()

void IAX2CallProcessor::ProcessIaxCmdUnquelch ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Resume audio/video transmission

Referenced by IncVideoFramesRcvd().

◆ ProcessIaxCmdUnsupport()

void IAX2CallProcessor::ProcessIaxCmdUnsupport ( IAX2FullFrameProtocol src)
protected

Process a FullFrameProtocol class, where the sub Class value is Unsupported message received

Referenced by IncVideoFramesRcvd().

◆ ProcessIncomingAudioFrame()

void IAX2CallProcessor::ProcessIncomingAudioFrame ( IAX2Frame newFrame)
protected

Process the audio data portions of the Frame argument, which may be a MiniFrame or FullFrame

Referenced by IncVideoFramesRcvd().

◆ ProcessIncomingVideoFrame()

void IAX2CallProcessor::ProcessIncomingVideoFrame ( IAX2Frame newFrame)
protected

Process the video data portions of the Frame argument, which may be a MiniFrame or FullFrame

Referenced by IncVideoFramesRcvd().

◆ ProcessLists()

virtual void IAX2CallProcessor::ProcessLists ( )
protectedvirtual

Go through the three lists for incoming data (ethernet/sound/UI commands.

Implements IAX2Processor.

◆ ProcessNetworkFrame() [1/13]

void IAX2CallProcessor::ProcessNetworkFrame ( IAX2Frame src)
protected

Internal method to process an incoming network frame of type IAX2Frame

◆ ProcessNetworkFrame() [2/13]

void IAX2CallProcessor::ProcessNetworkFrame ( IAX2MiniFrame src)
protectedvirtual

Internal method to process an incoming network frame of type IAX2MiniFrame

Implements IAX2Processor.

◆ ProcessNetworkFrame() [3/13]

void IAX2CallProcessor::ProcessNetworkFrame ( IAX2FullFrame src)
protected

Internal method to process an incoming network frame of type IAX2FullFrame

◆ ProcessNetworkFrame() [4/13]

void IAX2CallProcessor::ProcessNetworkFrame ( IAX2FullFrameDtmf src)
protected

Internal method to process an incoming network frame of type IAX2FullFrameDtmf

◆ ProcessNetworkFrame() [5/13]

void IAX2CallProcessor::ProcessNetworkFrame ( IAX2FullFrameVoice src)
protected

Internal method to process an incoming network frame of type IAX2FullFrameVoice

◆ ProcessNetworkFrame() [6/13]

void IAX2CallProcessor::ProcessNetworkFrame ( IAX2FullFrameVideo src)
protected

Internal method to process an incoming network frame of type IAX2FullFrameVideo

◆ ProcessNetworkFrame() [7/13]

void IAX2CallProcessor::ProcessNetworkFrame ( IAX2FullFrameSessionControl src)
protected

Internal method to process an incoming network frame of type IAX2FullFrameSessionControl

◆ ProcessNetworkFrame() [8/13]

void IAX2CallProcessor::ProcessNetworkFrame ( IAX2FullFrameNull src)
protected

Internal method to process an incoming network frame of type IAX2FullFrameNull

◆ ProcessNetworkFrame() [9/13]

virtual PBoolean IAX2CallProcessor::ProcessNetworkFrame ( IAX2FullFrameProtocol src)
protectedvirtual

Internal method to process an incoming network frame of type IAX2FullFrameProtocol.

A frame of FullFrameProtocol type is labelled as AST_FRAME_IAX in the asterisk souces, It will contain 0, 1, 2 or more Information Elements (Ie) in the data section.

Reimplemented from IAX2Processor.

◆ ProcessNetworkFrame() [10/13]

void IAX2CallProcessor::ProcessNetworkFrame ( IAX2FullFrameText src)
protected

Internal method to process an incoming network frame of type IAX2FullFrameText

◆ ProcessNetworkFrame() [11/13]

void IAX2CallProcessor::ProcessNetworkFrame ( IAX2FullFrameImage src)
protected

Internal method to process an incoming network frame of type IAX2FullFrameImage

◆ ProcessNetworkFrame() [12/13]

void IAX2CallProcessor::ProcessNetworkFrame ( IAX2FullFrameHtml src)
protected

Internal method to process an incoming network frame of type IAX2FullFrameHtml

◆ ProcessNetworkFrame() [13/13]

void IAX2CallProcessor::ProcessNetworkFrame ( IAX2FullFrameCng src)
protected

Internal method to process an incoming network frame of type IAX2FullFrameCng

◆ PutSoundPacketToNetwork()

void IAX2CallProcessor::PutSoundPacketToNetwork ( PBYTEArray *  sund)

Handle a sound packet received from the sound device. Now onsend this to the remote endpoint.

◆ ReceivedHookFlash()

void IAX2CallProcessor::ReceivedHookFlash ( )
protected

A callback which is used to indicate that the remote party has sent us a hook flash message (i.e, their hook was flashed)

Referenced by IncVideoFramesRcvd().

◆ RemoteNodeHasAnswered()

void IAX2CallProcessor::RemoteNodeHasAnswered ( )
protected

A callback which is used to indicate the remote party has accepted our call. Media can flow now

Referenced by IncVideoFramesRcvd().

◆ RemoteNodeIsBusy()

void IAX2CallProcessor::RemoteNodeIsBusy ( )
protected

A callback which is used to indicate that the remote party has sent us a message stating they are busy.

Referenced by IncVideoFramesRcvd().

◆ RemoteNodeIsRinging()

void IAX2CallProcessor::RemoteNodeIsRinging ( )
protected

we have received a message that the remote node is ringing. Now wait for the remote user to answer.

Referenced by IsCallAnswered().

◆ RemoteSelectedCodecOk()

PBoolean IAX2CallProcessor::RemoteSelectedCodecOk ( )
protected

Test the value supplied in the format Ie is compatible.

◆ ReportStatistics()

void IAX2CallProcessor::ReportStatistics ( )

Invoked by the User interface, which causes the statistics (count of in/out packets) to be printed

Referenced by Matches().

◆ RingingWasAcked()

void IAX2CallProcessor::RingingWasAcked ( )
protected

We have told the remote node that our phone is ringing. they have acked this message. Now, we advise opal that our phone "should" be ringing, and does opal want to accept our call.

Referenced by IsCallAnswered().

◆ SendAnswerMessageToRemoteNode()

void IAX2CallProcessor::SendAnswerMessageToRemoteNode ( )

Advise the other end that we have picked up the phone. This method is public, as it is called by the IAX2Connection class, in response to the user accepting an incoming call.

Referenced by GetPassword().

◆ SendDtmf()

void IAX2CallProcessor::SendDtmf ( const PString &  dtmfs)

Ask this IAX2CallProcessor to send dtmf to the remote endpoint. The dtmf is placed on a queue, ready for transmission in fullframes of type dtmf.

Referenced by GetEncryptionInfo().

◆ SendDtmfMessage()

void IAX2CallProcessor::SendDtmfMessage ( char  message)
protected

Cause the dtmf full frames to go out for this dtmf character

◆ SendHold()

void IAX2CallProcessor::SendHold ( )

Put the remote connection on hold

Referenced by IsCallTerminating().

◆ SendHoldRelease()

void IAX2CallProcessor::SendHoldRelease ( )

Take the remote connection of hold

Referenced by IsCallTerminating().

◆ SendQuelchMessage()

void IAX2CallProcessor::SendQuelchMessage ( )
protected

Send a message to put the remote connection on hold

◆ SendSoundMessage()

void IAX2CallProcessor::SendSoundMessage ( PBYTEArray *  sound)
protected

Cause a sound frame (which is full or mini) to be sent. The data in the array is already compressed.

◆ SendText()

void IAX2CallProcessor::SendText ( const PString &  text)

Ask this IAX2CallProcessor to send text to the remote endpoint. The text is placed on a queue, ready for transmission in fullframes of type text.

Referenced by GetEncryptionInfo().

◆ SendTextMessage()

void IAX2CallProcessor::SendTextMessage ( PString &  message)
protected

Cause the text full frames to go out for this text message

◆ SendTransfer()

void IAX2CallProcessor::SendTransfer ( const PString &  calledNumber,
const PString &  calledContext = PString::Empty() 
)

Send a transfer request, to transfer the remote party to the specified number and optionally with a context

Referenced by GetPassword().

◆ SendTransferMessage()

void IAX2CallProcessor::SendTransferMessage ( )
protected

Sends a transfer message ONLY if doTransfer is true

◆ SendUnQuelchMessage()

void IAX2CallProcessor::SendUnQuelchMessage ( )
protected

Send a message to take the remote connection off hold

◆ SetAlerting()

virtual PBoolean IAX2CallProcessor::SetAlerting ( const PString &  calleeName,
PBoolean  withMedia 
)
virtual

Indicate to remote endpoint an alert is in progress. If this is an incoming connection and the AnswerCallResponse is in a AnswerCallDeferred or AnswerCallPending state, then this function is used to indicate to that endpoint that an alert is in progress. This is usually due to another connection which is in the call (the B party) has received an OnAlerting() indicating that its remoteendpoint is "ringing".

The default behaviour is pure.

Parameters
withMediaName of endpoint being alerted. Open media with alerting

Referenced by GetSelectedCodec().

◆ SetCallAccepted()

void IAX2CallProcessor::SetCallAccepted ( PBoolean  newValue = true)
inlineprotected

Mark call status Accepted (argument determines flag status)

References callAccepted.

◆ SetCallAnswered()

void IAX2CallProcessor::SetCallAnswered ( PBoolean  newValue = true)
inlineprotected

Mark call status Answered (argument determines flag status)

References callAnswered.

◆ SetCallAuthorised()

void IAX2CallProcessor::SetCallAuthorised ( PBoolean  newValue = true)
inlineprotected

Mark call status Authorised (argument determines flag status)

References callAuthorised.

◆ SetCallNewed()

void IAX2CallProcessor::SetCallNewed ( PBoolean  newValue = true)
inlineprotected

Mark call status as having received a new packet

References callNewed.

◆ SetCallRegistered()

void IAX2CallProcessor::SetCallRegistered ( PBoolean  newValue = true)
inlineprotected

Mark call status Registered (argument determines flag status)

References callRegistered.

◆ SetCallRinging()

void IAX2CallProcessor::SetCallRinging ( PBoolean  newValue = true)
inlineprotected

Mark call status Ringing (argument determines flag status)

References callRinging.

◆ SetCallSentRinging()

void IAX2CallProcessor::SetCallSentRinging ( PBoolean  newValue = true)
inlineprotected

Mark call status as having sent a iaxcmdRinging packet

References callSentRinging.

◆ SetCallTerminating()

void IAX2CallProcessor::SetCallTerminating ( PBoolean  newValue = true)
inlineprotected

Mark call status as terminated (is processing IAX2 hangup packets etc)

References callTerminating.

◆ SetPassword()

void IAX2CallProcessor::SetPassword ( PString &  inPassword)
inline

Set the password for when we connect to a remote node we use it as authentication. Note this must only be used before the main thread is started. This is optional because some servers do not required authentication, also if it is not set then the default iax2Ep password will be used instead.

References password.

◆ SetUpConnection()

virtual PBoolean IAX2CallProcessor::SetUpConnection ( )
virtual

Start an outgoing connection. This function will initiate the connection to the remote entity, for example in H.323 it sends a SETUP, in SIP it sends an INVITE etc.

The behaviour at the opal level is pure. Here, the method is defined.

Referenced by GetEncryptionInfo().

◆ SetUserName()

void IAX2CallProcessor::SetUserName ( PString &  inUserName)
inline

Set the username for when we connect to a remote node we use it as authentication. Note this must only be used before the main thread is started. This is optional because some servers do not required authentication, also if it is not set then the default iax2Ep username will be used instead.

References GetUserName(), and userName.

◆ StartStatusCheckTimer()

void IAX2CallProcessor::StartStatusCheckTimer ( PINDEX  msToWait = 10000)

Set up the acceptable time (in milliseconds) to wait between doing status checks.

Parameters
msToWaittime between status checks, default = 10 seconds

Referenced by GetPassword().

Field Documentation

◆ answerCallNow

PBoolean IAX2CallProcessor::answerCallNow
protected

Flag to indicate we have to answer this call (i.e. send a FullFrameSessionControl::answer packet).

◆ audioCanFlow

PBoolean IAX2CallProcessor::audioCanFlow
protected

Flag to indicate we are ready for audio to flow

◆ audioCompressedBytes

PINDEX IAX2CallProcessor::audioCompressedBytes
protected

The number of bytes from compressing one frame of audio

◆ audioFrameDuration

PINDEX IAX2CallProcessor::audioFrameDuration
protected

The time period, in ms, of each audio frame. It is used when determining the appropriate timestamp to go on a packet.

◆ audioFramesNotStarted

PBoolean IAX2CallProcessor::audioFramesNotStarted
protected

A flag to indicate we have yet to send an audio frame to remote endpoint. If this is on, then the first audio frame sent is a full one.

◆ audioFramesRcvd

PAtomicInteger IAX2CallProcessor::audioFramesRcvd
protected

Count of the number of sound frames received

Referenced by IncAudioFramesRcvd().

◆ audioFramesSent

PAtomicInteger IAX2CallProcessor::audioFramesSent
protected

Count of the number of sound frames sent

Referenced by IncAudioFramesSent().

◆ callingContext

PString IAX2CallProcessor::callingContext
protected

the context index - used in creating a cmdNew packet for creating call

◆ callingDnid

PString IAX2CallProcessor::callingDnid
protected

The Dnid - used in creating a cmdNew packet for creating call

◆ callingExtension

PString IAX2CallProcessor::callingExtension
protected

The calling extension - derived from the destination of the call

◆ callingName

PString IAX2CallProcessor::callingName
protected

The calling Name - used when we send a new packet to the remote host - this name is put the new packet

Referenced by GetCallingName().

◆ callList

SafeStrings IAX2CallProcessor::callList
protected

Array of remote node we have to make a call to

◆ callStatus

unsigned short IAX2CallProcessor::callStatus
protected

Contains the bits stating what is happening in the call

Referenced by IsCallTerminating().

◆ con

IAX2Connection* IAX2CallProcessor::con
protected

The connection class we are charged with running.

◆ doTransfer

PBoolean IAX2CallProcessor::doTransfer
protected

Whether we want a transfer event to occur or not

◆ dtmfNetworkList

SafeStrings IAX2CallProcessor::dtmfNetworkList
protected

Array of received dtmf characters (These have come from the network)

◆ dtmfText

SafeString IAX2CallProcessor::dtmfText
protected

Contains the concatanation of the dtmf we have to send to the remote endpoint. This string is sent a character at a time, one DTMF frame per character. This list is threadsafe.

◆ firstMediaFrame

PBoolean IAX2CallProcessor::firstMediaFrame
protected

Flag to indicate if we are waiting on the first full frame of media (voice or video). The arrival of this frame causes the IAX2Connection::OnEstablished method to be called.

◆ hangList

SafeStrings IAX2CallProcessor::hangList
protected

Array of requests to end this current call

◆ holdCall

PBoolean IAX2CallProcessor::holdCall
protected

Flag to indicate we have to send hold call

◆ holdReleaseCall

PBoolean IAX2CallProcessor::holdReleaseCall
protected

Flag to indicate we have to send hold release

◆ lastFullFrameTimeStamp

PINDEX IAX2CallProcessor::lastFullFrameTimeStamp
protected

This is the timestamp of the last received full frame, which is used to reconstruct the timestamp of received MiniFrames

◆ password

PString IAX2CallProcessor::password
protected

Optional password for when we connect to a remote node we use it as authentication. Note this must only be set before the main thread is started.

Referenced by GetPassword(), and SetPassword().

◆ remotePhoneNumber

SafeString IAX2CallProcessor::remotePhoneNumber
protected

Phone number of the remote endpoint

◆ selectedCodec

unsigned int IAX2CallProcessor::selectedCodec
protected

Bitmask of FullFrameVoice::AudioSc values to specify which codec is used

Referenced by GetSelectedCodec().

◆ soundBufferState

SoundBufferState IAX2CallProcessor::soundBufferState
protected

This holds the current state for the sound recieving buffer

◆ soundWaitingForTransmission

IAX2SoundList IAX2CallProcessor::soundWaitingForTransmission
protected

Array of sound packets read from the audio device, and is about to be transmitted to the remote node

◆ statusCheckOtherEnd

PBoolean IAX2CallProcessor::statusCheckOtherEnd
protected

Flag to indicate we need to do a status query on the other end. this means, send a PING and a LAGRQ packet, which happens every 10 seconds. The timer, timeStatusCheck controls when this happens

◆ statusCheckTimer

PTimer IAX2CallProcessor::statusCheckTimer
protected

The timer which is used to do the status check

◆ suppressHangupFrame

PBoolean IAX2CallProcessor::suppressHangupFrame
protected

Flag to indicate we should not send the hangup frame on call termination. Normally, when a call ends, we send a hangup frame. However, in the case where the remote endpoint rejects our call, we are not supposed to send a hangup frame

◆ textList

SafeStrings IAX2CallProcessor::textList
protected

Array of the text we have to send to the remote endpoint. This array is threadsafe.

◆ transferCalledContext

PString IAX2CallProcessor::transferCalledContext
protected

The context to call for a transfer – this is optional

◆ transferCalledNumber

PString IAX2CallProcessor::transferCalledNumber
protected

The number to call for a transfer

◆ transferMutex

PMutex IAX2CallProcessor::transferMutex
protected

A mutex to make the transfer related fields atomic

◆ userName

PString IAX2CallProcessor::userName
protected

Optional username for when we connect to a remote node we use it as authentication. Note this must only be set before the main thread is started.

Referenced by SetUserName().

◆ videoFramesRcvd

PAtomicInteger IAX2CallProcessor::videoFramesRcvd
protected

Count of the number of video frames received

Referenced by IncVideoFramesRcvd().

◆ videoFramesSent

PAtomicInteger IAX2CallProcessor::videoFramesSent
protected

Count of the number of video frames sent

Referenced by IncVideoFramesSent().


The documentation for this class was generated from the following file: