Module: kamailio
Branch: master
Commit: 1a3ce79cc058c57197a7b3736b3ec8b08be5c33f
URL:
https://github.com/kamailio/kamailio/commit/1a3ce79cc058c57197a7b3736b3ec8b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-04-03T20:02:37+02:00
uac_redirect: updated the example script
---
Modified: modules/uac_redirect/README
Modified: modules/uac_redirect/doc/uac_redirect_admin.xml
---
Diff:
https://github.com/kamailio/kamailio/commit/1a3ce79cc058c57197a7b3736b3ec8b…
Patch:
https://github.com/kamailio/kamailio/commit/1a3ce79cc058c57197a7b3736b3ec8b…
---
diff --git a/modules/uac_redirect/README b/modules/uac_redirect/README
index 97abd83..030476c 100644
--- a/modules/uac_redirect/README
+++ b/modules/uac_redirect/README
@@ -362,36 +362,44 @@ loadmodule "modules/uac_redirect/uac_redirect.so"
modparam("usrloc", "db_mode", 0)
-route{
+request_route{
if (uri==myself) {
if (method=="REGISTER") {
save("location");
exit;
- };
+ }
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
exit;
- };
+ }
# do redirect with accounting
- t_on_failure("2");
+ t_on_failure("REDIRECT_ACC");
} else {
# just do redirect
- t_on_failure("1");
+ t_on_failure("REDIRECT_NOACC");
}
if (!t_relay()) {
sl_reply_error();
- };
+ }
}
-failure_route[1] {
+# redirect without storing acc record
+failure_route[REDIRECT_NOACC] {
+ if(!t_check_status("3[0-9][0-9]")) {
+ exit;
+ }
get_redirects("3:1");
t_relay();
}
-failure_route[2] {
- get_redirects("6:2","redirect");
+# redirect with storing acc record
+failure_route[REDIRECT_ACC] {
+ if(!t_check_status("3[0-9][0-9]")) {
+ exit;
+ }
+ get_redirects("6:2", "redirect");
t_relay();
}
diff --git a/modules/uac_redirect/doc/uac_redirect_admin.xml
b/modules/uac_redirect/doc/uac_redirect_admin.xml
index d0cb86b..ffb566d 100644
--- a/modules/uac_redirect/doc/uac_redirect_admin.xml
+++ b/modules/uac_redirect/doc/uac_redirect_admin.xml
@@ -510,37 +510,45 @@ loadmodule "modules/uac_redirect/uac_redirect.so"
modparam("usrloc", "db_mode", 0)
-route{
+request_route{
if (uri==myself) {
if (method=="REGISTER") {
save("location");
exit;
- };
+ }
if (!lookup("location")) {
sl_send_reply("404", "Not Found");
exit;
- };
+ }
# do redirect with accounting
- t_on_failure("2");
+ t_on_failure("REDIRECT_ACC");
} else {
# just do redirect
- t_on_failure("1");
+ t_on_failure("REDIRECT_NOACC");
}
if (!t_relay()) {
sl_reply_error();
- };
+ }
}
-failure_route[1] {
+# redirect without storing acc record
+failure_route[REDIRECT_NOACC] {
+ if(!t_check_status("3[0-9][0-9]")) {
+ exit;
+ }
get_redirects("3:1");
t_relay();
}
-failure_route[2] {
- get_redirects("6:2","redirect");
+# redirect with storing acc record
+failure_route[REDIRECT_ACC] {
+ if(!t_check_status("3[0-9][0-9]")) {
+ exit;
+ }
+ get_redirects("6:2", "redirect");
t_relay();
}
</programlisting>