API Docs for:
Show:

proxy_logic_13 Class

Module: proxy_logic_13
Parent Module: astproxy

This is the asterisk proxy logic linked to version asterisk 13.

Item Index

Methods

Methods

addConversationToExten

(
  • exten
  • resp
  • chid
)
private

Add new conversation to the extension.

Parameters:

  • exten String

    The extension number

  • resp Object

    The channel list object received by the listChannels command plugin

  • chid String

    The channel identifier

addConversationToTrunk

(
  • trunk
  • resp
  • chid
)
private

Add new conversation to the trunk.

Parameters:

  • trunk String

    The trunk number. It can be also the "usercontext" of the trunk

  • resp Object

    The channel list object received by the listChannels command plugin

  • chid String

    The channel identifier

addParkeeNames

(
  • resp
)
private

Add the name of the parked to the response received from "listParkedCalls" command plugin.

Parameters:

  • resp Object

    The reponse object received from the "listParkedCalls" command plugin

addPrefix

(
  • num
)
String

Adds a prefix to the number only if it is not already present and if it is not an extension.

Parameters:

  • num String

    The number to call

Returns:

String:

The number to call

addQueueMemberLoggedIn

(
  • data
  • queueId
)
private

Add a member to the queue with logged status set to "in". If the member is of dynamic type, it will be added only if it has been declared as dynamic member of the queue.

Parameters:

  • data Object
    • member String

      The member identifier

    • paused Boolean

      The paused status of the member

    • name String

      The name of the member

    • type String

      The type of the member (dynamic, static, realtime)

    • callsTakenCount Number

      The number of the taken calls

    • lastCallTimestamp Number

      The timestamp of the last call received by the member

  • queueId String

    The queue identifier

addQueueMemberLoggedOut

(
  • memberId
  • queueId
)
private

Add a member to a queue with logged status set to out.

Parameters:

  • memberId String

    The queue member identifier

  • queueId String

    The queue identifier

attendedTransferConvCb

(
  • err
)
private

This is the callback of attendedTransfer command plugin.

Parameters:

  • err Object

    The error object of the operation

attendedTransferConversation

(
  • extension
  • convid
  • to
  • cb
)

Attended transfer the conversation.

Parameters:

  • extension String

    The endpoint identifier (e.g. the extension number)

  • convid String

    The conversation identifier

  • to String

    The destination number to redirect the conversation

  • cb Function

    The callback function

blindTransferConvCb

(
  • err
)
private

This is the callback of blindTransfer command plugin.

Parameters:

  • err Object

    The error object of the operation

blindTransferConversation

(
  • extension
  • convid
  • to
  • cb
)

Blind transfer the conversation.

Parameters:

  • extension String

    The endpoint identifier (e.g. the extension number)

  • convid String

    The conversation identifier

  • to String

    The destination number to redirect the conversation

  • cb Function

    The callback function

call

(
  • endpointType
  • endpointId
  • to
  • extenForContext
  • cb
)

Make a new call.

Parameters:

  • endpointType String

    The type of the endpoint (e.g. extension, queue, parking, trunk...)

  • endpointId String

    The endpoint identifier (e.g. the extension number)

  • to String

    The destination number

  • extenForContext String

    The extension to be used to get the "context" to make the new call

  • cb Function

    The callback function

callAndSendDTMFSequence

(
  • chanType
  • extension
  • sequence
  • callerid
  • fromExten
  • cb
)
private

Call and then send sequence of DTMF digits to the specified extension.

Parameters:

  • chanType String

    The technology of the channel (e.g. SIP, IAX, ...)

  • extension String

    The extension identifier

  • sequence String

    The sequence of DTMF tones

  • callerid String

    The caller identifier

  • fromExten String

    The extension identifier from which the command has to be sent

  • cb Function

    The callback function

callCb

(
  • error
)
private

This is the callback of the call command plugin.

Parameters:

  • error Object

    The error object of the operation

createAlarm

(
  • params
  • cb
)

Create an alarm for a specified date, time and extension.

Parameters:

  • params Object
    • extension String

      The endpoint identifier (e.g. the extension number)

    • time String

      The time of the alarm. Use hh:mm in 24 format

    • date String

      The date of the alarm. Use YYYYMMDD format

    • [maxRetries] String optional

      Number of retries before failing

    • [retryTime] String optional

      Seconds between retries

    • [waitTime] String optional

      Seconds to wait for an answer

  • cb Function

    The callback function

deleteAlarm

(
  • filename
  • cb
)

Delete an alarm wakeup.

Parameters:

  • filename String

    The alarm filename

  • cb Function

    The callback function

endMeetmeConf

(
  • confId
  • cb
)

Ends the entire meetme conference.

Parameters:

  • confId String

    The conference identifier

  • cb Function

    The callback function

evtAddMeetmeUserConf

(
  • data
)

A user extension has joined the meetme conference. So update info about the conference.

Parameters:

  • data Object

    The response object received from the event plugin meetmejoin.

    • name String

      The name of the user

    • userId String

      The user identifier in the conference

    • extenId String

      The extension identifier in the conference

    • confId String

      The conference identifier

evtConversationConnected

(
  • num1
  • num2
)

If the involved numbers are extensions, it updates their conversations.

Parameters:

  • num1 String

    One of the two connected numbers

  • num2 String

    The other of the two connected numbers

evtConversationDialing

(
  • data
)

If the involved numbers are extensions, it updates their conversations. If the called is an extension it emits a dialing event to him with caller identity.

Parameters:

  • data Object

    The data received from the dial event plugin

evtConversationInfoChanged

(
  • num1
  • num2
)

Some information of a conversation has been changed, for example during an attended transfer call. So update info.

Parameters:

  • num1 String

    One of the two connected numbers

  • num2 String

    The other of the two connected numbers

evtExtenCfbChanged

(
  • exten
  • enabled
  • [to]
)
private

Updates the extension call forward busy status.

Parameters:

  • exten String

    The extension number

  • enabled Boolean

    True if the call forward busy is enabled

  • [to] String optional

    The destination number of the call forward busy

evtExtenCfbVmChanged

(
  • exten
  • enabled
  • [vm]
)
private

Updates the extension call forward busy to voicemail status.

Parameters:

  • exten String

    The extension number

  • enabled Boolean

    True if the call forward busy to voicemail is enabled

  • [vm] String optional

    The destination voicemail number of the call forward busy

evtExtenCfuChanged

(
  • exten
  • enabled
  • [to]
)
private

Updates the extension call forward on unavailable status.

Parameters:

  • exten String

    The extension number

  • enabled Boolean

    True if the call forward on unavailable is enabled

  • [to] String optional

    The destination number of the call forward on unavailable

evtExtenCfuVmChanged

(
  • exten
  • enabled
  • [vm]
)
private

Updates the extension call forward unavailable to voicemail status.

Parameters:

  • exten String

    The extension number

  • enabled Boolean

    True if the call forward unavailable to voicemail is enabled

  • [vm] String optional

    The destination voicemail number of the call forward unavailable

evtExtenDndChanged

(
  • exten
  • enabled
)
private

Updates the extension dnd status.

Parameters:

  • exten String

    The extension number

  • enabled Boolean

    True if the dnd is enabled

evtExtenStatusChanged

(
  • exten
  • statusCode
)
private

Updates the extension status and any other information except the channel list. To update the channel list it request all channels to analize through "listChannels" command plugin.

Parameters:

  • exten String

    The extension number

  • statusCode String

    The numeric status code as arrived from asterisk

evtExtenUnconditionalCfChanged

(
  • exten
  • enabled
  • [to]
)
private

Updates the extension unconditional call forward status.

Parameters:

  • exten String

    The extension number

  • enabled Boolean

    True if the call forward is enabled

  • [to] String optional

    The destination number of the call forward

evtExtenUnconditionalCfVmChanged

(
  • exten
  • enabled
  • [vm]
)
private

Updates the extension unconditional call forward to voicemail status.

