corrected broken sending request to given destination (used for example in msilo)
authorVaclav Kubart <vaclav.kubart@iptel.org>
Fri, 16 Feb 2007 11:28:42 +0000 (11:28 +0000)
committerVaclav Kubart <vaclav.kubart@iptel.org>
Fri, 16 Feb 2007 11:28:42 +0000 (11:28 +0000)
modules/tm/uac.c

index fb40b12..81363b1 100644 (file)
@@ -473,15 +473,27 @@ int request(str* m, str* ruri, str* to, str* from, str* h, str* b, str *next_hop
        if (ruri) {
                dialog->rem_target.s = ruri->s;
                dialog->rem_target.len = ruri->len;
-               dialog->hooks.request_uri = &dialog->rem_target;
+               /* hooks will be set from w_calculate_hooks */
        }
+
+       if (next_hop) dialog->dst_uri = *next_hop;
        w_calculate_hooks(dialog);
 
-       if (next_hop) 
-               if ((next_hop->len > 0) && next_hop->s) dialog->hooks.next_hop = next_hop;
+       /* WARNING:
+        * to be clean it should be called 
+        *   set_dlg_target(dialog, ruri, next_hop);
+        * which sets both uris if given [but it duplicates them in shm!]
+        *
+        * but in this case the _ruri parameter in set_dlg_target
+        * must be optional (it is needed now) and following hacks
+        *   dialog->rem_target.s = 0;
+        *   dialog->dst_uri.s = 0;
+        * before freeing dialog here must be removed
+        */
 
        res = t_uac(m, h, b, dialog, c, cp);
        dialog->rem_target.s = 0;
+       dialog->dst_uri.s = 0;
        free_dlg(dialog);
        return res;