Callback in architect

hello everyone,

I have created a callback function in architect,

and given our clients two options,

one to call back from number they are calling from, or
two call back on a selected number.

However if the number is private and they choose option 1, is there a way to force them to input their number?

Thanks

Is your question "How do I tell in architect that someone called from a private number"?

Yes,

and if possible to force them to enter the number to be called back on.

Hi Richard,

Could you provide an example of what you mean by a private number? For example, what is the value of Call.ANI in an inbound call flow in your case?

Also, if it helps we do have a phone number data type in Architect that often times helps flow authors trying to get at various pieces of the tel: / sip: formatted string in the built in Call.ANI variable. Here is the PureCloud help link that describes this data type in more detail:

Architect Phone Number Data Type

Within flow logic, whether you use the phone number data type or look at the string value contained in the Call.ANI variable to determine if the number is a private number, what you'd want to do is use a Collect Input action to get the number that the caller wishes to be called back on. Obviously the more information you can get the better.

So if you could assume the caller was calling from the United States, then in a Collect Input action your prompt would be "Please enter your ten digit phone number including the area code". On the Collect Input action you can specify that the caller needs to enter 10 digits exactly and it has options for verifying the input which in this case you'd want to verify as individual digits rather than numeric. It would look like this:

And then later in the inbound call flow, assuming you got a 10 digit number from the caller when you're specifying the number to call in the Create Callback action, you'd use this expression:

ToPhoneNumber(Append("tel:+1", Task.CallbackNumber))

With regards to being a private number or not, you could save off whether or not the flow determined if that number was private in a boolean variable. Assuming you want to use the Call.ANI value if the number was not determined to be private, you could use an expression like this on the Callback Number setting on the Create Callback action:

ToPhoneNumber(If(Task.IsCallerAniPrivate, Append("tel:+1", Task.CallbackNumber), Call.ANI))

Again, this is assuming United States callbacks which is why the "tel:+1" is hard coded in the expression but this should give an idea of how it could be done. In the event the number was determined to be private, that expression assumes that the Collect Input action successfully ran prior to the create callback action and that Task.CallbackNumber had a 10 digit string like "3178723000".

Hope this helps,

Jim

Oh, and one thing to point out is if you're looking to see if a string is made up entirely of digits but are not sure, often times someone would think to try and convert it to an integer using the ToInt but there are issues there where ToInt could invoke flow error handling if the string isn't convertible to an integral value. So while Architect doesn't have a built in function to say "is every character in this string a digit?", it's possible to accomplish this check within an expression. The expression below, which I've broken up in to separate lines for the sake of readability, basically says "replace every character zero through nine with blank" and if length of the resulting string is zero then we know the string had at least one digit and every character in the string was a digit. The initial IsNotSetOrEmpty function call looks to see if the string itself is NOT_SET or blank and returns false indicating that the string didn't have at least one digit character.

If (IsNotSetIrEmpty(Task.StringToCheck), 
  false,
  Length(
    Replace(
      Replace(
        Replace(
          Replace(
            Replace(
              Replace(
                Replace(
                  Replace(
                    Replace(
                      Replace(Task.StringToCheck, "0", ""),
                    "1", ""),
                  "2", ""),
                "3", ""),
              "4", ""),
            "5", ""),
          "6", ""),
        "7", ""),
      "8", ""),
    "9", "")
  ) == 0
)

:slight_smile:

Jim

Hi Jim

Thanks for that,

If a client calls from an anonymous phone number,

I have a few options in my INQ Architect.

First client input:

"Press one if you would like us to call you back, otherwise press two to remain on hold"

If they press 1, it will take them to another input,

Second client input:

"press one if you would like us to call you back on the number you are calling from, otherwise press two to select a number"

if they press two, there is no issues there at all, once they input a number it works perfect.

however if they choose 1, "call you back on the number you are calling from" and their number is hidden or anonymous it wont work for some reason. If their number is anonymous i would like them to input their phone number.

The expression i have for this is ToPhoneNumber(Call.Ani)

and the expression i have for them to input their own chosen number is ToPhoneNumber(Append("tel: +",ToPhoneNumber(Call.Ani).dialingCode, Flow.CustomerInput))

would it help if i export the architect and show?

hopefully this makes sense

Hi Richard,

So sounds like what you'd want to do is look at the value of Call.ANI to determine if it's anonymous. What I'm trying to figure out is what the string value is for Call.ANI in this case so we can get logic in the flow to detect it so you could prompt for a callback number. For example, does this do the trick?

  1. Update Data where you assign ToPhoneNumber(Call.Ani) to Task.MyPhoneNumber which is a variable of the phone number data type.

  2. Add a decision action with this expression:

    (IsSet(Task.MyPhoneNumber) and !IsNotSetOrEmpty(Task.MyPhoneNumber.dialingCode) and !IsNotSetOrEmpty(Task.MyPhoneNumber.e164)) or (Task.CallerAskedToInputNumberBoolean)

Then in the No output you'd go through logic to prompt the caller for their callback number.

So this is handling within an in-queue flow rather than an inbound call flow, correct? If you see issues with the Call.Ani value changing between the inbound call flow, transferring to a queue via. that Transfer to ACD action and the Call.Ani value in in-queue flow, just save the Call.Ani string value from the inbound call flow off to an attribute in participant data and then use a Get Participant Data to retrieve it from that attribute the in-queue call flow.

If you're able to reproduce the anonymous phone number scenario, adding a Play Audio action with the expression:

If(IsSet(Call.Ani), If(Length(Call.Ani)>0, ToAudioTTS(Call.Ani, Format.String.playChars), ToAudioTTS("The ANI is a blank string."), ToAudioTTS("The ANI is not set."))

could help to determine the contents of the Call.Ani string and would help to see if the logic I put above would be correct for your needs.

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