Lua → VBScript SwxWare v13.10
This function returns if the current call is disconnected or a given timeout is reached.
local nReturn = PBXCall.WaitForDisconnect(nTimeout)
This function returns a PBXResult value of PBXSuccess, PBXFailure, PBXTimeout, PBXCallTermNormalCallClearing or PBXCallTermOriginatorDisconnected.
Parameter
nTimeout
Optional. Default: 0
Time in seconds to wait for the call to disconnect. A zero timeout waits infinitely, i.e. until the call is disconnected. If the timeout is reached the function returns with the return value PBXTimeout.
This function can be used after a call has been connected to a user to keep the script running until the call is finally disconnected. This might be useful if some sort of work has to be done at that point (releasing used memory, writing call details, a.s.o.).
Please refer to PBXCall.ConnectedName() or PBXCall.ConnectedNumber() for another usage example of this function.
By Tom Wellige