...
The Logging and Testing panel is Noojee's gift to you. (We aren't afraid to admit that we are almost gods when it comes to this sort of thing. ).
But seriously, the Logging and Testing console is is really powerful and makes it easy to test Routes in general as well as your Custom Routes scripts.
...
Routes provide a number of default system variables Route Variables which can be access to determine information pertaining to the current call or the system as a whole. The following variables can be access by calling getVariable(variableName).
Please note that these variables are readonly and as such you can't update them.
The system may update some of these Route Variables as a call progresses through a route.
...
When a call is initially routed or Gosub is called the value in nj.Target is used to pattern match against possible targets in the context. When a specific target is selected 'nj.DeliveredTo' is set to the value of the Target that matches.
e.g. nj.Target might be: 03 8320 8100 but nj.DeliveredTo might be 03 XXXX XXXX.
...
The number that was dialed to cause the current call. For an inbound call this will be the DID for an outbound call this will be the no. dialed from the staff members handset.
The dialed no. will not change over the life of a call.
...
Set by the Trunk through which the call entered the system. Even calls from internal extensions (handsets) enter Routes via a Trunk.
The Realm is used to determine the direction of the call. The system uses the Source realm and the Delivered To realm to determine the direction of the call. The systems ability to determine a calls direction is important when determining whether a call should be recorded for an Account as well as for general reporting purposes.
It should be noted that superficially it would appear to be quite easy to determine a calls direction however in practices it can be quite complicated as a call can actually changed direction mid way through the call.
Realms are INTERNAL,EXTERNAL
...
Reflects the direction of the call.
The direction of a call is not as simple as it might look as a call can changed directions as the call progresses.
e.g. an inbound call is re-routed to an external call. It then becomes a 'PASS_THRU' call.
- INTERNAL - call between two handsets
- OUTBOUND - call to an outside number
- PASS_THRU - a call that has passed into then out of the system.
- INBOUND - a call from an external party into the system.
...
Set by the core routing each time a call is originated. For inbound calls this is the caller id, for calls dialed from a handset this is the handset extension no.
...
Call
...
The target typically starts out with the same value as the 'nj.DialedNo' but unlike nj.DialedNo the variable nj.Target is updated each time the Gosub command is called. nj.Target is updated to match the second argument of the Gosub command (context, target).
When a Gosub returns it will reset the nj.Target variable to the value it was before Gosub was called.
...
Target
A Target can be a phone no., a pattern or an alphabetical literal.
A Target pattern is a used to match Targets consisting of digits only.
SourceNo
Set by core routing each time a call is originated. For inbound this is the caller id, for calls dialed from a handset this is the handset extension no.
DialedNo
- called by the core routing logic when a call first enters the system. Normally this wouldn't be modified by a script unless the trunk provider provides a badly formatted no. hin which you may want to re-reformat it using the rewrite action.
For most systems the dialed no. doesn't change during the life of a call.
setCurrentTarget(target)
Called by the core routing logic whenever a call matches a route target including when the call enters the very first route.
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 Action Script UI contains builtin documentation. Click the 'Open Java Docs' button and a new browser tab will open with the full docs.
...