Skip to content

Commit 8232ff0

Browse files
committed
registrar docs: Fix misleading $(ct[1]) example input
The $(ct[1]) value is actually a full Contact header body, not just the URI. This, in turn, leads to a silent failure of is_contact_registered() even on the happy path, which can be time-consuming to debug... Credits to Bogdan Iancu for spotting this!
1 parent 5f8376d commit 8232ff0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

modules/registrar/doc/registrar_admin.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -894,17 +894,17 @@ if (is_registered("location",$fu)) {
894894
<title><function>is_contact_registered</function> usage</title>
895895
<programlisting format="linespecific">
896896
...
897-
/*let's say you want to block users that are not registered*/
897+
/* block users which are not registered... */
898898
if (is_method("INVITE")) {
899899
if (!is_contact_registered("location")) {
900900
sl_send_reply(401, "Unauthorized");
901-
...
901+
...
902902
}
903903
}
904-
/* you want to check the second contact from the message whether it is
905-
registered or not */
906-
if(is_method("INVITE")) {
907-
if (is_contact_registered("location",$fu,$(ct[1]),))
904+
905+
/* ... or check whether the 2nd Contact URI is registered or not */
906+
if (is_method("INVITE")) {
907+
if (is_contact_registered("location", $fu, $(ct.fields(uri)[1])))
908908
xlog("caller is registered\n");
909909
}
910910
...

0 commit comments

Comments
 (0)