在星号拨号计划中使用CURL发送位置选项

时间:2019-06-03 16:06:15

标签: curl redirect post asterisk

我如何发送--location选项以在带有等价星号拨号方案的带有CURL的http帖子中进行重定向,以使其等效于
curl -L --data "FirstNme=John&LastName=Doe&PhoneNumber=8005551212" https://www.example.com

我试图做

same => n,Set(CURLOPT(location))
same => n,Set(response=${CURL(https://www.example.com,FirstNme=John&LastName=Doe&PhoneNumber=8005551212)})

same => n,Set(response=${CURL(https://www.example.com,-L --data "FirstNme=John&LastName=Doe&PhoneNumber=8005551212")})

它不起作用。

我该怎么办?

1 个答案:

答案 0 :(得分:0)

CURLOPT不是变量,它是FUNCTION。它的选择数量确实有限。

它是开源的,您可以将函数添加到源代码中(要求在Linux下具有最低的c / c ++经验)。

pro-sip*CLI> core show function CURLOPT 

  -= Info about function 'CURLOPT' =- 

[Synopsis]
Set options for use with the CURL() function

[Description]
  cookie         - Send cookie with request [none]
  conntimeout    - Number of seconds to wait for connection
  dnstimeout     - Number of seconds to wait for DNS response
  ftptext        - For FTP, force a text transfer (boolean)
  ftptimeout     - For FTP, the server response timeout
  header         - Retrieve header information (boolean)
  httptimeout    - Number of seconds to wait for HTTP response
  maxredirs      - Maximum number of redirects to follow
  proxy          - Hostname or IP to use as a proxy
  proxytype      - http, socks4, or socks5
  proxyport      - port number of the proxy
  proxyuserpwd   - A <user>:<pass> to use for authentication
  referer        - Referer URL to use for the request
  useragent      - UserAgent string to use
  userpwd        - A <user>:<pass> to use for authentication
  ssl_verifypeer - Whether to verify the peer certificate (boolean)
  hashcompat     - Result data will be compatible for use with HASH()
                 - if value is "legacy", will translate '+' to ' '


[Syntax]
CURLOPT(<option>)

[Arguments]
Not available

[See Also]
Not available

请不要忘记,星号是PBX,不是编程语言。您始终可以将AGI / FastAGI / ARI与首选语言一起使用。