[asterisk-commits] file: branch group/pimp_my_sip r389846 - in /team/group/pimp_my_sip: channels...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue May 28 09:19:06 CDT 2013
Author: file
Date: Tue May 28 09:18:47 2013
New Revision: 389846
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389846
Log:
Add support for sending ringing as inband media.
(closes issue ASTERISK-21507)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2560/
Modified:
team/group/pimp_my_sip/channels/chan_gulp.c
team/group/pimp_my_sip/include/asterisk/res_sip.h
team/group/pimp_my_sip/res/res_sip.c
team/group/pimp_my_sip/res/res_sip/sip_configuration.c
Modified: team/group/pimp_my_sip/channels/chan_gulp.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/channels/chan_gulp.c?view=diff&rev=389846&r1=389845&r2=389846
==============================================================================
--- team/group/pimp_my_sip/channels/chan_gulp.c (original)
+++ team/group/pimp_my_sip/channels/chan_gulp.c Tue May 28 09:18:47 2013
@@ -853,7 +853,12 @@
switch (condition) {
case AST_CONTROL_RINGING:
if (ast_channel_state(ast) == AST_STATE_RING) {
- response_code = 180;
+ if (session->endpoint->inband_progress) {
+ response_code = 183;
+ res = -1;
+ } else {
+ response_code = 180;
+ }
} else {
res = -1;
}
@@ -929,16 +934,12 @@
break;
}
- if (!res && response_code) {
+ if (response_code) {
struct indicate_data *ind_data = indicate_data_alloc(session, condition, response_code, data, datalen);
- if (ind_data) {
- res = ast_sip_push_task(session->serializer, indicate, ind_data);
- if (res) {
- ast_log(LOG_NOTICE, "Cannot send response code %d to endpoint %s. Could not queue task properly\n",
- response_code, ast_sorcery_object_get_id(session->endpoint));
- ao2_cleanup(ind_data);
- }
- } else {
+ if (!ind_data || ast_sip_push_task(session->serializer, indicate, ind_data)) {
+ ast_log(LOG_NOTICE, "Cannot send response code %d to endpoint %s. Could not queue task properly\n",
+ response_code, ast_sorcery_object_get_id(session->endpoint));
+ ao2_cleanup(ind_data);
res = -1;
}
}
Modified: team/group/pimp_my_sip/include/asterisk/res_sip.h
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/include/asterisk/res_sip.h?view=diff&rev=389846&r1=389845&r2=389846
==============================================================================
--- team/group/pimp_my_sip/include/asterisk/res_sip.h (original)
+++ team/group/pimp_my_sip/include/asterisk/res_sip.h Tue May 28 09:18:47 2013
@@ -356,6 +356,8 @@
unsigned int use_avpf;
/*! Is one-touch recording permitted? */
unsigned int one_touch_recording;
+ /*! Boolean indicating if ringing should be sent as inband progress */
+ unsigned int inband_progress;
};
/*!
Modified: team/group/pimp_my_sip/res/res_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/res/res_sip.c?view=diff&rev=389846&r1=389845&r2=389846
==============================================================================
--- team/group/pimp_my_sip/res/res_sip.c (original)
+++ team/group/pimp_my_sip/res/res_sip.c Tue May 28 09:18:47 2013
@@ -327,6 +327,18 @@
</enumlist>
</description>
</configOption>
+ <configOption name="inband_progress" default="no">
+ <synopsis>Determines whether chan_gulp will indicate ringing using inband
+ progress.</synopsis>
+ <description><para>
+ If set to <literal>yes</literal>, chan_gulp will send a 183 Session Progress
+ when told to indicate ringing and will immediately start sending ringing
+ as audio.
+ </para><para>
+ If set to <literal>no</literal>, chan_gulp will send a 180 Ringing when told
+ to indicate ringing and will NOT send it as audio.
+ </para></description>
+ </configOption>
</configObject>
<configObject name="auth">
<synopsis>Authentication type</synopsis>
Modified: team/group/pimp_my_sip/res/res_sip/sip_configuration.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pimp_my_sip/res/res_sip/sip_configuration.c?view=diff&rev=389846&r1=389845&r2=389846
==============================================================================
--- team/group/pimp_my_sip/res/res_sip/sip_configuration.c (original)
+++ team/group/pimp_my_sip/res/res_sip/sip_configuration.c Tue May 28 09:18:47 2013
@@ -372,6 +372,7 @@
ast_sorcery_object_field_register_custom(sip_sorcery, "endpoint", "media_encryption", "no", media_encryption_handler, NULL, 0, 0);
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "use_avpf", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, use_avpf));
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "one_touch_recording", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, one_touch_recording));
+ ast_sorcery_object_field_register(sip_sorcery, "endpoint", "inband_progress", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, inband_progress));
if (ast_sip_initialize_sorcery_transport(sip_sorcery)) {
ast_log(LOG_ERROR, "Failed to register SIP transport support with sorcery\n");
More information about the asterisk-commits
mailing list