Pass a variable with comma to originate

Hi!
I’m trying to exec an originate int this way:

 {
    action: "originate",
    channel: "SIP/autotrunk/66699985049",
    context: "from-sip",
    exten: "myExten",
    priority: 1,
    variable: {
      name1: "value1,value2",
    },
  },

However in the ‘varset’ event handler i receive this object:

{
  event: 'VarSet',
  privilege: 'dialplan,all',
  systemname: '2c803df4732e',
  channel: 'SIP/autotrunk-00000001',
  channelstate: '0',
  channelstatedesc: 'Down',
  calleridnum: '<unknown>',
  calleridname: '<unknown>',
  connectedlinenum: '<unknown>',
  connectedlinename: '<unknown>',
  language: 'en',
  accountcode: '',
  context: 'autocontext',
  exten: '',
  priority: '1',
  uniqueid: '2c803df4732e-1727252622.2',
  linkedid: '2c803df4732e-1727252622.2',
  variable: { name1: '' },
  value: 'value1'
}

So the value of variable name1 goes from “value1,value2” to ‘value1’. Does exits a way to handle the comma in order to receive it in varset event?

hi
have you tryed to escape it

name1: "value1\,value2",

Yes but same problem

I don’t know why but with a double \ it works

name1: "value1\\,value2"
{
  event: 'VarSet',
  privilege: 'dialplan,all',
  systemname: '3b45a79c2c92',
  channel: 'SIP/autotrunk-000000bc',
  channelstate: '0',
  channelstatedesc: 'Down',
  calleridnum: '<unknown>',
  calleridname: '<unknown>',
  connectedlinenum: '<unknown>',
  connectedlinename: '<unknown>',
  language: 'en',
  accountcode: '',
  context: 'autocontext',
  exten: '',
  priority: '1',
  uniqueid: '3b45a79c2c92-1727265945.496',
  linkedid: '3b45a79c2c92-1727265945.496',
  variable: { name1: '' },
  value: 'value1,value2'
}```

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