add presence-disable-early sofia option to send non-specifc presence messages w/o special case for early

This commit is contained in:
Anthony Minessale 2012-02-07 11:10:42 -06:00
parent 8f05f098cf
commit 9b02315282
3 changed files with 20 additions and 1 deletions

View File

@ -262,6 +262,7 @@ typedef enum {
PFLAG_SHUTDOWN,
PFLAG_PRESENCE_MAP,
PFLAG_OPTIONS_RESPOND_503_ON_BUSY,
PFLAG_PRESENCE_DISABLE_EARLY,
/* No new flags below this line */
PFLAG_MAX
} PFLAGS;

View File

@ -3035,6 +3035,12 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
} else {
sofia_clear_pflag(profile, PFLAG_T38_PASSTHRU);
}
} else if (!strcasecmp(var, "presence-disable-early")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_PRESENCE_DISABLE_EARLY);
} else {
sofia_clear_pflag(profile, PFLAG_PRESENCE_DISABLE_EARLY);
}
} else if (!strcasecmp(var, "ignore-183nosdp")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_IGNORE_183NOSDP);
@ -3809,6 +3815,12 @@ switch_status_t config_sofia(int reload, char *profile_name)
} else {
sofia_clear_pflag(profile, PFLAG_T38_PASSTHRU);
}
} else if (!strcasecmp(var, "presence-disable-early")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_PRESENCE_DISABLE_EARLY);
} else {
sofia_clear_pflag(profile, PFLAG_PRESENCE_DISABLE_EARLY);
}
} else if (!strcasecmp(var, "ignore-183nosdp")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_IGNORE_183NOSDP);

View File

@ -2499,11 +2499,17 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
if (!strcasecmp(astate, "answered")) {
astate = "confirmed";
}
if (!strcasecmp(astate, "hangup")) {
astate = "terminated";
}
if (!sofia_test_pflag(profile, PFLAG_PRESENCE_DISABLE_EARLY)) {
if (!strcasecmp(astate, "ringing") || !strcasecmp(astate, "early")) {
astate = "confirmed";
}
}
if (is_dialog) {
if (!strcasecmp(astate, "ringing")) {