Thanks Brian for l’Inter, but exactly what am I doing wrong? Francesco Facco de Lagarda
On 30 Mar 2018, at 19:52, Brian West <brian@freeswitch.com> wrote:
You're already doing it wrong if you're taking this approach. Review our existing CDR modules that would accomplish this for you.
/b
On Fri, Mar 30, 2018 at 3:20 AM, Francesco Facco de Lagarda <francesco@delagarda.com> wrote: Good morning all,
I will be using both digital (which knows when the other part answers) and analogue (when, at least in Italy, doesn’t!)
I need to calculate the total duration of an outgoing call.
Calls also must have a preset max duration. I need to schedule a warning message (1 min before timeout) and a hangup (on timeout) for BOTH digital and analogue lines.
This is the core of the code, reduced to the bone:
var allowedSecs = 300; // max length 5 min …
session.answer();
var sessOut = new Session("sofia/gateway/realtoneFXO/" + dialedNum + "@192.168.0.216:5060");
if (trunkIsDigital) {
sessOut.execute("set", "execute_on_answer_1=sched_hangup " + allowedSects + " alloted_timeout")
sessOut.execute("set", "execute_on_answer_2=sched_broadcast + " + (allowedSects-10) + " playback::" + soundDir + "one_min_left.wav both");
} else {
// will schedule message and hangup on allowedSecs + graceTime to be calculated according to destintation (time to ring/answer)
}
if (sessOut.ready()) {
bridge(session, sessOut);
}
sessOut.hangup();
session.hangup();
/***
HOW LONG DID THE CALL (bridge) ACTUALLY LAST?? .. for billing purposes
**/
Thanks and Happy Easter!
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
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
--
Brian West | Co-founder and Developer Need Commercial support? email sales@freeswitch.com FreeSWITCH Solutions | 17345 Civic Drive #2531 Brookfield, WI 53045 Email: brian@freeswitch.com Mobile: 918-424-9378 Website: https://www.FreeSWITCH.com
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
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