|
Yate
|
An analog line. More...
#include <yatesig.h>
Public Types | |
| enum | Type { FXO , FXS , Recorder , Monitor , Unknown } |
| enum | State { OutOfService = -1 , Idle = 0 , Dialing = 1 , DialComplete = 2 , Ringing = 3 , Answered = 4 , CallEnded = 5 , OutOfOrder = 6 } |
| enum | CallSetupInfo { After , Before , NoCallSetup } |
Public Member Functions | |
| AnalogLine (AnalogLineGroup *grp, unsigned int cic, const NamedList ¶ms) | |
| virtual | ~AnalogLine () |
| Type | type () const |
| State | state () const |
| AnalogLineGroup * | group () |
| AnalogLine * | getPeer () |
| void | setPeer (AnalogLine *line=0, bool sync=true) |
| SignallingCircuit * | circuit () |
| const char * | address () const |
| bool | outbandDtmf () const |
| bool | answerOnPolarity () const |
| bool | hangupOnPolarity () const |
| bool | polarityControl () const |
| CallSetupInfo | callSetup () const |
| u_int64_t | callSetupTimeout () const |
| u_int64_t | noRingTimeout () const |
| u_int64_t | alarmTimeout () const |
| u_int64_t | delayDial () const |
| void | acceptPulseDigit (bool ok) |
| void * | userdata () const |
| void | userdata (void *data, bool sync=true) |
| virtual const String & | toString () const |
| void | resetEcho (bool train) |
| bool | resetCircuit () |
| bool | setCircuitParam (const char *param, const char *value=0) |
| bool | connect (bool sync) |
| bool | disconnect (bool sync) |
| bool | sendEvent (SignallingCircuitEvent::Type type, NamedList *params=0) |
| bool | sendEvent (SignallingCircuitEvent::Type type, State newState, NamedList *params=0) |
| virtual AnalogLineEvent * | getEvent (const Time &when) |
| virtual AnalogLineEvent * | getMonitorEvent (const Time &when) |
| virtual void | checkTimeouts (const Time &when) |
| bool | changeState (State newState, bool sync=false) |
| bool | enable (bool ok, bool sync, bool connectNow=true) |
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 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 () |
Static Public Member Functions | |
| static const TokenDict * | typeNames () |
| static const TokenDict * | stateNames () |
| static const TokenDict * | csNames () |
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 () |
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 () |
Protected Member Functions | |
| virtual void | destroyed () |
Protected Member Functions inherited from RefObject | |
| virtual void | zeroRefs () |
| bool | resurrect () |
Friends | |
| class | AnalogLineGroup |
An analog line.
This class is used to manage an analog line and keep data associated with it. Also it can be used to monitor a pair of FXS/FXO analog lines
| enum CallSetupInfo |
Call setup (such as Caller ID) management (send and detect)
| enum State |
Line state enumeration
| enum Type |
Line type enumerator
| AnalogLine | ( | AnalogLineGroup * | grp, |
| unsigned int | cic, | ||
| const NamedList & | params ) |
Constructor. Reserve the line's circuit. Connect it if requested. Creation will fail if no group, circuit, caller or the circuit is already allocated for another line in the group
| grp | The group owning this analog line |
| cic | The code of the signalling circuit used this line |
| params | The line's parameters |
Referenced by destroyed(), getPeer(), and setPeer().
|
virtual |
Destructor
|
inline |
Set/reset accept pulse digits flag
| ok | True to accept incoming pulse digits, false to ignore them |
|
inline |
Get the line address: group_name/circuit_number
|
inline |
Get the time allowed to stay in alarm. This option can be used by the clients to terminate an active call
|
inline |
Check if the line should be answered on polarity change
|
inline |
Check if the line is processing (send/receive) the setup info (such as caller id) and when it does it
|
inline |
Get the time allowed to ellapse between the call setup data and the first ring
| bool changeState | ( | State | newState, |
| bool | sync = false ) |
Change the line state if neither current or new state are OutOfService
| newState | The new state of the line |
| sync | True to synchronize (change state) the peer |
Referenced by sendEvent().
|
inlinevirtual |
Check timeouts if the line is not out of service and no event was generated by the circuit
| when | Time to use as computing base for timeouts |
|
inline |
Get the line's circuit
| bool connect | ( | bool | sync | ) |
Connect the line's circuit. Reset line echo canceller
| sync | True to synchronize (connect) the peer |
|
static |
Call setup info names
|
inline |
Get the time delay of dialing the called number
|
protectedvirtual |
| bool disconnect | ( | bool | sync | ) |
Disconnect the line's circuit. Reset line echo canceller
| sync | True to synchronize (disconnect) the peer |
| bool enable | ( | bool | ok, |
| bool | sync, | ||
| bool | connectNow = true ) |
Enable/disable line. Change circuit's state to Disabled/Reserved when entering/exiting the OutOfService state
| ok | Enable (change state to Idle) or disable (change state to OutOfService) the line |
| sync | True to synchronize (enable/disable) the peer |
| connectNow | Connect the line if enabled. Ignored if the line will be disabled |
|
virtual |
Get events from the line's circuit if not out of service. Check timeouts
| when | The current time |
|
virtual |
Alternate get events from this line or peer
| when | The current time |
|
inline |
Get this line's peer if belongs to a pair of monitored lines
References AnalogLine().
|
inline |
Get the group owning this line
|
inline |
Check if the line should be hanged up on polarity change
|
inline |
Get the time allowed to ellapse without receiving a ring on incoming calls
|
inline |
Check if allowed to send outband DTMFs (DTMF events)
|
inline |
Check if the line polarity change should be used
|
inline |
Reset the line's circuit (change its state to Reserved)
References state().
| void resetEcho | ( | bool | train | ) |
Reset the line circuit's echo canceller to line default echo canceller state
| train | Start echo canceller training if enabled |
| bool sendEvent | ( | SignallingCircuitEvent::Type | type, |
| NamedList * | params = 0 ) |
Send an event through this line if not out of service
| type | The type of the event to send |
| params | Optional event parameters |
References type().
Referenced by sendEvent().
|
inline |
Send an event through this line if not out of service and change its state on success
| type | The type of the event to send |
| newState | The new state of the line if the event was sent |
| params | Optional event parameters |
References changeState(), sendEvent(), and type().
|
inline |
Set a parameter of this line's circuit
| param | Parameter name |
| value | Optional parameter value |
| void setPeer | ( | AnalogLine * | line = 0, |
| bool | sync = true ) |
Remove old peer's peer. Set this line's peer
| line | This line's peer |
| sync | True to synchronize (set/reset) with the old peer |
References AnalogLine().
|
inline |
|
static |
Line state names dictionary
|
inlinevirtual |
|
inline |
Get this line's type
Referenced by sendEvent(), and sendEvent().
|
static |
Line type names dictionary
|
inline |
Get the private user data of this line
|
inline |
Set the private user data of this line and its peer if any
| data | The new private user data value of this line |
| sync | True to synchronize (set data) with the peer |
References Mutex::lock().