From 18695c75f2b2cd41ce8c7e7893913e4c3c091f68 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 18 Aug 2010 19:51:10 -0500 Subject: [PATCH] tweak presence --- src/mod/endpoints/mod_sofia/sofia_presence.c | 22 +++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c b/src/mod/endpoints/mod_sofia/sofia_presence.c index c6c0ccaa23..0c938b9ded 100644 --- a/src/mod/endpoints/mod_sofia/sofia_presence.c +++ b/src/mod/endpoints/mod_sofia/sofia_presence.c @@ -1348,17 +1348,23 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char * astate = "confirmed"; } - if (!strcasecmp(astate, "ringing")) { - if (!strcasecmp(direction, "recipient")) { - astate = "early"; - } else { + if (is_dialog) { + if (!strcasecmp(astate, "ringing")) { + if (!strcasecmp(direction, "recipient")) { + astate = "early"; + } else { + astate = "confirmed"; + } + } + + stream.write_function(&stream, "\n", uuid, direction); + stream.write_function(&stream, "%s\n", astate); + } else { + if (!strcasecmp(astate, "ringing")) { astate = "confirmed"; } } - if (is_dialog) { - stream.write_function(&stream, "\n", uuid, direction); - stream.write_function(&stream, "%s\n", astate); - } + if (!strcasecmp(astate, "early") || !strcasecmp(astate, "confirmed")) { clean_to_user = switch_mprintf("%s", sub_to_user ? sub_to_user : to_user);