|
@@ -14,9 +14,9 @@ Ramona-Elena Modroiu
|
|
|
|
|
|
<[email protected]>
|
|
<[email protected]>
|
|
|
|
|
|
- Copyright © 2009-2010 asipto.com
|
|
|
|
|
|
+ Copyright © 2009-2010 asipto.com
|
|
|
|
|
|
- Copyright © 2005 Voice Sistem
|
|
|
|
|
|
+ Copyright © 2005 Voice Sistem
|
|
__________________________________________________________________
|
|
__________________________________________________________________
|
|
|
|
|
|
Table of Contents
|
|
Table of Contents
|
|
@@ -158,7 +158,10 @@ Chapter 1. Admin Guide
|
|
The following modules must be loaded before this module:
|
|
The following modules must be loaded before this module:
|
|
* TM - Transaction Module
|
|
* TM - Transaction Module
|
|
* RR - Record-Route Module, but only if restore mode for FROM URI is
|
|
* RR - Record-Route Module, but only if restore mode for FROM URI is
|
|
- set to "auto".
|
|
|
|
|
|
+ set to “auto�.
|
|
|
|
+ * Dialog Module, but only if restore mode for FROM URI is set to
|
|
|
|
+ “auto� and you want uac_replace_from or uac_replace_to to store the
|
|
|
|
+ values of the URIs as dialog variables.
|
|
|
|
|
|
2.2. External Libraries or Applications
|
|
2.2. External Libraries or Applications
|
|
|
|
|
|
@@ -186,7 +189,7 @@ Chapter 1. Admin Guide
|
|
Name of Record-Route header parameter that will be used to store
|
|
Name of Record-Route header parameter that will be used to store
|
|
(encoded) the original FROM URI.
|
|
(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_from_store_param parameter
|
|
Example 1.1. Set rr_from_store_param parameter
|
|
...
|
|
...
|
|
@@ -198,7 +201,7 @@ modparam("uac","rr_from_store_param","my_param")
|
|
Name of Record-Route header parameter that will be used to store
|
|
Name of Record-Route header parameter that will be used to store
|
|
(encoded) the original TO URI.
|
|
(encoded) the original TO URI.
|
|
|
|
|
|
- This parameter is optional, it's default value being "vst".
|
|
|
|
|
|
+ This parameter is optional, it's default value being “vst�.
|
|
|
|
|
|
Example 1.2. Set rr_to_store_param parameter
|
|
Example 1.2. Set rr_to_store_param parameter
|
|
...
|
|
...
|
|
@@ -209,15 +212,15 @@ modparam("uac","rr_to_store_param","my_param")
|
|
|
|
|
|
There are 3 mode of restoring the original FROM URI and the original TO
|
|
There are 3 mode of restoring the original FROM URI and the original TO
|
|
URI:
|
|
URI:
|
|
- * "none" - no information about original URI is stored; restoration
|
|
|
|
|
|
+ * “none� - no information about original URI is stored; restoration
|
|
is not possible.
|
|
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
|
|
sequential requests - this must be manually updated based on
|
|
original URI.
|
|
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.
|
|
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.3. Set restore_mode parameter
|
|
Example 1.3. Set restore_mode parameter
|
|
...
|
|
...
|
|
@@ -242,13 +245,17 @@ modparam("uac","restore_passwd","my_secret_passwd")
|
|
the original from uri in order to be able to restore it in replies.
|
|
the original from uri in order to be able to restore it in replies.
|
|
That makes sense, if the original-uri can not be extracted from the
|
|
That makes sense, if the original-uri can not be extracted from the
|
|
original request, e.g. if msg_apply_changes() was used after calling
|
|
original request, e.g. if msg_apply_changes() was used after calling
|
|
- uac_replace_from()
|
|
|
|
|
|
+ uac_replace_from() or uac_replace_to().
|
|
|
|
+
|
|
|
|
+ If you create a dialog ( with dlg_manage() ) before calling
|
|
|
|
+ uac_replace_from(), this avp will not be needed. The values of the uris
|
|
|
|
+ will be stored as dialog variables.
|
|
|
|
|
|
Default value of this parameter is empty.
|
|
Default value of this parameter is empty.
|
|
|
|
|
|
Example 1.5. Set restore_from_avp parameter
|
|
Example 1.5. Set restore_from_avp parameter
|
|
...
|
|
...
|
|
-modparam("uac","restore_from_avp","$avp(s:original_uri_from)")
|
|
|
|
|
|
+modparam("uac","restore_from_avp","$avp(original_uri_from)")
|
|
...
|
|
...
|
|
|
|
|
|
3.6. restore_to_avp (string)
|
|
3.6. restore_to_avp (string)
|
|
@@ -259,11 +266,15 @@ modparam("uac","restore_from_avp","$avp(s:original_uri_from)")
|
|
request, e.g. if msg_apply_changes() was used after calling
|
|
request, e.g. if msg_apply_changes() was used after calling
|
|
uac_replace_to()
|
|
uac_replace_to()
|
|
|
|
|
|
|
|
+ If you create a dialog ( with dlg_manage() ) before calling or
|
|
|
|
+ uac_replace_to(), this avp will not be needed. The values of the uris
|
|
|
|
+ will be stored as dialog variables.
|
|
|
|
+
|
|
Default value of this parameter is empty.
|
|
Default value of this parameter is empty.
|
|
|
|
|
|
Example 1.6. Set restore_to_avp parameter
|
|
Example 1.6. Set restore_to_avp parameter
|
|
...
|
|
...
|
|
-modparam("uac","restore_to_avp","$avp(s:original_uri_to)")
|
|
|
|
|
|
+modparam("uac","restore_to_avp","$avp(original_uri_to)")
|
|
...
|
|
...
|
|
|
|
|
|
3.7. credential (string)
|
|
3.7. credential (string)
|
|
@@ -283,9 +294,9 @@ modparam("uac","credential","username:domain:password")
|
|
The definition of an AVP that might contain the realm to be used to
|
|
The definition of an AVP that might contain the realm to be used to
|
|
perform authentication.
|
|
perform authentication.
|
|
|
|
|
|
- If you define it, you also need to define "auth_username_avp"
|
|
|
|
- (Section 3.9, "auth_username_avp (string)") and "auth_username_avp"
|
|
|
|
- (Section 3.10, "auth_password_avp (string)").
|
|
|
|
|
|
+ If you define it, you also need to define “auth_username_avp�
|
|
|
|
+ (Section 3.9, “auth_username_avp (string)�) and “auth_username_avp�
|
|
|
|
+ (Section 3.10, “auth_password_avp (string)�).
|
|
|
|
|
|
Example 1.8. Set auth_realm_avp parameter
|
|
Example 1.8. Set auth_realm_avp parameter
|
|
...
|
|
...
|
|
@@ -297,9 +308,9 @@ modparam("uac","auth_realm_avp","$avp(i:10)")
|
|
The definition of an AVP that might contain the username to be used to
|
|
The definition of an AVP that might contain the username to be used to
|
|
perform authentication.
|
|
perform authentication.
|
|
|
|
|
|
- If you define it, you also need to define "auth_realm_avp"
|
|
|
|
- (Section 3.8, "auth_realm_avp (string)") and "auth_username_avp"
|
|
|
|
- (Section 3.10, "auth_password_avp (string)").
|
|
|
|
|
|
+ If you define it, you also need to define “auth_realm_avp�
|
|
|
|
+ (Section 3.8, “auth_realm_avp (string)�) and “auth_username_avp�
|
|
|
|
+ (Section 3.10, “auth_password_avp (string)�).
|
|
|
|
|
|
Example 1.9. Set auth_username_avp parameter
|
|
Example 1.9. Set auth_username_avp parameter
|
|
...
|
|
...
|
|
@@ -311,9 +322,9 @@ modparam("uac","auth_username_avp","$avp(i:11)")
|
|
The definition of an AVP that might contain the password to be used to
|
|
The definition of an AVP that might contain the password to be used to
|
|
perform authentication.
|
|
perform authentication.
|
|
|
|
|
|
- If you define it, you also need to define "auth_password_avp"
|
|
|
|
- (Section 3.10, "auth_password_avp (string)") and "auth_username_avp"
|
|
|
|
- (Section 3.10, "auth_password_avp (string)").
|
|
|
|
|
|
+ If you define it, you also need to define “auth_password_avp�
|
|
|
|
+ (Section 3.10, “auth_password_avp (string)�) and “auth_username_avp�
|
|
|
|
+ (Section 3.10, “auth_password_avp (string)�).
|
|
|
|
|
|
Example 1.10. Set auth_password_avp parameter
|
|
Example 1.10. Set auth_password_avp parameter
|
|
...
|
|
...
|
|
@@ -365,7 +376,7 @@ modparam("uac", "reg_contact_addr", "192.168.1.2:5080")
|
|
5.9. uac_reg_lookup(uuid, dst)
|
|
5.9. uac_reg_lookup(uuid, dst)
|
|
5.10. uac_reg_request_to(user, mode)
|
|
5.10. uac_reg_request_to(user, mode)
|
|
|
|
|
|
-5.1. uac_replace_from(display,uri)
|
|
|
|
|
|
+5.1. uac_replace_from(display,uri)
|
|
|
|
|
|
Replace in FROM header the display name and the URI part.
|
|
Replace in FROM header the display name and the URI part.
|
|
|
|
|
|
@@ -373,6 +384,24 @@ modparam("uac", "reg_contact_addr", "192.168.1.2:5080")
|
|
|
|
|
|
This function can be used from REQUEST_ROUTE and from BRANCH_ROUTE.
|
|
This function can be used from REQUEST_ROUTE and from BRANCH_ROUTE.
|
|
|
|
|
|
|
|
+ If you set restore_mode to AUTO, the URI will be modified automatically
|
|
|
|
+ in all subsequent requests and replies in that dialog.
|
|
|
|
+
|
|
|
|
+ There are two ways in which the AUTO mode can be achieved.
|
|
|
|
+
|
|
|
|
+ One uses the rr module and appends to the Record-Route header a
|
|
|
|
+ parameter containing some strings from which the original and new URI
|
|
|
|
+ can be computed. The problem with this mode is that it relies on the
|
|
|
|
+ fact the parties will send the Route exactly as it was received. In
|
|
|
|
+ case there is a change, the resulting URIs will not be correct.
|
|
|
|
+
|
|
|
|
+ The other one uses the dialog module to store the original and new URI.
|
|
|
|
+ If you already use dialog module in your configuration, this is the
|
|
|
|
+ advisable mode. All you need to do to use this is to call dlg_manage()
|
|
|
|
+ before calling uac_replace_from(). It works by storing the URIs as
|
|
|
|
+ dialog variables and registering callbacks in dialog module for in
|
|
|
|
+ dialog requests.
|
|
|
|
+
|
|
Example 1.14. uac_replace_from usage
|
|
Example 1.14. uac_replace_from usage
|
|
...
|
|
...
|
|
# replace both display and uri
|
|
# replace both display and uri
|
|
@@ -385,7 +414,7 @@ uac_replace_from("","sip:[email protected]");
|
|
uac_replace_from("","");
|
|
uac_replace_from("","");
|
|
...
|
|
...
|
|
|
|
|
|
-5.2. uac_replace_from(uri)
|
|
|
|
|
|
+5.2. uac_replace_from(uri)
|
|
|
|
|
|
Replace in FROM header the URI part without altering the display name.
|
|
Replace in FROM header the URI part without altering the display name.
|
|
|
|
|
|
@@ -398,7 +427,7 @@ uac_replace_from("","");
|
|
uac_replace_from("sip:[email protected]");
|
|
uac_replace_from("sip:[email protected]");
|
|
...
|
|
...
|
|
|
|
|
|
-5.3. uac_restore_from()
|
|
|
|
|
|
+5.3. uac_restore_from()
|
|
|
|
|
|
This function will check if the FROM URI was modified and will use the
|
|
This function will check if the FROM URI was modified and will use the
|
|
information stored in header parameter to restore the original FROM URI
|
|
information stored in header parameter to restore the original FROM URI
|
|
@@ -411,7 +440,7 @@ uac_replace_from("sip:[email protected]");
|
|
uac_restore_from();
|
|
uac_restore_from();
|
|
...
|
|
...
|
|
|
|
|
|
-5.4. uac_replace_to(display,uri)
|
|
|
|
|
|
+5.4. uac_replace_to(display,uri)
|
|
|
|
|
|
Replace in TO header the display name and the URI part.
|
|
Replace in TO header the display name and the URI part.
|
|
|
|
|
|
@@ -422,7 +451,7 @@ uac_restore_from();
|
|
Example 1.17. uac_replace_to usage
|
|
Example 1.17. uac_replace_to usage
|
|
...
|
|
...
|
|
# replace both display and uri
|
|
# replace both display and uri
|
|
-uac_replace_to("$avp(s:display)","$avp(s:uri)");
|
|
|
|
|
|
+uac_replace_to("$avp(display)","$avp(uri)");
|
|
# replace only display and do not touch uri
|
|
# replace only display and do not touch uri
|
|
uac_replace_to("batman","");
|
|
uac_replace_to("batman","");
|
|
# remove display and replace uri
|
|
# remove display and replace uri
|
|
@@ -431,7 +460,7 @@ uac_replace_to("","sip:[email protected]");
|
|
uac_replace_to("","");
|
|
uac_replace_to("","");
|
|
...
|
|
...
|
|
|
|
|
|
-5.5. uac_replace_to(uri)
|
|
|
|
|
|
+5.5. uac_replace_to(uri)
|
|
|
|
|
|
Replace in TO header the URI part without altering the display name.
|
|
Replace in TO header the URI part without altering the display name.
|
|
|
|
|
|
@@ -439,12 +468,30 @@ uac_replace_to("","");
|
|
|
|
|
|
This function can be used from REQUEST_ROUTE and from BRANCH_ROUTE.
|
|
This function can be used from REQUEST_ROUTE and from BRANCH_ROUTE.
|
|
|
|
|
|
|
|
+ If you set restore_mode to AUTO, the URI will be modified automatically
|
|
|
|
+ in all subsequent requests and replies in that dialog.
|
|
|
|
+
|
|
|
|
+ There are two ways in which the AUTO mode can be achieved.
|
|
|
|
+
|
|
|
|
+ One uses the rr module and appends to the Record-Route header a
|
|
|
|
+ parameter containing some strings from which the original and new URI
|
|
|
|
+ can be computed. The problem with this mode is that it relies on the
|
|
|
|
+ fact the parties will send the Route exactly as it was received. In
|
|
|
|
+ case there is a change, the resulting URIs will not be correct.
|
|
|
|
+
|
|
|
|
+ The other one uses the dialog module to store the original and new URI.
|
|
|
|
+ If you already use dialog module in your configuration, this is the
|
|
|
|
+ advisable mode. All you need to do to use this is to call dlg_manage()
|
|
|
|
+ before calling uac_replace_to(). It works by storing the URIs as dialog
|
|
|
|
+ variables and registering callbacks in dialog module for in dialog
|
|
|
|
+ requests.
|
|
|
|
+
|
|
Example 1.18. uac_replace_to usage
|
|
Example 1.18. uac_replace_to usage
|
|
...
|
|
...
|
|
uac_replace_to("sip:[email protected]");
|
|
uac_replace_to("sip:[email protected]");
|
|
...
|
|
...
|
|
|
|
|
|
-5.6. uac_restore_to()
|
|
|
|
|
|
+5.6. uac_restore_to()
|
|
|
|
|
|
This function will check if the TO URI was modified and will use the
|
|
This function will check if the TO URI was modified and will use the
|
|
information stored in header parameter to restore the original TO URI
|
|
information stored in header parameter to restore the original TO URI
|
|
@@ -457,7 +504,7 @@ uac_replace_to("sip:[email protected]");
|
|
uac_restore_to();
|
|
uac_restore_to();
|
|
...
|
|
...
|
|
|
|
|
|
-5.7. uac_auth()
|
|
|
|
|
|
+5.7. uac_auth()
|
|
|
|
|
|
This function can be called only from failure route and will build the
|
|
This function can be called only from failure route and will build the
|
|
authentication response header and insert it into the request without
|
|
authentication response header and insert it into the request without
|
|
@@ -470,7 +517,7 @@ uac_restore_to();
|
|
uac_auth();
|
|
uac_auth();
|
|
...
|
|
...
|
|
|
|
|
|
-5.8. uac_req_send()
|
|
|
|
|
|
+5.8. uac_req_send()
|
|
|
|
|
|
This function sends a SIP message from the configuration file. The
|
|
This function sends a SIP message from the configuration file. The
|
|
message is built out of $uac_req(...) pseudo-variable.
|
|
message is built out of $uac_req(...) pseudo-variable.
|
|
@@ -487,7 +534,7 @@ $uac_req(turi)="sip:kamailio.org";
|
|
uac_req_send();
|
|
uac_req_send();
|
|
...
|
|
...
|
|
|
|
|
|
-5.9. uac_reg_lookup(uuid, dst)
|
|
|
|
|
|
+5.9. uac_reg_lookup(uuid, dst)
|
|
|
|
|
|
This function sets the PV dst to SIP URI that correspond to uuid in uac
|
|
This function sets the PV dst to SIP URI that correspond to uuid in uac
|
|
registations table. uuid and dst must be pseudo-variables.
|
|
registations table. uuid and dst must be pseudo-variables.
|
|
@@ -503,7 +550,7 @@ if(uac_reg_lookup("$rU", "$ru"))
|
|
}
|
|
}
|
|
...
|
|
...
|
|
|
|
|
|
-5.10. uac_reg_request_to(user, mode)
|
|
|
|
|
|
+5.10. uac_reg_request_to(user, mode)
|
|
|
|
|
|
This function can be used to send an authenticated request to a remote
|
|
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
|
|
user in the uac registrations table. It sets the request-uri, dst-uri
|