]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4106 --resolve
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 13 Apr 2012 16:18:09 +0000 (11:18 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 13 Apr 2012 16:18:16 +0000 (11:18 -0500)
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_presence.c

index 2934c57f8cdaa7f2fdce972ebc8cc21c10d38ac1..fffc7392243d282fb4eb12168bf5ea3c8e580118 100644 (file)
@@ -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;
index 27d6e5d9db790e7766b9aa16d6489d8a7ff4d6c8..864b95aa13cf6be4fbbf6ca310b6e91e4f3eb78b 100644 (file)
@@ -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);
index e7a25933537b1550bb57c1f2e7fe456fcb87b10a..e3c2145d71dc218f4e85dcfe47f14dee8fa5541e 100644 (file)
@@ -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";
+                                       }
                                }