aboutsummaryrefslogtreecommitdiffstats
path: root/main/channel.c
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-10 21:03:06 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-10 21:03:06 +0000
commit07094e658f691018506eb0522b474fc34aefc57a (patch)
tree840731f195d04156927db8b87fdab53985d09e2f /main/channel.c
parent2e08c0f96992df307f76c1bcf8ee71cb1dda8421 (diff)
Merged revisions 79099 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r79099 | murf | 2007-08-10 14:53:43 -0600 (Fri, 10 Aug 2007) | 1 line From a user complaint on #asterisk, I have forced pbx_spool to explain what reason codes mean, when they are logged ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79100 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c
index 26f9da5f7..cd2202fd4 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2919,6 +2919,29 @@ int ast_set_write_format(struct ast_channel *chan, int fmt)
&chan->writetrans, 1);
}
+char *ast_channel_reason2str(int reason)
+{
+ switch (reason) /* the following appear to be the only ones actually returned by request_and_dial */
+ {
+ case 0:
+ return "Call Failure (not BUSY, and not NO_ANSWER, maybe Circuit busy or down?)";
+ case AST_CONTROL_HANGUP:
+ return "Hangup";
+ case AST_CONTROL_RING:
+ return "Local Ring";
+ case AST_CONTROL_RINGING:
+ return "Remote end Ringing";
+ case AST_CONTROL_ANSWER:
+ return "Remote end has Answered";
+ case AST_CONTROL_BUSY:
+ return "Remote end is Busy";
+ case AST_CONTROL_CONGESTION:
+ return "Congestion (circuits busy)";
+ default:
+ return "Unknown Reason!!";
+ }
+}
+
struct ast_channel *__ast_request_and_dial(const char *type, int format, void *data, int timeout, int *outstate, const char *cid_num, const char *cid_name, struct outgoing_helper *oh)
{
int dummy_outstate;