Page 1 of 1

access to call length mins secs - session variable?

Posted: Mon Jun 05, 2006 12:44 am
by sweetp123
how do i access the length of the actual call outside of the session logs. I want to record the length of the call when the user disconnects - is that possible?
is there some way to call a subdialog when the exit call is made or when the user just hangs up?

IVR issue resolved using javascript

Posted: Tue Jun 06, 2006 11:07 am
by support
You can use the javascript Date object to get a start and stop timestamp.

You can create a convenience function in JS like so which will return the number of seconds that have elapsed since 1/1/1970 at midnight:

Code: Select all

<script>
		function GetTimeInSeconds()
		{
			return Math.round((new Date().getTime()/1000));
		}
</script>
If you want to, say, capture the timestamp at disconnect, you could do this javascript code in conjunction with the <catch> tag in IVR:

Code: Select all

<var name="TimeEndContent" expr="" />
	<catch event="connection.disconnect.hangup">
			<!-- when doing this assign, concatenate the timestamp with the empty string to implicitly convert the timestamp to a string; -->
			<!-- otherwise, BAD things can happen when/if we try to submit the timestamp to another page as a GET variable  -->
			<assign name="TimeEndContent" expr="GetTimeInSeconds() + ''" />
			<log>
				ended Stop content at <value expr="TimeEndContent" />
			</log>
	</catch>

Posted: Tue Jun 06, 2006 10:29 pm
by sweetp123
well i didn't use js but i did something similar with my application in recording the time when they login and then again when they choose to disconnect or when the disconnect.hangup routine is triggered. this seems like a lot of 'patching' for something that is available in the session logs but not as a session variable that can be accessed using vxml?

If you don't mind me asking - are you planning to implement this - if not then why? is there a reason it is not available?

no plan to implement session length variable in IVR platform

Posted: Wed Jun 07, 2006 9:19 am
by support
There is currently no plan to implement an IVR session length variable in the Plum IVR Platform. We will, however, pass this request on to the IVR platform dev team for feature request review.

Posted: Sun Mar 11, 2007 10:06 am
by ocbermudez
I would to like to know if PLUM team has seen this requirement and if they have some news about that. (like date of implementation)
I think that we can do it our script, but we are doing 2 times the same work, because PLUM do that for you system, and each client has to do that for the client system and never it will be the same time (small difference we will have in client time). An easy and logic way could be that PLUM put in the session variable or send it in the callback result_url this value. May be PLUM has to analyze this more in detail.
Thanks.
Omar.

no plans to implement feature with IVR platform

Posted: Mon Mar 12, 2007 9:10 am
by support
There are currently no plans to implement this feature in the near future as the data you seek can already be captured with the simple IVR scripting example below.