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
[asterisk-users] Fwd: Asterisk 16.14.0 pjsip transport-tls cert parsing error
Hi, I'm experimenting with Asterisk-16.14.0 on a CentOS7 box, and run into problems loading the SSL certificate to establish transport-tls. Tried self-signed certificate generated with ast_tls_cert under contrib/scripts and the one issued by Letsencrypt, both would bomb out with a parsing error: [Dec 3 15:47:50] ERROR[11233] res_pjsip/config_transport.c: Transport: transport-tls: cert_file /home/asterisk/certs/asterisk.crt is either missing or not readable [Dec 3 15:47:50] ERROR[11233] config_options.c: Error parsing cert_file=/home/asterisk/certs/asterisk.crt at line 24 of What's interesting is that the self-signed asterisk.crt only has 20 lines. For letsencrypt certificate (both cert.pem and fullchain.pem), it'd bomb out at line 22. Here's the transport section of my /etc/asterisk/pjsip.conf: [transport-udp] type = transport protocol = udp bind = 0.0.0.0 [transport-tls] type = transport protocol = tls bind = 0.0.0.0 ;cert_file = /home/asterisk/certs/cert.pem ;cert_file = /home/asterisk/certs/fullchain.pem ;priv_key_file = /home/asterisk/certs/privkey.pem cert_file = /home/asterisk/certs/asterisk.crt priv_key_file = /home/asterisk/certs/asterisk.key allow_reload = true And a full listing of /home/asterisk/certs: -rw-r-. 1 asterisk asterisk 1212 Dec 2 17:19 asterisk.crt -rw-r-. 1 asterisk asterisk 578 Dec 2 17:18 asterisk.csr -rw-r-. 1 asterisk asterisk 891 Dec 2 17:18 asterisk.key -rw-r-. 1 asterisk asterisk 2103 Dec 2 17:19 asterisk.pem -rw-r-. 1 asterisk asterisk 1749 Dec 2 17:18 ca.crt -rw-r-. 1 asterisk asterisk 3311 Dec 2 17:18 ca.key -rw-r-. 1 asterisk asterisk 1923 Nov 13 16:29 cert.pem -rw-r-. 1 asterisk asterisk 3570 Nov 13 15:11 fullchain.pem -rw-r-. 1 asterisk asterisk 1704 Nov 13 15:12 privkey.pem The self-sign asterisk.crt: -BEGIN CERTIFICATE- MIIDUzCCATsCAQEwDQYJKoZIhvcNAQELBQAwMTEcMBoGA1UEAwwTQXN0ZXJpc2sg UHJpdmF0ZSBDQTERMA8GA1UECgwIQXN0ZXJpc2swHhcNMjAxMjAzMDMxOTA2WhcN MjExMjAzMDMxOTA2WjAyMR0wGwYDVQQDDBR2b2lwMS5pZmEuaGF3YWlpLmVkdTER MA8GA1UECgwIQXN0ZXJpc2swgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAOIn CVUjv8qsDGdv8VJMEtmiMMK2HAdMnkUAv0BgEU6v0lB49xDQfHheb54MBVmyCArB 7CCwcqej3QtGVOUnLO/kGUd0YkFvFfpY+esnxCIeA5JVat15fo5d+gOYGMdfTlGQ gPfYwagCvL94fOIrqEm/LU0vmUi487LSFJOrrcEfAgMBAAEwDQYJKoZIhvcNAQEL BQADggIBANRCkcl1KTN3/Ez2j7VR0ZisGQVVqwfwLJlM4TtT44ukZPNKWc/BhMH4 XtXA71Np+0ePERcQDpj0gPEQyW0PfGAZT/AsClUmphBoGWTnM5NB23BDDwawm9Ym aAddCm94aEe1gMwWJRaPqdWhkub9BS7KWWCkhdLwITryo+I0hSdD9ReXXODRPPyH ybL8CtNRJjCHU8shyvxtrpinZJFHJj3GSWYVB15uUotAUWlpF6H8+Q41UJgJYeGO 11FlpCMrB4uI/V2c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MliryVWMQXk3z2yicYHIHuSPxstsJrGtVhFDq2OedwvVGMSvCgh BniswjtAJ3oB21eB+XB5KMIAQK848E8YML4G8urCLMy9OmnLqnoUgdCju/S7/fkc Q83kL
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
Re: [asterisk-users] Can I turn off logging of Invalid packets received by PJSIP?
On Mon, Dec 14, 2020 at 1:04 PM Steve Sether wrote: > We get some noise in our Asterisk error file generated by scanners sending > invalid invites. Example below (details removed) > > This seems to be a feature added in pjsip. While it's often very useful > to log error packers, in our case it just winds up being noise 99.9% of the > time. > > Is their some way to configure Asterisk or PJSIP to not log these packets > as errors? Or maybe some way to just filter them out entirely before pjsip > even gets it (other than using an IP, which of course changes). > These are deep down in the transport layer, and there's no explicit configuration option in Asterisk or the PJSIP library itself to disable them. PJSIP appears to raise them as a normal log message at level 1. -- 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
[asterisk-users] Can I turn off logging of Invalid packets received by PJSIP?
We get some noise in our Asterisk error file generated by scanners sending invalid invites. Example below (details removed) [2020-12-0702:53:30]ERROR[23370]pjproject:sip_transport.c Error processing 559 bytes packet from UDP *** :PJSIPsyntaxerrorexceptionwhenparsing'Request Line'header on line 1 col 12:INVITEsip:@***SIP/2.0Via:SIP/2.0/UDP0.0.0.0:49990;branch=*Max-Forwards:70From:;tag=*To:Call-ID:***CSeq:1INVITEContact:Content-Type:application/sdpContent-Length:204v=0o=@**:50601626418299INIP40.0.0.0s=pplsipc=INIP40.0.0.0t=00m=audio25282RTP/AVP1006083185101a=rtpmap:0pcmu/8000a=rtpmap:101telephone-event/8000a=fmtp:1010-11 This seems to be a feature added in pjsip. While it's often very useful to log error packers, in our case it just winds up being noise 99.9% of the time. Is their some way to configure Asterisk or PJSIP to not log these packets as errors? Or maybe some way to just filter them out entirely before pjsip even gets it (other than using an IP, which of course changes). -- _ -- 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] Asterisk registrations - state?
On Tue, Dec 8, 2020 at 1:07 PM Antony Stone < antony.st...@asterisk.open.source.it> wrote: > Hi. > > I'm using Asterisk 16.2.1 with some registrations (ie: my Asterisk server > is > registering to other PBXs as though it were a telephone). > > Is there any way I can get presence / state information from those PBXs in > the > same way that a registered telephone can? > > In other words, can I send a Subscribe request to the PBX so that I get > Notify > announcements about other extensions and whether they're idle / busy / > ringing > / etc., the same as BLF indicators on a SIP phone can do? > > I've looked at > https://wiki.asterisk.org/wiki/display/AST/Querying+and+Manipulating+State > but > this appears to be only for the state of clients registered to my Asterisk > instance, not for the state of clients registered to the same remote PBX > as > Asterisk itself is registering to. > There is no functionality present to have Asterisk SUBSCRIBE to upstream servers, receive updates, and locally use them. -- 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