Parameters:

  • exten String

    The extension number

  • enabled Boolean

    True if the call forward to voicemail is enabled

  • [vm] String optional

    The destination voicemail number of the call forward

evtHangupConversation

(
  • data
)

It's called when an Hangup event is raised from the asterisk. It is called from the hangup event plugin.

Parameters:

  • data Object

    The data received from hangup event plugin

evtMeetmeUserConfMute

(
  • data
)

The mute status of a meetme user conference has been changed. So update info about the conference.

Parameters:

  • data Object

    The response object received from the event plugin meetmemute.

evtNewCdr

(
  • data
)
private

New call detail records (cdr) has been logged into the call history. So it emits the EVT_NEW_CDR event.

Parameters:

  • data Object
    • source String

      The calling party’s caller ID number

    • channel String

      The calling party’s channel

    • endtime String

      The end time of the call

    • duration String

      The number of seconds between the start and end times for the call

    • amaflags String

      The Automatic Message Accounting (AMA) flag associated with this call. This may be one of the following: OMIT, BILLING, DOCUMENTATION, or Unknown

    • uniqueid String

      The unique ID for the src channel

    • callerid String

      The full caller ID, including the name, of the calling party

    • starttime String

      The start time of the call

    • answertime String

      The answered time of the call

    • destination String

      The destination extension for the call

    • disposition String

      An indication of what happened to the call. This may be NO ANSWER, FAILED, BUSY, ANSWERED, or UNKNOWN

    • lastapplication String

      The last dialplan application that was executed

    • billableseconds String

      The number of seconds between the answer and end times for the call

    • destinationcontext String

      The destination context for the call

    • destinationchannel String

      The called party’s channel

evtNewExternalCall

(
  • number
)

A new external call is received. So it retrieves the data about the caller. It gets the created caller notes for the specified number and the central and cti phonebook contacts. Then add the data into the callerIdentityData property to use it when Dialing events are received. This method is called by the plugins_event_13/userevent.js.

Parameters:

  • number String

    The caller number

evtNewQueueWaitingCaller

(
  • data
)

Adds a new waiting caller to a queue.

Parameters:

  • data Object

    The response object received from the event plugin join.

evtNewVoicemailMessage

(
  • data
)
private

New voice messages has been left. So it emits the EVT_NEW_VOICEMAIL event.

Parameters:

  • data Object
    • context String

      The context of the voicemail extension

    • countNew String

      The number of the new voicemail messages

    • countOld String

      The number of the old voicemail messages

    • voicemail String

      The voicemail identifier who received the voice message

evtQueueMemberAdded

(
  • data
)
private

An event about queue member added has been received from the asterisk.

Parameters:

  • data Object
    • type String

      The membership type (static or dynamic)

    • name String

      The name of the member

    • queueId String

      The queue identifier

    • member String

      The queue member identifier

    • paused Boolean

      True if the extension has been paused from the queue

    • lastCallTimestamp Number

      The timestamp of the last call received by the member

    • callsTakenCount Number

      The number of the taken calls

evtQueueMemberPausedChanged

(
  • queueId
  • memberId
  • paused
  • reason
)
private

Updates the queue member paused status and it start time.

Parameters:

  • queueId String

    The queue identifier

  • memberId String

    The queue member identifier

  • paused Boolean

    True if the extension has been paused from the queue

  • reason String

    True reason description of the pause

evtQueueMemberRemoved

(
  • data
)
private

An event about queue member removed has been received from the asterisk. So updates the queue member status.

Parameters:

  • data Object
    • queueId String

      The queue identifier

    • member String

      The queue member identifier

evtQueueMemberStatus

(
  • data
)
private

An event about queue member status has been received from the asterisk. It updates the data about the queue member.

Parameters:

  • data Object
    • type String

      The membership type (static or dynamic)

    • name String

      The name of the member

    • queueId String

      The queue identifier

    • member String

      The queue member identifier

    • paused Boolean

      True if the extension has been paused from the queue

    • lastCallTimestamp Number

      The timestamp of the last call received by the member

    • callsTakenCount Number

      The number of the taken calls

evtRemoveMeetmeConf

(
  • data
)

A meetme conference has been ended. So update info about the conference.

Parameters:

  • data Object

    The response object received from the event plugin meetmeend.

evtRemoveMeetmeUserConf

(
  • data
)

A user extension has left the meetme conference. So update info about the conference.

Parameters:

  • data Object

    The response object received from the event plugin meetmeleave.

evtRemoveQueueWaitingCaller

(
  • data
)

A queue waiting caller has left the queue. So update all queue waiting callers.

Parameters:

  • data Object

    The response object received from the event plugin leave.

evtRename

() private

An event about channel renaming has been received from the asterisk. It updates the waiting callers of all queues.

evtSpyStartConversation

(
  • data
)

If the involved spier is an extensions, it updates its conversations.

Parameters:

  • data Object

    The data received from the __ event plugin

evtUpdateVoicemailMessages

(
  • data
)
private

Something has appens in the voice messages of the voicemail, for example the listen of a new voice message from the phone. So it emits the EVT_UPDATE_VOICE_MESSAGES event.

Parameters:

  • data Object
    • context String

      The context of the voicemail extension

    • voicemail String

      The voicemail identifier who received the voice message

extenStatus

(
  • err
  • resp
)
private

Sets the extension status received.

Parameters:

  • err Object

    The received error object

  • resp Object

    The received response object

extIaxDetails

(
  • resp
)
private

Sets the details for the iax extension object.

Parameters:

  • resp Object

    The extension information object

extPjsipDetails

(
  • err
  • resp
)
private

Sets the details for the pjsip extension object.

Parameters:

  • err Object

    The error object

  • resp Object

    The extension information object

extSipDetails

(
  • err
  • resp
)
private

Sets the details for the sip extension object.

Parameters:

  • err Object

    The error object

  • resp Object

    The extension information object

forceHangupConversation

(
  • endpointType
  • endpointId
  • convid
  • extForCtx
  • cb
)

Force hangup of the conversation.

Parameters:

  • endpointType String

    The type of the endpoint (e.g. extension, queue, parking, trunk...)

  • endpointId String

    The endpoint identifier (e.g. the extension number)

  • convid String

    The conversation identifier

  • extForCtx String

    The extension identifier used to get the context

  • cb Function

    The callback function

getAlarms

(
  • cb
)

Get the list of all alarms wakeup.

Parameters:

  • cb Function

    The callback function

getBaseCallRecAudioPath

() String

Returns the base path of the call recording audio files.

Returns:

String:

The base path of the call recording audio files.

getCCCounterByQueue

(
  • qid
)
Number

Return the number of connected calls through the specified queue.

Parameters:

  • qid String

    The queue identifier

Returns:

Number:

The the number of connected calls through the specified queue.

getCfbExten

(
  • exten
)
Function private

Get call forward on busy (CFB) status of the extension.

Parameters:

  • exten String

    The extension identifier

Returns:

Function:

The function to be called by initializePjsipExten.

getCfbVmExten

(
  • exten
)
Function private

Get call forward on busy to voicemail (CFB) status of the extension.

Parameters:

  • exten String

    The extension identifier

Returns:

Function:

The function to be called by initializePjsipExten.

getCfExten

(
  • exten
)
Function private

Get call forward (CF) status of the extension.

Parameters:

  • exten String

    The extension identifier

Returns:

Function:

The function to be called by initializePjsipExten.

getCfuExten

(
  • exten
)
Function private

Get call forward on unavailable (CFU) status of the extension.

Parameters:

  • exten String

    The extension identifier

Returns:

Function:

The function to be called by initializePjsipExten.

getCfuVmExten

(
  • exten
)
Function private

Get call forward on unavailable to voicemail (CFU) status of the extension.

Parameters:

  • exten String

    The extension identifier

Returns:

Function:

The function to be called by initializePjsipExten.

getCfVmExten

(
  • exten
)
Function private

Get call forward to voicemail (CFVM) status of the extension.

Parameters:

  • exten String

    The extension identifier

Returns:

Function:

The function to be called by initializePjsipExten.

