Javascript Message

From Yate Documentation
Jump to: navigation, search

Yate Message object


  • new Message(name)
  • new Message(name,broadcast,obj)

name - Name of the message to create (mandatory)
broadcast - Optional boolean flag to create a broadcast message
obj - Optional object from which to copy properties as message parameters. Objects, null and undefined values are not copied.

Static Methods

  • Message.install()

  • Message.uninstall()

  • Message.handlers()
  • Message.handlers(match)

match - Optional string or RegExp used to match only some handler names
Array of objects describing installed handlers, null if no handler matches.

  • name - String name of the handled messages
  • priority - Integer priority of the installed handler
  • handler - String name of the handling function
  • filterName - String name of the filtering parameter (only if a filter is installed)
  • filterValue - String value of the filtering parameter (only if a filter is installed)
  • trackName - String name of the handler used in tracking (only if not empty)

  • Message.installHook()

  • Message.uninstallHook()

  • Message.trackName()


  • enqueue()

Enqueues the Message in the Yate engine
Return: True if enqueue succeeded, false on failure

  • dispatch()
  • dispatch(unblock)

unblock - Optional boolean flag to unblock context variables during dispatch
Return: True if message was handled, false if it was not handled

  • name()

Return: String name of the message

  • broadcast()

Return: Boolean broadcast flag

  • getParam(name)
  • getParam(name,defValue)
  • getParam(name,defValue,autoNumber)

name - Name of the parameter to retrieve
defValue - Value to return if parameter is missing, default undefined
autoNumber - Automatically convert parameters to boolean or number type, default true
Return: Value of parameter, even if name matches a method name

  • setParam(name,value)

name - Name of the parameter to set
value - New value to set in parameter, undefined to delete the parameter
Return: True on success, false if message was not in a state where parameters can be changed

  • copyParams(obj,prefix,skip)

obj - object from which to copy properties (except objects, null and undefined)
prefix - optional parameter to specify that only properties that a key with the given index should be copied. If the prefix represents an object, the properties of that object will be copied.
skip - optional parameter (assumed, by default, to be true) to specifies if the prefix should be copied or eliminated from the key being copied.

  • retValue()

Return: Returned value of the message

  • retValue(value)

value - New returned value to set in the message

  • msgTime()

Return: Message creation time in milliseconds since EPOCH

  • getColumn()

  • getRow()

  • getResult()
Personal tools