User Tools

Site Tools


tutorials:auth:auth_db

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tutorials:auth:auth_db [2014/12/09 21:49] eschmidbauertutorials:auth:auth_db [2014/12/09 21:52] eschmidbauer
Line 65: Line 65:
 </code> </code>
  
 +<code>
 +route[REGISTER]
 +{
 +        if (is_method("REGISTER")) {
 +                # auth user/pass
 +                if(!www_authenticate("$fd", "user_extension")) {
 +                        www_challenge("$fd", "1");
 +                }
 +
 +                if (!save("sip_registration")) {
 +                        sl_reply_error();
 +                }
 +                exit;
 +        }
 +
 +}
 +</code>
 +
 +<code>
 +# Handle INVITE + REFER
 +route[INVITE]
 +{
 +        # record routing for dialog forming requests (in case they are routed)
 +        # remove preloaded route headers
 +        remove_hf("Route");
 +        if (is_method("INVITE|REFER")) {
 +                record_route();
 +               # auth user/pass
 +                if (!proxy_authenticate("$fd", "user_extension")) {
 +                        proxy_challenge("$fd", "1");
 +                        exit;
 +                }
 +        }
 +}
 +</code>
tutorials/auth/auth_db.txt · Last modified: 2014/12/09 21:55 by eschmidbauer

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki