mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	Add application to log user data to the CDRs
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		
							
								
								
									
										21
									
								
								cdr.c
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								cdr.c
									
									
									
									
									
								
							| @@ -345,6 +345,27 @@ int ast_cdr_setaccount(struct ast_channel *chan, char *account) | ||||
| 	return 0; | ||||
| } | ||||
|  | ||||
| int ast_cdr_setuserfield(struct ast_channel *chan, char *userfield) | ||||
| { | ||||
| 	struct ast_cdr *cdr = chan->cdr; | ||||
|  | ||||
| 	if (cdr) | ||||
| 		strncpy(cdr->userfield, userfield, sizeof(cdr->userfield) - 1); | ||||
| 	return 0; | ||||
| } | ||||
|  | ||||
| int ast_cdr_appenduserfield(struct ast_channel *chan, char *userfield) | ||||
| { | ||||
| 	struct ast_cdr *cdr = chan->cdr; | ||||
|  | ||||
| 	if (cdr) | ||||
| 	{ | ||||
| 		int len = strlen(cdr->userfield); | ||||
| 		strncpy(cdr->userfield+len, userfield, sizeof(cdr->userfield) - len - 1); | ||||
| 	} | ||||
| 	return 0; | ||||
| } | ||||
|  | ||||
| int ast_cdr_update(struct ast_channel *c) | ||||
| { | ||||
| 	struct ast_cdr *cdr = c->cdr; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user