Made "style" change requested by Kevin Fleming... used initializer in declaration,
brought decl down to block where the variable is used, got rid of memset. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
14beac0408
commit
e648f4ddb4
1 changed files with 3 additions and 17 deletions
|
@ -253,8 +253,6 @@ static const struct ast_channel_tech oh323_tech = {
|
||||||
/* Channel and private structures should be already locked */
|
/* Channel and private structures should be already locked */
|
||||||
static void __oh323_update_info(struct ast_channel *c, struct oh323_pvt *pvt)
|
static void __oh323_update_info(struct ast_channel *c, struct oh323_pvt *pvt)
|
||||||
{
|
{
|
||||||
struct ast_frame f;
|
|
||||||
|
|
||||||
if (c->nativeformats != pvt->nativeformats) {
|
if (c->nativeformats != pvt->nativeformats) {
|
||||||
if (h323debug)
|
if (h323debug)
|
||||||
ast_log(LOG_DEBUG, "Preparing %s for new native format\n", c->name);
|
ast_log(LOG_DEBUG, "Preparing %s for new native format\n", c->name);
|
||||||
|
@ -280,14 +278,9 @@ static void __oh323_update_info(struct ast_channel *c, struct oh323_pvt *pvt)
|
||||||
pvt->newcontrol = -1;
|
pvt->newcontrol = -1;
|
||||||
}
|
}
|
||||||
if (pvt->newdigit >= 0) {
|
if (pvt->newdigit >= 0) {
|
||||||
memset(&f, 0, sizeof(f));
|
struct ast_frame f = {AST_FRAME_DTMF, pvt->newdigit, };
|
||||||
f.frametype = AST_FRAME_DTMF;
|
|
||||||
f.subclass = pvt->newdigit;
|
|
||||||
f.datalen = 0;
|
|
||||||
f.samples = 800;
|
f.samples = 800;
|
||||||
f.offset = 0;
|
|
||||||
f.data = NULL;
|
|
||||||
f.mallocd = 0;
|
|
||||||
f.src = "UPDATE_INFO";
|
f.src = "UPDATE_INFO";
|
||||||
ast_queue_frame(c, &f);
|
ast_queue_frame(c, &f);
|
||||||
pvt->newdigit = -1;
|
pvt->newdigit = -1;
|
||||||
|
@ -1156,7 +1149,6 @@ struct oh323_alias *find_alias(const char *source_aliases)
|
||||||
int send_digit(unsigned call_reference, char digit, const char *token)
|
int send_digit(unsigned call_reference, char digit, const char *token)
|
||||||
{
|
{
|
||||||
struct oh323_pvt *pvt;
|
struct oh323_pvt *pvt;
|
||||||
struct ast_frame f;
|
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
ast_log(LOG_DEBUG, "Received Digit: %c\n", digit);
|
ast_log(LOG_DEBUG, "Received Digit: %c\n", digit);
|
||||||
|
@ -1166,14 +1158,8 @@ int send_digit(unsigned call_reference, char digit, const char *token)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (pvt->owner && !ast_mutex_trylock(&pvt->owner->lock)) {
|
if (pvt->owner && !ast_mutex_trylock(&pvt->owner->lock)) {
|
||||||
memset(&f, 0, sizeof(f));
|
struct ast_frame f = {AST_FRAME_DTMF, digit, };
|
||||||
f.frametype = AST_FRAME_DTMF;
|
|
||||||
f.subclass = digit;
|
|
||||||
f.datalen = 0;
|
|
||||||
f.samples = 800;
|
f.samples = 800;
|
||||||
f.offset = 0;
|
|
||||||
f.data = NULL;
|
|
||||||
f.mallocd = 0;
|
|
||||||
f.src = "SEND_DIGIT";
|
f.src = "SEND_DIGIT";
|
||||||
res = ast_queue_frame(pvt->owner, &f);
|
res = ast_queue_frame(pvt->owner, &f);
|
||||||
ast_mutex_unlock(&pvt->owner->lock);
|
ast_mutex_unlock(&pvt->owner->lock);
|
||||||
|
|
Loading…
Reference in a new issue