[OpenSIPS-Devel] Patch for auth_aaa module

Bogdan-Andrei Iancu bogdan at voice-system.ro
Sun Nov 8 19:48:54 CET 2009


Hi,

Couldn't you obtain this functionality by using a custom set (see 
http://www.opensips.org/html/docs/modules/devel/aaa_radius.html#id227231) 
to push extra information that you need.

If there is something different, please let me know.

Regards,
Bogdan

WhiteWind wrote:
> I needed proper auth of INVITE requests and I implemented it.
> I wish to see this patch in the mainstream and I'm ready to correct this  
> patch if it doesn't fit some standards or contains bugs
>
> Index: modules/auth_aaa/authaaa_mod.c
> ===================================================================
> --- modules/auth_aaa/authaaa_mod.c      (revision 6274)
> +++ modules/auth_aaa/authaaa_mod.c      (working copy)
> @@ -119,6 +119,8 @@
>
>          memset(attrs, 0, sizeof(attrs));
>          memset(vals, 0, sizeof(vals));
> +       attrs[A_CALLED_STATION_ID].name                 =  
> "Called-Station-Id";
> +       attrs[A_CALLING_STATION_ID].name                =  
> "Calling-Station-Id";
>          attrs[A_SERVICE_TYPE].name                      = "Service-Type";
>          attrs[A_SIP_URI_USER].name                      = "Sip-URI-User";
>          attrs[A_DIGEST_RESPONSE].name           = "Digest-Response";
> Index: modules/auth_aaa/sterman.c
> ===================================================================
> --- modules/auth_aaa/sterman.c  (revision 6274)
> +++ modules/auth_aaa/sterman.c  (working copy)
> @@ -231,6 +231,21 @@
>                  goto err;
>          }
>
> +       if (method.len == 6 && !strncmp(method.s, "INVITE", 6)) {
> +            struct sip_uri *uri = parse_to_uri(_msg);
> +            if (uri && uri->user.s)
> +                if (proto.avp_add(conn, send,  
> &attrs[A_CALLED_STATION_ID], uri->user.s,
> +                                  uri->user.len, 0)) {
> +                        LM_ERR("unable to add Called-Station-Id  
> attribute\n");
> +                        goto err;
> +                }
> +
> +            if (proto.avp_add(conn, send, &attrs[A_CALLING_STATION_ID],  
> user.s,user.len,0)) {
> +                    LM_ERR("unable to add Calling-Station-Id  
> attribute\n");
> +                    goto err;
> +            }
> +        }
> +
>          /* Add CALL-ID in Acct-Session-Id Attribute */
>          if ( _msg->callid==NULL &&
>                  (parse_headers(_msg, HDR_CALLID_F, 0)==-1 ||  
> _msg->callid==NULL)  ) {
>
>   




More information about the Devel mailing list