asterisk/asterisk.patch

changeset 315
75d162df42e8
parent 311
263143ec0fb2
child 316
153998c81c45
     1.1 --- a/asterisk/asterisk.patch	Tue Mar 22 19:46:20 2011 +0100
     1.2 +++ b/asterisk/asterisk.patch	Tue Mar 22 20:35:17 2011 +0100
     1.3 @@ -1282,3 +1282,56 @@
     1.4   		</member>
     1.5   		<member name="EXTRA-SOUNDS-EN-SLN16" displayname="English, Signed-linear 16kHz format">
     1.6   		</member>
     1.7 +Index: cdr/cdr_radius.c
     1.8 +diff -Nau cdr/cdr_radius.c.orig cdr/cdr_radius.c
     1.9 +--- cdr/cdr_radius.c.orig	2010-07-20 21:35:02.000000000 +0200
    1.10 ++++ cdr/cdr_radius.c	2011-03-22 16:12:11.000000000 +0100
    1.11 +@@ -105,10 +105,18 @@
    1.12 + 	if (!rc_avpair_add(rh, tosend, PW_AST_SRC, &cdr->src, strlen(cdr->src), VENDOR_CODE))
    1.13 + 		return -1;
    1.14 + 
    1.15 ++ 	/* RADIUS standard identifier patch */
    1.16 ++	if (!rc_avpair_add(rh, tosend, PW_CALLING_STATION_ID, &cdr->src, strlen(cdr->src), 0))
    1.17 ++		return -1;
    1.18 ++
    1.19 +  	/* Destination */
    1.20 + 	if (!rc_avpair_add(rh, tosend, PW_AST_DST, &cdr->dst, strlen(cdr->dst), VENDOR_CODE))
    1.21 + 		return -1;
    1.22 + 
    1.23 ++ 	/* RADIUS standard identifier patch */
    1.24 ++	if (!rc_avpair_add(rh, tosend, PW_CALLED_STATION_ID, &cdr->dst, strlen(cdr->dst), 0))
    1.25 ++		return -1;
    1.26 ++
    1.27 +  	/* Destination context */
    1.28 + 	if (!rc_avpair_add(rh, tosend, PW_AST_DST_CTX, &cdr->dcontext, strlen(cdr->dcontext), VENDOR_CODE))
    1.29 + 		return -1;
    1.30 +@@ -163,6 +171,10 @@
    1.31 + 	if (!rc_avpair_add(rh, tosend, PW_AST_BILL_SEC, &cdr->billsec, 0, VENDOR_CODE))
    1.32 + 		return -1;
    1.33 + 
    1.34 ++ 	/* RADIUS standard identifier patch */
    1.35 ++	if (!rc_avpair_add(rh, tosend, PW_ACCT_SESSION_TIME, &cdr->billsec, 0, 0))
    1.36 ++		return -1;
    1.37 ++
    1.38 + 	/* Disposition */
    1.39 + 	tmp = ast_cdr_disp2str(cdr->disposition);
    1.40 + 	if (!rc_avpair_add(rh, tosend, PW_AST_DISPOSITION, tmp, strlen(tmp), VENDOR_CODE))
    1.41 +@@ -186,10 +198,14 @@
    1.42 + 	}
    1.43 + 
    1.44 + 	/* Setting Acct-Session-Id & User-Name attributes for proper generation
    1.45 +-	   of Acct-Unique-Session-Id on server side */
    1.46 +-	/* Channel */
    1.47 +-	if (!rc_avpair_add(rh, tosend, PW_USER_NAME, &cdr->channel, strlen(cdr->channel), 0))
    1.48 +-		return -1;
    1.49 ++	   of Acct-Unique-Session-Id on server side Channel */
    1.50 ++	{
    1.51 ++		char szChanuser[NAME_MAX] = {0};
    1.52 ++		strncpy(szChanuser, &cdr->channel, NAME_MAX-1);
    1.53 ++		*(strrchr(szChanuser, '-')) = 0;
    1.54 ++		if (!rc_avpair_add(rh, tosend, PW_USER_NAME, szChanuser, strlen(cdr->channel), 0))
    1.55 ++			return -1;
    1.56 ++	}
    1.57 + 
    1.58 + 	/* Unique ID */
    1.59 + 	if (!rc_avpair_add(rh, tosend, PW_ACCT_SESSION_ID, &cdr->uniqueid, strlen(cdr->uniqueid), 0))

mercurial