Module: sip-router
Branch: master
Commit: 6395e97f14c8be6bf20466b94140bd106406aea2
URL:    
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6395e97f14c8be6bf20466b94140bd106406aea2

Author: Carsten Bock <[email protected]>
Committer: Carsten Bock <[email protected]>
Date:   Wed Jul 23 16:55:20 2014 +0200

Improve example for Proxy-CSCF Rx Usage

---

 examples/pcscf/kamailio.cfg |   48 +++++++++++++++++++++++++-----------------
 1 files changed, 28 insertions(+), 20 deletions(-)

diff --git a/examples/pcscf/kamailio.cfg b/examples/pcscf/kamailio.cfg
index 8133ece..961fe25 100644
--- a/examples/pcscf/kamailio.cfg
+++ b/examples/pcscf/kamailio.cfg
@@ -764,7 +764,7 @@ route[RTPPROXY_TERM] {
 route[REGISTER] {
 #!ifdef WITH_RX        
        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;
 }
 
@@ -889,12 +889,12 @@ route[Orig_Initial]
 
 #!ifdef WITH_RX
        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;
        }
 }
 
-route[ORIG_SESSION_AAR_REPLY] {
+route[ORIG_SESSION_AAR] {
        if ($avp(s:aar_return_code) != 1) {
                xlog("L_ERR", "Diameter: AAR failed\n");
                send_reply("403", "QoS not authorized");
@@ -929,15 +929,19 @@ onreply_route[Orig_Initial_reply]
 #!ifdef WITH_RX
        if (t_check_status("180|183|200")){
                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
        # Note: We only do the RTP-Update for the successful case,
        #   the others simply time-out (if we would do otherwise, RTP-Relaying
@@ -1087,12 +1091,12 @@ route[Term_Initial]
 
 #!ifdef WITH_RX
        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;
        }
 }
 
-route[TERM_SESSION_AAR_REPLY] {
+route[TERM_SESSION_AAR] {
        if ($avp(s:aar_return_code) != 1) {
                xlog("L_ERR", "Diameter: AAR failed\n");
                send_reply("403", "QoS not authorized");
@@ -1138,14 +1142,18 @@ onreply_route[Term_Initial_reply]
 
 #!ifdef WITH_RX
        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
 


_______________________________________________
sr-dev mailing list
[email protected]
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to