Add PRI_CAUSE feature for PRI ... If you set PRI_CAUSE=17 with SetVar and then call...
authorMartin Pycko <martinp@digium.com>
Wed, 5 Nov 2003 16:48:38 +0000 (16:48 +0000)
committerMartin Pycko <martinp@digium.com>
Wed, 5 Nov 2003 16:48:38 +0000 (16:48 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1696 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c

index 3d92949..c68bf8e 100755 (executable)
@@ -1797,8 +1797,14 @@ static int zt_hangup(struct ast_channel *ast)
                                                pri_hangup(p->pri->pri, p->call, -1);
                                                p->call = NULL;
                                        } else {
+                                               char *cause = pbx_builtin_getvar_helper(ast,"PRI_CAUSE");
+                                               int icause = ast->hangupcause ? hangup_cause2pri(ast->hangupcause) : -1;
                                                p->alreadyhungup = 1;
-                                               pri_hangup(p->pri->pri, p->call, ast->hangupcause ? hangup_cause2pri(ast->hangupcause) : -1);
+                                               if (cause) {
+                                                       if (atoi(cause))
+                                                               icause = atoi(cause);
+                                               }
+                                               pri_hangup(p->pri->pri, p->call, icause);
                                        }
 #endif
                                        if (res < 0)