You can play with the delay values.

Try this code:

---------------------------------------------------
os.execute("sleep " .. tonumber(10));

pin_number_test="0511";
out_gateway1="sofia/gateway/voipms/1";
message_dir="/usr/local/freeswitch/sounds/en/us/callie/custom/callback/";

number_to_call= argv[1];

session = freeswitch.Session("{ignore_early_media=true,originate_timeout=40}"..out_gateway1..number_to_call);
session:setAutoHangup(false);

session:sleep(400);
if ( session:ready() ) then
ššššššš session:sleep(200);
šššššššš if (session:answered()) then
ššššššššššššššš session:sleep(200);
ššššššššššššššš session:streamFile(message_dir.."enter-dest.wav");
šššššššš end
end
---------------------------------------------------


Tell me is this works.

If not - try to modify delays (400,200,200), use different values less then 1 second.

Regards,
Vitalie




10 ΙΐΞΡ 2010 Η. 17:51 ΠΟΜΨΪΟΧΑΤΕΜΨ Aloysius Lloyd <lloyd.aloysius@sunteltech.ca> ΞΑΠΙΣΑΜ:
Thanks Vitalli.

Increase the short delay solve the problem. I increase from 1000 to 2000.

But when I answer the phone there is a silent before play the file because of the dealy.

How to improve this? Is there any setting to make the session fast.


Thanks
Lloyd


2010/6/10 Vitalii Colosov <vetali100@gmail.com>
Try to add short delay - session:sleep:

...
session:setAutoHangup(false);

session:sleep(1000);š
...

Sometimes I was getting session is not ready, and fixed this by adding short delay.

Maybe you have same problem here.

Regards,
Vitalie



10 ΙΐΞΡ 2010 Η. 16:20 ΠΟΜΨΪΟΧΑΤΕΜΨ Aloysius Lloyd <lloyd.aloysius@sunteltech.ca> ΞΑΠΙΣΑΜ:

VItalli,

I try your suggestion. Now the script look like this


os.execute("sleep " .. tonumber(10));

pin_number_test="0511";
out_gateway1="sofia/gateway/voipms/1";
message_dir="/usr/local/freeswitch/sounds/en/us/callie/custom/callback/";

number_to_call= argv[1];

session = freeswitch.Session("{ignore_early_media=true,originate_timeout=40}"..out_gateway1..number_to_call);
session:setAutoHangup(false);

if ( session:ready() ) then
ššššššš session:sleep(1000);
šššššššš if (session:answered()) then
ššššššššššššššš session:sleep(1000);
ššššššššššššššš session:streamFile(message_dir.."enter-dest.wav");
šššššššš end
end

===

Also I try 5 test . This time out of 5 test,š wave file play only one time. Other for 4 tests silent.

Thanks
Lloyd



2010/6/10 Vitalii Colosov <vetali100@gmail.com>

It looks OK what you wrote - we have almost same lua code.

The only thing that I have in addition in my script is "if š(session:answered())" construction.

Try to write it like this:
...

if ( session:ready() ) then
ššššššš session:sleep(1000);šš š š š
šš š š šif (session:answered()) then
šš š š š ššsession:sleep(1000); š š š š
šš š š š š session:streamFile(message_dir.."enter-dest.wav");
šš š š šend

end
...

Not sure why this should work and that does not, but this is how it works for me - worth trying at lest.


Regards,
Vitalie


10 ΙΐΞΡ 2010 Η. 9:07 ΠΟΜΨΪΟΧΑΤΕΜΨ Aloysius Lloyd <lloyd.aloysius@sunteltech.ca> ΞΑΠΙΣΑΜ:


without bypass_media_after_bridge=true same results.

Lloyd



2010/6/10 Aloysius Lloyd <lloyd.aloysius@sunteltech.ca>

I try the bypass_media_after_bridge=trueš .. same results.

Thanks
Lloyd




On Thu, Jun 10, 2010 at 2:00 AM, Sergey Scheglov <sid@eltc.ru> wrote:
χ Thu, 10 Jun 2010 01:26:51 -0400
Aloysius Lloyd <lloyd.aloysius@gmail.com> wrote:


> session =
> freeswitch.Session("{bypass_media_after_bridge=true,ignore_early_media=true,originate_timeout=40}"..out_gateway1..number_to_call);
> session:setAutoHangup(false);
>
> Thanks
> Lloyd

Try without bypass_media_after_bridge=true

Regard
Sergey Scheglov

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org