getConference

() Object

Returns a conference of the extension.

Returns:

Object:

The MeetmeConference object.

getDndExten

(
  • exten
)
Function private

Get do not disturb (DND) status of the extension.

Parameters:

  • exten String

    The extension identifier

Returns:

Function:

The function to be called by initializePjsipExten.

getEchoCallDestination

() String

Returns the destination number to compose to make a new echo call.

Returns:

String:

The destination number to compose to make a new echo call.

getExtenCfbValue

(
  • exten
)
Srting

Returns the call forward busy value.

Parameters:

  • exten String

    The extension identifier

Returns:

Srting:

The call forward busy value.

getExtenCfuValue

(
  • exten
)
Srting

Returns the call forward on unavailable value.

Parameters:

  • exten String

    The extension identifier

Returns:

Srting:

The call forward on unavailable value.

getExtenCfValue

(
  • exten
)
Srting

Returns the call forward value.

Parameters:

  • exten String

    The extension identifier

Returns:

Srting:

The call forward value.

getExtenIdChannelConversation

(
  • exten
  • convid
)
String private

Return a channel identifier of the conversation of the specified extension. If the source channel is present it will returned its id, otherwise the destination channel id will be returned. It is useful for those operation in which the channel type is not important (e.g. the hangup operation).

Parameters:

  • exten String

    The extension number

  • convid String

    The conversation identifier

Returns:

String:

The channel identifier or undefined value if it's not present.

getExtenIdSourceChannelConversation

(
  • exten
  • convid
)
Object private

Return the identifier of the source channel of the conversation of the specified extension. If the source channel isn't present, undefined will be returned. It is useful for those operation in which the channel type is important. For example the start and stop record call must be executed on the same channel.

Parameters:

  • exten String

    The extension number

  • convid String

    The conversation identifier

Returns:

Object:

The identifier of the source channel or undefined value if it's not present.

getExtensionAgent

(
  • exten
)
String

Returns the extension user agent.

Parameters:

  • exten String

    The extension identifier

Returns:

String:

The extension user agent.

getExtensionIp

(
  • exten
)
String

Returns the IP address of the extension.

Parameters:

  • exten String

    The extension identifier

Returns:

String:

The IP address of the extension.

getExtensions

() Object

Return the extension list.

Returns:

Object:

The extensions object.

getExtensionsFromConversation

(
  • convid
  • exten
)
Array private

Returns the extensions involved in the specified conversation.

Parameters:

  • convid String

    The conversation identifier

  • exten String

    The extension identifier which has the conversation

Returns:

Array:

The extensions involved in the conversation.

getExtensList

() Array

Returns the list of the extensions.

Returns:

Array:

The extensions list.

getExtenSourceChannelConversation

(
  • exten
  • convid
)
Object private

Return the source channel of the conversation of the specified extension. If the source channel isn't present, undefined will be returned. It is useful for those operation in which the channel type is important. For example the start and stop record call must be executed on the same channel.

Parameters:

  • exten String

    The extension number

  • convid String

    The conversation identifier

Returns:

Object:

The source channel or undefined value if it's not present.

getJSONAgentsStats

(
  • day
  • callback
)
Object

Return the JSON representation of agent stats.

Parameters:

  • day String

    The day expressed in YYYYMMDD format

  • callback Function

    The callback function

Returns:

Object:

The JSON representation of agent stats.

getJSONAllAgentsStats

(
  • qlist
  • cb
)
Object

Return the JSON representation of agents statistics.

Parameters:

  • qlist Array

    The queue identifiers

  • cb Function

    The callback function

Returns:

Object:

The JSON representation of queue agents statistics.

getJSONAllQueuesStats

(
  • queuesList
  • cb
)
Object

Return the JSON statistics about all queues.

Parameters:

  • queuesList Array

    The list of the queues identifiers

  • cb Function

    The callback function

Returns:

Object:

The JSON statistics about all queues.

getJSONExtension

(
  • exten
  • [privacyStrOutQueue]
  • [privacyStrInQueue]
)
Object

Returns the JSON representation of the extension. If some error occurs it returns an empty object.

Parameters:

  • exten String

    The extension identifier

  • [privacyStrOutQueue] String optional

    If it is specified, it obfuscates the number of all calls that does not pass through a queue

  • [privacyStrInQueue] String optional

    If it is specified, it obfuscates the number of all calls that pass through a queue

Returns:

Object:

The JSON representation of the extension.

getJSONExtensions

(
  • [privacyStrOutQueue]
  • [privacyStrInQueue]
)
Object

Returns the JSON representation of all the extensions. If some error occurs it returns an empty object.

Parameters:

  • [privacyStrOutQueue] String optional

    If it is specified, it obfuscates the number of all calls that does not pass through a queue

  • [privacyStrInQueue] String optional

    If it is specified, it obfuscates the number of all calls that pass through a queue

Returns:

Object:

The JSON representation of the all extensions.

getJSONParkings

(
  • [privacyStr]
)
Object

Returns the JSON representation of all parkings.

Parameters:

  • [privacyStr] String optional

    If it's specified, it hides the last digits of the phone number

Returns:

Object:

The JSON representation of all parkings.

getJSONQueues

(
  • [privacyStr]
)
Object

Returns the JSON representation of all queues.

Parameters:

  • [privacyStr] String optional

    If it's specified, it hides the last digits of the phone number

Returns:

Object:

The JSON representation of all queues.

getJSONQueuesQOS

(
  • day
  • callback
)
Object

Return the JSON representation of queues QOS.

Parameters:

  • day String

    The day expressed in YYYYMMDD format

  • callback Function

    The callback function

Returns:

Object:

The JSON representation of queues QOS.

getJSONQueuesStats

(
  • day
  • callback
)
Object

Return the JSON representation of extended queue statistics.

Parameters:

  • day String

    The day expressed in YYYYMMDD format

  • callback Function

    The callback function

Returns:

Object:

The JSON representation of extended queue statistics.

getJSONQueueStats

(
  • qid
  • cb
)
Object

Return the JSON representation of queue statistics.

Parameters:

  • qid String

    The queue identifier

  • cb Function

    The callback function

Returns:

Object:

The JSON representation of extended queue statistics.

getJSONTrunks

(
  • [privacyStr]
)
Object

Returns the JSON representation of all trunks.

Parameters:

  • [privacyStr] String optional

    If it's specified, it hides the last digits of the phone number

Returns:

Object:

The JSON representation of all trunks.

getListChannels

() Function private

Get the list of channels.

Returns:

Function:

The function to be called by initializePjsipExten.

getMeetmeConfCode

() Object static

Returns the code used to start a meetme conference.

Returns:

Object:

The code used to start a meetme conference.

getPickupCode

() String static

Return the asterisk code of pickup operation.

Returns:

String:

The asterisk code of pickup operation.

getPjsipDetailExten

(
  • exten
)
Function private

Get pjsip extension details.

Parameters:

  • exten String

    The extension identifier

Returns:

Function:

The function to be called by initializePjsipExten.

getPrefix

() String static

Returns the prefix number used in all outgoing calls. It is not used with internal calls between extensions.

Returns:

String:

prefix The prefix number.

getQueueDetails

(
  • qid
)
Function private

Get the details of a queue.

Parameters:

  • qid String

    The queue identifier

Returns:

Function:

The function to be called by initializeQueues.

getQueueIdsOfExten

(
  • extenId
)
Object

Returns all the queue identifiers to which the specified extension belongs.

Parameters:

  • extenId String

    The extension identifier

Returns:

Object:

The queue identifier list as keys of an object.

getRecordFilename

(
  • exten
  • convid
  • now
)
String private

Returns the name of the audio file to record the conversation of the specified extension.

Parameters:

  • exten String

    The extension number

  • convid String

    The conversation identifier

  • now Object

    A date object

Returns:

String:

The name of the audio file or undefined value if it is not present.

getRecordFilepath

(
  • exten
  • convid
  • now
)
String private

Returns the path of the audio file to record the conversation of the specified extension.

