[asterisk-commits] mmichelson: branch mmichelson/sip_options r393997 - in /team/mmichelson/sip_o...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 10 12:46:08 CDT 2013


Author: mmichelson
Date: Wed Jul 10 12:46:07 2013
New Revision: 393997

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=393997
Log:
Add "sdpowner" and "sdpsession" endpoint options.


Modified:
    team/mmichelson/sip_options/include/asterisk/res_sip.h
    team/mmichelson/sip_options/res/res_sip.c
    team/mmichelson/sip_options/res/res_sip/sip_configuration.c
    team/mmichelson/sip_options/res/res_sip_session.c

Modified: team/mmichelson/sip_options/include/asterisk/res_sip.h
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/sip_options/include/asterisk/res_sip.h?view=diff&rev=393997&r1=393996&r2=393997
==============================================================================
--- team/mmichelson/sip_options/include/asterisk/res_sip.h (original)
+++ team/mmichelson/sip_options/include/asterisk/res_sip.h Wed Jul 10 12:46:07 2013
@@ -333,6 +333,10 @@
 		AST_STRING_FIELD(recordonfeature);
 		/*! Feature to enact when one-touch recording INFO with Record: Off is received */
 		AST_STRING_FIELD(recordofffeature);
+		/*! SDP origin username */
+		AST_STRING_FIELD(sdpowner);
+		/*! SDP session name */
+		AST_STRING_FIELD(sdpsession);
 	);
 	/*! Identification information for this endpoint */
 	struct ast_party_id id;

Modified: team/mmichelson/sip_options/res/res_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/sip_options/res/res_sip.c?view=diff&rev=393997&r1=393996&r2=393997
==============================================================================
--- team/mmichelson/sip_options/res/res_sip.c (original)
+++ team/mmichelson/sip_options/res/res_sip.c Wed Jul 10 12:46:07 2013
@@ -431,6 +431,12 @@
 				<configOption name="allowtransfer" default="yes">
 					<synopsis>Determines whether SIP REFER transfers are allowed for this endpoint</synopsis>
 				</configOption>
+				<configOption name="sdpowner" default="-">
+					<synopsis>String placed as the username portion of an SDP origin (o=) line.</synopsis>
+				</configOption>
+				<configOption name="sdpsession" default="Asterisk">
+					<synopsis>String used for the SDP session (s=) line.</synopsis>
+				</configOption>
 			</configObject>
 			<configObject name="auth">
 				<synopsis>Authentication type</synopsis>

Modified: team/mmichelson/sip_options/res/res_sip/sip_configuration.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/sip_options/res/res_sip/sip_configuration.c?view=diff&rev=393997&r1=393996&r2=393997
==============================================================================
--- team/mmichelson/sip_options/res/res_sip/sip_configuration.c (original)
+++ team/mmichelson/sip_options/res/res_sip/sip_configuration.c Wed Jul 10 12:46:07 2013
@@ -664,6 +664,8 @@
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "recordonfeature", "automixmon", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, recordonfeature));
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "recordofffeature", "automixmon", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, recordofffeature));
 	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "allowtransfer", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, allowtransfer));
+	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "sdpowner", "-", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, sdpowner));
+	ast_sorcery_object_field_register(sip_sorcery, "endpoint", "sdpsession", "Asterisk", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, sdpsession));
 
 	if (ast_sip_initialize_sorcery_transport(sip_sorcery)) {
 		ast_log(LOG_ERROR, "Failed to register SIP transport support with sorcery\n");

Modified: team/mmichelson/sip_options/res/res_sip_session.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/sip_options/res/res_sip_session.c?view=diff&rev=393997&r1=393996&r2=393997
==============================================================================
--- team/mmichelson/sip_options/res/res_sip_session.c (original)
+++ team/mmichelson/sip_options/res/res_sip_session.c Wed Jul 10 12:46:07 2013
@@ -1752,7 +1752,6 @@
 static struct pjmedia_sdp_session *create_local_sdp(pjsip_inv_session *inv, struct ast_sip_session *session, const pjmedia_sdp_session *offer)
 {
 	RAII_VAR(struct ao2_iterator *, successful, NULL, ao2_iterator_cleanup);
-	static const pj_str_t STR_ASTERISK = { "Asterisk", 8 };
 	static const pj_str_t STR_IN = { "IN", 2 };
 	static const pj_str_t STR_IP4 = { "IP4", 3 };
 	static const pj_str_t STR_IP6 = { "IP6", 3 };
@@ -1769,11 +1768,11 @@
 		local->origin.id = offer->origin.id;
 	}
 
-	local->origin.user = STR_ASTERISK;
+	pj_strdup2(inv->pool, &local->origin.user, session->endpoint->sdpowner);
 	local->origin.net_type = STR_IN;
 	local->origin.addr_type = session->endpoint->rtp_ipv6 ? STR_IP6 : STR_IP4;
 	local->origin.addr = *pj_gethostname();
-	local->name = local->origin.user;
+	pj_strdup2(inv->pool, &local->name, session->endpoint->sdpsession);
 
 	/* Now let the handlers add streams of various types, pjmedia will automatically reorder the media streams for us */
 	successful = ao2_callback_data(session->media, OBJ_MULTIPLE, add_sdp_streams, local, session);




More information about the asterisk-commits mailing list