[Freeswitch-svn] [commit] r9641 - in freeswitch/trunk/src: . include
Freeswitch SVN
mikej at freeswitch.org
Wed Sep 24 17:19:30 EDT 2008
Author: mikej
Date: Wed Sep 24 17:19:29 2008
New Revision: 9641
Modified:
freeswitch/trunk/src/include/switch_channel.h
freeswitch/trunk/src/switch_channel.c
Log:
add handy functions
Modified: freeswitch/trunk/src/include/switch_channel.h
==============================================================================
--- freeswitch/trunk/src/include/switch_channel.h (original)
+++ freeswitch/trunk/src/include/switch_channel.h Wed Sep 24 17:19:29 2008
@@ -112,6 +112,9 @@
*/
SWITCH_DECLARE(switch_call_cause_t) switch_channel_get_cause(_In_ switch_channel_t *channel);
+SWITCH_DECLARE(switch_call_cause_t) switch_channel_cause_q850(switch_call_cause_t cause);
+SWITCH_DECLARE(switch_call_cause_t) switch_channel_get_cause_q850(switch_channel_t *channel);
+
/*!
\brief return a cause string for a given cause
\param cause the code to check
Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c (original)
+++ freeswitch/trunk/src/switch_channel.c Wed Sep 24 17:19:29 2008
@@ -165,6 +165,20 @@
return channel->hangup_cause;
}
+SWITCH_DECLARE(switch_call_cause_t) switch_channel_cause_q850(switch_call_cause_t cause)
+{
+ if (cause <= SWITCH_CAUSE_INTERWORKING) {
+ return cause;
+ } else {
+ return SWITCH_CAUSE_NORMAL_CLEARING;
+ }
+}
+
+SWITCH_DECLARE(switch_call_cause_t) switch_channel_get_cause_q850(switch_channel_t *channel)
+{
+ return switch_channel_cause_q850(channel->hangup_cause);
+}
+
SWITCH_DECLARE(switch_channel_timetable_t *) switch_channel_get_timetable(switch_channel_t *channel)
{
switch_channel_timetable_t *times = NULL;
More information about the Freeswitch-svn
mailing list