[OpenSIPS-Devel] Patch for auth_aaa module

WhiteWind whitearchey at gmail.com
Mon Nov 9 01:15:26 CET 2009


Then I should append Digest attributes to request by myself using  
modparam("aaa_radius","sets", ...)

On Mon, 09 Nov 2009 02:48:54 +0800, Bogdan-Andrei Iancu  
<bogdan at voice-system.ro> wrote:

> 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)  ) {
>>
>>
>
>
> _______________________________________________
> Devel mailing list
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel


-- 
Написано в почтовом клиенте браузера Opera: http://www.opera.com/mail/



More information about the Devel mailing list