...
The routed no is essentially updated each time the call transition into a new route Target (the Gosub step is the main method of changing the current Target).
Documentation
The BaseScriptRoute class exposes the following methodsAction Script UI contains builtin documentation. Click the 'Open Java Docs' button and a new browser tab will open with the full docs.
BaseScriptRoute
The following provides a high level overview of the BaseScriptRoutes. Refer to the above noted Java doc for additiona details.
Overview:
Method | Arguments | Return type | Comments |
---|---|---|---|
dial | Trunk trunk, String phoneNo, String options, int timeout | void | Dials the given phone number using the selected trunk. trunk - the trunk to dial over phoneNo - the phone number to dial options - any asterisk dial options required. timeout - the time (in seconds) to wait for the dial to connect. |
conference | String roomNo, String pin, String options | roomNo - The conference room to pass the call to. If the conference room doesn't exist it will be dynamically created. PIN - the pin number used to control access to the conference room. Pass a blank string if you don't want a PIN assigned to the conference room. options - any valid asterisk conference room options. | |
getAccountFromId | Long id | Account | Look up an account using the id passed in. The Account object returned is detached from the database. |
getAgi | void | BaseAgiScript | Returns the BaseAgiScript, this allows direct agi calls to be made against the channel |
getArgAsBoolean | String fieldName | Boolean | Takes a fieldName for the Script and returns the fields value as a Boolean. |
getArgAsInt | String fieldName | Integer | Takes a fieldName for the Script and returns the fields value as an Integer. |
getArgAsLong | String fieldName | Long | Takes a fieldName for the Script and returns the fields value as a Long. |
getArgAsString | String fieldName | String | Takes a fieldName for the Script and returns the fields value as a String. |
getBMMFileNameFromId | Long id | String | Returns the name of the BMM audio file without the file extension. This is suitable for passing to the 'playback' command which assumes the file doesn't has a file extensions. |
getChannelVariable | String name | String | Gets the value of an Asterisk channel variable. |
getDialedNo | Void | String | Returns the number that was dialed to trigger this call route. For inbound calls this will be the DID, for outbound calls it will by the number dialed from the handsets. |
getDirection | Void | au.com.noojee.callrouting.CallDirection | Returns the CallDirection enum indicating which direction the call is flowing in. CallDirection has the following possible values: CallDirection.INBOUND CallDirection.PASS_THRU - not used on most systems CallDirection.INBOUND |
getHandsetFromId | Long id | Handset | Looks up the Handset indentified by id and returns a detached entity |
getPhoneNoForAccountId | Long id | String | Returns the phone currently attached to the given account. |
getQueueFromId | Long id | Queue | Looks up the Queue indentified by id and returns a detached entity |
getRoutedNo | None | String | The current RoutedNo. See setRoutedNo() for details. |
getSourceNo | None | String | Returns the source phone no. that originated the call. For an inbound call it is the callers caller id, for an outbound call it is the handsets extension no. |
getSourceRealm | None | Realm | Returns the Realm for the current call. When any call enters the system a Realm is set to describe how the call entered the system. The two Realms are Realm.INTERNAL and Realm.EXTERNAL |
getSystemVariable | String key | SystemEntity | returns a detatched system variable entity for the given key. |
getTrunkDialStringFromId | Long id | String | Returns the Dial String for the trunk whose primary key is id. |
getTrunkFromId | Long id | Trunk | Returns the Trunk object whose primary key is id. |
getVariable | String name | String | Gets the value of the Route Script variable with the given name. Route Script Variables have a life cycle linked to the underlying call. Route Script Variables are much faster than Channel Variables. |
getVoiceMailBoxFromId | Long | VoiceMailBox | returns the VoiceMailBox entity for the given id. |
gosub | RouteContext context, String target | void | Send the call to the given context with the given target as the 'deliveredTo' number. |
queue | Queue queue, String options, int timeout | void | queuename - the name of the queue to send the call to options - any valid asterisk queue options timeout - the amount of time to wait for the call to be connected before exiting the queue. The deliveredTo number gets set to the Agents extension when the call is answered by an agent. |
setChannelVariable | String name, String value | Void | Sets the value of an Asterisk channel variable. |
setDialedNo | String number | Void | Allows the dialedNo to be modified by a script. |
setSource | String number, Realm realm | Void | Set the number the call came from and the realm (INTERNAL/EXTERNAL ETC) |
setVariable | String name, String value | Void | Sets the value of the Route Script variable with the given name creating it if it doesn't already exists. |
substituteVariables | String message | String | Parses the passed message looking for any encoded Route variable names and replacing the encode variable name with the variables value. The encoding scheme is of the form: ${variablename} |
startRecording | boolean force, String tag | Void | Unconditionally starts recording the current call. If recording is already running then a new leg is started. |
stopRecording | boolean force | Void | Stops recording. |
voicemail | String vmbox, String options | void | Connects the caller to the given voicemail box. vmbox - the voicemail box no. options - any valid asterisk voicemail box options. |
variableExists | String name | Boolean | returns true if the variable with the given name exists and is non-zero in length. |
...