Getting Call.ANI and setting as new variable

Hello,

Sorry for the newb question here. We need to get the Call.Ani system variable and then reformat it as a new variable that we can use with a later Data Action.

I believe I understand using that the expression

ToPhoneNumber(Call.Ani).subscriberNumber

Should strip the leading tel:+1 and just reveal the actual phone number. Question is how do I then set this new value as a variable so I can then use it later in my flow?

I've tried various combinations of Get and Set Participant Data actions but I seem to have no luck when I try to test and playback the new variable using a Play Audio action. It seems as though the new variable isn't getting set. If I use the Play Audio on the original Call.Ani variable that plays back fine.

What am I missing?

Thanks in advance,
Shane

To clarify, Participant Data is data that's attached to a conversation participant that will travel with the conversation outside of a flow. It sounds like you're looking to use a flow or task variable. Those are set using the action Update Data.

Thanks Tim! That worked great. One final question that you may be able to assist with. I now need to format the Call.Ani like the following (###) ###-####

Will formatting like the above for the phone number be possible using RegEx?

ToPhoneNumber(Call.Ani).subscriberNumber gets me the callers phone number in ########## format so now I just need to convert it to the above, if possible.

Thanks again for the help!

Regards.

I don't do much work in Architect, so I couldn't say what the best way to format the number. Regular expressions might work, or use the subscriberNumber property with substrings to chop it up by length since that will be in a standard format.

I was able to use multiple substrings to chop up Call.Ani. I then used Append to add the necessary formatting around each section as desired. This seemed to work fine. There may be a more elegant or efficient way to do it but I believe mission accomplished at this point.

Thanks again for the help!

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