|
Yate
|
ISDN Q.931 implementation on top of Q.921. More...
#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 , ChannelExclusive = 0x00001000 } |
| 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 Types inherited from SignallingCallControl | |
| enum | MediaRequired { MediaNever , MediaAnswered , MediaRinging , MediaAlways } |
Public Member Functions | |
| ISDNQ931 (const NamedList ¶ms, const char *name=0) | |
| virtual | ~ISDNQ931 () |
| virtual bool | initialize (const NamedList *config) |
| virtual const char * | statusName () const |
| const ISDNLayer2 * | layer2 () const |
| bool | primaryRate () const |
| bool | network () 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, u_int8_t tei, String *reason=0) |
| virtual void | multipleFrameEstablished (u_int8_t tei, bool confirm, bool timeout, ISDNLayer2 *layer2) |
| virtual void | multipleFrameReleased (u_int8_t tei, bool confirm, bool timeout, ISDNLayer2 *layer2) |
| virtual void | receiveData (const DataBlock &data, u_int8_t tei, ISDNLayer2 *layer2) |
| virtual ISDNLayer2 * | attach (ISDNLayer2 *q921) |
| SignallingCall * | call (SignallingMessage *msg, String &reason) |
| bool | restart (const char *circuits) |
| bool | sendStatus (ISDNQ931Call *call, const char *cause, u_int8_t tei=0, const char *display=0, const char *diagnostic=0) |
| bool | sendRelease (ISDNQ931Call *call, bool release, const char *cause, u_int8_t tei=0, 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) |
| void | manageTimeout () |
| void | setDebug (bool printMsg, bool extendedDebug) |
Public Member Functions inherited from SignallingCallControl | |
| SignallingCallControl (const NamedList ¶ms, const char *msgPrefix=0) | |
| virtual | ~SignallingCallControl () |
| const String & | location () const |
| void | setExiting () |
| bool | exiting () const |
| bool | verify () |
| MediaRequired | mediaRequired () const |
| const String & | msgPrefix () const |
| SignallingCircuitGroup * | circuits () const |
| const ObjList & | calls () const |
| SignallingCircuitGroup * | attach (SignallingCircuitGroup *circuits) |
| bool | reserveCircuit (SignallingCircuit *&cic, const char *range=0, int checkLock=-1, const String *list=0, bool mandatory=true, bool reverseRestrict=false) |
| bool | releaseCircuit (SignallingCircuit *&cic, bool sync=false) |
| bool | releaseCircuit (unsigned int code, bool sync=false) |
| virtual SignallingEvent * | getEvent (const Time &when) |
| virtual void | buildVerifyEvent (NamedList ¶ms) |
Public Member Functions inherited from Mutex | |
| Mutex (bool recursive=false, const char *name=0) | |
| Mutex (const Mutex &original) | |
| ~Mutex () | |
| Mutex & | operator= (const Mutex &original) |
| virtual bool | lock (long maxwait=-1) |
| virtual bool | unlock () |
| virtual bool | locked () const |
| const char * | owner () const |
| bool | recursive () const |
Public Member Functions inherited from Lockable | |
| virtual | ~Lockable () |
| virtual bool | check (long maxwait=-1) |
| virtual bool | unlockAll () |
Public Member Functions inherited from SignallingDumpable | |
| ~SignallingDumpable () | |
Public Member Functions inherited from ISDNLayer3 | |
| virtual void | dataLinkState (u_int8_t tei, bool cmd, bool value, ISDNLayer2 *layer2) |
| virtual void | idleTimeout (ISDNLayer2 *layer2) |
Public Member Functions inherited from SignallingComponent | |
| virtual | ~SignallingComponent () |
| virtual const String & | toString () const |
| virtual NamedList * | controlCreate (const char *oper=0) |
| virtual bool | controlExecute (NamedList *params) |
| virtual void | engine (SignallingEngine *eng) |
| SignallingEngine * | engine () const |
| int | debugLevel (int level) |
| const String & | componentType () const |
Public Member Functions inherited from RefObject | |
| RefObject () | |
| virtual | ~RefObject () |
| virtual void * | getObject (const String &name) const |
| virtual bool | alive () const |
| bool | ref () |
| bool | deref () |
| int | refcount () const |
| virtual void | destruct () |
Public Member Functions inherited from GenObject | |
| GenObject () | |
| virtual | ~GenObject () |
| virtual const String & | traceId () const |
| NamedCounter * | getObjCounter () const |
| NamedCounter * | setObjCounter (NamedCounter *counter) |
Public Member Functions inherited from DebugEnabler | |
| DebugEnabler (int level=TelEngine::debugLevel(), bool enabled=true) | |
| int | debugLevel () const |
| int | debugLevel (int level) |
| bool | debugEnabled () const |
| void | debugEnabled (bool enable) |
| const char * | debugName () const |
| bool | debugAt (int level) const |
| bool | debugChained () const |
| void | debugChain (const DebugEnabler *chain=0) |
| void | debugCopy (const DebugEnabler *original=0) |
Static Public Attributes | |
| static const TokenDict | s_flags [] |
| static const TokenDict | s_swType [] |
Protected Member Functions | |
| virtual void | destroyed () |
| virtual void | timerTick (const Time &when) |
| ISDNQ931Call * | findCall (u_int32_t callRef, bool outgoing, u_int8_t tei=0) |
| 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, u_int8_t tei=0) |
| void | processMsgRestart (ISDNQ931Message *msg, u_int8_t tei=0) |
| void | processInvalidMsg (ISDNQ931Message *msg, u_int8_t tei=0) |
| 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, u_int8_t tei=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, u_int8_t tei, bool initiator, const char *cause=0, const char *diag=0, const char *display=0, const char *signal=0) |
Protected Member Functions inherited from SignallingCallControl | |
| int | strategy () const |
| virtual bool | processEvent (SignallingEvent *event) |
| virtual SignallingEvent * | processCircuitEvent (SignallingCircuitEvent *&event, SignallingCall *call=0) |
| void | clearCalls () |
| void | removeCall (SignallingCall *call, bool del=false) |
| void | setVerify (bool restartTimer=false, bool fireNow=false, const Time *time=0) |
Protected Member Functions inherited from SignallingDumpable | |
| SignallingDumpable (SignallingDumper::Type type, bool network=false) | |
| bool | dump (void *buf, unsigned int len, bool sent=false, int link=0) |
| bool | dump (const DataBlock &data, bool sent=false, int link=0) |
| void | setDumpNetwork (bool network) |
| void | setDumper (SignallingDumper *dumper=0) |
| bool | setDumper (const String &name, bool create=true, bool append=false) |
| bool | control (NamedList ¶ms, SignallingComponent *owner=0) |
Protected Member Functions inherited from ISDNLayer3 | |
| ISDNLayer3 (const char *name=0) | |
| Mutex & | l3Mutex () |
Protected Member Functions inherited from SignallingComponent | |
| SignallingComponent (const char *name=0, const NamedList *params=0, const char *type="unknown") | |
| void | insert (SignallingComponent *component) |
| virtual void | detach () |
| void | setName (const char *name) |
| void | setCompType (const char *type) |
| unsigned long | tickSleep (unsigned long usec=1000000) const |
Protected Member Functions inherited from RefObject | |
| virtual void | zeroRefs () |
| bool | resurrect () |
Protected Member Functions inherited from DebugEnabler | |
| void | debugName (const char *name) |
Friends | |
| class | ISDNQ931Call |
Additional Inherited Members | |
Static Public Member Functions inherited from Mutex | |
| static int | count () |
| static int | locks () |
| static bool | efficientTimedLock () |
Static Public Member Functions inherited from Lockable | |
| static void | wait (unsigned long maxwait) |
| static unsigned long | wait () |
| static void | startUsingNow () |
| static void | enableSafety (bool safe=true) |
| static bool | safety () |
Static Public Member Functions inherited from SignallingComponent | |
| static bool | resolveConfig (const String &cmpName, NamedList ¶ms, const NamedList *config) |
Static Public Member Functions inherited from RefObject | |
| static bool | alive (const RefObject *obj) |
| static bool | efficientIncDec () |
Static Public Member Functions inherited from GenObject | |
| static void * | getObject (const String &name, const GenObject *obj) |
| static bool | getObjCounting () |
| static void | setObjCounting (bool enable) |
| static NamedCounter * | getObjCounter (const String &name, bool create=true) |
| static ObjList & | getObjCounters () |
Protected Attributes inherited from SignallingCallControl | |
| ObjList | m_calls |
| String | m_msgPrefix |
| MediaRequired | m_mediaRequired |
| bool | m_verifyEvent |
| SignallingTimer | m_verifyTimer |
| String | m_location |
Static Protected Attributes inherited from SignallingCallControl | |
| static const TokenDict | s_mediaRequired [] |
ISDN Q.931 implementation on top of Q.921.
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 |
Destructor Destroy all calls
|
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 |
Attach an ISDN Q.921 transport This method is thread safe
| q921 | Pointer to the Q.921 transport to attach |
Reimplemented from ISDNLayer3.
Referenced by destroyed().
|
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.
Referenced by sendRelease(), and sendStatus().
|
virtual |
Set terminate to all calls This method is thread safe
| reason | Cleanup reason |
Reimplemented from SignallingCallControl.
|
inlineprotectedvirtual |
Detach links. Disposes memory
Reimplemented from SignallingComponent.
References attach(), SignallingCallControl::attach(), and RefObject::destroyed().
|
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) |
|
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 |
References restart().
|
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 |
| tei | TEI of the layer associated to the call to find |
|
protected |
Find a call given a circuit number
| circuit | The circuit number to find |
|
inline |
Get the default data format for outgoing calls
|
protected |
Process received data. Process received message segments if any
| data | The received data |
|
virtual |
Configure and initialize Q.931 and its layer 2
| config | Optional configuration parameters override |
Reimplemented from SignallingComponent.
|
inline |
Get the layer 2 attached to this object
Referenced by multipleFrameEstablished(), multipleFrameReleased(), and receiveData().
| void manageTimeout | ( | ) |
Manage timeout for the call setup message
|
virtual |
Notification of Layer 2 up state
| tei | TEI received by the Layer 2 |
| 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.
References layer2().
|
virtual |
Notification of Layer 2 down state
| tei | TEI received by the Layer 2 |
| 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.
References layer2().
|
inline |
Chech if this call controller is at the NET or CPE side of the link
|
inline |
Get the default numbering plan for outgoing calls
|
inline |
Get the default number presentation for outgoing calls
|
inline |
Get the default number screening for outgoing calls
|
inline |
Get the default number type for outgoing calls
|
inline |
Get the parser settings of this call control
|
inline |
Check if this call controller supports primary or basic rate transfer
|
protected |
Process messages with global call reference or should have one
| msg | The received message |
| tei | The TEI received with the message |
|
protected |
Process messages with invalid call reference
| msg | The received message |
| tei | The TEI received with the message |
|
protected |
Process a restart request
| msg | The received message |
| tei | The TEI received with the message |
|
virtual |
Receive data from Layer 2
| data | Received data |
| tei | TEI received by the Layer 2 |
| layer2 | Pointer to the sender Layer 2 |
Implements ISDNLayer3.
References layer2().
| bool restart | ( | const char * | circuits | ) |
Restart one or more the circuits
| circuits | Comma separated list of circuits to be restarted |
References SignallingCallControl::circuits().
Referenced by endRestart().
| bool sendMessage | ( | ISDNQ931Message * | msg, |
| u_int8_t | tei, | ||
| String * | reason = 0 ) |
Send a message
| msg | The message to be sent |
| tei | TEI value to use at Layer 2 |
| reason | Optional string to write the failure reason |
|
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 |
| tei | The TEI of the Layer 2 associated with the call |
| 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 |
|
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 |
| tei | TEI to which the release is sent to |
| diag | Optional hexified string for cause dignostic |
| display | Optional value for Display IE |
| signal | Optional value for Signal IE |
References call(), and sendRelease().
Referenced by sendRelease().
|
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) |
References Time::msecNow().
|
protected |
Send a STATUS message
| cause | Value for Cause IE |
| callRefLen | The call reference length parameter. |
| callRef | The call reference |
| tei | The TEI to send with the STATUS message |
| 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 |
|
inline |
Send a STATUS message for a given call
| call | The call requesting the operation |
| tei | The TEI to send with the STATUS message |
| cause | Value for Cause IE |
| display | Optional value for Display IE |
| diagnostic | Optional value for cause diagnostic value |
References call(), and sendStatus().
Referenced by sendStatus().
|
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 |
|
virtual |
|
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 |
|
protectedvirtual |
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.
|
inline |
Check if this call controller supports circuit switch or packet mode transfer
|
static |
The list of behaviour flag names
|
static |
The list of switch type names