Browse code

voicemail fixes

Jiri Kuthan authored on 09/09/2002 03:35:07
Showing 1 changed files
... ...
@@ -245,11 +245,6 @@ route{
245 245
 		break;
246 246
 	}; 
247 247
 
248
-	/* set up voicemail redirection for users who registered to do so */
249
-	if (method=="INVITE" && is_user_in("Request-URI", "voicemail")) {
250
-		t_on_negative("1");
251
-	} ;
252
-
253 248
 	# native SIP destinations are handled using our USRLOC DB
254 249
 	if (!lookup("location")) {
255 250
 		# handle user which was not found ...
... ...
@@ -264,17 +259,22 @@ route{
264 259
 		break;
265 260
 	};
266 261
 
267
-	# add RR to messages which were previously labeled for that
268
-	if (isflagset(2)) {
269
-		addRecordRoute();
270
-		;
271
-	};
272
-
262
+	/* set up voicemail redirection for users who registered to do so */
263
+	if (method=="INVITE" && is_user_in("Request-URI", "voicemail")) {
264
+		t_on_negative("1");
265
+	} ;
273 266
 	/* ... and also report on missed calls ... note that reporting
274 267
        on missed calls is mutually exclusive with silent C timer
275 268
     */
276 269
 	setflag(3);
277 270
 
271
+
272
+
273
+	# add RR to messages which were previously labeled for that
274
+	if (isflagset(2)) {
275
+		addRecordRoute();
276
+	};
277
+
278 278
 	# we now know we may, we know where, let it go out now!
279 279
 	append_hf("P-hint: USRLOC\r\n");
280 280
 	if (!t_relay()) {
... ...
@@ -453,8 +453,6 @@ route[4] {
453 453
 	# on each INVITE retranmission
454 454
 	if (method=="INVITE" || method=="ACK" || method=="BYE") {
455 455
 
456
-		/* we account missed calls for all off-line users */
457
-		acc_request("404 Not Found");
458 456
 		/* requests to voicemail users will be fwded to voicemail */
459 457
 		if (is_user_in("Request-URI", "voicemail")) {
460 458
 			rewritehostport("mail.iptel.org:5060");
... ...
@@ -475,6 +473,8 @@ route[4] {
475 473
 				sl_reply_error();
476 474
 			};
477 475
 		};
476
+		/* we account missed calls for all off-line users */
477
+		if (method=="INVITE") acc_request("404 Not Found");
478 478
 		break;
479 479
 	};
480 480
 	# non-VoIP messages: just return 404 statelessly