Dear all<br><br>I've done the following sample script to experiment the nixevent. I found some difference in behavior because of nixevent. Let me explain my question down the script.<br><br>require ESL;<br>use IO::Socket::INET;<br>
<br>my $ip = "192.168.1.222";<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>
for(;;) {<br> my $new_sock = $sock->accept();<br> next if (not defined ($new_sock));<br> my $pid = fork();<br> if ($pid) {<br> close($new_sock);<br> next;<br> }<br> print "CHILD PID: $$\n";<br>
my $host = $new_sock->sockhost();<br> my $fd = fileno($new_sock);<br><br> my $con = new ESL::ESLconnection($fd);<br> my $info = $con->getInfo();<br><br> my $uuid = $info->getHeader("unique-id");<br>
<br> printf "Connected call %s, from %s\n", $uuid, $info->getHeader("caller-caller-id-number");<br> my $r=$con->execute("answer");<br> $con->events("plain","all");<br>
##########################<br> $con->send("nixevent DTMF"); <br> my $val=$con->api("create_uuid");<br> $val = $val->getBody(); # LINE 1<br> chomp($val);<br> print "UUID is $val\n";<br>
my $e = $con->recvEvent(); <br> $val = $e->getBody(); # LINE 2<br> chomp($val);<br> print "UUID is $val\n";<br> close($new_sock);<br>}<br><br># If the line ($con->send("nixevent DTMF");) is commented, then the result of create_uuid is obtained in LINE 1.<br>
# else, the result isn't obtained in the LINE 1 and it has nothing. The result is obtained only when I do a recvEvent, <br>
# followed by a getBody (LINE 2)<br><br>Just want to know why the behavior differs when nixevent is present???<br><br>