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