]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
finally fix private hold
authorBrian West <brian@freeswitch.org>
Fri, 15 Jan 2010 00:31:43 +0000 (00:31 +0000)
committerBrian West <brian@freeswitch.org>
Fri, 15 Jan 2010 00:31:43 +0000 (00:31 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16315 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c
src/switch_channel.c
src/switch_time.c

index 10f4ccd3087abba6ba0a7b64bc7547b63ea4560e..63aaea27308fb2e79772745f3566521d4b9465ce 100644 (file)
@@ -51,6 +51,10 @@ extern su_log_t sresolv_log[];
 extern su_log_t stun_log[];
 extern su_log_t su_log_default[];
 
+
+void sofia_handle_sip_i_reinvite(switch_core_session_t *session, 
+                                                                nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[]);
+
 static void set_variable_sip_param(switch_channel_t *channel, char *header_type, sip_param_t const *params);
 
 
@@ -671,7 +675,11 @@ void sofia_event_callback(nua_event_t event,
                sofia_handle_sip_i_options(status, phrase, nua, profile, nh, sofia_private, sip, tags);
                break;
        case nua_i_invite:
-               if (!session) sofia_handle_sip_i_invite(nua, profile, nh, sofia_private, sip, tags);
+               if (session) {
+                       sofia_handle_sip_i_reinvite(session, nua, profile, nh, sofia_private, sip, tags);
+               } else {
+                       sofia_handle_sip_i_invite(nua, profile, nh, sofia_private, sip, tags);
+               }
                break;
        case nua_i_publish:
                sofia_presence_handle_sip_i_publish(nua, profile, nh, sofia_private, sip, tags);
@@ -5311,6 +5319,25 @@ const char *_url_set_chanvars(switch_core_session_t *session, url_t *url, const
        return uri;
 }
 
+void sofia_handle_sip_i_reinvite(switch_core_session_t *session, 
+                                                          nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[])
+{
+       char *call_info = NULL;
+
+       if (sofia_test_pflag(profile, PFLAG_MANAGE_SHARED_APPEARANCE)) {
+               switch_channel_t *channel = switch_core_session_get_channel(session);
+               if (channel && sip->sip_call_info) {
+                       char *p;
+                       if ((call_info = sip_header_as_string(nua_handle_home(nh), (void *) sip->sip_call_info))) {
+                               if ((p = strchr(call_info, ';'))) {
+                                       switch_channel_set_variable(channel, "presence_call_info", p+1);
+                               }
+                               su_free(nua_handle_home(nh), call_info);
+                       }
+               }
+       }
+}
+
 void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[])
 {
        switch_core_session_t *session = NULL;
index 123430a1cbb85757a6f770554b18c3132640f9d0..1e9c27dc13bbab86971b2749ae7fdcb947312469 100644 (file)
@@ -503,10 +503,10 @@ SWITCH_DECLARE(void) switch_channel_presence(switch_channel_t *channel, const ch
 
                        if (!switch_channel_up(channel)) {
                                call_info_state = "idle";
-                       } else if (!strcasecmp(status, "hold")) {
-                               call_info_state = "held";
                        } else if (!strcasecmp(status, "hold-private")) {
                                call_info_state = "held-private";
+                       } else if (!strcasecmp(status, "hold")) {
+                               call_info_state = "held";
                        } else if (!switch_channel_test_flag(channel, CF_ANSWERED)) {
                                if (channel->direction == SWITCH_CALL_DIRECTION_OUTBOUND) {
                                        call_info_state = "progressing";
index a50a1d51b656172a85a343ab982fb5eee5b7eb70..cfc052e1aeff2435445a7b564db70f8178836d69 100644 (file)
@@ -189,7 +189,7 @@ SWITCH_DECLARE(void) switch_time_calibrate_clock(void)
        if (ts.tv_nsec / 1000 > 1500) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
                                                  "Timer resolution of %ld microseconds detected!\n"
-                                                 "Do you have your kernel timer set to higher than 1khz? You may experience audio problems.\n", ts.tv_nsec / 1000);
+                                                 "Do you have your kernel timer set to higher than 1 kHz? You may experience audio problems.\n", ts.tv_nsec / 1000);
                do_sleep(5000000);
                switch_time_set_cond_yield(SWITCH_TRUE);
                return;
@@ -206,7 +206,7 @@ SWITCH_DECLARE(void) switch_time_calibrate_clock(void)
                if (diff > 1500) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, 
                                                          "Abnormally large timer gap %d detected!\n"
-                                                         "Do you have your kernel timer set to higher than 1khz? You may experience audio problems.\n", diff);
+                                                         "Do you have your kernel timer set to higher than 1 kHz? You may experience audio problems.\n", diff);
                        do_sleep(5000000);
                        switch_time_set_cond_yield(SWITCH_TRUE);
                        return;