Regarding syntax/format for text expressions in scripts

We need to display the SIP code in the script using the button option.

While doing so, we cam e across few observations which are mentioned below:

  1. The sip API needs conversation ID, start time and end time as the required parameters to execute the action.
  2. We can get the interaction ID from the scripter variable, but have challenge in getting the start time and end time as the timings should be in ISO-8601 format ( ":" replaced with "%3A" ) with URL encoding.
  3. We need to display the screen pop for outbound calls (external number or calling on behalf of queue to external number).Since it is an outbound call, we need to set the default script at the queue level.

Please provide some ideas in which way we can achieve it.

Thanks and Regards,
Pranjal

There is no replace function in script. In order to replace colons with %3A you would need to create a custom action.

Here is what I did. Since we don't have loops, I created a recursive action that checks if there are colons and then replaces one colon with %3A. It continues to call itself until all colons are removed. If you plan to use it, make sure you selected "Text Expression" (this and "Math Expression" are the only modes where you can apply functions).

Result:
chrome-capture-2023-9-6

1 Like

Thankyou very much for your response!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.