Browse code

uac: updated notes about uac_auth()

Daniel-Constantin Mierla authored on 11/06/2015 08:49:10
Showing 1 changed files
... ...
@@ -42,8 +42,10 @@
42 42
 			</listitem>
43 43
 			<listitem>
44 44
 			<para>
45
-				CSeq is not increased during authentication - the response 
46
-				may be rejected.
45
+				CSeq is not increased automatically by uac_auth() during authentication
46
+				- the follow up request may be rejected. CSeq can be increased when
47
+				authenticating INVITE requests - dialog module has to be used, with
48
+				CSeq tracking feature enabled (see the readme of dialog module).
47 49
 			</para>
48 50
 			</listitem>
49 51
 			<listitem>
... ...
@@ -688,7 +690,31 @@ uac_restore_to();
688 688
 				<title><function>uac_auth</function> usage</title>
689 689
 				<programlisting format="linespecific">
690 690
 ...
691
-uac_auth();
691
+modparam("uac","auth_username_avp","$avp(auser)")
692
+modparam("uac","auth_password_avp","$avp(apass)")
693
+modparam("uac","auth_realm_avp","$avp(arealm)")
694
+
695
+request_route {
696
+   ...
697
+   if(is_method("INVITE")) {
698
+      t_on_failure("TRUNKAUTH");
699
+   }
700
+   ...
701
+}
702
+
703
+failure_route[TRUNKAUTH] {
704
+
705
+    if (t_is_canceled()) {
706
+        exit;
707
+    }
708
+    if(t_check_status("401|407")) {
709
+        $avp(auser) = "test";
710
+        $avp(apass) = "test";
711
+        uac_auth();
712
+        t_relay();
713
+        exit;
714
+    }
715
+}
692 716
 ...
693 717
 				</programlisting>
694 718
 			</example>