<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<span class="corners-top"><span></span></span>Hello <br>
<br>
I've created an Asterisk module following this tutorial-->
<a class="moz-txt-link-freetext" href="http://blog.russellbryant.net/2008/06/19/how-to-write-an-asterisk-module-part-1/">http://blog.russellbryant.net/2008/06/19/how-to-write-an-asterisk-module-part-1/</a><br>
Following this part and parts <a
href="http://blog.russellbryant.net/2008/06/20/how-to-write-an-asterisk-module-part-2/"
class="postlink">2</a> and <a
href="http://blog.russellbryant.net/2008/06/30/how-to-write-an-asterisk-module-part-3/"
class="postlink">3</a> I have developed an asterisk module with a
CLI command.<br>
<br>
Now I want to use another c code in the module. This code uses
libcurl. <br>
What I've done is:<br>
In my module <span style="font-style: italic">res_module.c</span> I
include the header for the other code. <br>
<dl class="codebox">
<dd><code>#include "othercode.h"</code></dd>
</dl>
<p>I put all the files in the same folder and compiling with:<br>
</p>
<dl class="codebox">
<dd><code>gcc -o res_module.o -c res_module.c -MD -MT res_module.o
-MF .res_module.o.d -MP -pthread
-I/home/myuser/asterisk/asterisk-1.6.2.24/include
-I/usr/include/libxml2 -pipe -Wall -Wstrict-prototypes
-Wmissing-prototypes -Wmissing-declarations -g3 -march=i686
-O6 -fPIC -DAST_MODULE=\"res_module\" <br>
<br>
gcc -o othercode.o -c othercode.c -lcurl -lcrypto -lssl -ld<br>
<br>
gcc -o res_module.so -pthread -shared res_module.o other.o
-lcurl<br>
<br>
install -m 755 res_module.so /usr/lib/asterisk/modules</code></dd>
</dl>
<p>The problems are:<br>
If I don't include the option <span style="font-weight: bold">-lcurl</span>
in the 3rd gcc command I can not load the module because of an
error: <span style="font-style: italic">undefined symbol:
curl_easy_perform</span><br>
If I include the option <span style="font-weight: bold">-lcurl</span>
asterisk crashes and exits when I try to load the module.<br>
<br>
Any help?<br>
<br>
Thanks in advance. </p>
</body>
</html>