Where the caller hung up
Posted: Thu Apr 26, 2007 2:48 am
I want to know where the caller hung up during the call. My first thought was to pepper the code with:
<var name="hungup" expr="'got to A'" />
...
<var name="hungup" expr="'got to B'" />
Then use the "hungup" var with <catch> to know where they hung up. Unfortunately, the script keeps running when a caller hangs up, which always sets the hungup var to the very last value. So my next idea was to conditionally set it:
<if cond="_event != 'connection.disconnect.hangup'">
<var name="hungup" expr="'got to B'" />
</if>
That way, if a hangup occurred, only the appropriate var would be set. But that results in a semantic error. My guess is the _event var is only available within <catch>.
So I'm looking for other ideas that don't involved chopping my <form> into a bazillion little forms to be able to capture the point where the call ended. Is there a way to have the script abort immediately? Is there a way to conditionally test if an event has occurred outside of <catch>?
Thanks in advance.
- Bil
<var name="hungup" expr="'got to A'" />
...
<var name="hungup" expr="'got to B'" />
Then use the "hungup" var with <catch> to know where they hung up. Unfortunately, the script keeps running when a caller hangs up, which always sets the hungup var to the very last value. So my next idea was to conditionally set it:
<if cond="_event != 'connection.disconnect.hangup'">
<var name="hungup" expr="'got to B'" />
</if>
That way, if a hangup occurred, only the appropriate var would be set. But that results in a semantic error. My guess is the _event var is only available within <catch>.
So I'm looking for other ideas that don't involved chopping my <form> into a bazillion little forms to be able to capture the point where the call ended. Is there a way to have the script abort immediately? Is there a way to conditionally test if an event has occurred outside of <catch>?
Thanks in advance.
- Bil