]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-849 --resolve
authorMarc Olivier Chouinard <mochouinard@moctel.com>
Thu, 15 Dec 2011 18:20:27 +0000 (13:20 -0500)
committerMarc Olivier Chouinard <mochouinard@moctel.com>
Thu, 15 Dec 2011 18:20:27 +0000 (13:20 -0500)
conf/sip_profiles/internal.xml
conf/vars.xml
src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_presence.c

index 7f688b247292813b04d0a82be0fe50c8886cc84e..c9855c4bfe00b2c6c6964c9b19b1cc8823dad41d 100644 (file)
     <!-- Name of the db to use for this profile -->
     <!--<param name="dbname" value="share_presence"/>-->
     <param name="presence-hosts" value="$${domain},$${local_ip_v4}"/>
+    <param name="presence-privacy" value="$${presence_privacy}"/>
     <!-- ************************************************* -->
     
     <!-- This setting is for AAL2 bitpacking on G726 -->
index f24cc5ccee8c18b2403cb7e05aab05a6eeed744b..4f13a61fbb5c89d573d5ee58b85d6aff6caa63ee 100644 (file)
   <X-PRE-PROCESS cmd="set" data="default_areacode=918"/>
   <X-PRE-PROCESS cmd="set" data="default_country=US"/>
 
+  <!-- if false or undefined, the destination number is included in presence NOTIFY dm:note.
+       if true, the destination number is not included -->
+  <X-PRE-PROCESS cmd="set" data="presence_privacy=false"/>
+
   <X-PRE-PROCESS cmd="set" data="be-ring=%(1000,3000,425)"/>
   <X-PRE-PROCESS cmd="set" data="ca-ring=%(2000,4000,440,480)"/>
   <X-PRE-PROCESS cmd="set" data="cn-ring=%(1000,4000,450)"/>
index b289ffb703ce46929acdca4352d13497c3d4dd99..2648598b72734fc03c414c37b10338eaffc96470 100644 (file)
@@ -233,6 +233,7 @@ typedef enum {
        PFLAG_AUTO_NAT,
        PFLAG_SIPCOMPACT,
        PFLAG_SQL_IN_TRANS,
+       PFLAG_PRESENCE_PRIVACY,
        PFLAG_PASS_CALLEE_ID,
        PFLAG_LOG_AUTH_FAIL,
        PFLAG_FORWARD_MWI_NOTIFY,
@@ -549,6 +550,7 @@ struct sofia_profile {
        char *record_template;
        char *record_path;
        char *presence_hosts;
+       char *presence_privacy;
        char *challenge_realm;
        char *rtcp_audio_interval_msec;
        char *rtcp_video_interval_msec;
index f934c4eea4fa7b33bdcf48543381c3bd73081fcd..70cb12684e511c7e171e598c8396defb07ac456d 100644 (file)
@@ -3162,6 +3162,8 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
                                                profile->user_agent_filter = switch_core_strdup(profile->pool, val);
                                        } else if (!strcasecmp(var, "max-registrations-per-extension")) {
                                                profile->max_registrations_perext = atoi(val);
+                                       } else if (!strcasecmp(var,"presence-privacy")) {
+                                               profile->presence_privacy = switch_core_strdup(profile->pool, val);
                                        } else if (!strcasecmp(var, "rfc2833-pt")) {
                                                profile->te = (switch_payload_t) atoi(val);
                                        } else if (!strcasecmp(var, "cng-pt") && !(sofia_test_pflag(profile, PFLAG_SUPPRESS_CNG))) {
@@ -4064,6 +4066,10 @@ 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-privacy")) {
+                                               if (switch_true(val)) {
+                                                       sofia_set_pflag(profile, PFLAG_PRESENCE_PRIVACY);
+                                               }
                                        } else if (!strcasecmp(var, "manage-shared-appearance")) {
                                                if (switch_true(val)) {
                                                        sofia_set_pflag(profile, PFLAG_MANAGE_SHARED_APPEARANCE);
index 1f4a33ed8a5bbf22e3c9713cfadb9385feed2ff4..b165d62e17cb2fea6f07349377aa70867ebca90a 100644 (file)
@@ -2262,9 +2262,13 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
 
                                        } else if (!strcmp(astate, "confirmed")) {
                                                if (!zstr(op)) {
-                                                       //switch_snprintf(status_line, sizeof(status_line), "On The Phone");
-                                                       //} else {
-                                                       switch_snprintf(status_line, sizeof(status_line), "Talk %s", op);
+                                                       if (sofia_test_pflag(profile, PFLAG_PRESENCE_PRIVACY)) {
+                                                               switch_snprintf(status_line, sizeof(status_line), "On The Phone");
+                                                       } else {
+                                                               switch_snprintf(status_line, sizeof(status_line), "Talk %s", op);
+                                                       }
+                                               } else {
+                                                       switch_snprintf(status_line, sizeof(status_line), "On The Phone");
                                                }
 
                                                rpid = "on-the-phone";