#include <yatesig.h>
Public Types | |
enum | BehaviourFlags { SendNonIsdnSource = 0x00000001, IgnoreNonIsdnDest = 0x00000002, ForcePresNetProv = 0x00000004, Translate31kAudio = 0x00000008, URDITransferCapsOnly = 0x00000010, NoLayer1Caps = 0x00000020, IgnoreNonLockedIE = 0x00000040, NoDisplayIE = 0x00000080, NoDisplayCharset = 0x00000100, ForceSendComplete = 0x00000200, NoActiveOnConnect = 0x00000400, CheckNotifyInd = 0x00000800 } |
enum | SwitchType { Unknown = 0, EuroIsdnE1 = ForceSendComplete|CheckNotifyInd|NoDisplayCharset|URDITransferCapsOnly, EuroIsdnT1 = ForceSendComplete|CheckNotifyInd, NationalIsdn = SendNonIsdnSource, Dms100 = ForcePresNetProv|IgnoreNonIsdnDest, Lucent5e = IgnoreNonLockedIE, Att4ess = ForcePresNetProv|IgnoreNonLockedIE|Translate31kAudio|NoLayer1Caps, QSIG = NoActiveOnConnect|NoDisplayIE|NoDisplayCharset } |
Public Member Functions | |
ISDNQ931 (const NamedList ¶ms, const char *name=0) | |
virtual | ~ISDNQ931 () |
const ISDNLayer2 * | layer2 () const |
bool | primaryRate () const |
bool | transferModeCircuit () const |
ISDNQ931ParserData & | parserData () |
const String & | numPlan () const |
const String & | numType () const |
const String & | numPresentation () const |
const String & | numScreening () const |
const String & | format () const |
bool | sendMessage (ISDNQ931Message *msg, String *reason=0) |
virtual void | multipleFrameEstablished (bool confirm, bool timeout, ISDNLayer2 *layer2) |
virtual void | multipleFrameReleased (bool confirm, bool timeout, ISDNLayer2 *layer2) |
virtual void | receiveData (const DataBlock &data, bool ack, ISDNLayer2 *layer2) |
virtual void | attach (ISDNLayer2 *q921) |
SignallingCall * | call (SignallingMessage *msg, String &reason) |
bool | restart (const char *circuits) |
bool | sendStatus (ISDNQ931Call *call, const char *cause, const char *display=0, const char *diagnostic=0) |
bool | sendRelease (ISDNQ931Call *call, bool release, const char *cause, const char *diag=0, const char *display=0, const char *signal=0) |
virtual void | cleanup (const char *reason="offline") |
void | setInterval (SignallingTimer &timer, int id) |
virtual void * | getObject (const String &name) const |
virtual void | destruct () |
void | setDebug (bool printMsg, bool extendedDebug) |
Static Public Attributes | |
static TokenDict | s_flags [] |
static TokenDict | s_swType [] |
Protected Member Functions | |
virtual void | timerTick (const Time &when) |
ISDNQ931Call * | findCall (u_int32_t callRef, bool outgoing) |
ISDNQ931Call * | findCall (unsigned int circuit) |
void | terminateCalls (ObjList *list, const char *reason) |
bool | acceptNewCall (bool outgoing, String &reason) |
ISDNQ931Message * | getMsg (const DataBlock &data) |
ISDNQ931Message * | endReceiveSegment (const char *reason=0) |
void | processGlobalMsg (ISDNQ931Message *msg) |
void | processMsgRestart (ISDNQ931Message *msg) |
void | processInvalidMsg (ISDNQ931Message *msg) |
void | sendRestart (u_int64_t time=Time::msecNow(), bool retrans=false) |
void | endRestart (bool restart, u_int64_t time, bool timeout=false) |
bool | sendStatus (const char *cause, u_int8_t callRefLen, u_int32_t callRef=0, bool initiator=false, ISDNQ931Call::State state=ISDNQ931Call::Null, const char *display=0, const char *diagnostic=0) |
bool | sendRelease (bool release, u_int8_t callRefLen, u_int32_t callRef, bool initiator, const char *cause, const char *diag=0, const char *display=0, const char *signal=0) |
Friends | |
class | ISDNQ931Call |
Q.931 ISDN Layer 3 implementation on top of a Layer 2
enum BehaviourFlags |
Enumeration flags defining the behaviour of the ISDN call controller and any active calls managed by it
enum SwitchType |
Call controller switch type. Each value is a mask of behaviour flags
Constructor Initialize this object and the component
params | Layer's parameters and parser settings | |
name | Name of this component |
virtual ~ISDNQ931 | ( | ) | [virtual] |
Destructor Destroy all calls
bool acceptNewCall | ( | bool | outgoing, | |
String & | reason | |||
) | [protected] |
Check if this call control can accept new calls
outgoing | Call direction (true for outgoing) | |
reason | String to be filled with the reason if not accepted |
virtual void attach | ( | ISDNLayer2 * | q921 | ) | [virtual] |
Attach an ISDN Q.921 transport This method is thread safe
q921 | Pointer to the Q.921 transport to attach |
Reimplemented from ISDNLayer3.
SignallingCall* call | ( | SignallingMessage * | msg, | |
String & | reason | |||
) | [virtual] |
Create an outgoing call. Send a NewCall event with the given msg parameter
msg | Call parameters | |
reason | Failure reason if any |
Reimplemented from SignallingCallControl.
virtual void cleanup | ( | const char * | reason = "offline" |
) | [virtual] |
Set terminate to all calls This method is thread safe
reason | Cleanup reason |
Reimplemented from SignallingCallControl.
virtual void destruct | ( | ) | [inline, virtual] |
Detach links. Disposes memory
Reimplemented from GenObject.
References SignallingCallControl::attach(), and TelEngine::destruct().
ISDNQ931Message* endReceiveSegment | ( | const char * | reason = 0 |
) | [protected] |
End waiting for message segments If reason is 0 parse already received data for the segmented message This method is thread safe
reason | Debug info reason. If non 0 drop the received segment(s) |
void endRestart | ( | bool | restart, | |
u_int64_t | time, | |||
bool | timeout = false | |||
) | [protected] |
End restart procedure on timeout or restart acknoledge This method is thread safe
restart | True to try to send restart for the next circuit | |
time | The time of the transmission | |
timeout | True if a restart request timed out |
ISDNQ931Call* findCall | ( | unsigned int | circuit | ) | [protected] |
Find a call given a circuit number
circuit | The circuit number to find |
ISDNQ931Call* findCall | ( | u_int32_t | callRef, | |
bool | outgoing | |||
) | [protected] |
Find a call given its call reference and direction
callRef | The call reference to find | |
outgoing | True to find an outgoing call, false to find an incoming one |
const String& format | ( | ) | const [inline] |
Get the default data format for outgoing calls
ISDNQ931Message* getMsg | ( | const DataBlock & | data | ) | [protected] |
Process received data. Process received message segments if any
data | The received data |
virtual void* getObject | ( | const String & | name | ) | const [virtual] |
const ISDNLayer2* layer2 | ( | ) | const [inline] |
Get the layer 2 attached to this object
virtual void multipleFrameEstablished | ( | bool | confirm, | |
bool | timeout, | |||
ISDNLayer2 * | layer2 | |||
) | [virtual] |
Notification of Layer 2 up state
confirm | True if this is a confirmation of a previous request. False if it is an indication of state change on remote request | |
timeout | True if the reason is a timeout. | |
layer2 | Pointer to the notifier |
Reimplemented from ISDNLayer3.
virtual void multipleFrameReleased | ( | bool | confirm, | |
bool | timeout, | |||
ISDNLayer2 * | layer2 | |||
) | [virtual] |
Notification of Layer 2 down state
confirm | True if this is a confirmation of a previous request. False if it is an indication of state change on remote request | |
timeout | True if the reason is a timeout. | |
layer2 | Pointer to the notifier |
Reimplemented from ISDNLayer3.
const String& numPlan | ( | ) | const [inline] |
Get the default numbering plan for outgoing calls
const String& numPresentation | ( | ) | const [inline] |
Get the default number presentation for outgoing calls
const String& numScreening | ( | ) | const [inline] |
Get the default number screening for outgoing calls
const String& numType | ( | ) | const [inline] |
Get the default number type for outgoing calls
ISDNQ931ParserData& parserData | ( | ) | [inline] |
Get the parser settings of this call control
bool primaryRate | ( | ) | const [inline] |
Check if this call controller supports primary or basic rate transfer
void processGlobalMsg | ( | ISDNQ931Message * | msg | ) | [protected] |
Process messages with global call reference or should have one
msg | The received message |
void processInvalidMsg | ( | ISDNQ931Message * | msg | ) | [protected] |
Process messages with invalid call reference
msg | The received message |
void processMsgRestart | ( | ISDNQ931Message * | msg | ) | [protected] |
Process a restart request
msg | The received message |
virtual void receiveData | ( | const DataBlock & | data, | |
bool | ack, | |||
ISDNLayer2 * | layer2 | |||
) | [virtual] |
Receive data from Layer 2
data | Received data | |
ack | True if data is an acknoledged frame, false if it is an unacknoledged one | |
layer2 | Pointer to the sender |
Implements ISDNLayer3.
bool restart | ( | const char * | circuits | ) |
Restart one or more the circuits
circuits | Comma separated list of circuits to be restarted |
bool sendMessage | ( | ISDNQ931Message * | msg, | |
String * | reason = 0 | |||
) |
Send a message
msg | The message to be sent | |
reason | Optional string to write the failure reason |
bool sendRelease | ( | bool | release, | |
u_int8_t | callRefLen, | |||
u_int32_t | callRef, | |||
bool | initiator, | |||
const char * | cause, | |||
const char * | diag = 0 , |
|||
const char * | display = 0 , |
|||
const char * | signal = 0 | |||
) | [protected] |
Send a RELEASE or RELEASE COMPLETE message
release | True to send RELEASE, false to send RELEASE COMPLETE | |
callRefLen | The call reference length parameter | |
callRef | The call reference | |
initiator | The call initiator flag | |
cause | Value for Cause IE | |
diag | Optional hexified string for cause dignostic | |
display | Optional value for Display IE | |
signal | Optional value for Signal IE |
bool sendRelease | ( | ISDNQ931Call * | call, | |
bool | release, | |||
const char * | cause, | |||
const char * | diag = 0 , |
|||
const char * | display = 0 , |
|||
const char * | signal = 0 | |||
) | [inline] |
Send a RELEASE or RELEASE COMPLETE message for a given call
call | The call requesting the operation | |
release | True to send RELEASE, false to send RELEASE COMPLETE | |
cause | Value for Cause IE | |
diag | Optional hexified string for cause dignostic | |
display | Optional value for Display IE | |
signal | Optional value for Signal IE |
References ISDNQ931Call::callRef(), ISDNQ931Call::callRefLen(), and SignallingCall::outgoing().
void sendRestart | ( | u_int64_t | time = Time::msecNow() , |
|
bool | retrans = false | |||
) | [protected] |
Try to reserve a circuit for restarting if none. Send a restart request on it's behalf Start counting the restart interval if no circuit reserved This method is thread safe
time | The time of the transmission | |
retrans | Retransmission flag (true if a previous request timed out) |
bool sendStatus | ( | const char * | cause, | |
u_int8_t | callRefLen, | |||
u_int32_t | callRef = 0 , |
|||
bool | initiator = false , |
|||
ISDNQ931Call::State | state = ISDNQ931Call::Null , |
|||
const char * | display = 0 , |
|||
const char * | diagnostic = 0 | |||
) | [protected] |
Send a STATUS message
cause | Value for Cause IE | |
callRefLen | The call reference length parameter. | |
callRef | The call reference | |
initiator | True if this is from the call initiator | |
state | The state for CallState IE | |
display | Optional value for Display IE | |
diagnostic | Optional value for cause diagnostic value |
bool sendStatus | ( | ISDNQ931Call * | call, | |
const char * | cause, | |||
const char * | display = 0 , |
|||
const char * | diagnostic = 0 | |||
) | [inline] |
Send a STATUS message for a given call
call | The call requesting the operation | |
cause | Value for Cause IE | |
display | Optional value for Display IE | |
diagnostic | Optional value for cause diagnostic value |
References ISDNQ931Call::callRef(), ISDNQ931Call::callRefLen(), SignallingCall::outgoing(), and ISDNQ931State::state().
void setDebug | ( | bool | printMsg, | |
bool | extendedDebug | |||
) | [inline] |
Set debug data of this call controller
printMsg | Enable/disable message printing on output | |
extendedDebug | Enable/disable hex data dump if print messages is enabled |
void setInterval | ( | SignallingTimer & | timer, | |
int | id | |||
) |
Set the timeout interval for a given timer if implemented If the timer is not implemented the interval is set to 0
timer | The destination timer | |
id | The timer number as defined in Q.931 |
void terminateCalls | ( | ObjList * | list, | |
const char * | reason | |||
) | [protected] |
Terminate calls. If list is 0 terminate all calls
list | Optional list of circuits (strings) to be released | |
reason | The reason to be passed to each terminated call |
virtual void timerTick | ( | const Time & | when | ) | [protected, virtual] |
Method called periodically to check timeouts This method is thread safe
when | Time to use as computing base for events and timeouts |
Reimplemented from SignallingComponent.
bool transferModeCircuit | ( | ) | const [inline] |
Check if this call controller supports circuit switch or packet mode transfer