# IAX2IeCallToken Class Reference

`#include <ies.h>`

Inheritance diagram for IAX2IeCallToken:

[legend]
Collaboration diagram for IAX2IeCallToken:
[legend]

## Public Member Functions

| IAX2IeCallToken (BYTE length, BYTE *srcData)
| IAX2IeCallToken ()
virtual void | PrintOn (ostream &str) const
virtual BYTE | GetKeyValue () const
virtual void | StoreDataIn (IAX2IeData &res)
void | WriteKeySequence (PIPSocket::Address &remoteAddress)

## Static Public Member Functions

static void | InitialiseKey ()
static PBoolean | ValidKeySequence (IAX2IeCallToken &cf, PIPSocket::Address &remote)

## Protected Types

| iKeyValue = 0x36
| oKeyValue = 0x5c
| blockSize = 64
enum | { iKeyValue = 0x36, oKeyValue = 0x5c, blockSize = 64 }

## Static Protected Member Functions

static PString | ReportKeySequence (const PString &time, PIPSocket::Address &remote)

## Static Protected Attributes

static PString | secretKey
static BYTE | iKeyPad [blockSize]
static BYTE | oKeyPad [blockSize]

## Detailed Description

An Information Element that contains the Call Token - a mechanism to stop DOS attacks through setting up lots of calls

The IAX2IeCallToken uses the HMAC SHA1 algorithm to secure the challenge message sent to the initiating computer. With this approach, it is not feasible for spoofing etc of the reply. You can readup on hmac-sha1 at http://en.wikipedia.org/wiki/HMAC

## Member Enumeration Documentation

anonymous enum`[protected]`

The internal size of the hmac sha1 key, which the protocol sets at 64 bytes, as this is a 512 bit hash

Enumerator:

  iKeyValue | Speced in protocol, an ambiguitating value
  oKeyValue | Same as iKeyValue, bitwise is very different.
  blockSize | Size of the cypher. 64 bytes = 512 bits.

## Constructor & Destructor Documentation

IAX2IeCallToken::IAX2IeCallToken | ( | BYTE | length,
|  | BYTE * | srcData |
| ) |  |  | `[inline]`

Constructor from data read from the network. Contents are undefined if the network data is bogus/invalid

IAX2IeCallToken::IAX2IeCallToken | ( |  | ) | `[inline]`

Build an empty IAX2IeCallToken, which is used in the new packet, as sent by the node initiating a call

## Member Function Documentation

virtual BYTE IAX2IeCallToken::GetKeyValue | ( |  | ) | const`[inline, virtual]`

Get the key value for this particular Information Element class

Reimplemented from IAX2Ie.

static void IAX2IeCallToken::InitialiseKey | ( |  | ) | `[static]`

Initialise the internal key, and the iKeyPad and oKeyPad variables, for the generation of the SHA1-HMAC keysequence. This initialisation happens once, at program startup.

virtual void IAX2IeCallToken::PrintOn | ( | ostream & | str | ) | const`[virtual]`

print this class (nicely) to the designated stream

Reimplemented from IAX2IeBinary.

static PString IAX2IeCallToken::ReportKeySequence | ( | const PString & | time,
|  | PIPSocket::Address & | remote |
| ) |  |  | `[static, protected]`

Report the key sequence that should be built, provided the supplied time string and address

virtual void IAX2IeCallToken::StoreDataIn | ( | IAX2IeData & | res | ) | `[inline, virtual]`

Take the data from this IAX2Ie, and copy it into the IAX2IeData structure. This is done on processing an incoming frame which contains IAX2Ie in the data section.

Reimplemented from IAX2Ie.

static PBoolean IAX2IeCallToken::ValidKeySequence | ( | IAX2IeCallToken & | cf,
|  | PIPSocket::Address & | remote |
| ) |  |  | `[static]`

Examine the hash key sequence in the supplied IE, and see if it is valid.

void IAX2IeCallToken::WriteKeySequence | ( | PIPSocket::Address & | remoteAddress | ) |

Fill with a hash key sequence, that we will later verify

## Field Documentation

BYTE IAX2IeCallToken::iKeyPad[blockSize]`[static, protected]`

Used for generating the SHA1-HMAC hash. Initialised at program startup, saves on time later.

BYTE IAX2IeCallToken::oKeyPad[blockSize]`[static, protected]`

Similar to the iKeyPad, an internal variable

PString IAX2IeCallToken::secretKey `[static, protected]`

The key used in generating the SHA1-HMAC hash. Key is required for handling incoming calls

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

- ies.h