<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.apple-tab-span
{mso-style-name:apple-tab-span;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=FR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I doubt if you really need ALL events.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I send:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Courier New";color:#1F497D'>event xml BACKGROUND_JOB CHANNEL_CALLSTATE<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I receive:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Courier New";color:#1F497D'>Reply-Text: +OK event listener enabled xml<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>… and then all events I need (in XML)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>De :</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> FreeSWITCH-users [mailto:freeswitch-users-bounces@lists.freeswitch.org] <b>De la part de</b> Raimundo Pérez Nieves<br><b>Envoyé :</b> lundi 15 janvier 2018 16:03<br><b>À :</b> FreeSWITCH Users Help<br><b>Objet :</b> [Freeswitch-users] Event Socket not displaying all events<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span style='background:white'>Hi, </span><o:p></o:p></p><div><p class=MsoNormal><span style='background:white'>I can’t receive all events, like ringtone, exchange media, answered, etc, from <a href="mailto:sofia/external/550075372035172@64.34.75.23">sofia/external/550075372035172@64.34.75.23</a></span><o:p></o:p></p></div><div><p class=MsoNormal><span style='background:white'>What I am missing?</span><o:p></o:p></p></div><div><p class=MsoNormal><span style='background:white'>Thanks </span><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='background:white'>iam using this dial plan:</span><o:p></o:p></p><div><div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'><extension name="outbound event socket"></span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> <condition field="destination_number" data="^(5004)$">\</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> <action application="socket" data="127.0.0.1:8040 async"/></span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> </condition></span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> </extension><span class=apple-tab-span> </span></span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><o:p> </o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'>And this is my perl script:</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><o:p> </o:p></p></div><div><div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'>require ESL;</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'>use IO::Socket::INET;</span><o:p></o:p></p></div><p class=MsoNormal style='line-height:13.5pt'><o:p> </o:p></p><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'>my $ip = "127.0.0.1";</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'>my $sock = new IO::Socket::INET ( LocalHost => $ip, LocalPort => '8040', Proto => 'tcp', Listen => 1, Reuse => 1 );</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'>my $dial_string = '<a href="mailto:sofia/external/550075372035172@64.34.75.23">sofia/external/550075372035172@64.34.75.23</a>';</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'>my $codec_string = 'G729';</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'>die "Could not create socket: $!\n" unless $sock;</span><o:p></o:p></p></div><p class=MsoNormal style='line-height:13.5pt'><o:p> </o:p></p><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'>for(;;) {</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> my $new_sock = $sock->accept();</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> my $pid = fork();</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> if ($pid) {</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> print "New child pid $pid created...\n";</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> close($new_sock);</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> next;</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> }</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> my $fd = fileno($new_sock);</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> my $con = new ESL::ESLconnection($fd);</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> my $info = $con->getInfo();</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> my $uuid = $info->getHeader("unique-id");</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> printf "Connected call %s, from %s\n", $uuid, $info->getHeader("caller-caller-id-number");</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> $con->sendRecv("event plain ALL");</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> $con->execute("export","nolocal:absolute_codec_string=$codec_string");</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> $con->execute("bridge",$dial_string);</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> while($con->connected()) {</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> my $e = $con->recvEvent();</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> if ($e) {</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> my $name = $e->getHeader("event-name");</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> print "EVENT [$name]\n";</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> }</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> }</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> print "BYE\n";</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'> close($new_sock);</span><o:p></o:p></p></div><div><p class=MsoNormal style='line-height:13.5pt'><span style='background:white'>}</span><o:p></o:p></p></div></div></div></div></div></div></div></body></html>