Parameters:

  • exten String

    The extension number

  • convid String

    The conversation identifier

  • now Object

    A date object

Returns:

String:

The path of the audio file or undefined value if it is not present.

getSipTrunkStatus

(
  • trunk
)
Function private

Get status of trunk sip.

Parameters:

  • trunk String

    The trunk identifier

Returns:

Function:

The function to be called by initializeSipTrunk.

getTrunkName

(
  • trunk
)
String

Return the trunk name. This is used because in same cases trunk name obtained from channels correspond to the "usercontext" of the trunk itself, as in the case of incoming calls on IAX2 trunks.

Parameters:

  • trunk String

    The trunk name

Returns:

String:

The name of the trunk.

getTrunkSipDetails

(
  • trunk
)
Function private

Get trunk sip details.

Parameters:

  • trunk String

    The trunk identifier

Returns:

Function:

The function to be called by initializeSipTrunk.

getTrunksList

() Array

Returns the list of the trunks.

Returns:

Array:

The trunks list.

getUserExtenIdFromConf

(
  • confId
  • userId
)
String

Returns the extension identifier for the user of the conference.

Parameters:

  • confId String

    The conference identifier

  • userId String

    The user identifier

Returns:

String:

The extension identifier.

getWaitingCounterByQueues

(
  • qid
)
Number

Return the number of waiting calls through the specified queue.

Parameters:

  • qid String

    The queue identifier

Returns:

Number:

The the number of waiting calls through the specified queue.

hangupChannel

(
  • endpointType
  • endpointId
  • ch
  • cb
)

Hangup the asterisk channel of the endpoint.

Parameters:

  • endpointType String

    The type of the endpoint (e.g. extension, queue, parking, trunk...)

  • endpointId String

    The endpoint identifier (e.g. the extension number)

  • ch String

    The channel identifier

  • cb Function

    The callback function

hangupConvCb

(
  • err
)
private

This is the callback of the hangup command plugin.

Parameters:

  • err Object

    The error object of the operation

hangupConversation

(
  • endpointId
  • convid
  • cb
)

Hangup the conversation of the endpoint.

Parameters:

  • endpointId String

    The endpoint identifier (e.g. the extension number)

  • convid String

    The conversation identifier

  • cb Function

    The callback function

hangupMainExtension

(
  • endpointId
  • cb
)

Hangup all the conversations of the main extensions and so event all of the associated secondary extensions.

Parameters:

  • endpointId String

    The main extension identifier

  • cb Function

    The callback function

hangupUserMeetmeConf

(
  • confId
  • extenId
  • cb
)

Hangup a user of a meetme conference.

Parameters:

  • confId String

    The meetme conference identifier

  • extenId String

    The extension indentifier into the conference

  • cb Function

    The callback function

iaxExtenStructValidation

(
  • err
  • resp
)
private

Validates all iax extensions of the structure ini file and initialize iax Extension objects.

Parameters:

  • err Object

    The error received from the command.

  • resp Array

    The response received from the command.

iaxTrunkStructValidation

(
  • err
  • resp
)
private

Validates all iax trunks of the structure ini file and initialize iax Trunk objects.

Parameters:

  • err Object

    The error received from the command

  • resp Array

    The response received from the command

initializeIaxExten

(
  • resp
)
private

Initialize all iax extensions as Extension object into the extensions property.

Parameters:

  • resp Object

    The response of the listIaxPeers command plugin.

initializeIaxTrunk

(
  • err
  • resp
)
private

Initialize all iax trunks as Trunk object into the trunks property.

Parameters:

  • err Object

    The error received from the command

  • resp Array

    The response received from the command

initializeParkings

(
  • err
  • resp
)
private

Initialize all parkings as Parking object into the parkings property.

Parameters:

  • err Object

    The error received from the command

  • resp Object

    The response received from the command

initializePjsipExten

(
  • err
  • results
)
private

Initialize all pjsip extensions as Extension object into the extensions property.

Parameters:

  • err Object

    The error

  • results Array

    The extensions list

initializePjsipTrunk

(
  • err
  • resp
)
private

Initialize all pjsip trunks as Trunk object into the trunks property.

Parameters:

  • err Object

    The error received from the command

  • resp Array

    The response received from the command

initializeQueues

(
  • err
  • results
)
private

Initialize all queues as Queue object into the queues property.

Parameters:

  • err Object

    The error

  • results Array

    The queues list

initializeSipExten

() private

Initialize all sip extensions as Extension object into the extensions property.

initializeSipTrunk

(
  • err
  • resp
)
private

Initialize all sip trunks as Trunk object into the trunks property.

Parameters:

  • err Object

    The error received from the command

  • resp Array

    The response received from the command

initMeetmeConf

() private

Initializes all meetme conferences.

inoutDynQueues

(
  • endpointId
  • cb
)

Alternates the logon and logout of the specified extension in all the queues for which it's a dynamic member.

Parameters:

  • endpointId String

    The endpoint identifier (e.g. the extension number)

  • cb Function

    The callback function

isAutoC2CEnabled

() Boolean static

Return true if the automatic click 2 call has to be used.

Returns:

Boolean:

True if the automatic click 2 call has to be used.

isDynMemberLoggedInQueue

(
  • extenId
  • queueId
)
Boolean

Checks if the specified queue dynamic member is logged into the specified queue.

Parameters:

  • extenId String

    The extension identifier

  • queueId String

    The queue identifier

Returns:

Boolean:

True if the specified queue dynamic member is logged into the specified queue.

isExten

(
  • id
)
Boolean

Check if the identifier is an extension.

Parameters:

  • id String

    The number identifier

Returns:

Boolean:

True if the id is an extension

isExtenCf

(
  • exten
)
Boolean

Check if the extension has call forward enabled.

Parameters:

  • exten String

    The extension identifier

Returns:

Boolean:

True if the extension has call forward enabled.

isExtenCfb

(
  • exten
)
Boolean

Check if the extension has call forward busy enabled.

Parameters:

  • exten String

    The extension identifier

Returns:

Boolean:

True if the extension has call forward busy enabled.

isExtenCfbVm

(
  • exten
)
Boolean

Check if the extension has call forward on busy to voicemail enabled.

Parameters:

  • exten String

    The extension identifier

Returns:

Boolean:

True if the extension has call forward on busy to voicemail enabled.

isExtenCfu

(
  • exten
)
Boolean

Check if the extension has call forward on unavailable enabled.

Parameters:

  • exten String

    The extension identifier

Returns:

Boolean:

True if the extension has call forward on unavailable enabled.

isExtenCfuVm

(
  • exten
)
Boolean

Check if the extension has call forward on unavailable to voicemail enabled.

Parameters:

  • exten String

    The extension identifier

Returns:

Boolean:

True if the extension has call forward on unavailable to voicemail enabled.

isExtenCfVm

(
  • exten
)
Boolean

Check if the extension has call forward to voicemail enabled.

Parameters:

  • exten String

    The extension identifier

Returns:

Boolean:

True if the extension has call forward to voicemail enabled.

isExtenDnd

(
  • exten
)
Boolean

Check if the extension has dnd enabled.

Parameters:

  • exten String

    The extension identifier

Returns:

Boolean:

True if the extension has dnd enabled.

isExtenDynMemberQueue

(
  • extenId
  • queueId
)
Boolean

Checks if the specified extension is a dynamic member of the specified queue.

Parameters:

  • extenId String

    The extension identifier

  • queueId String

    The queue identifier

Returns:

Boolean:

True if the specified extension is a dynamic member of the specified queue.

isExtenInMeetmeConf

(
  • ownerExtenId
)
Boolean

Returns true if the extension is already into its meetme conference.

Parameters:

  • ownerExtenId String

    The extension owner of the conference

Returns:

Boolean:

True if the extension is already into its meetme conference.

isMainExtension

(
  • exten
)
Boolean private

Check if the extension is a main extension.

Parameters:

  • exten String

    The extension identifier

Returns:

Boolean:

True if the extension is a main extension.

