Fix add include (bug #966) and small update to bug 890
authorMark Spencer <markster@digium.com>
Sat, 31 Jan 2004 20:22:25 +0000 (20:22 +0000)
committerMark Spencer <markster@digium.com>
Sat, 31 Jan 2004 20:22:25 +0000 (20:22 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2103 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_zap.c
pbx/pbx_config.c

index 3114410..31a4113 100755 (executable)
@@ -6472,6 +6472,7 @@ static void *pri_dchannel(void *vpri)
                                                if (!pri->pvt[chan]->alreadyhungup) {
                                                        /* we're calling here zt_hangup so once we get there we need to clear p->call after calling pri_hangup */
                                                        pri->pvt[chan]->alreadyhungup = 1;
+                                                       pri->pvt[chan]->owner->hangupcause = hangup_pri2cause(e->hangup.cause);
                                                        /* Queue a BUSY instead of a hangup if our cause is appropriate */
                                                        if (pri->pvt[chan]->owner) {
                                                                switch(e->hangup.cause) {
index 7f7af1b..e017be7 100755 (executable)
@@ -689,12 +689,12 @@ static char *complete_context_remove_extension(char *line, char *word, int pos,
  */
 static int handle_context_add_include(int fd, int argc, char *argv[])
 {
-       if (argc != 4) return RESULT_SHOWUSAGE;
+       if (argc != 5) return RESULT_SHOWUSAGE;
 
        /* third arg must be 'in' ... */
-       if (strcmp(argv[2], "in")) return RESULT_SHOWUSAGE;
+       if (strcmp(argv[3], "in")) return RESULT_SHOWUSAGE;
 
-       if (ast_context_add_include(argv[3], argv[1], registrar)) {
+       if (ast_context_add_include(argv[4], argv[2], registrar)) {
                switch (errno) {
                        case ENOMEM:
                                ast_cli(fd, "Out of memory for context addition\n"); break;
@@ -709,7 +709,7 @@ static int handle_context_add_include(int fd, int argc, char *argv[])
                        case ENOENT:
                        case EINVAL:
                                ast_cli(fd, "There is no existence of context '%s'\n",
-                                       errno == ENOENT ? argv[3] : argv[1]); break;
+                                       errno == ENOENT ? argv[4] : argv[2]); break;
 
                        default:
                                ast_cli(fd, "Failed to include '%s' in '%s' context\n",
@@ -720,7 +720,7 @@ static int handle_context_add_include(int fd, int argc, char *argv[])
 
        /* show some info ... */
        ast_cli(fd, "Context '%s' included in '%s' context\n",
-               argv[1], argv[3]);
+               argv[2], argv[3]);
 
        return RESULT_SUCCESS;
 }