Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
0bedd436
Commit
0bedd436
authored
7 years ago
by
Joshua Colp
Committed by
Gerrit Code Review
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge "app_originate: Set ORIGINATE_STATUS correctly on failure"
parents
45756b49
3ad7d2f3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/app_originate.c
+23
-9
23 additions, 9 deletions
apps/app_originate.c
with
23 additions
and
9 deletions
apps/app_originate.c
+
23
−
9
View file @
0bedd436
...
...
@@ -155,6 +155,7 @@ static int originate_exec(struct ast_channel *chan, const char *data)
char
*
parse
;
char
*
chantech
,
*
chandata
;
int
res
=
-
1
;
int
continue_in_dialplan
=
0
;
int
outgoing_status
=
0
;
unsigned
int
timeout
=
30
;
static
const
char
default_exten
[]
=
"s"
;
...
...
@@ -223,6 +224,12 @@ static int originate_exec(struct ast_channel *chan, const char *data)
predial_callee
=
opt_args
[
OPT_ARG_PREDIAL_CALLEE
];
}
if
(
strcasecmp
(
args
.
type
,
"exten"
)
&&
strcasecmp
(
args
.
type
,
"app"
))
{
ast_log
(
LOG_ERROR
,
"Incorrect type, it should be 'exten' or 'app': %s
\n
"
,
args
.
type
);
goto
return_cleanup
;
}
if
(
!
strcasecmp
(
args
.
type
,
"exten"
))
{
int
priority
=
1
;
/* Initialized in case priority not specified */
const
char
*
exten
=
args
.
arg2
;
...
...
@@ -241,25 +248,32 @@ static int originate_exec(struct ast_channel *chan, const char *data)
ast_debug
(
1
,
"Originating call to '%s/%s' and connecting them to extension %s,%s,%d
\n
"
,
chantech
,
chandata
,
args
.
arg1
,
exten
,
priority
);
ast_pbx_outgoing_exten_predial
(
chantech
,
cap_slin
,
chandata
,
res
=
ast_pbx_outgoing_exten_predial
(
chantech
,
cap_slin
,
chandata
,
timeout
*
1000
,
args
.
arg1
,
exten
,
priority
,
&
outgoing_status
,
AST_OUTGOING_WAIT
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
0
,
NULL
,
predial_callee
);
}
else
if
(
!
strcasecmp
(
args
.
type
,
"app"
))
{
}
else
{
ast_debug
(
1
,
"Originating call to '%s/%s' and connecting them to %s(%s)
\n
"
,
chantech
,
chandata
,
args
.
arg1
,
S_OR
(
args
.
arg2
,
""
));
ast_pbx_outgoing_app_predial
(
chantech
,
cap_slin
,
chandata
,
res
=
ast_pbx_outgoing_app_predial
(
chantech
,
cap_slin
,
chandata
,
timeout
*
1000
,
args
.
arg1
,
args
.
arg2
,
&
outgoing_status
,
AST_OUTGOING_WAIT
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
predial_callee
);
}
else
{
ast_log
(
LOG_ERROR
,
"Incorrect type, it should be 'exten' or 'app': %s
\n
"
,
args
.
type
);
goto
return_cleanup
;
}
res
=
0
;
/*
* Getting here means that we have passed the various validation checks and
* have at least attempted the dial. If we have a reason (outgoing_status),
* we clear our error indicator so that we ultimately report the right thing
* to the caller.
*/
if
(
res
&&
outgoing_status
)
{
res
=
0
;
}
/* We need to exit cleanly if we've gotten this far */
continue_in_dialplan
=
1
;
return_cleanup:
if
(
res
)
{
...
...
@@ -292,7 +306,7 @@ return_cleanup:
ao2_cleanup
(
cap_slin
);
ast_autoservice_stop
(
chan
);
return
res
;
return
continue_in_dialplan
?
0
:
-
1
;
}
static
int
unload_module
(
void
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment