]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
send-message-query-on-register profile param, set it to false to disable default...
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 24 Apr 2009 14:33:54 +0000 (14:33 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 24 Apr 2009 14:33:54 +0000 (14:33 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13139 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.h
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_reg.c

index b306a6799c172441945cb8ac583168065a868d11..544df65ed9f31111c74265da8a76b6f06702fb42 100644 (file)
@@ -184,6 +184,7 @@ typedef enum {
        PFLAG_AUTOFLUSH,
        PFLAG_NAT_OPTIONS_PING,
        PFLAG_AUTOFIX_TIMING,
+       PFLAG_MESSAGE_QUERY_ON_REGISTER,
        /* No new flags below this line */
        PFLAG_MAX
 } PFLAGS;
index 6834d89b4aaab0be48927d7e407d4b39b25b4a91..42f892b347436b64f1f0ed89918616ff17337371 100644 (file)
@@ -1495,6 +1495,12 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
                                                        sofia_clear_flag(profile, TFLAG_TPORT_LOG);
                                                }
                                                nua_set_params(profile->nua, TPTAG_LOG(sofia_test_flag(profile, TFLAG_TPORT_LOG)), TAG_END());
+                                       } else if (!strcasecmp(var, "send-message-query-on-register")) {
+                                               if (switch_true(val)) {
+                                                       sofia_set_pflag(profile, PFLAG_MESSAGE_QUERY_ON_REGISTER);
+                                               } else {
+                                                       sofia_clear_pflag(profile, PFLAG_MESSAGE_QUERY_ON_REGISTER);
+                                               }
                                        } else if (!strcasecmp(var, "auto-rtp-bugs")) {
                                                parse_rtp_bugs(profile, val);
                                        } else if (!strcasecmp(var, "user-agent-string")) { 
@@ -1964,6 +1970,7 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                sofia_set_pflag(profile, PFLAG_DISABLE_100REL);
                                profile->auto_restart = 1;
                                sofia_set_pflag(profile, PFLAG_AUTOFIX_TIMING);
+                               sofia_set_pflag(profile, PFLAG_MESSAGE_QUERY_ON_REGISTER);
 
                                for (param = switch_xml_child(settings, "param"); param; param = param->next) {
                                        char *var = (char *) switch_xml_attr_soft(param, "name");
@@ -2022,6 +2029,12 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                                if (tmp > 0) {
                                                        profile->force_subscription_expires = tmp;
                                                }
+                                       } else if (!strcasecmp(var, "send-message-query-on-register")) {
+                                               if (switch_true(val)) {
+                                                       sofia_set_pflag(profile, PFLAG_MESSAGE_QUERY_ON_REGISTER);
+                                               } else {
+                                                       sofia_clear_pflag(profile, PFLAG_MESSAGE_QUERY_ON_REGISTER);
+                                               }
                                        } else if (!strcasecmp(var, "inbound-use-callid-as-uuid")) {
                                                if (switch_true(val)) {
                                                        sofia_set_pflag(profile, PFLAG_CALLID_AS_UUID);
index 17dbba4f1a7469fc9a8fc1fbcaf8b6ec92b54b44..37915e05ecd7479a90e0f87a89a138f3484c1648 100644 (file)
@@ -1148,10 +1148,12 @@ uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_hand
                        switch_snprintf(exp_param, sizeof(exp_param), "expires=%ld", exptime);
                        sip_contact_add_param(nua_handle_home(nh), sip->sip_contact, exp_param);
 
-                       if (switch_event_create(&s_event, SWITCH_EVENT_MESSAGE_QUERY) == SWITCH_STATUS_SUCCESS) {
-                               switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "Message-Account", "sip:%s@%s", to_user, reg_host);
-                               switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "VM-Sofia-Profile", profile->name);
-                               switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "VM-Call-ID", call_id);
+                       if (sofia_test_pflag(profile, PFLAG_MESSAGE_QUERY_ON_REGISTER)) {
+                               if (switch_event_create(&s_event, SWITCH_EVENT_MESSAGE_QUERY) == SWITCH_STATUS_SUCCESS) {
+                                       switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "Message-Account", "sip:%s@%s", to_user, reg_host);
+                                       switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "VM-Sofia-Profile", profile->name);
+                                       switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "VM-Call-ID", call_id);
+                               }
                        }
                } else {
                        if (switch_event_create_subclass(&s_event, SWITCH_EVENT_CUSTOM, MY_EVENT_UNREGISTER) == SWITCH_STATUS_SUCCESS) {