diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 2934c57f8c..fffc739224 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -509,6 +509,12 @@ typedef enum { PRES_TYPE_PASSIVE = 2 } sofia_presence_type_t; +typedef enum { + PRES_HELD_EARLY = 0, + PRES_HELD_CONFIRMED = 1, + PRES_HELD_TERMINATED = 2 +} sofia_presence_held_calls_type_t; + typedef enum { MEDIA_OPT_NONE = 0, MEDIA_OPT_MEDIA_ON_HOLD = (1 << 0), @@ -623,6 +629,7 @@ struct sofia_profile { int server_rport_level; int client_rport_level; sofia_presence_type_t pres_type; + sofia_presence_held_calls_type_t pres_held_type; sofia_media_options_t media_options; uint32_t force_subscription_expires; uint32_t force_publish_expires; diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 27d6e5d9db..864b95aa13 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -4213,6 +4213,12 @@ switch_status_t config_sofia(int reload, char *profile_name) } else if (switch_true(val)) { profile->pres_type = PRES_TYPE_FULL; } + } else if (!strcasecmp(var, "presence-hold-state")) { + if (!strcasecmp(val, "confirmed")) { + profile->pres_held_type = PRES_HELD_CONFIRMED; + } else if (!strcasecmp(val, "terminated")) { + profile->pres_held_type = PRES_HELD_TERMINATED; + } } else if (!strcasecmp(var, "presence-privacy")) { if (switch_true(val)) { sofia_set_pflag(profile, PFLAG_PRESENCE_PRIVACY); diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index e7a2593353..e3c2145d71 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -2545,7 +2545,13 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * } if (holding) { - astate = "early"; + if (profile->pres_held_type == PRES_HELD_CONFIRMED) { + astate = "confirmed"; + } else if (profile->pres_held_type == PRES_HELD_TERMINATED) { + astate = "terminated"; + } else { + astate = "early"; + } }