]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add presence-disable-early sofia option to send non-specifc presence messages w/o...
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 7 Feb 2012 17:10:42 +0000 (11:10 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 7 Feb 2012 17:10:51 +0000 (11:10 -0600)
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_presence.c

index 1860c082908eaa212e2c92fea3dd345e72660073..0a2f672df67855d37828b03333229e1ef05fa8ac 100644 (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;
index 3dd28d7f6043bf84b81205a31972e64eb51114c0..0668eedf57836273d7ce1935c1596519eac37f7d 100644 (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);
index 75c663ef0703c3583357778f77f05279f4932cc5..683903fc66a98111df07624696ffd6d00c9b3c17 100644 (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")) {