|
|
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 Type { FXO, FXS, Recorder, Monitor, Unknown } | Type |
Line type enumerator
| enum State { OutOfService = -1, Idle = 0, Dialing = 1, DialComplete = 2, Ringing = 3, Answered = 4, CallEnded = 5, OutOfOrder = 6, } | State |
Line state enumeration
| enum CallSetupInfo { After, Before, NoCallSetup } | CallSetupInfo |
Call setup (such as Caller ID) management (send and detect)
| AnalogLine (AnalogLineGroup* grp, unsigned int cic, const NamedList& params)
| AnalogLine |
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
Parameters:
| grp | The group owning this analog line |
| cic | The code of the signalling circuit used this line |
| params | The line's parameters |
| ~AnalogLine ()
| ~AnalogLine |
[virtual]
Destructor
| inline Type type ()
| type |
[const]
Get this line's type
Returns: The line type as enumeration
| inline State state ()
| state |
[const]
Get the line state
Returns: The line state as enumeration
| inline AnalogLineGroup* group ()
| group |
Get the group owning this line
Returns: The group owning this line
| inline AnalogLine* getPeer ()
| getPeer |
Get this line's peer if belongs to a pair of monitored lines
Returns: This line's peer if belongs to a pair of monitored lines
| void setPeer (AnalogLine* line = 0, bool sync = true)
| setPeer |
Remove old peer's peer. Set this line's peer
Parameters:
| line | This line's peer |
| sync | True to synchronize (set/reset) with the old peer |
| inline SignallingCircuit* circuit ()
| circuit |
Get the line's circuit
Returns: SignallingCircuit pointer or 0 if no circuit was attached to this line
| inline const char* address ()
| address |
[const]
Get the line address: group_name/circuit_number
Returns: The line address
| inline bool outbandDtmf ()
| outbandDtmf |
[const]
Check if allowed to send outband DTMFs (DTMF events)
Returns: True if allowed to send outband DTMFs
| inline bool answerOnPolarity ()
| answerOnPolarity |
[const]
Check if the line should be answered on polarity change
Returns: True if the line should be answered on polarity change
| inline bool hangupOnPolarity ()
| hangupOnPolarity |
[const]
Check if the line should be hanged up on polarity change
Returns: True if the line should be hanged up on polarity change
| inline bool polarityControl ()
| polarityControl |
[const]
Check if the line polarity change should be used
Returns: True if the line polarity change should be used
| inline CallSetupInfo callSetup ()
| callSetup |
[const]
Check if the line is processing (send/receive) the setup info (such as caller id) and when it does it
Returns: Call setup info processing as enumeration
| inline u_int64_t callSetupTimeout ()
| callSetupTimeout |
[const]
Get the time allowed to ellapse between the call setup data and the first ring
Returns: The time allowed to ellapse between the call setup data and the first ring
| inline u_int64_t noRingTimeout ()
| noRingTimeout |
[const]
Get the time allowed to ellapse without receiving a ring on incoming calls
Returns: The time allowed to ellapse without receiving a ring on incoming calls
| inline u_int64_t alarmTimeout ()
| alarmTimeout |
[const]
Get the time allowed to stay in alarm. This option can be used by the clients to terminate an active call
Returns: The time allowed to stay in alarm
| inline u_int64_t delayDial ()
| delayDial |
[const]
Get the time delay of dialing the called number
Returns: The time delay of dialing the called number
| inline void acceptPulseDigit (bool ok)
| acceptPulseDigit |
Set/reset accept pulse digits flag
Parameters:
| ok | True to accept incoming pulse digits, false to ignore them |
| inline void* userdata ()
| userdata |
[const]
Get the private user data of this line
Returns: The private user data of this line
| inline void userdata (void* data, bool sync = true)
| userdata |
Set the private user data of this line and its peer if any
Parameters:
| data | The new private user data value of this line |
| sync | True to synchronize (set data) with the peer |
| const String& toString ()
| toString |
[const virtual]
Get this line's address
Returns: This line's address
Reimplemented from GenObject.
| void resetEcho (bool train)
| resetEcho |
Reset the line circuit's echo canceller to line default echo canceller state
Parameters:
| train | Start echo canceller training if enabled |
| inline bool resetCircuit ()
| resetCircuit |
Reset the line's circuit (change its state to Reserved)
Returns: True if the line's circuit state was changed to Reserved
| inline bool setCircuitParam (const char* param, const char* value = 0)
| setCircuitParam |
Set a parameter of this line's circuit
Parameters:
| param | Parameter name |
| value | Optional parameter value |
Returns: True if the line's circuit parameter was set
| bool connect (bool sync)
| connect |
Connect the line's circuit. Reset line echo canceller
Parameters:
| sync | True to synchronize (connect) the peer |
Returns: True if the line's circuit state was changed to Connected
| bool disconnect (bool sync)
| disconnect |
Disconnect the line's circuit. Reset line echo canceller
Parameters:
| sync | True to synchronize (disconnect) the peer |
Returns: True if the line's circuit was disconnected (changed state from Connected to Reserved)
| bool sendEvent (SignallingCircuitEvent::Type type, NamedList* params = 0)
| sendEvent |
Send an event through this line if not out of service
Parameters:
| type | The type of the event to send |
| params | Optional event parameters |
Returns: True on success
| inline bool sendEvent (SignallingCircuitEvent::Type type, State newState,
NamedList* params = 0)
| sendEvent |
Send an event through this line if not out of service and change its state on success
Parameters:
| type | The type of the event to send |
| newState | The new state of the line if the event was sent |
| params | Optional event parameters |
Returns: True on success
| AnalogLineEvent* getEvent (const Time& when)
| getEvent |
[virtual]
Get events from the line's circuit if not out of service. Check timeouts
Parameters:
| when | The current time |
Returns: AnalogLineEvent pointer or 0 if no events
| AnalogLineEvent* getMonitorEvent (const Time& when)
| getMonitorEvent |
[virtual]
Alternate get events from this line or peer
Parameters:
| when | The current time |
Returns: AnalogLineEvent pointer or 0 if no events
| void checkTimeouts (const Time& when)
| checkTimeouts |
[virtual]
Check timeouts if the line is not out of service and no event was generated by the circuit
Parameters:
| when | Time to use as computing base for timeouts |
| bool changeState (State newState, bool sync = false)
| changeState |
Change the line state if neither current or new state are OutOfService
Parameters:
| newState | The new state of the line |
| sync | True to synchronize (change state) the peer |
Returns: True if line state changed
| bool enable (bool ok, bool sync, bool connectNow = true)
| enable |
Enable/disable line. Change circuit's state to Disabled/Reserved when entering/exiting the OutOfService state
Parameters:
| 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 |
Returns: True if line state changed
| const TokenDict* typeNames ()
| typeNames |
[static]
Line type names dictionary
| const TokenDict* stateNames ()
| stateNames |
[static]
Line state names dictionary
| const TokenDict* csNames ()
| csNames |
[static]
Call setup info names
| void destroyed ()
| destroyed |
[protected virtual]
Deref the circuit. Remove itself from group
Reimplemented from RefObject.
| Generated by: paulc on bussard on Sun Oct 20 21:06:06 2013, using kdoc 2.0a54. |