<div dir="ltr">Hi Dave,<br><br>Thanks for the reply but the problem here is :<br><br>if i want to play message your account balance is xxx then i must answer my call in starting of js before playing file which creates a session. so basically here are two sessions and call is answered 2 times .<br>
<br>After answering the call and playing account balance it originates call from js and creates another session.<br>Now what i need is the exact session time(the time between end user answered the call and the disconnect time of the call) of new session .<br>
<br>I hope i was able to explain .<br><br>here is my js script:<br><br>====start ========<br><br>var DialNumber = '12127773456';<br>console_log("notice", "Your destination :"+DialNumber+"\n");<br>
<br>var dialstr = "sofia/external/"+DialNumber+"@<a href="http://192.168.1.10:5090">192.168.1.10:5090</a>";<br><br><br> new_session = new Session();<br> new_session.setCallerData("caller_id_name", "ABC");<br>
new_session.setCallerData("caller_id_number", "2121231234");<br> new_session.originate(session, dialstr,60);<br> bridge(session, new_session);<br>
<br><br>var Acallduration=session.getVariable("billsec");<br><br>var p1time=session.getVariable("progresssec");<br><br>var p4time=session.getVariable("duration");<br><br>var Bcallduration=new_session.getVariable("billsec");<br>
var ptime=new_session.getVariable("progresssec");<br>var p5time=new_session.getVariable("duration");<br><br>console_log("notice", "Your old session time bill duration:"+Acallduration+"\n");<br>
console_log("notice", "Your old session progress time :"+p1time+"\n");<br>console_log("notice", "Your old session total time :"+p4time+"\n");<br><br>console_log("notice", "Your new session time :"+Bcallduration+"\n");<br>
console_log("notice", "Your new session progress time :"+ptime+"\n");<br>console_log("notice", "Your new session total time :"+p5time+"\n");<br>new_session.hangup();<br>
<br><br>session.hangup();<br><br><br>===end===<br><br><div class="gmail_quote">On Tue, Aug 19, 2008 at 3:27 PM, David Knell <span dir="ltr"><<a href="mailto:dave@3c.co.uk">dave@3c.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style="">Hi -<div><br></div><div>The answer to your initial question is "it depends." The ringtone that a caller hears is generated by a switch at the far end of a call - that's why, when you call people in different countries, you will usually hear the ringtone for that country. If that switch is before you in the chain - as it will be if, for example, you're receiving the calls via an analogue line - then you cannot play audio to the caller without answering the call. If there isn't a switch before you in the chain which believes that it's its job to generate ringtone, then you can play audio to the caller before answering.</div>
<div><br></div><div>If you can do what you want calling FS directly from a softphone on your desk - I use X-Lite - then you've done your bit. If it doesn't work when calling via the PSTN (but you hear ringing while the "your balance is.." message is playing, then someone between FS and the caller is generating that ringtone.</div>
<div><br></div><div>Cheers --</div><div><br></div><div>Dave</div><div><div></div><div class="Wj3C7c"><div><div><br><blockquote type="cite"><div dir="ltr">Let me explain why i need this.<br><br>I have a written a small script which will get balance from database and play the balance and after that connect the call by using session.originate.<br>
<br><br>Dialing 009199XXXXXXX will call test.js which will first play balance and then dial 9199XXXXXX.<br> <br>Now the problem is :<br><br><br><b>If i answer the call first and then play balance and then dial number .<br>
<br>Call goes fine but the the session time calculated by freeswitch is from dialing 009199XXXXXXX till the end of call.<br> </b><br>which is wrong it should calculate only the call duration of new session originated by js. <br>
<br><br><b>If not answer the call, duration is correct but it will not play the balance. </b><br><br><br><br><div class="gmail_quote"> On Tue, Aug 19, 2008 at 2:15 PM, vidhya sagar dixit <span dir="ltr"><<a href="mailto:vids.cs@gmail.com" target="_blank">vids.cs@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div dir="ltr">Hi,<br><br>I am dialing from softphone to pstn using freeswitch. <br>Is it possible to play a sound file before connecting the call.<br>
<br>when dial from softphone i should hear first the sound file lets say welcome.wav and then dial the number.<br> <br><br><br><div class="gmail_quote"><div><div></div><div>On Tue, Aug 19, 2008 at 2:10 PM, James Green <span dir="ltr"><<a href="mailto:james.green@stealthnet.net" target="_blank">james.green@stealthnet.net</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div> <div>vidhya sagar dixit wrote:<br> > Hi All,<br> ><br>
> Is it possible to play a sound file without answering the call in free<br> > switch ?<br> <br> </div>To whom?<br> <font color="#888888"><br> James<br> </font><br></div></div>_______________________________________________<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><br><br clear="all"><br>-- <br>Thanks and Regards <br><br>Vidhya Sagar Dixit<br> </div></div> </blockquote></div><br><br clear="all"><br>-- <br>Thanks and Regards <br><br>Vidhya Sagar Dixit<br>
</div> _______________________________________________<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></div></div><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><br clear="all"><br>-- <br>Thanks and Regards <br><br>Vidhya Sagar Dixit<br>
</div>