Jump to content

Tom Wellige

Root Moderator
  • Posts

    4,310
  • Joined

  • Last visited

  • Days Won

    117

 Content Type 

Profiles

SwyxPEDIA Wiki

Zendesk Integration

Persistent Variables

Longest Waiting

VBScript build in functions

GSE build in functions (VBScript)

Server Script API (VBScript)

GSE build in functions (Lua)

Server Script API (Lua)

Function Collection (VBScript)

Function Collection (Lua)

IPS Integration

Jira Service Integration

Forums

Blogs

Downloads

Everything posted by Tom Wellige

  1. Lua → VBScript SwxWare v13.10 This function returns the name of the calling device. local sName = PBXCall.CallingDeviceName() This function returns a string value. If the call is "external", i.e. it comes via a gateway trunk, link trunk or sip trunk, this function returns the name of that trunk as configured in the SwyxWare Administration. If you need to figure the calling device type as well you can use the function PBXCall.CallingDeviceType(). With the combination of PBXCall.CallingDeviceName() and PBXCall.CallingDeviceType() you can easily identify a specifc trunk a call came into your SwyxWare, be it an external trunk or a trunk to another linked SwyxWare.
  2. Lua → VBScript SwxWare v13.10 This function returns the unique call id the server has reserved for the current call. local nCallId = PBXCall.CallId() This function returns a number value. SwyxServer reserves a unique id for each call within the system. This id will also be stored in the Call Detail Records. Do mot mistake this id with the caller number. Do also not mistake this CallId by the unique call id you find within the SwyxWare traces files per call. The call id column in the traces files takes a number that will be reset by every restart of the service, while the CallID of course is persistent. Hints on reading SwyxWare traces files (especially in terms of call routing) can be found here: How to filter the Server Trace for Call Routing output of a certain call
  3. Lua → VBScript SwxWare v13.10 This function returns called number that has leaded the call to reach the current script. A script is connected to a user who has internal and external numbers. This functions returns the external number. local sNumber = PBXCall.CalledPartyNumberCanonical() This function returns a string value. This function returns the external number of the script user that was called. If you are interested in the internal number that was dialed you can use the PBXCall.CalledPartyNumber(). Example: Script user has internal number 200 and external number +4923147770 Internal caller dialed 200123 PBXCall.CalledPartyNumber() returns 200 PBXCall.DialedNumber() returns 200123 PBXCall.PostDialingDigits() returns 123 External caller dialed +492314447 PBXCall.CalledPartyNumberCanonical() returns +4923147770
  4. Lua → VBScript SwxWare v13.10 This function returns the dialed number that has lead the call to reach the current script. It returns just the first digits to correctly identify the script user but *not* any so called post dialing digits. local sNumber = PBXCall.CalledPartyNumber() This function returns a string value. This function is identical to the GSE build in function CalledNumber(). This function returns the internal number of the script user that was called. If you are interested in the external number that was dialed you can use the PBXCall.CalledPartyNumberCanonical(). There is another function available PBXCall.DialedNumber() which returns all dialed digits, including the so post dialing digits.. If you are interested in the post dialing digits you can use the property PBXCall.PostDialingDigits() or the GSE build-in function PostDialingDigits(). Example: Script user has internal number 200 and external number +4923147770 Internal caller dialed 200123 PBXCall.CalledPartyNumber() returns 200 PBXCall.DialedNumber() returns 200123 PBXCall.PostDialingDigits() returns 123 External caller dialed +492314447 PBXCall.CalledPartyNumberCanonical() returns +4923147770
  5. Lua SwxWare v13.10 This function returns the name of the user that has been called. local sName = PBXCall.CalledPartyName() This function returns a string value. To figure which number has been called you can use the PBXCall.CalledPartyNumber() function.
  6. Lua → VBScript SwxWare v13.10 This function sends an alerting message to the originator of the current call. local nReturn = PBXCall.Alerting() This function returns a PBXResult value of PBXSuccess, PBXFailure or PBXCallTermOriginatorDisconnected. If the current call is already in state Alerting or Connected the function call will be ignored. Common usage of this function is to signal s standard ringing tone will be played in the direction of the caller. The call is not connected and therefore consumes not costs. Please note the timeouts of the pstn / provider when handling with this message directly. Beside sending alerting you can also sent a call proceeding message using the PBXCall.CallProceeding() function. You can also skip the alerting phase for the current call by using the PBXCall.SkipAlerting() function.
  7. Lua → VBScript SwxWare v13.10 This functions activates a call previously being put on hold. Activating in fact means stop playing the music on hold. local nReturn = PBXCall.Activate() This function returns a PBXResult value of PBXSuccess or PBXFailure. To put a call on hold you can use the PBXCall.Hold() function. All GSE Play Sound blocks as also all "Connect" blocks like Connect To, Follow Me and Loop will automatically activate a call currently being on hold. You can use the PBXCall.IsOnHold() function to check if the current call is currently on hold.
  8. Lua → VBScript SwxWare v13.10 This function returns the email address being configured within the SwyxWare Administration as to be used as "From" address for all voicemails to be sent by the server. local sFrom = VoicemailOriginatorEMailAddress() This function returns a string value. If you make use of the Send E-mail block within the GSE to sent your own emails from the script and want these emails to have the globally configured voicemail "From" address the function VoicemailOriginatorEMailAddress() comes into use:
  9. Lua SwxWare v13.10 This functions returns the pin the script user has configured for his remote inquiry. local sPIN = RIPIN() or if being used directly within a GSE property dialog, e.g. in an Evalute block to check if the caller has entered a correct pin via DTMF: This function returns a string value. If being used in a group context (from SwyxWare v13.27) this function returns an empty string. Read more about user and group context differences here. Do not mistake this RIPIN() function with the PIN() function in the GSE of VBScript based call routing user, which returns the pin the script user has configured to login at his IP desk phone.
  10. Lua → VBScript SwxWare v13.10 This functions returns the length in seconds of the last recorded message using the Record Message block of the GSE. local nLength = RecordLen() or if being used directly within a GSE property dialog, e.g. in a Say Number block to directly announce the length of the last recorded message to the caller: This function returns a number value. This function is identical to the Server Script API function PBXCall.LastRecordedMessageLength(). When using the Record Message block of the GSE you can afterwards call this function at any time to receive the length of the recorded message (i.e. the WAV file) in seconds. If no message was recorded the function returns 0 (zero). The Send Email block deletes the last recording. So retrieve it beforehand. If you got a file size it remains valid until the script is finished. After that the file will be deleted by the server.
  11. Lua → VBScript SwxWare v13.10 This function returns the digits that where dialed by the caller after the current script was already reached. local 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(). Example: 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: local MAXWAITFORPDD = 3 -- seconds local NUMOFEXPECTEDPDDS = 3 -- digits local nWait = 0 while ((StringLen(PostDialingDigits()) < NUMOFEXPECTEDPDDS) and (nWait < MAXWAITFORPDD)) do PBXScript.Sleep(1000) nWait = nWait + 1 end local bDigitsComplete = (StringLen(PostDialingDigits()) == NUMOFEXPECTEDPDDS) This example makes use of the string helper function StringLen(). 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.
  12. Lua → VBScript SwxWare v13.10 This function returns the suffix to dial when connecting the call to a conference to switch the "one way" conference mode on for this call. local sSuffix = OneWayConferenceSuffix() or if being used directly within a GSE property dialog, e.g. in a Connect To block to connect the call to a conference room in "one way" mode: This function returns a string value. The suffix is fixed to the value #owc#, refer to Feature Codes. A "one way" conference is a conference where the caller is able to listen only. His own voice will automatically be muted. Instead of using this suffix when connecting the call into a conference, you can also enable the one way mode by using the IpPbx.OneWayConference() function before using the Connect To block to connect the call into the conference room.
  13. Lua SwxWare v13.10 This function returns the current script users' logged off status. if (NotLoggedIn() == true) then -- do something else -- do something else end or if being used directly within a GSE property dialog, e.g. in an Evaluate block to directly evaluate the logged off status and place it the block exits: This function returns a boolean value. This function can be called at any time within the call routing script. The current login state will be requested making use of the Server Script API function PBXUser.IsLoggedIn().
  14. Lua → VBScript SwxWare v13.10 The function returns the return value from the latest connect to attempt. local nLastCause = LastCause() This function returns a number value. After having used a Connect To block (or Follow Me or Loop) within the call routing script where the result of the connect to attempt was evaluated by the extis of the block it is possible to use this LastCause() function to request that result again. Possible return values are: PBXSuccess (0) PBXFailure (1) PBXTimeout (2) PBXCallTermNormalCallClearing (3) PBXCallTermDestinationBusy (4) PBXCallTermReject (5) PBXCallTermWrongNumber (12) PBXCallTermConnectToCallerImpossible (13) PBXCallTermDestinationUnreachable (14) PBXNoChannelAvailable (18) PBXNetworkCongestion (19) PBXIncompatibleDestination (20) PBXOriginatorDisconnected (22)
  15. Lua → VBScript SwxWare v13.10 This function returns the current script users' Outlook Out Of Office status. if (IsOutOfOffice() == true) then -- do something else -- do something else end or if being used directly within a GSE property dialog, e.g. in an Evaluate block to directly evaluate the Outlook Out Of Office status and place it the block exits: This function returns a boolean value. If being used in a group context (from SwyxWare v13.27) this function returns false. Read more about user and group context differences here. This function can be called at any time within the call routing script. The current outlook busy state will be requested making use of the Server Script API function PBXUser.IsOutOfOffice(). The function returns true if the script user has urrently an appointment in his Outlook calendar which is marked as Out Of Office. Please refer to the SwyxWare Administrator manual (chapter 5.3.3, Installation for Calendar-Based Call Management) for information on how to setup calendar based call routing correctly.
  16. Lua → VBScript SwxWare v13.10 This function returns the current script users' Outlook Busy status. if (IsOutlookBusy() == true) then -- do something else -- do something else end or if being used directly within a GSE property dialog, e.g. in an Evaluate block to directly evaluate the Outlook Busy status and place it the block exits: This function returns a boolean value. If being used in a group context (from SwyxWare v13.27) this function returns false. Read more about user and group context differences here. This function can be called at any time within the call routing script. The current outlook busy state will be requested making use of the Server Script API function PBXUser.IsOutlookBusy(). The function returns true if the script user has urrently an appointment in his Outlook calendar which is marked as Busy. Please refer to the SwyxWare Administrator manual (chapter 5.3.3, Installation for Calendar-Based Call Management) for information on how to setup calendar based call routing correctly.
  17. Lua → VBScript SwxWare v13.10 This function returns the current script users' logged in status. if (IsLoggedIn() == true) then -- do something else -- do something else end or if being used directly within a GSE property dialog, e.g. in an Evaluate block to directly evaluate the logged in status and place it the block exits: This function returns a boolean value. This function can be called at any time within the call routing script. The current login state will be requested making use of the Server Script API function PBXUser.IsLoggedIn().
  18. Lua → VBScript SwxWare v13.10 This function returns the current script users' DoNotDisturb (DND) status. if (IsDoNotDisturb() == true) then -- do something else -- do something else end or if being used directly within a GSE property dialog, e.g. in an Evaluate block to directly evaluate the DoNotDisturb status and place it the block exits: This function returns a boolean value. If being used in a group context (from SwyxWare v13.27) this function returns false. Read more about user and group context differences here. This function can be called at any time within the call routing script. The current do not disturb state will be requested making use of the Server Script API function PBXUser.DoNotDisturb(). This function only returns the SwyxWare internal do not disturb state. If you need the extended state which includes also the status of connected systems, like MS Teams, you should use the function PBXUser.DoNotDisturbViaPresence().
  19. Lua → VBScript SwxWare v13.10 This function returns the current script users' Busy status. if (IsBusy() == true) then -- do something else -- do something else end or if being used directly within a GSE property dialog, e.g. in an Evaluate block to directly evaluate the Busy status and place it the block exits: This function returns a boolean value. This function can be called at any time within the call routing script. The current busy state will be requested making use of the Server Script API function PBXUser.IsBusy.
  20. Lua → VBScript SwxWare v13.10 This function returns the current script users' Away status. if (IsAway() == true) then -- do something else -- do something else end or if being used directly within a GSE property dialog, e.g. in an Evaluate block to directly evaluate the Away status and place it the block exits: This function returns a boolean value. If being used in a group context (from SwyxWare v13.27) this function returns false. Read more about user and group context differences here. This function can be called at any time within the call routing script. The current away state will be requested making use of the Server Script API function PBXUser.Away. This function only returns the SwyxWare internal away state. If you need the extended state which includes also the status of connected systems, like MS Teams, you should use the function PBXUser.AwayViaPresence().
  21. Lua → VBScript SwxWare v13.10 This function takes or returns the current free status text of the script user. -- Getting the script users free status text local sUserFreeStatusText = IpPbx.UserFreeStatusText() -- Setting the script users free status text IpPbx.UserFreeStatusText("I am out for lunch") This function takes or returns a string value. If being used in a group context (from SwyxWare v13.27) this function returns an empty string. Read more about user and group context differences here. This function is identical to the Server Script API function PBXUser.FreeStatusText(). The status text of a user is getting in the SwyxIt! client when hovering the mouse pointer above a speed dial key being configured to that user.
  22. Lua → VBScript SwxWare v13.10 This function returns the secondory calling party number, i.e. the network provided number. local sSecondaryCallingNumber = IpPbx.SecondaryCallingNumber() This function returns a string value. The function IpPbx.CallingNumber() provides the so called user provided number. This number can either be suppressed or manipulated (via "clip no screening") by the caller. The network provided number can't be manipulated by the caller. Usually it is not getting signalled by the provider. On special lines/trunks, e.g. emergency services (police, fire brigade), it will be signalled by the provider. If the SwyxWare is connected to such special line/trunk the IpPbx.SecondaryCallingNumber provides the network provided number. Otherwise it is empty.
  23. Lua → VBScript SwxWare v13.10 This function takes or returns the "one way" conference status of the current call. If the call is transfered into a conference this flag defines, if the caller is in "listen only" mode or not. -- Retrieving the current oneway conference status local bOneWayConference = IpPbx.OneWayConference() -- Setting the oneway conference status IpPbx.OneWayConference(true) This function takes or returns a boolean value. A "one way" conference is a conference where the caller is able to listen only. His own voice will automatically be muted. If you want to enable the "one way" conference for this user, you need to call this function before actually connecting the call to the conference by using the Connect To block. It is also possible to use a special Feature Codes when connecting the call to a conference. The feature code for the one way conference can be requested within the call routing script by using the OneWayConferenceSuffix() function.
  24. Lua → VBScript SwxWare v13.10 This function takes or returns the current do not disturb status of the script user. -- Getting the script users current do not disturb (dnd) state local bDoNotDisturb = IpPbx.DoNotDisturb() -- Setting the script users do not disturb (dnd) state IpPbx.DoNotDisturb(true) This function takes or returns a boolean value. If being used in a group context (from SwyxWare v13.27) this function returns false. Read more about user and group context differences here. This function is identical to the Server Script API function PBXUser.DoNotDisturb().
  25. Lua → VBScript SwxWare v13.10 This function takes or returns the number of the current caller. -- Retrieving the caller number local sNumber = IpPbx.CallingNumber() -- Setting the caller number IpPbx.CallingNumber("123456789") This function takes or returns a string value. This function can be used to modify the number being displayed on a client (SwyxIt!, SwyxPhone). It does not modify the caller list entry. Additionally you can also modify the name being displayed using the IpPbx.CallingName() function. Please note that you have to modify this value before actually connecting the call to a user using the Connect To block. This function is identical to the Server Script API function PBXCall.CallingPartyNumber().
×
×
  • 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.