Browse code

secsipid: docs for secsipid_build_identity(...) function

Daniel-Constantin Mierla authored on 17/06/2021 14:35:55
Showing 1 changed files
... ...
@@ -322,6 +322,42 @@ request_route {
322 322
     ...
323 323
 }
324 324
 ...
325
+</programlisting>
326
+		</example>
327
+	</section>
328
+	<section id="secsipid.f.secsipid_build_identity">
329
+		<title>
330
+		<function moreinfo="none">secsipid_build_identity(origTN, destTN, attest, origID, x5u, keyPath)</function>
331
+		</title>
332
+		<para>
333
+			Build Identity value using the key specified by "keyPath" to sign the JWT body.
334
+			If origID is empty, a UUID string is generated to fill the field. The origTN
335
+			represents the origination telephone number; destTN represents the destination
336
+			telephone number; x5u is the HTTP URL referencing to the public key that
337
+			should be used to verify the signature; attest represents the attestation
338
+			level (should be "A", "B" or "C"). On success, the Indentity value is
339
+			stored in variable $secsipid(val). It also sets $secsipid(ret) to
340
+			the return value of the libsecsipid functions.
341
+		</para>
342
+		<para>
343
+		The parameters can contain pseudo-variables.
344
+		</para>
345
+		<para>
346
+		This function can be used from ANY_ROUTE.
347
+		</para>
348
+		<example>
349
+		<title><function>secsipid_build_identity</function> usage</title>
350
+		<programlisting format="linespecific">
351
+...
352
+request_route {
353
+    ...
354
+    if(secsipid_build_identity("$fU", "$rU", "A", "",
355
+            "https://kamailio.org/stir/$rd/cert.pem", "/secsipid/$rd/key.pem")) {
356
+        xinfo("Identity value: $secsipid(val)\n");
357
+    }
358
+    ...
359
+}
360
+...
325 361
 </programlisting>
326 362
 		</example>
327 363
 	</section>