dect
/
asterisk
Archived
13
0
Fork 0

Fix add include (bug #966) and small update to bug 890

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2103 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
markster 2004-01-31 20:22:25 +00:00
parent 2a39386ffc
commit c050b2ae99
2 changed files with 6 additions and 5 deletions

View File

@ -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) {

View File

@ -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;
}