From 006395f49a116551029c974d0f23aa4e46589361 Mon Sep 17 00:00:00 2001 From: markster Date: Thu, 3 May 2001 23:57:34 +0000 Subject: Version 0.1.8 from FTP git-svn-id: http://svn.digium.com/svn/asterisk/trunk@310 f38db490-d61c-443f-a65b-d21fe96a405b --- file.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'file.c') diff --git a/file.c b/file.c index 0ab0676e8..e38a4afb5 100755 --- a/file.c +++ b/file.c @@ -77,14 +77,14 @@ int ast_format_register(char *name, char *exts, int format, char * (*getcomment)(struct ast_filestream *)) { struct ast_format *tmp; - if (pthread_mutex_lock(&formatlock)) { + if (ast_pthread_mutex_lock(&formatlock)) { ast_log(LOG_WARNING, "Unable to lock format list\n"); return -1; } tmp = formats; while(tmp) { if (!strcasecmp(name, tmp->name)) { - pthread_mutex_unlock(&formatlock); + ast_pthread_mutex_unlock(&formatlock); ast_log(LOG_WARNING, "Tried to register '%s' format, already registered\n", name); return -1; } @@ -93,7 +93,7 @@ int ast_format_register(char *name, char *exts, int format, tmp = malloc(sizeof(struct ast_format)); if (!tmp) { ast_log(LOG_WARNING, "Out of memory\n"); - pthread_mutex_unlock(&formatlock); + ast_pthread_mutex_unlock(&formatlock); return -1; } strncpy(tmp->name, name, sizeof(tmp->name)); @@ -108,7 +108,7 @@ int ast_format_register(char *name, char *exts, int format, tmp->getcomment = getcomment; tmp->next = formats; formats = tmp; - pthread_mutex_unlock(&formatlock); + ast_pthread_mutex_unlock(&formatlock); if (option_verbose > 1) ast_verbose( VERBOSE_PREFIX_2 "Registered file format %s, extension(s) %s\n", name, exts); return 0; @@ -117,7 +117,7 @@ int ast_format_register(char *name, char *exts, int format, int ast_format_unregister(char *name) { struct ast_format *tmp, *tmpl = NULL; - if (pthread_mutex_lock(&formatlock)) { + if (ast_pthread_mutex_lock(&formatlock)) { ast_log(LOG_WARNING, "Unable to lock format list\n"); return -1; } @@ -129,7 +129,7 @@ int ast_format_unregister(char *name) else formats = tmp->next; free(tmp); - pthread_mutex_unlock(&formatlock); + ast_pthread_mutex_unlock(&formatlock); if (option_verbose > 1) ast_verbose( VERBOSE_PREFIX_2 "Unregistered format %s\n", name); return 0; @@ -228,7 +228,7 @@ static int ast_filehelper(char *filename, char *filename2, char *fmt, int action if (action == ACTION_OPEN) ret = -1; /* Check for a specific format */ - if (pthread_mutex_lock(&formatlock)) { + if (ast_pthread_mutex_lock(&formatlock)) { ast_log(LOG_WARNING, "Unable to lock format list\n"); if (action == ACTION_EXISTS) return 0; @@ -304,7 +304,7 @@ static int ast_filehelper(char *filename, char *filename2, char *fmt, int action } f = f->next; } - pthread_mutex_unlock(&formatlock); + ast_pthread_mutex_unlock(&formatlock); if ((action == ACTION_EXISTS) || (action == ACTION_OPEN)) res = ret ? ret : -1; return res; @@ -404,7 +404,7 @@ struct ast_filestream *ast_writefile(char *filename, char *type, char *comment, struct ast_filestream *fs=NULL; char *fn; char *ext; - if (pthread_mutex_lock(&formatlock)) { + if (ast_pthread_mutex_lock(&formatlock)) { ast_log(LOG_WARNING, "Unable to lock format list\n"); return NULL; } @@ -434,7 +434,7 @@ struct ast_filestream *ast_writefile(char *filename, char *type, char *comment, } f = f->next; } - pthread_mutex_unlock(&formatlock); + ast_pthread_mutex_unlock(&formatlock); if (!f) ast_log(LOG_WARNING, "No such format '%s'\n", type); return fs; @@ -476,6 +476,10 @@ char ast_waitstream(struct ast_channel *c, char *breakon) case AST_CONTROL_HANGUP: ast_frfree(fr); return -1; + case AST_CONTROL_RINGING: + case AST_CONTROL_ANSWER: + /* Unimportant */ + break; default: ast_log(LOG_WARNING, "Unexpected control subclass '%d'\n", fr->subclass); } -- cgit v1.2.3