isTrunk

(
  • trunk
)
Boolean

Check if the exten is a trunk.

Parameters:

  • trunk String

    The trunk name

Returns:

Boolean:

True if the exten is a trunk.

listIaxPeers

() private

Sets the details for all iax extension object.

listParkedCalls

(
  • err
  • resp
)
private

Store parked channels in memory and launch "listChannel" command plugin to get the number and the name of each parked channels.

Parameters:

  • err Object

    The error object received from the "listParkedCalls" command plugin

  • resp Object

    The reponse object received from the "listParkedCalls" command plugin

muteCb

(
  • error
)
private

This is the callback of the mute command plugin.

Parameters:

  • error Object

    The error object of the operation

muteConversation

(
  • extension
  • convid
  • cb
)

Mute a call.

Parameters:

  • extension String

    The extension identifier (e.g. the extension number)

  • convid String

    The conversation identifier to be muted

  • cb Function

    The callback function

muteRecordConversation

(
  • extension
  • convid
  • cb
)

Mute the recording of the conversation.

Parameters:

  • extension String

    The extension identifier (e.g. the extension number)

  • convid String

    The conversation identifier

  • cb Function

    The callback function

muteUserMeetmeConf

(
  • confId
  • userId
  • cb
)

Mute a user of a meetme conference.

Parameters:

  • confId String

    The meetme conference identifier

  • userId String

    The user indentifier into the conference

  • cb Function

    The callback function

muteUserMeetmeConfCb

(
  • error
)
private

This is the callback of the mute user of a meetme conference command plugin.

Parameters:

  • error Object

    The error object of the operation

on

(
  • type
  • cb
)
Object

Subscribe a callback function to a custom event fired by this object. It's the same of nodejs events.EventEmitter.on.

Parameters:

  • type String

    The name of the event

  • cb Function

    The callback to execute in response to the event

Returns:

Object:

A subscription handle capable of detaching that subscription.

parkConversation

(
  • extension
  • convid
  • applicantId
  • cb
)

Park the conversation.

Parameters:

  • extension String

    The endpoint identifier (e.g. the extension number)

  • convid String

    The conversation identifier

  • applicantId String

    The applicant identifier of the park operation (e.g. the extension number)

  • cb Function

    The callback function

pickupConvCb

(
  • err
)
private

This is the callback of the pickup operation.

Parameters:

  • err Object

    The error object of the operation

pickupConversation

(
  • endpointId
  • destId
  • extForCtx
  • cb
)

Pickup a conversation.

Parameters:

  • endpointId String

    The endpoint identifier (e.g. the extension number)

  • destId String

    The endpoint identifier that pickup the conversation

  • extForCtx String

    The extension identifier used to get the context

  • cb Function

    The callback function

pickupParking

(
  • parking
  • destId
  • extForCtx
  • cb
)

Pickup a parked caller.

Parameters:

  • parking String

    The number of the parking

  • destId String

    The endpoint identifier that pickup the conversation

  • extForCtx String

    The extension identifier used to get the context

  • cb Function

    The callback function

pickupQueueWaitingCaller

(
  • queue
  • waitCallerId
  • destId
  • extForCtx
  • cb
)

Pickup a conversation.

Parameters:

  • queue String

    The queue identifier

  • waitCallerId String

    The queue waiting caller identifier

  • destId String

    The endpoint identifier that pickup the conversation

  • extForCtx String

    The extension identifier used to get the context

  • cb Function

    The callback function

pickupQueueWaitingCallerCb

(
  • err
)
private

This is the callback of the pickup queue waiting caller operation.

Parameters:

  • err Object

    The error object of the operation

queueDetails

(
  • err
  • resp
)
private

Sets the details for the queue object. The details include the members and the waiting callers.

Parameters:

  • err Object

    The error response object

  • resp Object

    The queue information object

queueDetailsUpdate

(
  • err
  • resp
)
private

Updates the details for the queue object.

Parameters:

  • err Object

    The error response object

  • resp Object

    The queue information object

queueMemberAdd

(
  • endpointId
  • queueId
  • [paused]
  • [penalty]
  • cb
)

Adds the member to the queue.

Parameters:

  • endpointId String

    The endpoint identifier (e.g. the extension number)

  • queueId String

    The queue identifier

  • [paused] String optional

    To pause or not the member initially

  • [penalty] Boolean optional

    A penalty (number) to apply to this member. Asterisk will distribute calls to members with higher penalties only after attempting to distribute calls to those with lower penalty

  • cb Function

    The callback function

queueMemberPauseUnpause

(
  • endpointId
  • queueId
  • reason
  • paused
  • cb
)

Pause or unpause an extension from a specific queue or from all queues omitting the queueId parameter.

Parameters:

  • endpointId String

    The endpoint identifier (e.g. the extension number)

  • queueId String

    The queue identifier

  • reason String

    The textual description of the reason. In the unpause case, simply it's ignored

  • paused Boolean

    If the extension must be paused or unpaused. If it's true the extension will be paused from the queue

  • cb Function

    The callback function

queueMemberRemove

(
  • endpointId
  • queueId
  • cb
)

Removes the extension from a specific queue.

Parameters:

  • endpointId String

    The endpoint identifier (e.g. the extension number)

  • queueId String

    The queue identifier

  • cb Function

    The callback function

recordAudioFile

(
  • data
  • cb
)

Record an audio file.

Parameters:

  • data Object
    • exten String

      The extension to be used for recording

    • filepath String

      The path of the audio file to be stored

  • cb Function

    The callback function

redirectConvCb

(
  • err
)
private

This is the callback of the redirectChannel command plugin.

Parameters:

  • err Object

    The error object of the operation

redirectConversation

(
  • extension
  • convid
  • to
  • extForCtx
  • cb
)

Redirect the conversation.

Parameters:

  • extension String

    The extension identifier

  • convid String

    The conversation identifier

  • to String

    The destination number to redirect the conversation

  • extForCtx String

    The extension identifier used to get the context

  • cb Function

    The callback function

redirectParking

(
  • parking
  • to
  • extForCtx
  • cb
)

Redirect the parked call to the specified destination.

Parameters:

  • parking String

    The identifier of the parking

  • to String

    The destination number to redirect the parked call

  • extForCtx String

    The extension identifier used to get the context

  • cb Function

    The callback function

redirectWaitingCaller

(
  • waitingCallerId
  • queue
  • to
  • extForCtx
  • cb
)

Redirect the waiting caller from the queue to the specified destination.

Parameters:

  • waitingCallerId String

    The identifier of the waiting caller

  • queue String

    The identifier of the queue in which the caller waiting

  • to String

    The destination number to redirect the conversation

  • extForCtx String

    The extension identifier used to get the context

  • cb Function

    The callback function

reset

() static

Reset the component.

sendDTMFSequence

(
  • extension
  • sequence
  • callerid
  • fromExten
  • cb
)
private

Sends the DTMF tones to the specified extension. If the extension as already busy in a conversation, or it's calling, then one channel already exists and then use it to play DTMF. Otherwise, if the extension is free, it calls the extension and then sends the DTMF digits.

Parameters:

  • extension String

    The extension identifier

  • sequence Boolean

    The DTMF digits to send to the extension

  • callerid String

    The caller identifier

  • fromExten String

    The extension identifier from which the command has to be sent

  • cb Function

    The callback function

sendDTMFSequenceToChannel

(
  • channel
  • sequence
  • cb
)
private

Play sequence of DTMF digits in the specified channel.

Parameters:

  • channel String

    The channel to play DTMF tones

  • sequence String

    The sequence of DTMF tones

  • cb Function

    The callback function

sendDtmfToConversation

(
  • extension
  • convid
  • tone
  • cb
)

Sends the dtmf tone to the conversation destination.

Parameters:

  • extension String

    The extension identifier (e.g. the extension number)

  • convid String

    The conversation identifier

  • tone String

    The dtmf tone to send

  • cb Function

    The callback function

setAsteriskPresence

(
  • extension
  • presenceState
  • cb
)

