diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2001-05-03 23:57:34 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2001-05-03 23:57:34 +0000 |
commit | 006395f49a116551029c974d0f23aa4e46589361 (patch) | |
tree | 8af7b9dc59db0a20bb8c7a24117a0f78d234dab5 /file.c | |
parent | e244b0d372e2a432a628d8377e2e0b5d44bfce3e (diff) |
Version 0.1.8 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@310 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'file.c')
-rwxr-xr-x | file.c | 24 |
1 files changed, 14 insertions, 10 deletions
@@ -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); } |