Index: apps/app_realtime.c =================================================================== RCS file: /usr/cvsroot/asterisk/apps/app_realtime.c,v retrieving revision 1.18 diff -u -r1.18 app_realtime.c --- apps/app_realtime.c 8 Nov 2005 04:48:00 -0000 1.18 +++ apps/app_realtime.c 14 Nov 2005 02:52:28 -0000 @@ -130,7 +130,8 @@ { char *family=NULL, *colmatch=NULL, *value=NULL, *newcol=NULL, *newval=NULL; struct localuser *u; - int res = 0; + int res = 0, count = 0; + char countc[13]; if (ast_strlen_zero(data)) { ast_log(LOG_ERROR,"Invalid input: usage %s\n",UUSAGE); @@ -156,9 +157,12 @@ ast_log(LOG_ERROR,"Invalid input: usage %s\n",UUSAGE); res = -1; } else { - ast_update_realtime(family,colmatch,value,newcol,newval,NULL); + count = ast_update_realtime(family,colmatch,value,newcol,newval,NULL); } + snprintf(countc, sizeof(countc), "%d", count); + pbx_builtin_setvar_helper(chan, "REALTIMECOUNT", countc); + LOCAL_USER_REMOVE(u); return res; @@ -167,10 +171,11 @@ static int realtime_exec(struct ast_channel *chan, void *data) { - int res=0; + int res=0, count=0; struct localuser *u; struct ast_variable *var, *itt; char *family=NULL, *colmatch=NULL, *value=NULL, *prefix=NULL, *vname=NULL; + char countc[13]; size_t len; if (ast_strlen_zero(data)) { @@ -207,11 +212,14 @@ vname = itt->name; pbx_builtin_setvar_helper(chan, vname, itt->value); + count++; } ast_variables_destroy(var); } else if (option_verbose > 3) ast_verbose(VERBOSE_PREFIX_4"No Realtime Matches Found.\n"); } + snprintf(countc, sizeof(countc), "%d", count); + pbx_builtin_setvar_helper(chan, "REALTIMECOUNT", countc); LOCAL_USER_REMOVE(u); return res;