From: Anthony Minessale Date: Wed, 22 Jan 2014 21:13:10 +0000 (+0500) Subject: FS-6140 --resolve X-Git-Tag: v1.2.19~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90add491ca2c1263c4423151f83a01b16cd80d33;p=thirdparty%2Ffreeswitch.git FS-6140 --resolve --- diff --git a/conf/vanilla/sip_profiles/internal.xml b/conf/vanilla/sip_profiles/internal.xml index 3a5f0eb4ce..d243c7bb29 100644 --- a/conf/vanilla/sip_profiles/internal.xml +++ b/conf/vanilla/sip_profiles/internal.xml @@ -182,6 +182,8 @@ + + diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index a420930ba1..603b70ca95 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -285,6 +285,7 @@ typedef enum { PFLAG_TCP_KEEPALIVE, PFLAG_TCP_PINGPONG, PFLAG_TCP_PING2PONG, + PFLAG_MESSAGES_RESPOND_200_OK, /* No new flags below this line */ PFLAG_MAX } PFLAGS; diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 9893366806..fdc6866469 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -3733,6 +3733,12 @@ switch_status_t config_sofia(sofia_config_t reload, char *profile_name) } else if (!strcasecmp(var, "tcp-ping2pong") && !zstr(val)) { profile->tcp_ping2pong = atoi(val); sofia_set_pflag(profile, PFLAG_TCP_PING2PONG); + } else if (!strcasecmp(var, "sip-messages-respond-200-ok") && !zstr(val)) { + if (switch_true(val)) { + sofia_set_pflag(profile, PFLAG_MESSAGES_RESPOND_200_OK); + } else { + sofia_clear_pflag(profile, PFLAG_MESSAGES_RESPOND_200_OK); + } } else if (!strcasecmp(var, "odbc-dsn") && !zstr(val)) { profile->odbc_dsn = switch_core_strdup(profile->pool, val); } else if (!strcasecmp(var, "db-pre-trans-execute") && !zstr(val)) { diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index 7f75932c1d..f0b2b6023a 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -4669,7 +4669,11 @@ void sofia_presence_handle_sip_i_message(int status, end: - nua_respond(nh, SIP_202_ACCEPTED, NUTAG_WITH_THIS_MSG(de->data->e_msg), TAG_END()); + if (sofia_test_pflag(profile, PFLAG_MESSAGES_RESPOND_200_OK)) { + nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS_MSG(de->data->e_msg), TAG_END()); + } else { + nua_respond(nh, SIP_202_ACCEPTED, NUTAG_WITH_THIS_MSG(de->data->e_msg), TAG_END()); + } }