Try to add short delay - session:sleep:<div><font class="Apple-style-span" color="#500050" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" color="#500050" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">...</span></font></div>
<div>session:setAutoHangup(false);</div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; color: rgb(80, 0, 80); "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; color: rgb(80, 0, 80); ">session:sleep(1000);</span></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; color: rgb(80, 0, 80); ">...</span></div><div><div><br></div><div>Sometimes I was getting session is not ready, and fixed this by adding short delay.</div>
<div><br></div><div>Maybe you have same problem here.</div><div><br></div><div>Regards,</div><div>Vitalie</div><div><br></div><div><br><br><div class="gmail_quote">10 ΙΐΞΡ 2010 Η. 16:20 ΠΟΜΨΪΟΧΑΤΕΜΨ Aloysius Lloyd <span dir="ltr"><<a href="mailto:lloyd.aloysius@sunteltech.ca">lloyd.aloysius@sunteltech.ca</a>></span> ΞΑΠΙΣΑΜ:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">VItalli,<br><br>I try your suggestion. Now the script look like this<div class="im"><br><br>os.execute("sleep " .. tonumber(10));<br>
<br>pin_number_test="0511";<br>out_gateway1="sofia/gateway/voipms/1";<br>message_dir="/usr/local/freeswitch/sounds/en/us/callie/custom/callback/";<br>
<br>number_to_call= argv[1];<br><br></div>session = freeswitch.Session("{ignore_early_media=true,originate_timeout=40}"..out_gateway1..number_to_call);<br>session:setAutoHangup(false);<br><div class="im"><br>if ( session:ready() ) then<br>
session:sleep(1000);<br> if (session:answered()) then<br> session:sleep(1000);<br> session:streamFile(message_dir.."enter-dest.wav");<br> end<br>end<br><br>
</div>
===<br>
<br>Also I try 5 test . This time out of 5 test, wave file play only one time. Other for 4 tests silent.<br><br>Thanks<br>Lloyd<br><br>
<br><br><div class="gmail_quote">2010/6/10 Vitalii Colosov <span dir="ltr"><<a href="mailto:vetali100@gmail.com" target="_blank">vetali100@gmail.com</a>></span><div><div></div><div class="h5"><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
It looks OK what you wrote - we have almost same lua code.<div><br><div>The only thing that I have in addition in my script is "if (session:answered())" construction.</div><div><br></div><div>Try to write it like this:</div>
<div>...</div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse">if ( session:ready() ) then<br> session:sleep(1000); </span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"> if (session:answered()) then</span></div><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"> session:sleep(1000); </span></div>
<div>
<div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"> session:streamFile(message_dir.."enter-dest.wav");</span></div><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"> end</span></div>
</div><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><br>end</span></div><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse">...</span></div>
<div><br></div><div>Not sure why this should work and that does not, but this is how it works for me - worth trying at lest.</div><div><br></div><div><br></div><div>Regards,</div><div>Vitalie</div><div><br><br><div class="gmail_quote">
10 ΙΐΞΡ 2010 Η. 9:07 ΠΟΜΨΪΟΧΑΤΕΜΨ Aloysius Lloyd <span dir="ltr"><<a href="mailto:lloyd.aloysius@sunteltech.ca" target="_blank">lloyd.aloysius@sunteltech.ca</a>></span> ΞΑΠΙΣΑΜ:<div><div></div><div><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<br clear="all">without bypass_media_after_bridge=true same results.<br><br>Lloyd<br><br>
<br><br><div class="gmail_quote">2010/6/10 Aloysius Lloyd <span dir="ltr"><<a href="mailto:lloyd.aloysius@sunteltech.ca" target="_blank">lloyd.aloysius@sunteltech.ca</a>></span><div><div></div><div><br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
I try the bypass_media_after_bridge=true .. same results.<br><br>Thanks<br><font color="#888888">Lloyd</font><div><div></div><div><br><br>
<br><br><div class="gmail_quote">On Thu, Jun 10, 2010 at 2:00 AM, Sergey Scheglov <span dir="ltr"><<a href="mailto:sid@eltc.ru" target="_blank">sid@eltc.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
χ Thu, 10 Jun 2010 01:26:51 -0400<br>
<div>Aloysius Lloyd <<a href="mailto:lloyd.aloysius@gmail.com" target="_blank">lloyd.aloysius@gmail.com</a>> wrote:<br>
<br>
<br>
</div><div>> session =<br>
> freeswitch.Session("{bypass_media_after_bridge=true,ignore_early_media=true,originate_timeout=40}"..out_gateway1..number_to_call);<br>
> session:setAutoHangup(false);<br>
><br>
</div>> Thanks<br>
> Lloyd<br>
<br>
Try without bypass_media_after_bridge=true<br>
<br>
Regard<br>
Sergey Scheglov<br>
<br>
_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br>
</div></div></blockquote></div></div></div><br>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div></div></div><br></div></div>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div></div></div><br>
<br>_______________________________________________<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div></div>