This function returns the digits that where dialed by the caller after the current script was already reached.
Dim sPostDialingDigits sPostDialingDigits = PostDialingDigits()
This function returns a string value.
This function must be called before connecting the call to a device by using the Connect To block.
Post dialing digits are the digits the caller has dialed after the user was already unambiguously identified, i.e. his extension was dialed. These numbers might already be completely dialed when the call reaches the script, but even digits being dialed later on can be requested by this function (see example below).
To figure the number that has been dialed to reach the current script (i.e. the user extension, excluding the post dialing digits) one can use CalledNumber(), which is identical to the Server Script API function PBXCall.CalledPartyNumber.
To figure all dialed digits, the user extension plus the post dialing digits, one can use the Server Script API function PBXCall.DialedNumber.
- Script user has internal number 200 and external number +4923147770
- Internal caller dialed 200123
- PBXCall.CalledPartyNumber returns 200
- PBXCall.DialedNumber returns 200123
- PostDialingDigits() returns 123
- External caller dialed +492314447
- PBXCall.CalledPartyNumberCanonical returns +4923147770
It is not unlikely that the caller hasn't dialed already all post dialing digits at the moment when the call reaches the script. It is therefore necessary for the script to wait for all needed post dialing digits (if they are of interest). The following is an example code that waits 3 seconds at most for 3 post dialing digits:
Const MAXWAITFORPDD = 3 ' seconds Const NUMOFEXPECTEDPDDS = 3 ' digits Dim nWait nWait = 0 While (Len(PostDialingDigits()) < NUMOFEXPECTEDPDDS) and (nWait < MAXWAITFORPDD) PBXScript.Sleep 1000 nWait = nWait + 1 Wend Dim bDigitsComplete bDigitsComplete = (Len(PostDialingDigits()) = NUMOFEXPECTEDPDDS)
Please note that you should not wait too long for such post dialing digits as the caller experience would suffer from a too long waiting time within a script if he doesn't want to dial any additional numbers.