Re: [asterisk-users] CURLOPT(useragent) fails with Set requires an '=' to be a valid assignment
Of course! Thank you. I had not thought about escaping it because ";" is not a character I've normally had to escape. Thanks again for this - so obvious now you mention it. On Mon, 14 Dec 2020 at 18:54, Joshua C. Colp wrote: > > On Mon, Dec 14, 2020 at 2:51 PM Jonathan H wrote: >> >> Thank you. >> >> Yes, the useragent string does indeed contain semicolon, and as most >> seem to, how can I set the (useragent) to a valid useragent? >> >> And does that mean I can never SET something with a semicolon in the >> string, even if wrapped in quotes? >> >> Sorry if I'm being thick here! > > > The character to escape it is "\" thus: "\;" would tell the config parser to > not treat it as a comment. > > -- > Joshua C. Colp > Asterisk Technical Lead > Sangoma Technologies > Check us out at www.sangoma.com and www.asterisk.org > -- > _ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: >http://lists.digium.com/mailman/listinfo/asterisk-users -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CURLOPT(useragent) fails with Set requires an '=' to be a valid assignment
On Mon, Dec 14, 2020 at 2:51 PM Jonathan H wrote: > Thank you. > > Yes, the useragent string does indeed contain semicolon, and as most > seem to, how can I set the (useragent) to a valid useragent? > > And does that mean I can never SET something with a semicolon in the > string, even if wrapped in quotes? > > Sorry if I'm being thick here! > The character to escape it is "\" thus: "\;" would tell the config parser to not treat it as a comment. -- Joshua C. Colp Asterisk Technical Lead Sangoma Technologies Check us out at www.sangoma.com and www.asterisk.org -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CURLOPT(useragent) fails with Set requires an '=' to be a valid assignment
Thank you. Yes, the useragent string does indeed contain semicolon, and as most seem to, how can I set the (useragent) to a valid useragent? And does that mean I can never SET something with a semicolon in the string, even if wrapped in quotes? Sorry if I'm being thick here! Thanks On Mon, 14 Dec 2020 at 18:34, Richard Mudgett wrote: > > There are semicolons in the useragent string you are trying to set. If that > is the exact dialplan line then > those semicolons are being seen as a start of a comment. > > Richard > > On Mon, Dec 14, 2020 at 12:25 PM Jonathan H wrote: >> >> All my other CURLOPT settings like timeout work fine. But this: >> >> same => n,Set(CURLOPT(useragent)="Mozilla/5.0 (Windows NT 10.0; >> Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.41 >> Safari/537.36") >> >> give the following warning on dialplan reload, with and without quotes >> around the user agent. Everything else is fine - perhaps it is the >> parenthesis in the user agent? >> If so, how do I get round this? I am fairly sure it's a typo at my >> end, but I've looked at examples from other people/gists and my usage >> looks correct. >> It's only the useragent option it chokes on. >> >> -- Executing [s@setup:3] Set("Local/s@setup-0006;2", >> "CURLOPT(useragent") in new stack >> [Dec 14 17:24:30] WARNING[10243][C-0007]: pbx_variables.c:1140 >> pbx_builtin_setvar: Set requires an '=' to be a valid assignment. >> -- Executing [s@setup:4] Set("Local/s@setup-0006;2", >> "CURLOPT(conntimeout)=3") in new stack >> -- Executing [s@setup:5] Set("Local/s@setup-0006;2", >> "CURLOPT(dnstimeout)=3") in new stack >> >> >> NOTE: The reason I'm doing this is because I want Asterisk to give a >> different user agent for ControlPlayback function and move on quickly >> if the remote file is not available / slow. >> If that is not the correct way then please let me know! >> >> -- >> _ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> Check out the new Asterisk community forum at: >> https://community.asterisk.org/ >> >> New to Asterisk? Start here: >> https://wiki.asterisk.org/wiki/display/AST/Getting+Started >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >>http://lists.digium.com/mailman/listinfo/asterisk-users > > -- > _ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: >http://lists.digium.com/mailman/listinfo/asterisk-users -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [asterisk-users] CURLOPT(useragent) fails with Set requires an '=' to be a valid assignment
There are semicolons in the useragent string you are trying to set. If that is the exact dialplan line then those semicolons are being seen as a start of a comment. Richard On Mon, Dec 14, 2020 at 12:25 PM Jonathan H wrote: > All my other CURLOPT settings like timeout work fine. But this: > > same => n,Set(CURLOPT(useragent)="Mozilla/5.0 (Windows NT 10.0; > Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.41 > Safari/537.36") > > give the following warning on dialplan reload, with and without quotes > around the user agent. Everything else is fine - perhaps it is the > parenthesis in the user agent? > If so, how do I get round this? I am fairly sure it's a typo at my > end, but I've looked at examples from other people/gists and my usage > looks correct. > It's only the useragent option it chokes on. > > -- Executing [s@setup:3] Set("Local/s@setup-0006;2", > "CURLOPT(useragent") in new stack > [Dec 14 17:24:30] WARNING[10243][C-0007]: pbx_variables.c:1140 > pbx_builtin_setvar: Set requires an '=' to be a valid assignment. > -- Executing [s@setup:4] Set("Local/s@setup-0006;2", > "CURLOPT(conntimeout)=3") in new stack > -- Executing [s@setup:5] Set("Local/s@setup-0006;2", > "CURLOPT(dnstimeout)=3") in new stack > > > NOTE: The reason I'm doing this is because I want Asterisk to give a > different user agent for ControlPlayback function and move on quickly > if the remote file is not available / slow. > If that is not the correct way then please let me know! > > -- > _ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: > https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: >http://lists.digium.com/mailman/listinfo/asterisk-users -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] CURLOPT(useragent) fails with Set requires an '=' to be a valid assignment
All my other CURLOPT settings like timeout work fine. But this: same => n,Set(CURLOPT(useragent)="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.41 Safari/537.36") give the following warning on dialplan reload, with and without quotes around the user agent. Everything else is fine - perhaps it is the parenthesis in the user agent? If so, how do I get round this? I am fairly sure it's a typo at my end, but I've looked at examples from other people/gists and my usage looks correct. It's only the useragent option it chokes on. -- Executing [s@setup:3] Set("Local/s@setup-0006;2", "CURLOPT(useragent") in new stack [Dec 14 17:24:30] WARNING[10243][C-0007]: pbx_variables.c:1140 pbx_builtin_setvar: Set requires an '=' to be a valid assignment. -- Executing [s@setup:4] Set("Local/s@setup-0006;2", "CURLOPT(conntimeout)=3") in new stack -- Executing [s@setup:5] Set("Local/s@setup-0006;2", "CURLOPT(dnstimeout)=3") in new stack NOTE: The reason I'm doing this is because I want Asterisk to give a different user agent for ControlPlayback function and move on quickly if the remote file is not available / slow. If that is not the correct way then please let me know! -- _ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- Check out the new Asterisk community forum at: https://community.asterisk.org/ New to Asterisk? Start here: https://wiki.asterisk.org/wiki/display/AST/Getting+Started asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users