diff options
author | Joshua Colp <jcolp@digium.com> | 2014-11-15 21:36:44 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2014-11-15 21:36:44 +0000 |
commit | ece61f5ed1c88f097535cdceb91ce3c80b98adfb (patch) | |
tree | 00c91b830f96a24fb1e981403963c56e315c8373 /channels | |
parent | 49e63a191dd11e498e0c76e931b6823619f84c33 (diff) |
chan_pjsip: Add additional log message when an AOR is specified when dialing and it does not exist.
ASTERISK-24499 #close
Reported by: Rusty Newton
........
Merged revisions 428007 from http://svn.asterisk.org/svn/asterisk/branches/12
........
Merged revisions 428008 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@428009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_pjsip.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c index 87ecabeaf..03df0077f 100644 --- a/channels/chan_pjsip.c +++ b/channels/chan_pjsip.c @@ -1792,6 +1792,7 @@ static int request(void *obj) struct ast_sip_session *session = 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_aor *aor = NULL; AST_DECLARE_APP_ARGS(args, AST_APP_ARG(endpoint); @@ -1821,9 +1822,16 @@ static int request(void *obj) 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; return -1; + } else if (!ast_strlen_zero(args.aor) && (!(aor = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "aor", args.aor)))) { + ast_log(LOG_ERROR, "Unable to create PJSIP channel - AOR '%s' was not found\n", args.aor); + req_data->cause = AST_CAUSE_NO_ROUTE_DESTINATION; + return -1; } + ao2_cleanup(aor); + if (!(session = ast_sip_session_create_outgoing(endpoint, NULL, args.aor, request_user, req_data->caps))) { + ast_log(LOG_ERROR, "Failed to create outgoing session to endpoint '%s'\n", endpoint_name); req_data->cause = AST_CAUSE_NO_ROUTE_DESTINATION; return -1; } |