[Asterisk-cvs] asterisk manager.c,1.72,1.73
citats at lists.digium.com
citats at lists.digium.com
Fri Sep 17 10:11:06 CDT 2004
Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/home/citats/cvs/asterisk
Modified Files:
manager.c
Log Message:
Cleanup code. Spacing issues, nested if issues, lots of strlen used instead of ast_strlen_zero
Index: manager.c
===================================================================
RCS file: /usr/cvsroot/asterisk/manager.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- manager.c 14 Sep 2004 22:15:50 -0000 1.72
+++ manager.c 17 Sep 2004 14:15:11 -0000 1.73
@@ -814,22 +814,22 @@
} else {
res = ast_pbx_outgoing_exten(in->tech, AST_FORMAT_SLINEAR, in->data, in->timeout, in->context, in->exten, in->priority, &reason, 1, !ast_strlen_zero(in->callerid) ? in->callerid : NULL, in->variable, in->account);
}
- if(!res)
- manager_event(EVENT_FLAG_CALL,
- "OriginateSuccess",
- "%s"
- "Channel: %s/%s\r\n"
- "Context: %s\r\n"
- "Exten: %s\r\n",
- in->tech, in->data, in->idtext, in->context, in->exten);
- else
- manager_event(EVENT_FLAG_CALL,
- "OriginateFailure",
- "%s"
- "Channel: %s/%s\r\n"
- "Context: %s\r\n"
- "Exten: %s\r\n",
- in->tech, in->data, in->idtext, in->context, in->exten);
+ if (!res)
+ manager_event(EVENT_FLAG_CALL,
+ "OriginateSuccess",
+ "%s"
+ "Channel: %s/%s\r\n"
+ "Context: %s\r\n"
+ "Exten: %s\r\n",
+ in->tech, in->data, in->idtext, in->context, in->exten);
+ else
+ manager_event(EVENT_FLAG_CALL,
+ "OriginateFailure",
+ "%s"
+ "Channel: %s/%s\r\n"
+ "Context: %s\r\n"
+ "Exten: %s\r\n",
+ in->tech, in->data, in->idtext, in->context, in->exten);
free(in);
return NULL;
@@ -894,15 +894,11 @@
}
*data = '\0';
data++;
- if (ast_true(async))
- {
+ if (ast_true(async)) {
struct fast_originate_helper *fast = malloc(sizeof(struct fast_originate_helper));
- if (!fast)
- {
+ if (!fast) {
res = -1;
- }
- else
- {
+ } else {
memset(fast, 0, sizeof(struct fast_originate_helper));
if (id && !ast_strlen_zero(id))
snprintf(fast->idtext, sizeof(fast->idtext), "ActionID: %s\r\n", id);
@@ -919,12 +915,9 @@
fast->priority = pi;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- if (ast_pthread_create(&th, &attr, fast_originate, fast))
- {
+ if (ast_pthread_create(&th, &attr, fast_originate, fast)) {
res = -1;
- }
- else
- {
+ } else {
res = 0;
}
}
More information about the svn-commits
mailing list