|
@@ -14,9 +14,9 @@ Ramona-Elena Modroiu
|
|
|
|
|
|
<[email protected]>
|
|
|
|
|
|
- Copyright © 2009-2010 asipto.com
|
|
|
+ Copyright © 2009-2010 asipto.com
|
|
|
|
|
|
- Copyright © 2005 Voice Sistem
|
|
|
+ Copyright © 2005 Voice Sistem
|
|
|
__________________________________________________________________
|
|
|
|
|
|
Table of Contents
|
|
@@ -49,6 +49,7 @@ Ramona-Elena Modroiu
|
|
|
4.4. uac_auth()
|
|
|
4.5. uac_req_send()
|
|
|
4.6. uac_reg_lookup(uuid, dst)
|
|
|
+ 4.7. uac_reg_request_to(user, mode)
|
|
|
|
|
|
5. Exported pseudo-variables
|
|
|
6. Remote Registration
|
|
@@ -70,7 +71,8 @@ Ramona-Elena Modroiu
|
|
|
1.13. uac_auth usage
|
|
|
1.14. uac_req_send usage
|
|
|
1.15. uac_reg_lookup usage
|
|
|
- 1.16. lookup remote registrations usage
|
|
|
+ 1.16. uac_reg_request_to usage
|
|
|
+ 1.17. lookup remote registrations usage
|
|
|
|
|
|
Chapter 1. Admin Guide
|
|
|
|
|
@@ -102,6 +104,7 @@ Chapter 1. Admin Guide
|
|
|
4.4. uac_auth()
|
|
|
4.5. uac_req_send()
|
|
|
4.6. uac_reg_lookup(uuid, dst)
|
|
|
+ 4.7. uac_reg_request_to(user, mode)
|
|
|
|
|
|
5. Exported pseudo-variables
|
|
|
6. Remote Registration
|
|
@@ -134,7 +137,7 @@ Chapter 1. Admin Guide
|
|
|
The following modules must be loaded before this module:
|
|
|
* TM - Transaction Module
|
|
|
* RR - Record-Route Module, but only if restore mode for FROM URI is
|
|
|
- set to “auto�.
|
|
|
+ set to "auto".
|
|
|
|
|
|
2.2. External Libraries or Applications
|
|
|
|
|
@@ -159,7 +162,7 @@ Chapter 1. Admin Guide
|
|
|
Name of Record-Route header parameter that will be used to store
|
|
|
(encoded) the original FROM URI.
|
|
|
|
|
|
- This parameter is optional, it's default value being “vsf�.
|
|
|
+ This parameter is optional, it's default value being "vsf".
|
|
|
|
|
|
Example 1.1. Set rr_store_param parameter
|
|
|
...
|
|
@@ -169,15 +172,15 @@ modparam("uac","rr_store_param","my_param")
|
|
|
3.2. from_restore_mode (string)
|
|
|
|
|
|
There are 3 mode of restoring the original FROM URI:
|
|
|
- * “none� - no information about original URI is stored; restoration
|
|
|
+ * "none" - no information about original URI is stored; restoration
|
|
|
is not possible.
|
|
|
- * “manual� - all following replies will be restored, but not also the
|
|
|
+ * "manual" - all following replies will be restored, but not also the
|
|
|
sequential requests - this must be manually updated based on
|
|
|
original URI.
|
|
|
- * “auto� - all sequential requests and replies will be automatically
|
|
|
+ * "auto" - all sequential requests and replies will be automatically
|
|
|
updated based on stored original URI.
|
|
|
|
|
|
- This parameter is optional, it's default value being “auto�.
|
|
|
+ This parameter is optional, it's default value being "auto".
|
|
|
|
|
|
Example 1.2. Set from_restore_mode parameter
|
|
|
...
|
|
@@ -213,9 +216,9 @@ modparam("uac","credential","username:domain:password")
|
|
|
The definition of an AVP that might contain the realm to be used to
|
|
|
perform authentication.
|
|
|
|
|
|
- If you define it, you also need to define “auth_username_avp�
|
|
|
- (Section 3.6, “auth_username_avp (string)�) and “auth_username_avp�
|
|
|
- (Section 3.7, “auth_password_avp (string)�).
|
|
|
+ If you define it, you also need to define "auth_username_avp"
|
|
|
+ (Section 3.6, "auth_username_avp (string)") and "auth_username_avp"
|
|
|
+ (Section 3.7, "auth_password_avp (string)").
|
|
|
|
|
|
Example 1.5. Set auth_realm_avp parameter
|
|
|
...
|
|
@@ -227,9 +230,9 @@ modparam("uac","auth_realm_avp","$avp(i:10)")
|
|
|
The definition of an AVP that might contain the username to be used to
|
|
|
perform authentication.
|
|
|
|
|
|
- If you define it, you also need to define “auth_realm_avp�
|
|
|
- (Section 3.5, “auth_realm_avp (string)�) and “auth_username_avp�
|
|
|
- (Section 3.7, “auth_password_avp (string)�).
|
|
|
+ If you define it, you also need to define "auth_realm_avp"
|
|
|
+ (Section 3.5, "auth_realm_avp (string)") and "auth_username_avp"
|
|
|
+ (Section 3.7, "auth_password_avp (string)").
|
|
|
|
|
|
Example 1.6. Set auth_username_avp parameter
|
|
|
...
|
|
@@ -241,9 +244,9 @@ modparam("uac","auth_username_avp","$avp(i:11)")
|
|
|
The definition of an AVP that might contain the password to be used to
|
|
|
perform authentication.
|
|
|
|
|
|
- If you define it, you also need to define “auth_password_avp�
|
|
|
- (Section 3.7, “auth_password_avp (string)�) and “auth_username_avp�
|
|
|
- (Section 3.7, “auth_password_avp (string)�).
|
|
|
+ If you define it, you also need to define "auth_password_avp"
|
|
|
+ (Section 3.7, "auth_password_avp (string)") and "auth_username_avp"
|
|
|
+ (Section 3.7, "auth_password_avp (string)").
|
|
|
|
|
|
Example 1.7. Set auth_password_avp parameter
|
|
|
...
|
|
@@ -278,6 +281,7 @@ modparam("uac", "reg_contact_addr", "192.168.1.2:5080")
|
|
|
4.4. uac_auth()
|
|
|
4.5. uac_req_send()
|
|
|
4.6. uac_reg_lookup(uuid, dst)
|
|
|
+ 4.7. uac_reg_request_to(user, mode)
|
|
|
|
|
|
4.1. uac_replace_from(display,uri)
|
|
|
|
|
@@ -371,6 +375,39 @@ if(uac_reg_lookup("$rU", "$ru"))
|
|
|
}
|
|
|
...
|
|
|
|
|
|
+4.7. uac_reg_request_to(user, mode)
|
|
|
+
|
|
|
+ This function can be used to send an authenticated request to a remote
|
|
|
+ user in the uac registrations table. It sets the request-uri, dst-uri
|
|
|
+ and auth_*_avp pv's to the values that correspond to the supplied user.
|
|
|
+
|
|
|
+ The mode indicates whether the user should match the local uuid
|
|
|
+ (mode=0), or the username (mode=1).
|
|
|
+
|
|
|
+ The auth_*_avp module parameters must be set to valid pv's.
|
|
|
+
|
|
|
+ This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
|
|
|
+ BRANCH_ROUTE.
|
|
|
+
|
|
|
+ Example 1.16. uac_reg_request_to usage
|
|
|
+...
|
|
|
+
|
|
|
+if(uac_reg_request_to("$fU", 0))
|
|
|
+{
|
|
|
+ xlog("L_NOTICE", "Found remote user [$rU] on [$rd] via [$du]");
|
|
|
+ t_on_failure("REMOTE_AUTH");
|
|
|
+
|
|
|
+ t_relay()
|
|
|
+}
|
|
|
+...
|
|
|
+failure_route[REMOTE_AUTH] {
|
|
|
+ if ($T_reply_code == 401 or $T_reply_code == 407) {
|
|
|
+ xlog("L_NOTICE", "Remote asked for authentication");
|
|
|
+ uac_auth()
|
|
|
+ }
|
|
|
+}
|
|
|
+...
|
|
|
+
|
|
|
5. Exported pseudo-variables
|
|
|
|
|
|
* $uac_req(key)
|
|
@@ -411,7 +448,7 @@ if(uac_reg_lookup("$rU", "$ru"))
|
|
|
if the call is coming from a remote SIP provider and can change the
|
|
|
R-URI to local username@domain. Afterwards you can run location lookup.
|
|
|
|
|
|
- Example 1.16. lookup remote registrations usage
|
|
|
+ Example 1.17. lookup remote registrations usage
|
|
|
...
|
|
|
if(uac_reg_lookup("$rU", "$ru")) {
|
|
|
xlog("request from a remote SIP provider [$ou => $ru]\n");
|