use arg parsing macros in the AGENT dialplan function (issue #6236, with small mods)