<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><font style="background-color: rgb(255, 255, 255);" class="">Hi, </font><div class=""><font style="background-color: rgb(255, 255, 255);" class="">I can’t receive all events, like ringtone, exchange media, answered, etc, from </font><span style="white-space: pre; background-color: rgb(255, 255, 255);" class=""><a href="mailto:sofia/external/550075372035172@64.34.75.23" class="">sofia/external/550075372035172@64.34.75.23</a></span></div><div class=""><font style="background-color: rgb(255, 255, 255);" class="">What I am missing?</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class="">Thanks </font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""><br class=""></font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class="">iam using this dial plan:</font><div class=""><div style="line-height: 18px; white-space: pre;" class=""><div class=""><font style="background-color: rgb(255, 255, 255);" class=""><extension name="outbound event socket"></font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> <condition field="destination_number" data="^(5004)$">\</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> <action application="socket" data="127.0.0.1:8040 async"/></font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> </condition></font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> </extension><span class="Apple-tab-span" style="white-space:pre"> </span></font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""><br class=""></font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class="">And this is my perl script:</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""><br class=""></font></div><div class=""><div style="line-height: 18px;" class=""><div class=""><font style="background-color: rgb(255, 255, 255);" class="">require ESL;</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class="">use IO::Socket::INET;</font></div><font style="background-color: rgb(255, 255, 255);" class=""><br class=""></font><div class=""><font style="background-color: rgb(255, 255, 255);" class="">my $ip = "127.0.0.1";</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class="">my $sock = new IO::Socket::INET ( LocalHost => $ip, LocalPort => '8040', Proto => 'tcp', Listen => 1, Reuse => 1 );</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class="">my $dial_string = '<a href="mailto:sofia/external/550075372035172@64.34.75.23" class="">sofia/external/550075372035172@64.34.75.23</a>';</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class="">my $codec_string = 'G729';</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class="">die "Could not create socket: $!\n" unless $sock;</font></div><font style="background-color: rgb(255, 255, 255);" class=""><br class=""></font><div class=""><font style="background-color: rgb(255, 255, 255);" class="">for(;;) {</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> my $new_sock = $sock->accept();</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> my $pid = fork();</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> if ($pid) {</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> print "New child pid $pid created...\n";</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> close($new_sock);</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> next;</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> }</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> my $fd = fileno($new_sock);</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> my $con = new ESL::ESLconnection($fd);</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> my $info = $con->getInfo();</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> my $uuid = $info->getHeader("unique-id");</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> printf "Connected call %s, from %s\n", $uuid, $info->getHeader("caller-caller-id-number");</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> $con->sendRecv("event plain ALL");</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> $con->execute("export","nolocal:absolute_codec_string=$codec_string");</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> $con->execute("bridge",$dial_string);</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> while($con->connected()) {</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> my $e = $con->recvEvent();</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> if ($e) {</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> my $name = $e->getHeader("event-name");</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> print "EVENT [$name]\n";</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> }</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> }</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> print "BYE\n";</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class=""> close($new_sock);</font></div><div class=""><font style="background-color: rgb(255, 255, 255);" class="">}</font></div></div></div></div></div></div></body></html>