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
e79f0c07
Commit
e79f0c07
authored
7 years ago
by
Jenkins2
Committed by
Gerrit Code Review
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge "chan_pjsip.c: Improve ast_request() diagnostic msgs."
parents
f2d23e86
4a461bcd
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
channels/chan_pjsip.c
+36
-10
36 additions, 10 deletions
channels/chan_pjsip.c
with
36 additions
and
10 deletions
channels/chan_pjsip.c
+
36
−
10
View file @
e79f0c07
...
@@ -2381,7 +2381,7 @@ static int request(void *obj)
...
@@ -2381,7 +2381,7 @@ static int request(void *obj)
struct
request_data
*
req_data
=
obj
;
struct
request_data
*
req_data
=
obj
;
struct
ast_sip_session
*
session
=
NULL
;
struct
ast_sip_session
*
session
=
NULL
;
char
*
tmp
=
ast_strdupa
(
req_data
->
dest
),
*
endpoint_name
=
NULL
,
*
request_user
=
NULL
;
char
*
tmp
=
ast_strdupa
(
req_data
->
dest
),
*
endpoint_name
=
NULL
,
*
request_user
=
NULL
;
RAII_VAR
(
struct
ast_sip_endpoint
*
,
endpoint
,
NULL
,
ao2_cleanup
)
;
struct
ast_sip_endpoint
*
endpoint
;
AST_DECLARE_APP_ARGS
(
args
,
AST_DECLARE_APP_ARGS
(
args
,
AST_APP_ARG
(
endpoint
);
AST_APP_ARG
(
endpoint
);
...
@@ -2406,10 +2406,18 @@ static int request(void *obj)
...
@@ -2406,10 +2406,18 @@ static int request(void *obj)
}
}
if
(
ast_strlen_zero
(
endpoint_name
))
{
if
(
ast_strlen_zero
(
endpoint_name
))
{
ast_log
(
LOG_ERROR
,
"Unable to create PJSIP channel with empty endpoint name
\n
"
);
if
(
request_user
)
{
ast_log
(
LOG_ERROR
,
"Unable to create PJSIP channel with empty endpoint name: %s@<endpoint-name>
\n
"
,
request_user
);
}
else
{
ast_log
(
LOG_ERROR
,
"Unable to create PJSIP channel with empty endpoint name
\n
"
);
}
req_data
->
cause
=
AST_CAUSE_CHANNEL_UNACCEPTABLE
;
req_data
->
cause
=
AST_CAUSE_CHANNEL_UNACCEPTABLE
;
return
-
1
;
return
-
1
;
}
else
if
(
!
(
endpoint
=
ast_sorcery_retrieve_by_id
(
ast_sip_get_sorcery
(),
"endpoint"
,
endpoint_name
)))
{
}
endpoint
=
ast_sorcery_retrieve_by_id
(
ast_sip_get_sorcery
(),
"endpoint"
,
endpoint_name
);
if
(
!
endpoint
)
{
ast_log
(
LOG_ERROR
,
"Unable to create PJSIP channel - endpoint '%s' was not found
\n
"
,
endpoint_name
);
ast_log
(
LOG_ERROR
,
"Unable to create PJSIP channel - endpoint '%s' was not found
\n
"
,
endpoint_name
);
req_data
->
cause
=
AST_CAUSE_NO_ROUTE_DESTINATION
;
req_data
->
cause
=
AST_CAUSE_NO_ROUTE_DESTINATION
;
return
-
1
;
return
-
1
;
...
@@ -2421,23 +2429,38 @@ static int request(void *obj)
...
@@ -2421,23 +2429,38 @@ static int request(void *obj)
ast_log
(
LOG_ERROR
,
"Unable to create PJSIP channel with empty endpoint name
\n
"
);
ast_log
(
LOG_ERROR
,
"Unable to create PJSIP channel with empty endpoint name
\n
"
);
req_data
->
cause
=
AST_CAUSE_CHANNEL_UNACCEPTABLE
;
req_data
->
cause
=
AST_CAUSE_CHANNEL_UNACCEPTABLE
;
return
-
1
;
return
-
1
;
}
else
if
(
!
(
endpoint
=
ast_sorcery_retrieve_by_id
(
ast_sip_get_sorcery
(),
"endpoint"
,
endpoint_name
)))
{
}
endpoint
=
ast_sorcery_retrieve_by_id
(
ast_sip_get_sorcery
(),
"endpoint"
,
endpoint_name
);
if
(
!
endpoint
)
{
/* It seems it's not a multi-domain endpoint or single endpoint exact match,
/* It seems it's not a multi-domain endpoint or single endpoint exact match,
* it's possible that it's a SIP trunk with a specified user (user@trunkname),
* it's possible that it's a SIP trunk with a specified user (user@trunkname),
* so extract the user before @ sign.
* so extract the user before @ sign.
*/
*/
if
((
endpoint_name
=
strchr
(
args
.
endpoint
,
'@'
)))
{
endpoint_name
=
strchr
(
args
.
endpoint
,
'@'
);
request_user
=
args
.
endpoint
;
if
(
!
endpoint_name
)
{
*
endpoint_name
++
=
'\0'
;
/*
* Couldn't find an '@' so it had to be an endpoint
* name that doesn't exist.
*/
ast_log
(
LOG_ERROR
,
"Unable to create PJSIP channel - endpoint '%s' was not found
\n
"
,
args
.
endpoint
);
req_data
->
cause
=
AST_CAUSE_NO_ROUTE_DESTINATION
;
return
-
1
;
}
}
request_user
=
args
.
endpoint
;
*
endpoint_name
++
=
'\0'
;
if
(
ast_strlen_zero
(
endpoint_name
))
{
if
(
ast_strlen_zero
(
endpoint_name
))
{
ast_log
(
LOG_ERROR
,
"Unable to create PJSIP channel with empty endpoint name
\n
"
);
ast_log
(
LOG_ERROR
,
"Unable to create PJSIP channel with empty endpoint name: %s@<endpoint-name>
\n
"
,
request_user
);
req_data
->
cause
=
AST_CAUSE_CHANNEL_UNACCEPTABLE
;
req_data
->
cause
=
AST_CAUSE_CHANNEL_UNACCEPTABLE
;
return
-
1
;
return
-
1
;
}
}
if
(
!
(
endpoint
=
ast_sorcery_retrieve_by_id
(
ast_sip_get_sorcery
(),
"endpoint"
,
endpoint_name
)))
{
endpoint
=
ast_sorcery_retrieve_by_id
(
ast_sip_get_sorcery
(),
"endpoint"
,
endpoint_name
);
if
(
!
endpoint
)
{
ast_log
(
LOG_ERROR
,
"Unable to create PJSIP channel - endpoint '%s' was not found
\n
"
,
endpoint_name
);
ast_log
(
LOG_ERROR
,
"Unable to create PJSIP channel - endpoint '%s' was not found
\n
"
,
endpoint_name
);
req_data
->
cause
=
AST_CAUSE_NO_ROUTE_DESTINATION
;
req_data
->
cause
=
AST_CAUSE_NO_ROUTE_DESTINATION
;
return
-
1
;
return
-
1
;
...
@@ -2445,7 +2468,10 @@ static int request(void *obj)
...
@@ -2445,7 +2468,10 @@ static int request(void *obj)
}
}
}
}
if
(
!
(
session
=
ast_sip_session_create_outgoing
(
endpoint
,
NULL
,
args
.
aor
,
request_user
,
req_data
->
topology
)))
{
session
=
ast_sip_session_create_outgoing
(
endpoint
,
NULL
,
args
.
aor
,
request_user
,
req_data
->
topology
);
ao2_ref
(
endpoint
,
-
1
);
if
(
!
session
)
{
ast_log
(
LOG_ERROR
,
"Failed to create outgoing session to endpoint '%s'
\n
"
,
endpoint_name
);
ast_log
(
LOG_ERROR
,
"Failed to create outgoing session to endpoint '%s'
\n
"
,
endpoint_name
);
req_data
->
cause
=
AST_CAUSE_NO_ROUTE_DESTINATION
;
req_data
->
cause
=
AST_CAUSE_NO_ROUTE_DESTINATION
;
return
-
1
;
return
-
1
;
...
...
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