How to add function CURL

How do I add function CURL to Asterisk 1.6.0.3 on Ubuntu 8.10 (server)

[Feb 23 11:01:54] ERROR[9958]: pbx.c:2772 ast_func_read: Function CURL not registered

medionCLI> core show function CURL
No function by that name registered.
Command ‘core show function CURL’ failed.
medion
CLI>

I’m doing a test install of Asterisk (ver 1.4.23) on another pc, to find out why CURL is not working.

During ‘make menuselect’ in
Asterisk Module and Build Option Select -> 6. Dialplan Functions
I can see XXX 6. func_curl

Why can’t I choose function curl ?
(curl is installed in Linux)

Hi

I think its down to the version.

check lists.digium.com/pipermail/aster … 74843.html

Ian

[quote=“ianplain”]Hi

I think its down to the version.

check lists.digium.com/pipermail/aster … 74843.html

Ian[/quote]
[ul]
In the link above is also written:

func_curl fails to compile, asterisk1.4

I got it sorted by myself in the meantime.

I had version 7.9.8 of CurlLib installed. I upgraded to 7.16.0 and everything
compiled just fine.

Why didn’t the configure script check for this version dependency of CurlLib?[/ul]

I have:
henkoegema@medion:~$ curl -V
curl 7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.8
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
henkoegema@medion:~$

[quote=“ianplain”]Hi

I think its down to the version.

check lists.digium.com/pipermail/aster … 74843.html

Ian[/quote]

I finally solved it: :smiley:

./configure -with-curl

bump

I got the same problem, although the versions are pretty much up to date…

# asterisk -V
Asterisk 1.4.22.2

# curl -V
curl 7.19.4 (i586-pc-linux-gnu) libcurl/7.19.4 OpenSSL/0.9.8c zlib/1.2.3
Protocols: tftp ftp telnet dict http file https ftps
Features: IPv6 Largefile NTLM SSL libz

i did compile asterisk with curl, but it doesnt seem to work properly…

./configure
checking for curl-config... /usr/local/bin/curl-config
checking for curl_version() in curl/curl.h... yes

make menuselect
[*] 5.  func_curl

make
make install   (grep curl)
for x in func_base64.so func_callerid.so func_cdr.so func_channel.so func_curl.so func_cut.so func_db.so func_enum.so func_env.so func_global.so func_groupcount.so func_language.so func_logic.so func_math.so func_md5.so func_moh.so func_rand.so func_realtime.so func_sha1.so func_strings.so func_timeout.so func_uri.so; do /usr/bin/install -c -m 755 $x /usr/lib/asterisk/modules ; done

some more info…

# asterisk -rvvvvvvvvvvvvv

on incoming calls when i use CURL in extensions.conf:
*CLI>[Mar  6 21:47:49] ERROR[5015]: pbx.c:1550 ast_func_read: Function CURL not registered

*CLI>show function CURL 
No function by that name registered.

anyone got a hint?

[quote=“thunderbyte”]bump

I got the same problem, although the versions are pretty much up to date…

anyone got a hint?[/quote]

Try to load the packages mentioned in

colt45.chemlab.org/2008/10/08/ex … freepbx-25

Specially the libcurl4-gnutls-dev package is needed.

Then you can ./compile ‘-with-curl’ is not needed.
Check also in make menuselect -> dialplan settings if the curl module is present.

still no success. i see the curl activated when running a make menuselect.

on asterisk-startup:

[Mar  7 14:15:17] WARNING[5099] loader.c: Error loading module 'func_curl.so': libcurl.so.4: cannot open shared object file: No such file or directory
[Mar  7 14:15:17] WARNING[5099] loader.c: Module 'func_curl.so' could not be loaded.

some debug info:

/usr/lib/asterisk/modules# ll func_curl.so
140 -rwxr-xr-x 1 root root 137547 Mar  7 14:03 func_curl.so

# ldd /usr/local/lib/libcurl.so.4
        linux-gate.so.1 =>  (0xffffe000)
        libssl.so.0.9.8 => /usr/lib/i586/libssl.so.0.9.8 (0xb7efd000)
        libcrypto.so.0.9.8 => /usr/lib/i586/libcrypto.so.0.9.8 (0xb7dd5000)
        librt.so.1 => /lib/tls/librt.so.1 (0xb7dcd000)
        libz.so.1 => /usr/lib/libz.so.1 (0xb7db9000)
        libc.so.6 => /lib/tls/libc.so.6 (0xb7c86000)
        libdl.so.2 => /lib/tls/libdl.so.2 (0xb7c82000)
        libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7c70000)
        /lib/ld-linux.so.2 (0x80000000)

/usr/local/lib/# ls -las libcurl*
352 -rw-r--r-- 1 root staff 355288 Mar  6 20:15 libcurl.a
  4 -rwxr-xr-x 1 root staff    943 Mar  6 20:15 libcurl.la
  0 lrwxrwxrwx 1 root staff     16 Mar  6 20:15 libcurl.so -> libcurl.so.4.1.1
  0 lrwxrwxrwx 1 root staff     16 Mar  6 20:15 libcurl.so.4 -> libcurl.so.4.1.1
296 -rwxr-xr-x 1 root staff 298266 Mar  6 20:15 libcurl.so.4.1.1

thus a link problem…
fixed it by creating a softlink:

thanks anyway :wink:

[quote=“thunderbyte”]

fixed it by creating a softlink:

thanks anyway :wink:[/quote]

:smile: