correct handling of get_destination return values

A failure when calling the get_destination can mean multiple things.  If
the extension is not found, a 404 error is appropriate, but if the URI
scheme is incorrect, a 404 is not approperiate.  This patch adds the
get_destination_result enum to differentiate between these and other failure
types.  The only logical difference in this patch is that we now send a "416
Unsupported URI scheme" response instead of a "404" when the scheme is not
recognized.  This indicates to the initiator of the INVITE to retry the request
with a correct URI. 



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@273427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
David Vossel
2010-07-01 16:40:17 +00:00
parent bd9ff2829e
commit 243d87038e
2 changed files with 55 additions and 29 deletions

View File

@@ -449,6 +449,15 @@ enum sip_auth_type {
WWW_AUTH = 401,
};
/*! \brief Result from get_destination function */
enum sip_get_dest_result {
SIP_GET_DEST_PICKUP_EXTEN_FOUND = 1,
SIP_GET_DEST_EXTEN_FOUND = 0,
SIP_GET_DEST_EXTEN_NOT_FOUND = -1,
SIP_GET_DEST_REFUSED = -2,
SIP_GET_DEST_INVALID_URI = -3,
};
/*! \brief Authentication result from check_auth* functions */
enum check_auth_result {
AUTH_DONT_KNOW = -100, /*!< no result, need to check further */