Browse code

- appropriate log messages in check_params(...) - wrapper to calculate_hooks, used by b2bua to send requests within a dialog

Daniel-Constantin Mierla authored on 08/07/2003 16:38:51
Showing 3 changed files
... ...
@@ -27,6 +27,7 @@
27 27
  * History:
28 28
  * -------
29 29
  * 2003-03-29 Created by janakj
30
+ * 2003-07-08 added wrapper to calculate_hooks, needed by b2bua (dcm)
30 31
  */
31 32
 
32 33
 
... ...
@@ -153,6 +154,14 @@ static inline int calculate_hooks(dlg_t* _d)
153 154
 	return 0;
154 155
 }
155 156
 
157
+/*
158
+ * wrapper to calculate_hooks
159
+ * added by dcm
160
+ */
161
+int w_calculate_hooks(dlg_t* _d)
162
+{
163
+	return calculate_hooks(_d);
164
+}
156 165
 
157 166
 /*
158 167
  * Create a new dialog
... ...
@@ -159,5 +159,10 @@ int calculate_routeset_length(dlg_t* _d);
159 159
  */
160 160
 char* print_routeset(char* buf, dlg_t* _d);
161 161
 
162
+/*
163
+ * wrapper to calculate_hooks
164
+ * added by dcm
165
+ */
166
+int w_calculate_hooks(dlg_t* _d);
162 167
 
163 168
 #endif /* DLG_H */
... ...
@@ -42,6 +42,8 @@
42 42
  *  2003-03-01  kr set through a function now (jiri)
43 43
  *  2003-03-19  replaced all mallocs/frees w/ pkg_malloc/pkg_free (andrei)
44 44
  *  2003-04-02  port_no_str does not contain a leading ':' anymore (andrei)
45
+ *  2003-07-08  appropriate log messages in check_params(...), 
46
+ *               call calculate_hooks if next_hop==NULL in t_uac (dcm) 
45 47
  */
46 48
 
47 49
 #include <string.h>
... ...
@@ -121,12 +123,12 @@ static inline int check_params(str* method, str* to, str* from, dlg_t** dialog)
121 123
 	}
122 124
 
123 125
 	if (!to->s || !to->len) {
124
-		LOG(L_ERR, "check_params(): Invalid request method\n");
126
+		LOG(L_ERR, "check_params(): Invalid To URI\n");
125 127
 		return -4;
126 128
 	}
127 129
 
128 130
 	if (!from->s || !from->len) {
129
-		LOG(L_ERR, "check_params(): Invalid request method\n");
131
+		LOG(L_ERR, "check_params(): Invalid From URI\n");
130 132
 		return -5;
131 133
 	}
132 134
 	return 0;
... ...
@@ -147,6 +149,12 @@ int t_uac(str* method, str* headers, str* body, dlg_t* dialog, transaction_cb cb
147 149
 	int ret;
148 150
 
149 151
 	ret=-1;
152
+	
153
+	/*** added by dcm 
154
+	 * - needed by external ua to send a request within a dlg
155
+	 */
156
+	if(!dialog->hooks.next_hop && w_calculate_hooks(dialog)<0)
157
+		goto error2;
150 158
 
151 159
 	send_sock = uri2sock(dialog->hooks.next_hop, &to_su, PROTO_NONE);
152 160
 	if (!send_sock) {