Voicepulse Macro in AEL - Issue with While statement

I am trying to use the Macros provided by Voicepulse in AEL here:

connect.voicepulse.com/samples/ … ons.sample

My code looks like this:

context macro-voicepulseparseresponse { s => { Set(VoicePulseTemp=${ARG1}); Set(VoicePulseTemp=${CUT(VoicePulseTemp|>|2-)}); Set(VoicePulseTemp=${CUT(VoicePulseTemp|>|2-)}); Set(VoicePulseTemp=${CUT(VoicePulseTemp|<|1)}); Set(VoicePulseCounter=${FIELDQTY(VoicePulseTemp|~)}); While($[${VoicePulseCounter} > 0]); NoOp(Inside VoicePulseCounter = ${VoicePulseCounter}); Set(VoicePulsePair=${CUT(VoicePulseTemp|~|${VoicePulseCounter})}); Set(VoicePulseKey=${CUT(VoicePulsePair|=|1)}); Set(VoicePulseValue=${CUT(VoicePulsePair|=|2)}); Set(${VOICEPULSE_API_PREFIX}${VoicePulseKey}=${VoicePulseValue}); Set(VoicePulseCounter=$[${VoicePulseCounter}-1]); EndWhile(); }; };

My CLI output when I try to dial looks like this:

-- Executing Ringing("SIP/3002-2018", "") in new stack -- Executing Set("SIP/3002-2018", "OTHER_PROVIDERS_FLAT_RATE=0.02") in new stack -- Executing Macro("SIP/3002-2018", "voicepulseflexrate|MYAPIKEY|14154029080") in new stack -- Executing Set("SIP/3002-2018", "VOICEPULSE_FLEX_RATE=999") in new stack -- Executing Set("SIP/3002-2018", "VoicePulsePostData=ApiKey=MYAPIKEY&PhoneNumber=14154029080") in new stack -- SIP Seeding peer from astdb: '3002' at 3002@MYIP:5063 for 180 -- Executing Set("SIP/3002-2018", "VoicePulseResponse=<?xml version="1.0" encoding="utf-8"?> <string xmlns="http://namespaces.voicepulse.com/apis/">API_REMAINING=4980~FLEXRATE=0.0060~API_ERROR_CODE=0~API_ERROR_MESSAGE=</string>") in new stack -- Executing Macro("SIP/3002-2018", "voicepulseparseresponse|<?xml version="1.0" encoding="utf-8"?> <string xmlns="http://namespaces.voicepulse.com/apis/">API_REMAINING=4980~FLEXRATE=0.0060~API_ERROR_CODE=0~API_ERROR_MESSAGE=</string>") in new stack -- Executing Set("SIP/3002-2018", "VoicePulseTemp=<?xml version="1.0" encoding="utf-8"?> <string xmlns="http://namespaces.voicepulse.com/apis/">API_REMAINING=4980~FLEXRATE=0.0060~API_ERROR_CODE=0~API_ERROR_MESSAGE=</string>") in new stack -- Executing Set("SIP/3002-2018", "VoicePulseTemp= <string xmlns="http://namespaces.voicepulse.com/apis/">API_REMAINING=4980~FLEXRATE=0.0060~API_ERROR_CODE=0~API_ERROR_MESSAGE=</string>") in new stack -- Executing Set("SIP/3002-2018", "VoicePulseTemp=API_REMAINING=4980~FLEXRATE=0.0060~API_ERROR_CODE=0~API_ERROR_MESSAGE=</string>") in new stack -- Executing Set("SIP/3002-2018", "VoicePulseTemp=API_REMAINING=4980~FLEXRATE=0.0060~API_ERROR_CODE=0~API_ERROR_MESSAGE=") in new stack -- Executing Set("SIP/3002-2018", "VoicePulseCounter=4") in new stack -- Executing GotoIf("SIP/3002-2018", "1?7:8") in new stack -- Goto (macro-voicepulseparseresponse,s,7) -- Executing Goto("SIP/3002-2018", "6") in new stack -- Goto (macro-voicepulseparseresponse,s,6) -- Executing GotoIf("SIP/3002-2018", "1?7:8") in new stack -- Goto (macro-voicepulseparseresponse,s,7) -- Executing Goto("SIP/3002-2018", "6") in new stack -- Goto (macro-voicepulseparseresponse,s,6) -- Executing GotoIf("SIP/3002-2018", "1?7:8") in new stack -- Goto (macro-voicepulseparseresponse,s,7) -- Executing Goto("SIP/3002-2018", "6") in new stack -- Goto (macro-voicepulseparseresponse,s,6)

And it just loops into eternity. I have looked at it for a while and tried various things and now think I am chasing my tail. Does anyone spot anything obvious here?

If I set my VoicePulseCounter to 0 and it immediately tries to dial of course, so I know my While statement is working.