# HG changeset patch # User Michael Schloh von Bennewitz # Date 1300822517 -3600 # Node ID 75d162df42e8edf07d2c94b7174534af7a2512df # Parent 1f760a8355e2acb4db39cc5d8ee568ab924648af Implement standard RADIUS identifers and modify AAA username to be constant. diff -r 1f760a8355e2 -r 75d162df42e8 asterisk/asterisk.patch --- a/asterisk/asterisk.patch Tue Mar 22 19:46:20 2011 +0100 +++ b/asterisk/asterisk.patch Tue Mar 22 20:35:17 2011 +0100 @@ -1282,3 +1282,56 @@ +Index: cdr/cdr_radius.c +diff -Nau cdr/cdr_radius.c.orig cdr/cdr_radius.c +--- cdr/cdr_radius.c.orig 2010-07-20 21:35:02.000000000 +0200 ++++ cdr/cdr_radius.c 2011-03-22 16:12:11.000000000 +0100 +@@ -105,10 +105,18 @@ + if (!rc_avpair_add(rh, tosend, PW_AST_SRC, &cdr->src, strlen(cdr->src), VENDOR_CODE)) + return -1; + ++ /* RADIUS standard identifier patch */ ++ if (!rc_avpair_add(rh, tosend, PW_CALLING_STATION_ID, &cdr->src, strlen(cdr->src), 0)) ++ return -1; ++ + /* Destination */ + if (!rc_avpair_add(rh, tosend, PW_AST_DST, &cdr->dst, strlen(cdr->dst), VENDOR_CODE)) + return -1; + ++ /* RADIUS standard identifier patch */ ++ if (!rc_avpair_add(rh, tosend, PW_CALLED_STATION_ID, &cdr->dst, strlen(cdr->dst), 0)) ++ return -1; ++ + /* Destination context */ + if (!rc_avpair_add(rh, tosend, PW_AST_DST_CTX, &cdr->dcontext, strlen(cdr->dcontext), VENDOR_CODE)) + return -1; +@@ -163,6 +171,10 @@ + if (!rc_avpair_add(rh, tosend, PW_AST_BILL_SEC, &cdr->billsec, 0, VENDOR_CODE)) + return -1; + ++ /* RADIUS standard identifier patch */ ++ if (!rc_avpair_add(rh, tosend, PW_ACCT_SESSION_TIME, &cdr->billsec, 0, 0)) ++ return -1; ++ + /* Disposition */ + tmp = ast_cdr_disp2str(cdr->disposition); + if (!rc_avpair_add(rh, tosend, PW_AST_DISPOSITION, tmp, strlen(tmp), VENDOR_CODE)) +@@ -186,10 +198,14 @@ + } + + /* Setting Acct-Session-Id & User-Name attributes for proper generation +- of Acct-Unique-Session-Id on server side */ +- /* Channel */ +- if (!rc_avpair_add(rh, tosend, PW_USER_NAME, &cdr->channel, strlen(cdr->channel), 0)) +- return -1; ++ of Acct-Unique-Session-Id on server side Channel */ ++ { ++ char szChanuser[NAME_MAX] = {0}; ++ strncpy(szChanuser, &cdr->channel, NAME_MAX-1); ++ *(strrchr(szChanuser, '-')) = 0; ++ if (!rc_avpair_add(rh, tosend, PW_USER_NAME, szChanuser, strlen(cdr->channel), 0)) ++ return -1; ++ } + + /* Unique ID */ + if (!rc_avpair_add(rh, tosend, PW_ACCT_SESSION_ID, &cdr->uniqueid, strlen(cdr->uniqueid), 0)) diff -r 1f760a8355e2 -r 75d162df42e8 asterisk/asterisk.spec --- a/asterisk/asterisk.spec Tue Mar 22 19:46:20 2011 +0100 +++ b/asterisk/asterisk.spec Tue Mar 22 20:35:17 2011 +0100 @@ -49,7 +49,7 @@ Group: VoIP License: GPL Version: %{V_opkg} -Release: 20110314 +Release: 20110316 # package options %option with_dahdi no