Click or drag to resize
ManagerConnection Class
Default implemention of the ManagerConnection interface.
Inheritance Hierarchy
SystemObject
  AsterNET.ManagerManagerConnection

Namespace: AsterNET.Manager
Assembly: AsterNET (in AsterNET.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public class ManagerConnection

The ManagerConnection type exposes the following members.

Constructors
  NameDescription
Public methodManagerConnection
Creates a new instance.
Public methodManagerConnection(String, Int32, String, String)
Creates a new instance with the given connection parameters.
Public methodManagerConnection(String, Int32, String, String, Encoding)
Creates a new instance with the given connection parameters.
Top
Methods
  NameDescription
Public methodBuildAction(ManagerAction)
Public methodBuildAction(ManagerAction, String)
Protected methodconnect
Protected methoddetermineVersion
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetProtocolIdentifier
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIsConnected
Returns true if there is a socket connection to the asterisk server, false otherwise.
Public methodLogin
Logs in to the Asterisk manager using asterisk's MD5 based challenge/response protocol. The login is delayed until the protocol identifier has been received by the reader.
Public methodLogin(Int32)
Log in to the Asterisk manager using asterisk's MD5 based challenge/response protocol. The login is delayed until the protocol identifier has been received by the reader.
Public methodLogoff
Sends a LogoffAction and disconnects from the server.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRegisterUserEventClass
Register User Event Class
Public methodSendAction(ManagerAction)
Send Action with default timeout.
Public methodSendAction(ManagerAction, ResponseHandler)
Public methodSendAction(ManagerAction, Int32)
Send action ans with timeout (milliseconds)
Public methodSendEventGeneratingAction(ManagerActionEvent)
Public methodSendEventGeneratingAction(ManagerActionEvent, Int32)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldUseASyncEvents
Allows you to specifiy how events are fired. If false (default) then events will be fired in order. Otherwise events will be fired as they arrive and control logic in your application will need to handle synchronization.
Public fieldVAR_DELIMITER
Top
Properties
  NameDescription
Public propertyAsteriskVersion
Public propertyDefaultEventTimeout
Sets the time in milliseconds the synchronous method will wait for a response and the last response event before throwing a TimeoutException.
Default is 5000.
Public propertyDefaultResponseTimeout
Sets the time in milliseconds the synchronous method will wait for a response before throwing a TimeoutException.
Default is 2000.
Public propertyFireAllEvents
If this property set to true then ManagerConnection send all unassigned events to UnhandledEvent handler,
if set to false then all unassgned events lost and send only UnhandledEvent.
Default: false
Public propertyHostname
Sets the hostname of the asterisk server to connect to.
Default is localhost.
Public propertyKeepAlive
Should we attempt to reconnect when the connection is lost?
This is set to true after successful login and to false after logoff or after an authentication failure when keepAliveAfterAuthenticationFailure is false.
Public propertyKeepAliveAfterAuthenticationFailure
Set to true to try reconnecting to ther asterisk serve even if the reconnection attempt threw an AuthenticationFailedException.
Default is false.
Public propertyPassword
Sets the password to use to connect to the asterisk server. This is the password specified in asterisk's manager.conf file.
Public propertyPingInterval
Timeout from Ping to Pong. If no Pong received send Disconnect event. Set to zero to disable.
Public propertyPort
Sets the port to use to connect to the asterisk server. This is the port specified in asterisk's manager.conf file.
Default is 5038.
Public propertyReconnectIntervalFast
Default Fast Reconnect interval in milliseconds.
Public propertyReconnectIntervalMax
Default Slow Reconnect interval in milliseconds.
Public propertyReconnectRetryFast
Default Fast Reconnect retry counter.
Public propertyReconnectRetryMax
Default Maximum Reconnect retry counter.
Public propertySleepTime
Sets the time in milliseconds the synchronous methods SendAction(Action.ManagerAction) and SendAction(Action.ManagerAction, long) will sleep between two checks for the arrival of a response. This value should be rather small.
The sleepTime attribute is also used when checking for the protocol identifer.
Default is 50.
Public propertySocketEncoding
Socket Encoding - default ASCII
Public propertyUsername
Sets the username to use to connect to the asterisk server. This is the username specified in asterisk's manager.conf file.
Public propertyVersion
Top
Events
  NameDescription
Public eventAgentCallbackLogin
An AgentCallbackLogin is triggered when an agent is successfully logged in.
Public eventAgentCallbackLogoff
An AgentCallbackLogoff is triggered when an agent that previously logged in is logged of.
Public eventAgentCalled
An AgentCalled is triggered when an agent is ring.
To enable AgentCalled you have to set eventwhencalled = yes in queues.conf.
Public eventAgentComplete
An AgentCompleteEvent is triggered when at the end of a call if the caller was connected to an agent.
Public eventAgentConnect
An AgentConnectEvent is triggered when a caller is connected to an agent.
Public eventAgentDump
An AgentDumpEvent is triggered when an agent dumps the caller while listening to the queue announcement.
Public eventAgentLogin
An AgentLoginEvent is triggered when an agent is successfully logged in using AgentLogin.
Public eventAgentLogoff
An AgentCallbackLogoffEvent is triggered when an agent that previously logged in using AgentLogin is logged of.
Public eventAgents
An AgentsEvent is triggered for each agent in response to an AgentsAction.
Public eventAgentsComplete
An AgentsCompleteEvent is triggered after the state of all agents has been reported in response to an AgentsAction.
Public eventAGIExec
AgiExec is execute
Public eventAlarm
An AlarmEvent is triggered when a Zap channel enters or changes alarm state.
Public eventAlarmClear
An AlarmEvent is triggered when a Zap channel leaves alarm state.
Public eventAttendedTransfer
Public eventBlindTransfer
Public eventBridge
Public eventBridgeCreate
Public eventBridgeDestroy
Public eventBridgeEnter
Public eventBridgeLeave
Public eventCdr
A CdrEvent is triggered when a call detail record is generated, usually at the end of a call.
Public eventConfbridgeEnd
This event is sent when the last user leaves a conference and it is torn down.
Public eventConfbridgeJoin
This event is sent when a user joins a conference - either one already in progress or as the first user to join a newly instantiated bridge.
Public eventConfbridgeLeave
This event is sent when a user leaves a conference.
Public eventConfbridgeStart
This event is sent when the first user requests a conference and it is instantiated
Public eventConfbridgeTalking
This event is sent when the conference detects that a user has either begin or stopped talking.
Public eventConnectionState
A ConnectionState is triggered after Connect/Disconnect/Reload/Shutdown events.
Public eventDBGetResponse
Public eventDial
A Dial is triggered whenever a phone attempts to dial someone.
Public eventDialBegin
Raised when a dial action has started.
Public eventDialEnd
Raised when a dial action has completed.
Public eventDNDState
A DNDStateEvent is triggered by the Zap channel driver when a channel enters or leaves DND (do not disturb) state.
Public eventDTMF
Public eventExtensionStatus
An ExtensionStatus is triggered when the state of an extension changes.
Public eventFailedACL
Public eventHangup
A Hangup is triggered when a channel is hung up.
Public eventHold
A Hold is triggered by the SIP channel driver when a channel is put on hold.
Public eventHoldedCall
A HoldedCall is triggered when a channel is put on hold.
Public eventJoin
A Join is triggered when a channel joines a queue.
Public eventLeave
A Leave is triggered when a channel leaves a queue.
Public eventLink
A Link is triggered when two voice channels are linked together and voice data exchange commences.
Several Link events may be seen for a single call. This can occur when Asterisk fails to setup a native bridge for the call.This is when Asterisk must sit between two telephones and perform CODEC conversion on their behalf.
Public eventLogChannel
A LogChannel is triggered when logging is turned on or off.
Public eventMeetMeJoin
A MeetMeJoin is triggered if a channel joins a meet me conference.
Public eventMeetMeLeave
A MeetMeLeave is triggered if a channel leaves a meet me conference.
Public eventMeetMeTalking
A MeetMeTalkingEvent is triggered when a user starts talking in a meet me conference.
To enable talker detection you must pass the option 'T' to the MeetMe application.
Public eventMessageWaiting
A MessageWaiting is triggered when someone leaves voicemail.
Public eventNewCallerId
A NewCallerId is triggered when the caller id of a channel changes.
Public eventNewChannel
A NewChannel is triggered when a new channel is created.
Public eventNewExten
A NewExten is triggered when a channel is connected to a new extension.
Public eventNewState
A NewState is triggered when the state of a channel has changed.
Public eventOriginateResponse
An OriginateResponse is triggered when the execution of an Originate.
Public eventParkedCall
A ParkedCall is triggered when a channel is parked (in this case no action id is set) and in response to a ParkedCallsAction.
Public eventParkedCallGiveUp
A ParkedCallGiveUp is triggered when a channel that has been parked is hung up.
Public eventParkedCallsComplete
A ParkedCallsComplete is triggered after all parked calls have been reported in response to a ParkedCallsAction.
Public eventParkedCallTimeOut
A ParkedCallTimeOut is triggered when call parking times out for a given channel.
Public eventPeerEntry
A PeerEntry is triggered in response to a SIPPeersAction or SIPShowPeerAction and contains information about a peer.
Public eventPeerlistComplete
A PeerlistComplete is triggered after the details of all peers has been reported in response to an SIPPeersAction or SIPShowPeerAction.
Public eventPeerStatus
A PeerStatus is triggered when a SIP or IAX client attempts to registrer at this asterisk server.
Public eventQueueCallerAbandon
A QueueEntryEvent is triggered in response to a QueueStatusAction and contains information about an entry in a queue.
Public eventQueueCallerJoin
Raised when a caller joins a Queue.
Public eventQueueCallerLeave
Raised when a caller leaves a Queue.
Public eventQueueEntry
A QueueEntryEvent is triggered in response to a QueueStatusAction and contains information about an entry in a queue.
Public eventQueueMember
A QueueMemberEvent is triggered in response to a QueueStatusAction and contains information about a member of a queue.
Public eventQueueMemberAdded
A QueueMemberAddedEvent is triggered when a queue member is added to a queue.
Public eventQueueMemberPause
A QueueMemberPauseEvent is triggered when a queue member is paused or unpaused.
Available since : Asterisk 12.
Public eventQueueMemberPaused
A QueueMemberPausedEvent is triggered when a queue member is paused or unpaused. Replaced by : QueueMemberPauseEvent since Asterisk 12.
Removed since : Asterisk 13.
Public eventQueueMemberRemoved
A QueueMemberRemovedEvent is triggered when a queue member is removed from a queue.
Public eventQueueMemberStatus
A QueueMemberStatusEvent shows the status of a QueueMemberEvent.
Public eventQueueParams
A QueueParamsEvent is triggered in response to a QueueStatusAction and contains the parameters of a queue.
Public eventQueueStatusComplete
A QueueStatusCompleteEvent is triggered after the state of all queues has been reported in response to a QueueStatusAction.
Public eventRegistry
A Registry is triggered when this asterisk server attempts to register as a client at another SIP or IAX server.
Public eventRename
A RenameEvent is triggered when the name of a channel is changed.
Public eventStatus
A StatusEvent is triggered for each active channel in response to a StatusAction.
Public eventStatusComplete
A StatusCompleteEvent is triggered after the state of all channels has been reported in response to a StatusAction.
Public eventTransfer
Public eventUnhandledEvent
An UnhandledEvent is triggered on unknown event.
Public eventUnhold
An UnholdEvent is triggered by the SIP channel driver when a channel is no longer put on hold.
Public eventUnlink
An UnlinkEvent is triggered when a link between two voice channels is discontinued, for example, just before call completion.
Public eventUnparkedCall
A UnparkedCallEvent is triggered when a channel that has been parked is resumed.
Public eventUserEvents
A ZapShowChannelsEvent is triggered on UserEvent in dialplan.
Public eventVarSet
When a variable is set
Public eventZapShowChannels
A ZapShowChannelsEvent is triggered in response to a ZapShowChannelsAction and shows the state of a zap channel.
Public eventZapShowChannelsComplete
A ZapShowChannelsCompleteEvent is triggered after the state of all zap channels has been reported in response to a ZapShowChannelsAction.
Top
See Also