Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| examples:restrict-calls-to-registered-users [2011/08/19 07:02] – 92.112.119.221 | examples:restrict-calls-to-registered-users [2012/03/22 12:41] (current) – removed spam 80.250.1.245 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== How to restrict calls to only registered users ====== | ||
| + | |||
| + | |||
| + | There are a couple of ways to authenticate INVITEs. | ||
| + | |||
| + | Using membership in the grp table you can try the following: | ||
| + | |||
| + | if (!is_user_in(" | ||
| + | exit; | ||
| + | }; | ||
| + | |||
| + | You need to insert a username, domain and grp=" | ||
| + | |||
| + | If you would like to use AVP's, the following example might work for you: | ||
| + | |||
| + | if (avp_db_load(" | ||
| + | if (!avp_check(" | ||
| + | exit; | ||
| + | }; | ||
| + | }; | ||
| + | |||
| + | You need to insert a username, domain, attribute=" | ||
| + | |||
| + | Another (or additional) test would be to execute the following logic: | ||
| + | |||
| + | if (is_method(" | ||
| + | if (!proxy_authorize("", | ||
| + | proxy_challenge("", | ||
| + | exit; | ||
| + | } else if (!check_from()) { | ||
| + | sl_send_reply(" | ||
| + | exit; | ||
| + | } else { | ||
| + | append_rpid_hf(); | ||
| + | }; | ||
| + | consume_credentials(); | ||
| + | }; | ||
| + | |||
| + | It is possible to use all three methods above at the same time to provide granular control over INVITEs. | ||