diff options
author | Mark Michelson <mmichelson@digium.com> | 2015-09-04 14:40:38 -0500 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2015-09-04 14:48:20 -0500 |
commit | 993ae9a669778aa9e8edcc42e3183b12e80a4d69 (patch) | |
tree | 59c42f389987c0fe19da53e784c6765fa80780e7 /res/res_pjsip.c | |
parent | c15d8cc0ed110ace9e85cce0857524358139c075 (diff) |
res_pjsip: Change default from user value.
When Asterisk sends an outbound SIP request, if there is no direct
reason to place a specific value for the username in the From header,
Asterisk would generate a UUID. For example, this would happen when
sending outbound OPTIONS requests when qualifying or when sending
outbound INVITE requests when originating (if no explicit caller ID were
provided). The issue is that some SIP providers reject these sorts of
requests with a "Name too long" error response.
This patch aims to fix this by changing the default outbound username in
From headers to "asterisk". This value can be overridden by changing the
default_from_user option in the global options if desired.
ASTERISK-25377 #close
Reported by Mark Michelson
Change-Id: I6a4d34a56ff73ff4f661b0075aeba5461b7f3190
Diffstat (limited to 'res/res_pjsip.c')
-rw-r--r-- | res/res_pjsip.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c index b8463cecd..4af886b4b 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -1286,6 +1286,11 @@ Identifier names are usually derived from and can be found in the endpoint identifier module itself (res_pjsip_endpoint_identifier_*)</synopsis> </configOption> + <configOption name="default_from_user" default="asterisk"> + <synopsis>When Asterisk generates an outgoing SIP request, the From header username will be + set to this value if there is no better option (such as CallerID) to be + used.</synopsis> + </configOption> </configObject> </configFile> </configInfo> @@ -2333,10 +2338,9 @@ static int sip_dialog_create_from(pj_pool_t *pool, pj_str_t *from, const char *u pjsip_sip_uri *sip_uri; pjsip_transport_type_e type = PJSIP_TRANSPORT_UNSPECIFIED; int local_port; - char uuid_str[AST_UUID_STR_LEN]; if (ast_strlen_zero(user)) { - user = ast_uuid_generate_str(uuid_str, sizeof(uuid_str)); + user = ast_sip_get_default_from_user(); } /* Parse the provided target URI so we can determine what transport it will end up using */ |