Hi all,<br>I'm trying to do the following scenario.<br>I've created an Inbound socket. I issue the following command in the Inbound ESL<br><br>api originate {origination_caller_id_name='lakshmanan',origination_caller_id_number=227,call=1,user=2,type=test,id=1001,refid=847,enabled=0,ignore_early_media=true,originate_timeout=30}user/1006 202 XML default<br>
<br>My dialplan looks like follows:<br> <br> <context name="default"><br> <extension name="outbound_soc"><br> <condition field="destination_number" expression="^.*$"><br>
<action application="set" data="continue_on_fail=true"/><br> <action application="set" data="bypass_media=false"/><br>
<action application="set" data="ignore_early_media=true"/><br> <action application="set" data="exec_after_bridge_app=park"/><br>
<action application="socket" data="<a href="http://0.0.0.0:8447">0.0.0.0:8447</a> async full"/><br> </condition><br> </extension><br>
</context><br><br>So once the user 1006 answers the call, it will connect to an Outbound socket.<br>And here is my program in perl for controlling the Outbound ESL.<br><br>use lib '/root/freeswitch/libs/esl/perl/';<br>
require ESL;<br>use IO::Socket::INET;<br>my $ip = "localhost";<br>my $sock = new IO::Socket::INET ( LocalHost => $ip, LocalPort => '8447', Proto => 'tcp', Listen => 1, Reuse => 1 );<br>
die "Could not create socket: $!\n" unless $sock;<br><br>for(;;) {<br> printf "Going to wait for clients to connect\n\n";<br> my $new_sock = $sock->accept();<br> my $pid = fork();<br>
if ($pid) {<br> close($new_sock);<br> next;<br> }<br> &registerSignals();<br> my $host = $new_sock->sockhost();<br> my $fd = fileno($new_sock);<br><br>
printf "Before making a ESL connection $fd\n";<br><br> my $con = new ESL::ESLconnection($fd);<br> my $info = $con->getInfo();<br> my $uuid = $info->getHeader("unique-id");<br>
printf "Connected call %s, from %s\n", $uuid, $info->getHeader("caller-caller-id-number");<br> print "BYE\n";<br> close($new_sock);<br>}<br><br>sub registerSignals() {<br>
foreach ( keys %SIG ) {<br> $SIG{$_} = 'sig_Handler';<br> }<br>}<br>sub sig_Handler() {<br> my $handle = shift;<br> print "Got signal $handle\n";<br> if($handle eq "CHLD") {<br>
wait();<br> }<br>}<br><br>But as soon as the call comes to the Outbound ESL program, it receives SIGSEGV.<br>The child program prints the following:<br> Before making a ESL connection 4<br> Got signal SEGV<br>
<br><br>Can any one please tell me why this is happening??<br><br>And one more thing. If I execute the following API, it works fine as expected.<br><br>api originate {origination_caller_id_name='lakshmanan',origination_caller_id_number=227,call=1}user/1006 202 XML default<br>
<br>The child prints as follows:<br>Before making a ESL connection 4<br>Connected call 01200ab6-73bf-11df-af54-55cf82f02c9b, from 227<br><br><br><br>