setAsteriskPresence

Parameters:

  • extension String

    The endpoint identifier (e.g. the extension number)

  • presenceState String

    The state of presence [ AVAILABLE | DND | AWAY,CELLPHONE | XA,VOICEMAIL ]

  • cb Function

    The callback function

setAutoC2CStatus

(
  • status
)
static

Enable/disable if automatica click 2 call has to be used.

Parameters:

  • status String

    The status ("enabled"|"disabled").

setBlindTransferContext

(
  • ctx
)
static

Set the context used for blind transfer.

Parameters:

  • ctx String

    The context for blind transfer

setCfb

(
  • exten
  • activate
  • [to]
  • cb
)

Enable/disable the call forward busy status of the endpoint. The used plugin command cfbSet does not generate any asterisk events, so simulates it.

Parameters:

  • exten String

    The extension number

  • activate Boolean

    True if the call forward busy must be enabled

  • [to] String optional

    The destination number of the call forward busy to be set

  • cb Function

    The callback function

setCfbStatus

(
  • err
  • resp
)
private

Set the call forward on busy status of the extension.

Parameters:

  • err Object

    The error object of the cfbGet command plugin

  • resp Object

    The response object of the cfbGet command plugin

setCfbVm

(
  • exten
  • activate
  • [to]
  • cb
)

Enable/disable the call forward busy to voicemail status of the endpoint. The used plugin command cfbVmSet does not generate any asterisk events, so simulates it.

Parameters:

  • exten String

    The extension number

  • activate Boolean

    True if the call forward busy to voicemail must be enabled

  • [to] String optional

    The destination voicemail identifier of the call forward busy to be set

  • cb Function

    The callback function

setCfbVmStatus

(
  • err
  • resp
)
private

Sets the call forward on busy to voicemail status of the extension.

Parameters:

  • err Object

    The error object of the cfbVmGet command plugin.

  • resp Object

    The response object of the cfbVmGet command plugin.

setCfStatus

(
  • err
  • resp
)
private

Set the call forward status of the extension.

Parameters:

  • err Object

    The error object of the cfGet command plugin

  • resp Object

    The response object of the cfGet command plugin

setCfu

(
  • exten
  • activate
  • [to]
  • cb
)

Enable/disable the call forward unavailable status of the endpoint. The used plugin command cfuSet does not generate any asterisk events, so simulates it.

Parameters:

  • exten String

    The extension number

  • activate Boolean

    True if the call forward unavailable must be enabled

  • [to] String optional

    The destination number of the call forward unavailable to be set

  • cb Function

    The callback function

setCfuStatus

(
  • err
  • resp
)
private

Set the call forward on unavailable status of the extension.

Parameters:

  • err Object

    The error object of the cfuGet command plugin

  • resp Object

    The response object of the cfuGet command plugin

setCfuVm

(
  • exten
  • activate
  • [to]
  • cb
)

Enable/disable the call forward unavailable to voicemail status of the endpoint. The used plugin command cfuVmSet does not generate any asterisk events, so simulates it.

Parameters:

  • exten String

    The extension number

  • activate Boolean

    True if the call forward unavailable to voicemail must be enabled

  • [to] String optional

    The destination voicemail identifier of the call forward unavailable to be set

  • cb Function

    The callback function

setCfuVmStatus

(
  • err
  • resp
)
private

Sets the call forward on unavailable to voicemail status of the extension.

Parameters:

  • err Object

    The error object of the cfuVmGet command plugin.

  • resp Object

    The response object of the cfuVmGet command plugin.

setCfVmStatus

(
  • err
  • resp
)
private

Sets the call forward to voicemail status of the extension.

Parameters:

  • err Object

    The error object of the cfVmGet command plugin.

  • resp Object

    The response object of the cfVmGet command plugin.

setCompCallerNote

(
  • comp
)

Sets the caller note architect component.

Parameters:

  • comp Object

    The caller note architect component.

setCompDbconn

(
  • comp
)

Sets the database architect component.

Parameters:

  • comp Object

    The database architect component.

setCompPhonebook

(
  • comp
)

Sets the phonebook architect component.

Parameters:

  • comp Object

    The phonebook architect component.

setDnd

(
  • exten
  • activate
  • cb
)

Enable/disable the do not disturb status of the endpoint. The used plugin command dndSet does not generate any asterisk events, so simulates it.

Parameters:

  • exten String

    The extension number

  • activate Boolean

    True if the dnd must be enabled

  • cb Function

    The callback function

setDndStatus

(
  • err
  • resp
)
private

Set the don't disturb status of the extension.

Parameters:

  • err Object

    The error object of the dndGet command plugin.

  • resp Object

    The response object of the dndGet command plugin.

setFeatureCodes

(
  • obj
)
static

Set the asterisk feature codes read from JSON configuration file.

Parameters:

  • obj Object

    The feature codes object read from JSON config file

setLogger

(
  • log
)
static

Sets the logger to be used.

Parameters:

  • log Object

    The logger object. It must have at least three methods: info, warn and error as console object.

setNullCallPeriod

(
  • period
)
static

Set the period of time to consider a call as null. All calls with waiting time less than this period is considered null.

Parameters:

  • period Number

    The period of time.

setPrefix

(
  • prefix
)
static

Sets the prefix number to be used in all outgoing calls. It does not to be used with internal calls between extensions.

Parameters:

  • prefix String

    The prefix number.

setQueueData

(
  • q
  • resp
)
private

Sets the data for the queue object.

Parameters:

  • q String

    The queue name

  • resp Object

    The queue information object

setRecordStatusConversations

(
  • convid
  • value
)
private

Sets the recording status of all the conversations with the specified convid.

Parameters:

  • convid String

    The conversation identifier

  • value Boolean

    The value to be set

setRecordStatusMuteConversations

(
  • convid
)
private

Sets the recording status mute of all the conversations with the specified convid.

Parameters:

  • convid String

    The conversation identifier

setRemoteSitesPrefixes

(
  • obj
)
static

Sets the remote sites phone prefixes used to filter the meetme conference members.

Parameters:

  • obj Object

    The remote sites prefixes data.

setStaticDataExtens

(
  • obj
)
static

Set the extension names read from JSON configuration file.

Parameters:

  • obj Object

    The extension names associations

setStaticDataQueues

(
  • obj
)
static

Set the initial trunks list read from JSON configuration file.

Parameters:

  • obj Object

    The queues object read from JSON config file

setStaticDataTrunks

(
  • obj
)
static

Set the initial trunks list read from JSON configuration file.

Parameters:

  • obj Object

    The trunks object read from JSON config file

setUnconditionalCf

(
  • exten
  • activate
  • [to]
  • cb
)

Enable/disable the unconditional call forward status of the endpoint. The used plugin command cfSet doesn't generate any asterisk events, so simulates it.

Parameters:

  • exten String

    The extension number

  • activate Boolean

    True if the call forward must be enabled

  • [to] String optional

    The destination number of the call forward to be set

  • cb Function

    The callback function

setUnconditionalCfVm

(
  • exten
  • activate
  • [to]
  • cb
)

Enable/disable the call forward to voicemail status of the endpoint. The used plugin command cfVmSet doesn't generate any asterisk events, so simulates it.

Parameters:

  • exten String

    The extension number

  • activate Boolean

    True if the call forward to voicemail must be enabled

  • [to] String optional

    The destination voicemail identifier of the call forward to be set

  • cb Function

    The callback function

sipTrunkStatus

(
  • err
  • resp
)
private

Sets the sip trunk status received.

Parameters:

  • err Object

    The received error object

  • resp Object

    The received response object

sipTrunkStructValidation

(
  • err
  • resp
)
private

Validates all sip trunks of the structure ini file and initialize sip Trunk objects.

Parameters:

  • err Object

    The error received from the command

  • resp Array

    The response received from the command

start

() static

It is called when the asterisk connection is fully booted.

startIntervalUpdateQueuesDetails

(
  • interval
)
private

Updates the data about all queues each interval of time.

