diff --git a/conf/vanilla/sip_profiles/internal.xml b/conf/vanilla/sip_profiles/internal.xml index c813d99c67..bc02775a03 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 752dd8671b..62586e251b 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -269,6 +269,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 19ec32735c..6e72cc6fef 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -3838,6 +3838,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 dd0fe1ac95..bab266abdf 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -4783,7 +4783,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()); + } }