Quellcode durchsuchen

Improve example for Proxy-CSCF Rx Usage

Carsten Bock vor 11 Jahren
Ursprung
Commit
6395e97f14
1 geänderte Dateien mit 28 neuen und 20 gelöschten Zeilen
  1. 28 20
      examples/pcscf/kamailio.cfg

+ 28 - 20
examples/pcscf/kamailio.cfg

@@ -764,7 +764,7 @@ route[RTPPROXY_TERM] {
 route[REGISTER] {
 route[REGISTER] {
 #!ifdef WITH_RX	
 #!ifdef WITH_RX	
 	xlog("L_DBG","Subscribing to signalling bearer status\n");
 	xlog("L_DBG","Subscribing to signalling bearer status\n");
-	if (Rx_AAR_Register("REG_AAR_REPLY, "location") == 0)
+	if (Rx_AAR_Register("REG_AAR_REPLY", "location") == 0)
 		exit;
 		exit;
 }
 }
 
 
@@ -889,12 +889,12 @@ route[Orig_Initial]
 
 
 #!ifdef WITH_RX
 #!ifdef WITH_RX
 	xlog("L_DBG","Diameter: Orig authorizing media via Rx\n");	
 	xlog("L_DBG","Diameter: Orig authorizing media via Rx\n");	
-	if(Rx_AAR("ORIG_SESSION_AAR_REPLY","orig")==0){
+	if(Rx_AAR("ORIG_SESSION_AAR","orig")==0){
 		exit;
 		exit;
 	}
 	}
 }
 }
 
 
-route[ORIG_SESSION_AAR_REPLY] {
+route[ORIG_SESSION_AAR] {
 	if ($avp(s:aar_return_code) != 1) {
 	if ($avp(s:aar_return_code) != 1) {
 		xlog("L_ERR", "Diameter: AAR failed\n");
 		xlog("L_ERR", "Diameter: AAR failed\n");
 		send_reply("403", "QoS not authorized");
 		send_reply("403", "QoS not authorized");
@@ -929,15 +929,19 @@ onreply_route[Orig_Initial_reply]
 #!ifdef WITH_RX
 #!ifdef WITH_RX
 	if (t_check_status("180|183|200")){
 	if (t_check_status("180|183|200")){
 		xlog("L_DBG","Diameter: Orig authorizing media via Rx\n");	
 		xlog("L_DBG","Diameter: Orig authorizing media via Rx\n");	
-		Rx_AAR("orig");
-		if ($avp(s:aar_return_code) < 0) {
-			xlog("L_ERR", "IMS: AAR failed Orig\n");
-			dlg_terminate("all", "Sorry no QoS available");
-		} else {
-			xlog("L_DBG", "Diameter: Orig AAR success on media authorization\n");	
-		} 
-      		xlog("L_DBG", "IMS: Received 183/200 inside orig_initial_reply\n");
+		if(Rx_AAR("ORIG_SESSION_AAR_REPLY","orig")==0){
+			exit;
+		}
 	}
 	}
+}
+
+route[ORIG_SESSION_AAR_REPLY] {
+	if ($avp(s:aar_return_code) != 1) {
+		xlog("L_ERR", "IMS: AAR failed Orig\n");
+		dlg_terminate("all", "Sorry no QoS available");
+	} else {
+		xlog("L_DBG", "Diameter: Orig AAR success on media authorization\n");	
+	} 
 #!endif
 #!endif
 	# Note: We only do the RTP-Update for the successful case,
 	# Note: We only do the RTP-Update for the successful case,
 	#   the others simply time-out (if we would do otherwise, RTP-Relaying
 	#   the others simply time-out (if we would do otherwise, RTP-Relaying
@@ -1087,12 +1091,12 @@ route[Term_Initial]
 
 
 #!ifdef WITH_RX
 #!ifdef WITH_RX
 	xlog("L_DBG","Diameter: Term authorizing media via Rx\n");	
 	xlog("L_DBG","Diameter: Term authorizing media via Rx\n");	
-	if(Rx_AAR("TERM_SESSION_AAR_REPLY","orig")==0){
+	if(Rx_AAR("TERM_SESSION_AAR","term")==0){
 		exit;
 		exit;
 	}
 	}
 }
 }
 
 
-route[TERM_SESSION_AAR_REPLY] {
+route[TERM_SESSION_AAR] {
 	if ($avp(s:aar_return_code) != 1) {
 	if ($avp(s:aar_return_code) != 1) {
 		xlog("L_ERR", "Diameter: AAR failed\n");
 		xlog("L_ERR", "Diameter: AAR failed\n");
 		send_reply("403", "QoS not authorized");
 		send_reply("403", "QoS not authorized");
@@ -1138,14 +1142,18 @@ onreply_route[Term_Initial_reply]
 
 
 #!ifdef WITH_RX
 #!ifdef WITH_RX
 	if (t_check_status("180|183|200")){
 	if (t_check_status("180|183|200")){
-		xlog("L_DBG","Diameter Term authorizing media via Rx\n");
-		if (!Rx_AAR("term")) {
-			xlog("L_ERR", "IMS: AAR failed Term\n");
-			dlg_terminate("all", "Sorry no QoS available");
-		}  else {
-			xlog("L_DBG", "Diameter: Term AAR success on media authorization\n");
+		xlog("L_DBG","Diameter: Orig authorizing media via Rx\n");	
+		if(Rx_AAR("TERM_SESSION_AAR_REPLY","term")==0){
+			exit;
 		}
 		}
-		xlog("L_DBG", "IMS: SENDING EARLY BYE\n");
+	}
+}
+
+route[TERM_SESSION_AAR_REPLY] {
+	if ($avp(s:aar_return_code) != 1) {
+		xlog("L_ERR", "Diameter: AAR failed\n");
+		send_reply("403", "QoS not authorized");
+		exit;
 	}
 	}
 #!endif
 #!endif