diff options
Diffstat (limited to 'channels/iax2')
-rw-r--r-- | channels/iax2/include/iax2.h | 4 | ||||
-rw-r--r-- | channels/iax2/include/parser.h | 4 | ||||
-rw-r--r-- | channels/iax2/parser.c | 26 | ||||
-rw-r--r-- | channels/iax2/provision.c | 22 |
4 files changed, 28 insertions, 28 deletions
diff --git a/channels/iax2/include/iax2.h b/channels/iax2/include/iax2.h index ca9ab74dd..3deb5dbcd 100644 --- a/channels/iax2/include/iax2.h +++ b/channels/iax2/include/iax2.h @@ -2,7 +2,7 @@ * Asterisk -- An open source telephony toolkit. * * Implementation of Inter-Asterisk eXchange - * + * * Copyright (C) 2003, Digium * * Mark Spencer <markster@linux-support.net> @@ -19,7 +19,7 @@ * \ref iax2-parser.h * \ref chan_iax2.c */ - + #ifndef _IAX2_H #define _IAX2_H diff --git a/channels/iax2/include/parser.h b/channels/iax2/include/parser.h index 7c9ba2ab5..d8edc4b2a 100644 --- a/channels/iax2/include/parser.h +++ b/channels/iax2/include/parser.h @@ -2,7 +2,7 @@ * Asterisk -- An open source telephony toolkit. * * Implementation of Inter-Asterisk eXchange - * + * * Copyright (C) 2003, Digium * * Mark Spencer <markster@digium.com> @@ -14,7 +14,7 @@ /*!\file * \brief Implementation of the IAX2 protocol */ - + #ifndef _IAX2_PARSER_H #define _IAX2_PARSER_H diff --git a/channels/iax2/parser.c b/channels/iax2/parser.c index 09c13238d..c003a821d 100644 --- a/channels/iax2/parser.c +++ b/channels/iax2/parser.c @@ -20,7 +20,7 @@ * * \brief Implementation of Inter-Asterisk eXchange Protocol, v 2 * - * \author Mark Spencer <markster@digium.com> + * \author Mark Spencer <markster@digium.com> */ /*** MODULEINFO @@ -138,7 +138,7 @@ static void dump_prefs(char *output, int maxlen, void *value, int len) strncpy(output, value, maxlen); output[maxlen] = '\0'; - + iax2_codec_pref_convert(&pref, output, total_len, 0); memset(output,0,total_len); iax2_codec_pref_string(&pref, output, total_len); @@ -149,7 +149,7 @@ static void dump_int(char *output, int maxlen, void *value, int len) if (len == (int)sizeof(unsigned int)) snprintf(output, maxlen, "%lu", (unsigned long)ntohl(get_unaligned_uint32(value))); else - ast_copy_string(output, "Invalid INT", maxlen); + ast_copy_string(output, "Invalid INT", maxlen); } static void dump_short(char *output, int maxlen, void *value, int len) @@ -179,7 +179,7 @@ static void dump_datetime(char *output, int maxlen, void *value, int len) tm.tm_mday = (val >> 16) & 0x1f; tm.tm_mon = ((val >> 21) & 0x0f) - 1; tm.tm_year = ((val >> 25) & 0x7f) + 100; - ast_strftime(output, maxlen, "%Y-%m-%d %T", &tm); + ast_strftime(output, maxlen, "%Y-%m-%d %T", &tm); } else ast_copy_string(output, "Invalid DATETIME format!", maxlen); } @@ -368,7 +368,7 @@ static void dump_prov_ies(char *output, int maxlen, unsigned char *iedata, int l char tmp[256]; if (len < 2) return; - strcpy(output, "\n"); + strcpy(output, "\n"); maxlen -= strlen(output); output += strlen(output); while(len > 2) { ie = iedata[0]; @@ -750,14 +750,14 @@ int iax_ie_append_versioned_uint64(struct iax_ie_data *ied, unsigned char ie, un return iax_ie_append_raw(ied, ie, &newval, (int) sizeof(newval)); } -int iax_ie_append_int(struct iax_ie_data *ied, unsigned char ie, unsigned int value) +int iax_ie_append_int(struct iax_ie_data *ied, unsigned char ie, unsigned int value) { unsigned int newval; newval = htonl(value); return iax_ie_append_raw(ied, ie, &newval, (int)sizeof(newval)); } -int iax_ie_append_short(struct iax_ie_data *ied, unsigned char ie, unsigned short value) +int iax_ie_append_short(struct iax_ie_data *ied, unsigned char ie, unsigned short value) { unsigned short newval; newval = htons(value); @@ -774,7 +774,7 @@ int iax_ie_append_byte(struct iax_ie_data *ied, unsigned char ie, unsigned char return iax_ie_append_raw(ied, ie, &dat, 1); } -int iax_ie_append(struct iax_ie_data *ied, unsigned char ie) +int iax_ie_append(struct iax_ie_data *ied, unsigned char ie) { return iax_ie_append_raw(ied, ie, NULL, 0); } @@ -980,7 +980,7 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen) snprintf(tmp, (int)sizeof(tmp), "Expecting msgcount to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len); errorf(tmp); } else - ies->msgcount = ntohs(get_unaligned_uint16(data + 2)); + ies->msgcount = ntohs(get_unaligned_uint16(data + 2)); break; case IAX_IE_AUTOANSWER: ies->autoanswer = 1; @@ -1007,7 +1007,7 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen) snprintf(tmp, (int)sizeof(tmp), "Expecting firmwarever to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len); errorf(tmp); } else - ies->firmwarever = ntohs(get_unaligned_uint16(data + 2)); + ies->firmwarever = ntohs(get_unaligned_uint16(data + 2)); break; case IAX_IE_DEVICETYPE: ies->devicetype = (char *)data + 2; @@ -1060,7 +1060,7 @@ int iax_parse_ies(struct iax_ies *ies, unsigned char *data, int datalen) snprintf(tmp, (int)sizeof(tmp), "Expecting callingtns to be %d bytes long but was %d\n", (int)sizeof(unsigned short), len); errorf(tmp); } else - ies->calling_tns = ntohs(get_unaligned_uint16(data + 2)); + ies->calling_tns = ntohs(get_unaligned_uint16(data + 2)); break; case IAX_IE_RR_JITTER: if (len != (int)sizeof(unsigned int)) { @@ -1269,12 +1269,12 @@ struct iax_frame *iax_frame_new(int direction, int datalen, unsigned int cacheab fr->direction = direction; fr->retrans = -1; - + if (fr->direction == DIRECTION_INGRESS) ast_atomic_fetchadd_int(&iframes, 1); else ast_atomic_fetchadd_int(&oframes, 1); - + ast_atomic_fetchadd_int(&frames, 1); return fr; diff --git a/channels/iax2/provision.c b/channels/iax2/provision.c index 85dfe9448..2d12ebbb1 100644 --- a/channels/iax2/provision.c +++ b/channels/iax2/provision.c @@ -17,8 +17,8 @@ */ /*! \file - * - * \brief IAX Provisioning Protocol + * + * \brief IAX Provisioning Protocol * * \author Mark Spencer <markster@digium.com> */ @@ -95,7 +95,7 @@ char *iax_provflags2str(char *buf, int buflen, unsigned int flags) if (!buf || buflen < 1) return NULL; - + buf[0] = '\0'; for (x = 0; x < ARRAY_LEN(iax_flags); x++) { @@ -105,7 +105,7 @@ char *iax_provflags2str(char *buf, int buflen, unsigned int flags) } } - if (!ast_strlen_zero(buf)) + if (!ast_strlen_zero(buf)) buf[strlen(buf) - 1] = '\0'; else strncpy(buf, "none", buflen - 1); @@ -241,7 +241,7 @@ int iax_provision_build(struct iax_ie_data *provdata, unsigned int *signature, c iax_ie_append_int(provdata, PROV_IE_FORMAT, cur->format); if (force || cur->tos) iax_ie_append_byte(provdata, PROV_IE_TOS, cur->tos); - + /* Calculate checksum of message so far */ sig = prov_ver_calc(provdata); if (signature) @@ -301,7 +301,7 @@ static int iax_template_parse(struct iax_template *cur, struct ast_config *cfg, ast_log(LOG_WARNING, "Unable to find base template '%s' for creating '%s'. Trying '%s'\n", t, s, def); else def = t; - } + } if (!src) { src = iax_template_find(def, 0); if (!src) @@ -344,7 +344,7 @@ static int iax_template_parse(struct iax_template *cur, struct ast_config *cfg, cur->server = ntohl(ia.s_addr); else cur->altserver = ntohl(ia.s_addr); - } else + } else ast_log(LOG_WARNING, "Ignoring invalid %s '%s' for '%s' at line %d\n", v->name, v->value, s, v->lineno); } else if (!strcasecmp(v->name, "codec")) { struct ast_format *tmpfmt; @@ -427,10 +427,10 @@ static const char *ifthere(const char *s) static const char *iax_server(unsigned int addr) { struct in_addr ia; - + if (!addr) return "<unspecified>"; - + ia.s_addr = htonl(addr); return ast_inet_ntoa(ia); @@ -463,7 +463,7 @@ static char *iax_show_provisioning(struct ast_cli_entry *e, int cmd, struct ast_ ast_mutex_lock(&provlock); AST_LIST_TRAVERSE(&templates, cur, list) { if ((a->argc == 3) || (!strcasecmp(a->argv[3], cur->name))) { - if (found) + if (found) ast_cli(a->fd, "\n"); ast_copy_string(server, iax_server(cur->server), sizeof(server)); ast_copy_string(alternate, iax_server(cur->altserver), sizeof(alternate)); @@ -537,7 +537,7 @@ int iax_provision_reload(int reload) struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 }; if (!provinit) iax_provision_init(); - + cfg = ast_config_load2("iaxprov.conf", "chan_iax2", config_flags); if (cfg != NULL && cfg != CONFIG_STATUS_FILEUNCHANGED && cfg != CONFIG_STATUS_FILEINVALID) { /* Mark all as dead. No need for locking */ |