We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

access to call length mins secs - session variable?

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
sweetp123
Posts: 16
Joined: Wed May 24, 2006 9:22 am

access to call length mins secs - session variable?

Post 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?

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

IVR issue resolved using javascript

Post 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>
Last edited by support on Wed Jan 13, 2010 4:09 pm, edited 3 times in total.

sweetp123
Posts: 16
Joined: Wed May 24, 2006 9:22 am

Post 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?

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

no plan to implement session length variable in IVR platform

Post 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.
Last edited by support on Wed Feb 24, 2010 5:54 pm, edited 3 times in total.

ocbermudez
Posts: 34
Joined: Tue Aug 08, 2006 10:00 am

Post 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.

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

no plans to implement feature with IVR platform

Post 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.

Post Reply