Strings with or without " "

I am having some problems with defining strings that include the , character. From what I have been reading, I should include the string between double quotes " " and Asterisk should accept it as a string (save the content between the " " and discard the double quotes). But my tests don’t show that behaviour.

exten => 742,1,Set(Test_1=Test String 1)
exten => 742,n,Set(Test_2="Test String 2")
exten => 742,n,NoOp(${Test_1})
exten => 742,n,NoOp(${Test_2})
exten => 742,n,Hangup()
    -- Executing [742@internal:1] Set("SIP/106-00000e79", "Test_1=Test String 1") in new stack
    -- Executing [742@internal:2] Set("SIP/106-00000e79", "Test_2="Test String 2"") in new stack
    -- Executing [742@internal:3] NoOp("SIP/106-00000e79", "Test String 1") in new stack
    -- Executing [742@internal:4] NoOp("SIP/106-00000e79", ""Test String 2"") in new stack
    -- Executing [742@internal:5] Hangup("SIP/106-00000e79", "") in new stack

Asterisk book says that both string definitions should be the same, but they are not. Asterisk is not discarding the " ". I am testing this on Asterisk 11.5.1.

Does anyone have any other equivalent to defining strings with " "?

Try quoting the , with \

The "'s are part of the string.

Do you mean that I input a string like this (without using the " "):

this, is the string, I want
this, is the string, I want

If I run this through the dialplan, the \ remain as a part of the string - the string is not chopped on the , delimiter but I still get the \ as a part of the string. So again, I can not use it.

About string definition with " " - apparently the Asterisk book is wrong.

I must admit that I find it really strange, that Asterisk does not support string definition with " ".

Well, it looks like I will be using a lot of global variables for this dialplan :smile:

Thanks for your help anyways David.