[asterisk-commits] file: branch file/gulp_connected_line r389949 - in /team/file/gulp_connected_...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue May 28 13:49:39 CDT 2013
Author: file
Date: Tue May 28 13:49:35 2013
New Revision: 389949
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389949
Log:
Allow the method used for sending connected line updates to be configurable.
Modified:
team/file/gulp_connected_line/channels/chan_gulp.c
team/file/gulp_connected_line/include/asterisk/res_sip.h
team/file/gulp_connected_line/res/res_sip.c
team/file/gulp_connected_line/res/res_sip/sip_configuration.c
Modified: team/file/gulp_connected_line/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/file/gulp_connected_line/channels/chan_gulp.c?view=diff&rev=389949&r1=389948&r2=389949
==============================================================================
--- team/file/gulp_connected_line/channels/chan_gulp.c (original)
+++ team/file/gulp_connected_line/channels/chan_gulp.c Tue May 28 13:49:35 2013
@@ -869,7 +869,7 @@
}
}
} else {
- ast_sip_session_refresh(session, NULL, NULL, AST_SIP_SESSION_REFRESH_METHOD_INVITE, 0);
+ ast_sip_session_refresh(session, NULL, NULL, session->endpoint->connected_line_method, 0);
}
return 0;
Modified: team/file/gulp_connected_line/include/asterisk/res_sip.h
URL: http://svnview.digium.com/svn/asterisk/team/file/gulp_connected_line/include/asterisk/res_sip.h?view=diff&rev=389949&r1=389948&r2=389949
==============================================================================
--- team/file/gulp_connected_line/include/asterisk/res_sip.h (original)
+++ team/file/gulp_connected_line/include/asterisk/res_sip.h Tue May 28 13:49:35 2013
@@ -334,6 +334,8 @@
unsigned int direct_media;
/*! When using direct media, which method should be used */
enum ast_sip_session_refresh_method direct_media_method;
+ /*! When performing connected line update, which method should be used */
+ enum ast_sip_session_refresh_method connected_line_method;
/*! Take steps to mitigate glare for direct media */
enum ast_sip_direct_media_glare_mitigation direct_media_glare_mitigation;
/*! Do not attempt direct media session refreshes if a media NAT is detected */
Modified: team/file/gulp_connected_line/res/res_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/file/gulp_connected_line/res/res_sip.c?view=diff&rev=389949&r1=389948&r2=389949
==============================================================================
--- team/file/gulp_connected_line/res/res_sip.c (original)
+++ team/file/gulp_connected_line/res/res_sip.c Tue May 28 13:49:35 2013
@@ -161,6 +161,19 @@
</enumlist>
</description>
</configOption>
+ <configOption name="connected_line_method" default="invite">
+ <synopsis>Connected line method type</synopsis>
+ <description>
+ <para>Method used when updating connected line information.</para>
+ <enumlist>
+ <enum name="invite" />
+ <enum name="reinvite">
+ <para>Alias for the <literal>invite</literal> value.</para>
+ </enum>
+ <enum name="update" />
+ </enumlist>
+ </description>
+ </configOption>
<configOption name="direct_media" default="yes">
<synopsis>Determines whether media may flow directly between endpoints.</synopsis>
</configOption>
Modified: team/file/gulp_connected_line/res/res_sip/sip_configuration.c
URL: http://svnview.digium.com/svn/asterisk/team/file/gulp_connected_line/res/res_sip/sip_configuration.c?view=diff&rev=389949&r1=389948&r2=389949
==============================================================================
--- team/file/gulp_connected_line/res/res_sip/sip_configuration.c (original)
+++ team/file/gulp_connected_line/res/res_sip/sip_configuration.c Tue May 28 13:49:35 2013
@@ -206,6 +206,22 @@
endpoint->direct_media_method = AST_SIP_SESSION_REFRESH_METHOD_INVITE;
} else if (!strcasecmp(var->value, "update")) {
endpoint->direct_media_method = AST_SIP_SESSION_REFRESH_METHOD_UPDATE;
+ } else {
+ ast_log(LOG_NOTICE, "Unrecognized option value %s for %s on endpoint %s\n",
+ var->value, var->name, ast_sorcery_object_get_id(endpoint));
+ return -1;
+ }
+ return 0;
+}
+
+static int connected_line_method_handler(const struct aco_option *opt, struct ast_variable *var, void *obj)
+{
+ struct ast_sip_endpoint *endpoint = obj;
+
+ if (!strcasecmp(var->value, "invite") || !strcasecmp(var->value, "reinvite")) {
+ endpoint->connected_line_method = AST_SIP_SESSION_REFRESH_METHOD_INVITE;
+ } else if (!strcasecmp(var->value, "update")) {
+ endpoint->connected_line_method = AST_SIP_SESSION_REFRESH_METHOD_UPDATE;
} else {
ast_log(LOG_NOTICE, "Unrecognized option value %s for %s on endpoint %s\n",
var->value, var->name, ast_sorcery_object_get_id(endpoint));
@@ -357,6 +373,7 @@
ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "identify_by", "username,location", ident_handler, NULL, 0, 0);
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "direct_media", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, direct_media));
ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "direct_media_method", "invite", direct_media_method_handler, NULL, 0, 0);
+ ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "connected_line_method", "invite", connected_line_method_handler, NULL, 0, 0);
ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "direct_media_glare_mitigation", "none", direct_media_glare_mitigation_handler, NULL, 0, 0);
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "disable_direct_media_on_nat", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, disable_direct_media_on_nat));
ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "callerid", "", caller_id_handler, NULL, 0, 0);
More information about the asterisk-commits
mailing list