Parameters:

  • interval Number

    The interval time to update the details of all the queues.

startMeetmeConference

(
  • convid
  • ownerExtenId
  • addExtenId
  • cb
)

Starts a meetme conference. Its behaviour change based on owner extension status of the conference.

Parameters:

  • convid String

    The conversation identifier of the owner to be added to the conference

  • ownerExtenId String

    The extension owner of the conference

  • addExtenId String

    The extension identifier to be added to the conference

  • cb Function

    The callback function

startRecordCallCb

(
  • convid
)
private

Sets the recording status of the conversations.

Parameters:

  • convid String

    The conversation identifier

startRecordConversation

(
  • extension
  • convid
  • cb
)

Starts the recording of the conversation.

Parameters:

  • extension String

    The extension identifier (e.g. the extension number)

  • convid String

    The conversation identifier

  • cb Function

    The callback function

startSpyListenConvCb

(
  • err
  • convid
)
private

This is the callback of the spy command plugin with only listening.

Parameters:

  • err Object

    The error object of the operation

  • convid String

    The conversation identifier

startSpyListenConversation

(
  • convid
  • endpointId
  • destId
  • cb
)

Start the spy of the conversation with only listening.

Parameters:

  • convid String

    The conversation identifier

  • endpointId String

    The endpoint identifier that has the conversation to spy

  • destId String

    The endpoint identifier that spy the conversation

  • cb Function

    The callback function

startSpySpeakConvCb

(
  • err
  • convid
)
private

This is the callback of the spy command plugin with speaking.

Parameters:

  • err Object

    The error object of the operation

  • convid String

    The conversation identifier

startSpySpeakConversation

(
  • convid
  • endpointId
  • destId
  • cb
)

Start the spy of the conversation with speaking.

Parameters:

  • convid String

    The conversation identifier

  • endpointId String

    The endpoint identifier that has the conversation to spy

  • destId String

    The endpoint identifier that spy the conversation

  • cb Function

    The callback function

stopRecordCallCb

(
  • err
  • convid
)
private

This is the callback of the stop record call command plugin. Reset the record status of the conversations.

Parameters:

  • err Object

    The error object of the operation

  • convid String

    The conversation identifier

stopRecordConversation

(
  • extension
  • convid
  • cb
)

Stop the recording of the conversation.

Parameters:

  • extension String

    The extension identifier (e.g. the extension number)

  • convid String

    The conversation identifier

  • cb Function

    The callback function

transferConversationToVoicemail

(
  • endpointType
  • endpointId
  • convid
  • voicemail
  • extForCtx
  • cb
)

Transfer the conversation to the voicemail.

Parameters:

  • endpointType String

    The type of the endpoint (e.g. extension, queue, parking, trunk...)

  • endpointId String

    The endpoint identifier (e.g. the extension number)

  • convid String

    The conversation identifier

  • voicemail String

    The destination voicemail number to transfer the conversation

  • extForCtx String

    The extension identifier used to get the context

  • cb Function

    The callback function

transferConvToVoicemailCb

(
  • err
)
private

This is the callback of transferToVoicemail command plugin.

Parameters:

  • err Object

    The error object of the operation

trunkSipDetails

(
  • err
  • resp
)
private

Sets the details for the sip trunk object.

Parameters:

  • err Object

    The error object

  • resp Object

    The trunk information object

unmuteConversation

(
  • extension
  • convid
  • cb
)

Unmute a call.

Parameters:

  • extension String

    The endpoint identifier (e.g. the extension number)

  • convid String

    The conversation identifier to be unmuted

  • cb Function

    The callback function

unmuteRecordConversation

(
  • extension
  • convid
  • cb
)

Unmute the recording of the conversation.

Parameters:

  • extension String

    The extension identifier (e.g. the extension number)

  • convid String

    The conversation identifier

  • cb Function

    The callback function

unmuteUserMeetmeConf

(
  • confId
  • userId
  • cb
)

Unmute a user of a meetme conference.

Parameters:

  • confId String

    The meetme conference identifier

  • userId String

    The user indentifier into the conference

  • cb Function

    The callback function

unmuteUserMeetmeConfCb

(
  • error
)
private

This is the callback of the unmute user of a meetme conference command plugin.

Parameters:

  • error Object

    The error object of the operation

updateConversationsForAllExten

(
  • err
  • resp
)
private

Updates the conversations for all extensions.

Parameters:

  • err Object

    The error object

  • resp Object

    The channel list as received by the listChannels command plugin.

updateConversationsForAllTrunk

(
  • err
  • resp
)
private

Updates the conversations for all trunks.

Parameters:

  • err Object

    The error object

  • resp Object

    The channel list as received by the listChannels command plugin.

updateConversationsOfNum

(
  • num
)
private

Update the conversations of the specified num, that can be extension, trunk or other.

Parameters:

  • num String

    A phone number that can be extension, trunk or other.

updateExtenConversations

(
  • err
  • resp
  • exten
)
private

Update the conversations of the extension.

Parameters:

  • err Object

    The error object received by the listChannels command plugin

  • resp Object

    The object received by the listChannels command plugin

  • exten String

    The extension number

updateExtIaxDetails

(
  • err
  • resp
)
private

Update iax extension information and emit EVT_EXTEN_CHANGED event.

Parameters:

  • err Object

    The error object

  • resp Object

    The iax extension information object

updateExtPjsipDetails

(
  • err
  • resp
)
private

Update extension information and emit EVT_EXTEN_CHANGED event.

Parameters:

  • err Object

    The error object

  • resp Object

    The extension information object

updateExtSipDetails

(
  • err
  • resp
)
private

Update extension information and emit EVT_EXTEN_CHANGED event.

Parameters:

  • err Object

    The error object

  • resp Object

    The extension information object

updateMeetmeConf

(
  • err
  • data
)
private

Updates data about a single meetme conference.

Parameters:

  • err Object

    The error response object

  • data Object

    The meetme conference information object

updateMeetmeConferences

(
  • err
  • data
)
private

Updates data about all meetme conferences.

Parameters:

  • err Object

    The error response object

  • data Object

    The meetme conferences information object

updateParkedCallerForAllParkings

(
  • err
  • resp
)
private

Updates all parking lots with their relative parked calls, if they are present.

Parameters:

  • err Object

    The error object

  • resp Object

    The object received from the "listChannels" command plugin

updateParkedCallerOfOneParking

(
  • err
  • resp
  • parking
)
private

Update the parked caller of the specified parking.

Parameters:

  • err Object

    The error received from the listChannels command plugin

  • resp Object

    The response received from the listChannels command plugin

  • parking String

    The parking identifier

updateParkedChannelOfOneParking

(
  • err
  • resp
  • parking
)
private

Updates specified parking key of the parkedChannels property with the object received from listParkedCalls command plugin.

Parameters:

  • err Object

    The error object received from listParkedCalls command plugin

  • resp Object

    The response object received from listParkedCalls command plugin

  • parking String

    The parking identifier

updateQueueMemberLastPauseData

(
  • memberName
  • memberId
  • queueId
)
private

Sets the "last started pause" and the "last ended pause" data to the member.

Parameters:

  • memberName String

    The queue member name

  • memberId String

    The queue member identifier

  • queueId String

    The queue identifier

updateQueueWaitingCallers

(
  • err
  • resp
)
private

Updates waiting callers of the queue object.

Parameters:

  • err Object

    The error response object

  • resp Object

    The queue information object

updateTrunkConversations

(
  • err
  • resp
  • trunk
)
private

Update the conversations of the extension.

Parameters:

  • err Object

    The error object received by the listChannels command plugin

  • resp Object

    The object received by the listChannels command plugin

  • trunk String

    The trunk number

visit

(
  • ap
)

Store the asterisk proxy to visit.

Parameters:

  • ap Object

    The asterisk proxy module.

Properties

AST_ALARMS_DIRPATH

String private final

The default asterisk directory path of the alarms.

Default: "/var/spool/asterisk/outgoing/"

astProxy

Object private

