O'Reilly logo

Asterisk: The Future of Telephony by Leif Madsen, Jared Smith, Jim Van Meggelen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Curl() — Loads an external URL and assigns the result to a variable

Synopsis

    Curl(URL[,postdata])

Downloads the given URL and assigns it to the channel variable named CURL. If specified, the postdata argument is passed to the URL as an HTTP POST. Curl() is often used to signal external applications of dialplan events.

Returns 0, or -1 on fatal errors.

    ; post the Caller ID number and unique call ID to a URL
    exten => 123,1,Curl(http://localhost/test.
    php,CallerID=${CALLERID}&UniqueCallID={$UNIQUEID})
    ; now use the NoOp() application to print the result to 
    the Asterisk console
    exten => 123,2,NoOp(${CURL})

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required