[asterisk-commits] file: branch file/pimp_sip_location r381280 - in /team/file/pimp_sip_location...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Feb 12 14:09:18 CST 2013
Author: file
Date: Tue Feb 12 14:09:15 2013
New Revision: 381280
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=381280
Log:
For defined locations allow configuration of whether the user portion of the request URI can be changed or not.
Modified:
team/file/pimp_sip_location/include/asterisk/res_sip.h
team/file/pimp_sip_location/res/res_sip.c
team/file/pimp_sip_location/res/res_sip/location.c
Modified: team/file/pimp_sip_location/include/asterisk/res_sip.h
URL: http://svnview.digium.com/svn/asterisk/team/file/pimp_sip_location/include/asterisk/res_sip.h?view=diff&rev=381280&r1=381279&r2=381280
==============================================================================
--- team/file/pimp_sip_location/include/asterisk/res_sip.h (original)
+++ team/file/pimp_sip_location/include/asterisk/res_sip.h Tue Feb 12 14:09:15 2013
@@ -124,6 +124,8 @@
/*! Optional explicit transport to use */
AST_STRING_FIELD(transport);
);
+ /*! Whether the user portion of the request URI is permitted to be changed or not */
+ unsigned int change_user;
/*! Absolute time that this location is valid until */
time_t expiration_time;
};
Modified: team/file/pimp_sip_location/res/res_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/file/pimp_sip_location/res/res_sip.c?view=diff&rev=381280&r1=381279&r2=381280
==============================================================================
--- team/file/pimp_sip_location/res/res_sip.c (original)
+++ team/file/pimp_sip_location/res/res_sip.c Tue Feb 12 14:09:15 2013
@@ -346,7 +346,8 @@
dlg->local.contact = pjsip_parse_hdr(dlg->pool, &HCONTACT, local_uri.ptr, local_uri.slen, NULL);
/* If a request user has been specified and we are permitted to change it, do so */
- if (!ast_strlen_zero(request_user) && (PJSIP_URI_SCHEME_IS_SIP(dlg->target) || PJSIP_URI_SCHEME_IS_SIPS(dlg->target))) {
+ if (!ast_strlen_zero(request_user) && (!location || location->change_user) &&
+ (PJSIP_URI_SCHEME_IS_SIP(dlg->target) || PJSIP_URI_SCHEME_IS_SIPS(dlg->target))) {
pjsip_sip_uri *target = pjsip_uri_get_uri(dlg->target);
pj_strdup2(dlg->pool, &target->user, request_user);
}
Modified: team/file/pimp_sip_location/res/res_sip/location.c
URL: http://svnview.digium.com/svn/asterisk/team/file/pimp_sip_location/res/res_sip/location.c?view=diff&rev=381280&r1=381279&r2=381280
==============================================================================
--- team/file/pimp_sip_location/res/res_sip/location.c (original)
+++ team/file/pimp_sip_location/res/res_sip/location.c Tue Feb 12 14:09:15 2013
@@ -64,6 +64,7 @@
ast_sorcery_object_field_register(sorcery, "location", "type", "", OPT_NOOP_T, 0, 0);
ast_sorcery_object_field_register(sorcery, "location", "uri", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_location, uri));
ast_sorcery_object_field_register(sorcery, "location", "transport", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_location, transport));
+ ast_sorcery_object_field_register(sorcery, "location", "change_user", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_location, change_user));
return 0;
}
More information about the asterisk-commits
mailing list