The asterisk proxy.

autoC2CEnabled

Boolean private

If the automatica click 2 call has to be used or not.

Default: true

BASE_CALL_REC_AUDIO_PATH

Object private

The default base path for the recording call audio file.

Default: "/var/spool/asterisk/monitor"

blindTransferContext

String private

Context used for blind transfer.

callerIdentityData

Object private

Contains the information about the caller. The key is the caller number and the value is the information object. The data are about the created caller notes and the phonebook contacts from the centralized and nethcti address book that match on the caller number. The information are retrieved when a UserEvent is received and are used when Dialing events occurs. This is because when a call is directed to a queue, only one UserEvent is emitted and many Dialing events for each members of the queue. So it executes only one query per call. Due to asynchronous nature of the query, it may happen that when Dialing event occurs the query is not completed. In this case the information of the caller are those returned by the asterisk event. In this manner we give more importance to the speed rather than to information completeness.

Default: {}

compCallerNote

Object private

The caller note component.

compDbconn

Object private

The database component.

compPhonebook

Object private

The phonebook component.

conferences

Object private

All mettme conferences. The key is the extension owner number and the value is the MeetmeConference object.

emitter

Object private

The event emitter.

EVT_EXTEN_CF_CHANGED

String

The name of the extension cf changed event.

Default: "extenCfChanged"

EVT_EXTEN_CFB_CHANGED

String

The name of the extension cfb changed event.

Default: "extenCfbChanged"

EVT_EXTEN_CFBVM_CHANGED

String

The name of the extension cfbVm changed event.

Default: "extenCfbVmChanged"

EVT_EXTEN_CFU_CHANGED

String

The name of the extension cfu changed event.

Default: "extenCfuChanged"

EVT_EXTEN_CFUVM_CHANGED

String

The name of the extension cfuVm changed event.

Default: "extenCfuVmChanged"

EVT_EXTEN_CFVM_CHANGED

String

The name of the extension cf to voicemail changed event.

Default: "extenCfVmChanged"

EVT_EXTEN_CHANGED

String

The name of the extension changed event.

Default: "extenChanged"

EVT_EXTEN_CONNECTED

String

The name of the extension connected event.

Default: "extenConnected"

EVT_EXTEN_DIALING

String

The name of the extension dialing event.

Default: "extenDialing"

EVT_EXTEN_DND_CHANGED

String

The name of the extension dnd changed event.

Default: "extenDndChanged"

EVT_EXTEN_HANGUP

String

The name of the extension hangup event.

Default: "extenHangup"

EVT_MEETME_CONF_CHANGED

String

The name of the meetme conference changed event.

Default: "meetmeConfChanged"

EVT_MEETME_CONF_END

String

The name of the meetme conference end event.

Default: "meetmeConfEnd"

EVT_NEW_CDR

String

The name of the new call detail records (cdr) event.

Default: "newCdr"

EVT_NEW_VOICE_MESSAGE

String

The name of the new voicemail event.

Default: "newVoiceMessage"

EVT_PARKING_CHANGED

String

The name of the parking changed event.

Default: "parkingChanged"

EVT_QUEUE_CHANGED

String

The name of the queue changed event.

Default: "queueChanged"

EVT_QUEUE_MEMBER_CHANGED

String

The name of the queue member changed event.

Default: "queueMemberChanged"

EVT_READY

String

The name of the ready event.

Default: "ready"

EVT_RELOADED

String

The name of the reloaded event.

Default: "reloaded"

EVT_TRUNK_CHANGED

String

The name of the trunk changed event.

Default: "trunkChanged"

EVT_UPDATE_VOICE_MESSAGES

String

The name of the update voice messages event.

Default: "updateVoiceMessages"

extensions

Object private

All extensions. The key is the extension number and the value is the Extension object.

featureCodes

Object private

Feature codes of asterisk, e.g. the pickup code.

IDLOG

String private final

The module identifier used by the logger.

Default: [proxy_logic_13]

INI_STRUCT

Object private

These are the key names used into the asterisk structure file created by the perl script.

INTERVAL_UPDATE_QUEUE_DETAILS

Number private final

The interval time to update the details of all the queues.

Default: 60000

intervalUpdateQueuesDetails

Number private

The identifier of the interval used to update queues details.

logger

Object private

The logger. It must have at least three methods: info, warn and error.

Default: console

nullCallPeriod

Number private

The period of time to consider a call as null.

Default: 5

parkedChannels

Object private

It is used to store the parked channels to be used in conjunction with "listChannels" command plugin to get the number and name of the parked channels. The key is the parking number and the value is an object with the parked channel information.

parkings

Object private

All parkings. The key is the parkings number and the value is the Parking object.

prefix

String private

The prefix number to be used in outgoing call. It is not used in internal calls between extensions.

Default: ""

queues

Object private

All queues. The key is the queue number and the value is the Queue object.

ready

Boolean private

True if the component has been started. Used to emit EVT_RELOADED instead of EVT_READY

Default: false

recordingConv

Object private

Store the recording information about conversations. The key is the conversation identifier and the value is the status. The presence of the key means that the conversation is recording, otherwise not. It's necessary because asterisk has not the recording information. So, when conversation list is refreshed, it is used to set recording status to a conversation.

remoteSitesPrefixes

Object private

The remote sites phone prefixes.

staticDataExtens

Object private

Extensions data read from JSON configuration file.

staticDataQueues

Object private

Queues data read from JSON configuration file.

staticDataTrunks

Object private

Trunks data read from JSON configuration file.

trunks

Object private

All trunks. The key is the trunk number and the value is the Trunk object.

Events

extenCfbChanged

Fired when call forward busy status of an extension has been changed.

Event Payload:

  • msg Object

    The event data

extenCfbVmChanged

Fired when call forward busy to voicemail status of an extension has been changed.

Event Payload:

  • msg Object

    The event data

extenCfChanged

Fired when call forward status of an extension has been changed.

Event Payload:

  • msg Object

    The event data

extenCfuChanged

Fired when call forward on unavailable status of an extension has been changed.

Event Payload:

  • msg Object

    The event data

extenCfuVmChanged

Fired when call forward on unavailable to voicemail status of an extension has been changed.

Event Payload:

  • msg Object

    The event data

extenCfVmChanged

Fired when call forward to voicemail status of an extension has been changed.

Event Payload:

  • msg Object

    The event data

extenChanged

Fired when something changed in an extension.

Event Payload:

  • msg Object

    The extension object

extenConnected

Fired when an extension is connected in a conversation.

Event Payload:

  • data Object

    The caller identity

extenDialing

Fired when an extension ringing.

Event Payload:

  • data Object

    The caller identity

extenDndChanged

Fired when dnd status of an extension has been changed.

Event Payload:

  • msg Object

    The event data

hangup

Fired when an hangup happened on extension.

Event Payload:

  • msg Object

    The extension hangup data object

meetmeConfChanged

Fired when something changed in a meetme conference.

Event Payload:

  • msg Object

    The conference object

meetmeConfEnd

Fired when something a meetme conference has been ended.

Event Payload:

  • id String

    The conference identifier

newCdr

Fired when new call detail records (cdr) has been logged into the call history.

Event Payload:

  • msg Object

    The call detail records.

newVoiceMessage

Fired when new voicemail message has been left.

Event Payload:

  • msg Object

    The data about the voicemail, with the number of new and old messages

parkingChanged

Fired when something changed in a parking.

Event Payload:

  • msg Object

    The parking object

queueChanged

Fired when something changed in a queue.

Event Payload:

  • msg Object

    The queue object

queueMemberChanged

Fired when something changed in an queue member.

Event Payload:

  • msg Object

    The queue member object

ready

Fired when the component is ready.

reloaded

Fired when the component has been reloaded.

trunkChanged

Fired when something changed in a trunk.

Event Payload:

  • msg Object

    The trunk object

updateVoiceMessages

Something has appen in the voice messages of the voicemail, for example the listen of a new voice message from the phone.

Event Payload:

  • msg Object

    The data about the voicemail