Jump to content
  • PostDialingDigits()


    VBScript   → Lua


    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).


    The current post dialing digits will be requested making use of the Server Script API function PBXCall.PostDialingDigits.


    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.




    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
    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.



    Tom Wellige


  • Create New...

Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.