[asterisk-commits] seanbright: branch seanbright/NoLossCDR-Redux r104076 - in /team/seanbright/N...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Feb 23 21:20:58 CST 2008
Author: seanbright
Date: Sat Feb 23 21:20:57 2008
New Revision: 104076
URL: http://svn.digium.com/view/asterisk?view=rev&rev=104076
Log:
Merged revisions 104014,104016,104019-104020,104024-104025,104028-104029,104031,104036,104038-104039,104045,104073-104074 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r104014 | tilghman | 2008-02-21 00:21:39 -0500 (Thu, 21 Feb 2008) | 6 lines
Ignore some more unused generated events.
(closes issue #12042)
Reported by: junky
Patches:
astman_events.diff uploaded by junky (license 177)
................
r104016 | kpfleming | 2008-02-21 09:44:04 -0500 (Thu, 21 Feb 2008) | 10 lines
Merged revisions 104015 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r104015 | kpfleming | 2008-02-21 08:33:51 -0600 (Thu, 21 Feb 2008) | 2 lines
reduce the likelihood that HTTP Manager session ids will consist of primarily '1' bits
........
................
r104019 | file | 2008-02-21 11:44:57 -0500 (Thu, 21 Feb 2008) | 8 lines
Disable epoll as it has caused more obscure issues then any of my previous code. I will continue to work on it in a separate branch to make it stable for a release and test it against the following issues.
(closes issue #11253)
Reported by: falves11
(closes issue #11657)
Reported by: davevg
(closes issue #11033)
Reported by: falves11
................
r104020 | mmichelson | 2008-02-21 11:46:37 -0500 (Thu, 21 Feb 2008) | 7 lines
Don't print the fact that we are using dead mode in AGI if called from the
'h' extension since it is well-known that it will be running in dead mode.
(closes issue #12046)
Reported by: explidous
................
r104024 | dbailey | 2008-02-21 12:38:40 -0500 (Thu, 21 Feb 2008) | 4 lines
Added configuration distinction between neon and fsk mwi detection
Add the detection for neon MWI events
got rid of extraneous handle_init_event call in monitor loop
................
r104025 | mmichelson | 2008-02-21 12:44:34 -0500 (Thu, 21 Feb 2008) | 4 lines
Instead of a notice, make the message about a hung-up channel a debug message, and revert the original
logic on the if statement. Thanks to Juggie for bringing this to my attention.
................
r104028 | mmichelson | 2008-02-21 16:09:11 -0500 (Thu, 21 Feb 2008) | 14 lines
Blocked revisions 104026 via svnmerge
........
r104026 | mmichelson | 2008-02-21 14:12:38 -0600 (Thu, 21 Feb 2008) | 7 lines
Remove an incorrect debug message. It reported that it had received a specific event and tried to report
which event was received. What actually was happening was that it was reporting the number of bytes returned
from a call to read().
Thanks to Jared Smith for bringing the issue up on IRC
........
................
r104029 | mmichelson | 2008-02-21 16:09:54 -0500 (Thu, 21 Feb 2008) | 11 lines
Blocked revisions 104027 via svnmerge
........
r104027 | mmichelson | 2008-02-21 15:05:42 -0600 (Thu, 21 Feb 2008) | 4 lines
And as a followup to revision 104026, completely remove event-related
calls from a section of code where we know there was no event to handle or get.
........
................
r104031 | russell | 2008-02-21 16:27:24 -0500 (Thu, 21 Feb 2008) | 1 line
fix a typo
................
r104036 | tilghman | 2008-02-22 17:39:21 -0500 (Fri, 22 Feb 2008) | 7 lines
Allow database password to be NULL and several other cleanups.
(closes issue #12048)
Reported by: bukaj
Patches:
20080222__bug12048.diff.txt uploaded by Corydon76 (license 14)
Tested by: bukaj
................
r104038 | tilghman | 2008-02-22 17:48:18 -0500 (Fri, 22 Feb 2008) | 14 lines
Merged revisions 104037 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r104037 | tilghman | 2008-02-22 16:45:14 -0600 (Fri, 22 Feb 2008) | 6 lines
Backwards debug message.
(closes issue #12052)
Reported by: flefoll
Patches:
chan_sip.c.br14.patch_found-notfound uploaded by flefoll (license 244)
........
................
r104039 | tilghman | 2008-02-22 17:55:35 -0500 (Fri, 22 Feb 2008) | 2 lines
Move Originate to a separate privilege and require the additional System privilege to call out to a subshell.
................
r104045 | dbailey | 2008-02-22 18:56:55 -0500 (Fri, 22 Feb 2008) | 2 lines
Add protection to chan_zap build when NEONMWI events are not defined
................
r104073 | murf | 2008-02-23 19:44:14 -0500 (Sat, 23 Feb 2008) | 1 line
On a 64-bit machine, with dev-mode turned on, and pgsql installed, I get warnings that stops the compile. They are fixed now.
................
r104074 | murf | 2008-02-23 21:37:08 -0500 (Sat, 23 Feb 2008) | 1 line
Enforce a space between function args as per code review.
................
Modified:
team/seanbright/NoLossCDR-Redux/ (props changed)
team/seanbright/NoLossCDR-Redux/CHANGES
team/seanbright/NoLossCDR-Redux/UPGRADE.txt
team/seanbright/NoLossCDR-Redux/channels/chan_sip.c
team/seanbright/NoLossCDR-Redux/channels/chan_zap.c
team/seanbright/NoLossCDR-Redux/configure
team/seanbright/NoLossCDR-Redux/configure.ac
team/seanbright/NoLossCDR-Redux/doc/manager_1_1.txt
team/seanbright/NoLossCDR-Redux/include/asterisk/autoconfig.h.in
team/seanbright/NoLossCDR-Redux/include/asterisk/manager.h
team/seanbright/NoLossCDR-Redux/main/manager.c
team/seanbright/NoLossCDR-Redux/res/res_agi.c
team/seanbright/NoLossCDR-Redux/res/res_config_pgsql.c
team/seanbright/NoLossCDR-Redux/utils/astman.c
Propchange: team/seanbright/NoLossCDR-Redux/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.
Propchange: team/seanbright/NoLossCDR-Redux/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/seanbright/NoLossCDR-Redux/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Feb 23 21:20:57 2008
@@ -1,1 +1,1 @@
-/trunk:1-103999
+/trunk:1-104075
Modified: team/seanbright/NoLossCDR-Redux/CHANGES
URL: http://svn.digium.com/view/asterisk/team/seanbright/NoLossCDR-Redux/CHANGES?view=diff&rev=104076&r1=104075&r2=104076
==============================================================================
--- team/seanbright/NoLossCDR-Redux/CHANGES (original)
+++ team/seanbright/NoLossCDR-Redux/CHANGES Sat Feb 23 21:20:57 2008
@@ -48,6 +48,9 @@
* Updated action newcat to allow new category to be inserted in file above another
existing category.
* Added new event "JitterBufStats" in the IAX2 channel
+ * Originate now requires the Originate privilege and, if you want to call out
+ to a subshell, it requires the System privilege, as well. This was done to
+ enhance manager security.
Dialplan functions
------------------
Modified: team/seanbright/NoLossCDR-Redux/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/seanbright/NoLossCDR-Redux/UPGRADE.txt?view=diff&rev=104076&r1=104075&r2=104076
==============================================================================
--- team/seanbright/NoLossCDR-Redux/UPGRADE.txt (original)
+++ team/seanbright/NoLossCDR-Redux/UPGRADE.txt Sat Feb 23 21:20:57 2008
@@ -178,3 +178,6 @@
change your manager.conf to add the level to existing AMI users, if they
want to see the CDR events generated.
+* The Originate command now requires the Originate write permission. For
+ Originate with the Application parameter, you need the additional System
+ privilege if you want to do anything that calls out to a subshell.
Modified: team/seanbright/NoLossCDR-Redux/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/seanbright/NoLossCDR-Redux/channels/chan_sip.c?view=diff&rev=104076&r1=104075&r2=104076
==============================================================================
--- team/seanbright/NoLossCDR-Redux/channels/chan_sip.c (original)
+++ team/seanbright/NoLossCDR-Redux/channels/chan_sip.c Sat Feb 23 21:20:57 2008
@@ -729,7 +729,7 @@
* should be used to modify these values. */
static int suserobjs = 0; /*!< Static users */
static int ruserobjs = 0; /*!< Realtime users */
-static int speerobjs = 0; /*!< Statis peers */
+static int speerobjs = 0; /*!< Static peers */
static int rpeerobjs = 0; /*!< Realtime peers */
static int apeerobjs = 0; /*!< Autocreated peer objects */
static int regobjs = 0; /*!< Registry objects */
@@ -3004,7 +3004,7 @@
break;
}
}
- ast_debug(1, "(Provisional) Stopping retransmission (but retaining packet) on '%s' %s %d: %s\n", p->callid, resp ? "Response" : "Request", seqno, res ? "Not Found" : "Found");
+ ast_debug(1, "(Provisional) Stopping retransmission (but retaining packet) on '%s' %s %d: %s\n", p->callid, resp ? "Response" : "Request", seqno, res == -1 ? "Not Found" : "Found");
return res;
}
@@ -3465,7 +3465,7 @@
apeerobjs--;
else if (peer->is_realtime) {
rpeerobjs--;
- ast_debug(3,"-REALTIME- peer Destroyed. Name: %s. Realtime Peer objects: %d\n", peer->name, rpeerobjs);
+ ast_debug(3, "-REALTIME- peer Destroyed. Name: %s. Realtime Peer objects: %d\n", peer->name, rpeerobjs);
} else
speerobjs--;
clear_realm_authentication(peer->auth);
@@ -3675,15 +3675,15 @@
return NULL;
}
- ast_debug(3,"-REALTIME- loading peer from database to memory. Name: %s. Peer objects: %d\n", peer->name, rpeerobjs);
+ ast_debug(3, "-REALTIME- loading peer from database to memory. Name: %s. Peer objects: %d\n", peer->name, rpeerobjs);
if (ast_test_flag(&global_flags[1], SIP_PAGE2_RTCACHEFRIENDS)) {
/* Cache peer */
- ast_copy_flags(&peer->flags[1],&global_flags[1], SIP_PAGE2_RTAUTOCLEAR|SIP_PAGE2_RTCACHEFRIENDS);
+ ast_copy_flags(&peer->flags[1], &global_flags[1], SIP_PAGE2_RTAUTOCLEAR|SIP_PAGE2_RTCACHEFRIENDS);
if (ast_test_flag(&global_flags[1], SIP_PAGE2_RTAUTOCLEAR)) {
AST_SCHED_REPLACE(peer->expire, sched, global_rtautoclear * 1000, expire_register, (void *) peer);
}
- ASTOBJ_CONTAINER_LINK(&peerl,peer);
+ ASTOBJ_CONTAINER_LINK(&peerl, peer);
} else {
peer->is_realtime = 1;
}
@@ -3777,7 +3777,7 @@
if (ast_test_flag(&global_flags[1], SIP_PAGE2_RTCACHEFRIENDS)) {
ast_set_flag(&user->flags[1], SIP_PAGE2_RTCACHEFRIENDS);
suserobjs++;
- ASTOBJ_CONTAINER_LINK(&userl,user);
+ ASTOBJ_CONTAINER_LINK(&userl, user);
} else {
/* Move counter from s to r... */
suserobjs--;
@@ -4107,7 +4107,7 @@
/* Check whether there is vxml_url, distinctive ring variables */
headp=&ast->varshead;
- AST_LIST_TRAVERSE(headp,current,entries) {
+ AST_LIST_TRAVERSE(headp, current, entries) {
/* Check whether there is a VXML_URL variable */
if (!p->options->vxml_url && !strcasecmp(ast_var_name(current), "VXML_URL")) {
p->options->vxml_url = ast_var_value(current);
@@ -4127,7 +4127,7 @@
p->options->replaces = ast_var_value(current);
} else if (!strcasecmp(ast_var_name(current), "T38CALL")) {
p->t38.state = T38_LOCAL_DIRECT;
- ast_debug(1,"T38State change to %d on channel %s\n", p->t38.state, ast->name);
+ ast_debug(1, "T38State change to %d on channel %s\n", p->t38.state, ast->name);
}
}
@@ -4165,7 +4165,7 @@
int xmitres;
p->t38.jointcapability = p->t38.capability;
- ast_debug(2,"Our T38 capability (%d), joint T38 capability (%d)\n", p->t38.capability, p->t38.jointcapability);
+ ast_debug(2, "Our T38 capability (%d), joint T38 capability (%d)\n", p->t38.capability, p->t38.jointcapability);
xmitres = transmit_invite(p, SIP_INVITE, 1, 2);
if (xmitres == XMIT_ERROR)
@@ -5163,7 +5163,7 @@
if (title)
my_name = title;
- else if ( (my_name = strchr(i->fromdomain,':')) )
+ else if ( (my_name = strchr(i->fromdomain, ':')) )
my_name++; /* skip ':' */
else
my_name = i->fromdomain;
@@ -5558,7 +5558,7 @@
if (faxdetected && ast_test_flag(&p->t38.t38support, SIP_PAGE2_T38SUPPORT_UDPTL) && (p->t38.state == T38_DISABLED) && !(ast_bridged_channel(ast))) {
if (!ast_test_flag(&p->flags[0], SIP_GOTREFER)) {
if (!p->pendinginvite) {
- ast_debug(3, "Sending reinvite on SIP (%s) for T.38 negotiation.\n",ast->name);
+ ast_debug(3, "Sending reinvite on SIP (%s) for T.38 negotiation.\n", ast->name);
change_t38_state(p, T38_LOCAL_REINVITE);
transmit_reinvite_with_sdp(p, TRUE, FALSE);
}
@@ -6475,7 +6475,7 @@
sin.sin_port = htons(udptlportno);
ast_udptl_set_peer(p->udptl, &sin);
if (debug)
- ast_debug(1,"Peer T.38 UDPTL is at port %s:%d\n",ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
+ ast_debug(1, "Peer T.38 UDPTL is at port %s:%d\n", ast_inet_ntoa(sin.sin_addr), ntohs(sin.sin_port));
} else {
ast_udptl_stop(p->udptl);
if (debug)
@@ -6608,7 +6608,7 @@
if (debug)
ast_verbose("Found unknown media description format %s for ID %d\n", mimeSubtype, codec);
}
- } else if (!strncasecmp(mimeSubtype, "T140",4)) { /* Text */
+ } else if (!strncasecmp(mimeSubtype, "T140", 4)) { /* Text */
if (p->trtp) {
/* ast_verbose("Adding t140 mimeSubtype to textrtp struct\n"); */
ast_rtp_set_rtpmap_type(newtextrtp, codec, "text", mimeSubtype, 0);
@@ -6640,10 +6640,10 @@
while ((a = get_sdp_iterate(&iterator, req, "a"))[0] != '\0') {
if ((sscanf(a, "T38FaxMaxBuffer:%d", &x) == 1)) {
found = 1;
- ast_debug(3, "MaxBufferSize:%d\n",x);
+ ast_debug(3, "MaxBufferSize:%d\n", x);
} else if ((sscanf(a, "T38MaxBitRate:%d", &x) == 1)) {
found = 1;
- ast_debug(3,"T38MaxBitRate: %d\n",x);
+ ast_debug(3, "T38MaxBitRate: %d\n", x);
switch (x) {
case 14400:
peert38capability |= T38FAX_RATE_14400 | T38FAX_RATE_12000 | T38FAX_RATE_9600 | T38FAX_RATE_7200 | T38FAX_RATE_4800 | T38FAX_RATE_2400;
@@ -6666,30 +6666,30 @@
}
} else if ((sscanf(a, "T38FaxVersion:%d", &x) == 1)) {
found = 1;
- ast_debug(3, "FaxVersion: %d\n",x);
+ ast_debug(3, "FaxVersion: %d\n", x);
if (x == 0)
peert38capability |= T38FAX_VERSION_0;
else if (x == 1)
peert38capability |= T38FAX_VERSION_1;
} else if ((sscanf(a, "T38FaxMaxDatagram:%d", &x) == 1)) {
found = 1;
- ast_debug(3, "FaxMaxDatagram: %d\n",x);
+ ast_debug(3, "FaxMaxDatagram: %d\n", x);
ast_udptl_set_far_max_datagram(p->udptl, x);
ast_udptl_set_local_max_datagram(p->udptl, x);
} else if ((sscanf(a, "T38FaxFillBitRemoval:%d", &x) == 1)) {
found = 1;
- ast_debug(3, "FillBitRemoval: %d\n",x);
+ ast_debug(3, "FillBitRemoval: %d\n", x);
if (x == 1)
peert38capability |= T38FAX_FILL_BIT_REMOVAL;
} else if ((sscanf(a, "T38FaxTranscodingMMR:%d", &x) == 1)) {
found = 1;
- ast_debug(3, "Transcoding MMR: %d\n",x);
+ ast_debug(3, "Transcoding MMR: %d\n", x);
if (x == 1)
peert38capability |= T38FAX_TRANSCODING_MMR;
}
if ((sscanf(a, "T38FaxTranscodingJBIG:%d", &x) == 1)) {
found = 1;
- ast_debug(3, "Transcoding JBIG: %d\n",x);
+ ast_debug(3, "Transcoding JBIG: %d\n", x);
if (x == 1)
peert38capability |= T38FAX_TRANSCODING_JBIG;
} else if ((sscanf(a, "T38FaxRateManagement:%255s", s) == 1)) {
@@ -7269,7 +7269,7 @@
}
/* Check for strict or loose router */
- if (p->route && !ast_strlen_zero(p->route->hop) && strstr(p->route->hop,";lr") == NULL) {
+ if (p->route && !ast_strlen_zero(p->route->hop) && strstr(p->route->hop, ";lr") == NULL) {
is_strict = TRUE;
if (sipdebug)
ast_debug(1, "Strict routing enforced for session %s\n", p->callid);
@@ -7795,14 +7795,14 @@
if ((p->t38.jointcapability & T38FAX_VERSION) == T38FAX_VERSION_1)
ast_str_append(&a_modem, 0, "a=T38FaxVersion:1\r\n");
if ((x = t38_get_rate(p->t38.jointcapability)))
- ast_str_append(&a_modem, 0, "a=T38MaxBitRate:%d\r\n",x);
+ ast_str_append(&a_modem, 0, "a=T38MaxBitRate:%d\r\n", x);
ast_str_append(&a_modem, 0, "a=T38FaxFillBitRemoval:%d\r\n", (p->t38.jointcapability & T38FAX_FILL_BIT_REMOVAL) ? 1 : 0);
ast_str_append(&a_modem, 0, "a=T38FaxTranscodingMMR:%d\r\n", (p->t38.jointcapability & T38FAX_TRANSCODING_MMR) ? 1 : 0);
ast_str_append(&a_modem, 0, "a=T38FaxTranscodingJBIG:%d\r\n", (p->t38.jointcapability & T38FAX_TRANSCODING_JBIG) ? 1 : 0);
ast_str_append(&a_modem, 0, "a=T38FaxRateManagement:%s\r\n", (p->t38.jointcapability & T38FAX_RATE_MANAGEMENT_LOCAL_TCF) ? "localTCF" : "transferredTCF");
x = ast_udptl_get_local_max_datagram(p->udptl);
- ast_str_append(&a_modem, 0, "a=T38FaxMaxBuffer:%d\r\n",x);
- ast_str_append(&a_modem, 0, "a=T38FaxMaxDatagram:%d\r\n",x);
+ ast_str_append(&a_modem, 0, "a=T38FaxMaxBuffer:%d\r\n", x);
+ ast_str_append(&a_modem, 0, "a=T38FaxMaxDatagram:%d\r\n", x);
if (p->t38.jointcapability != T38FAX_UDP_EC_NONE)
ast_str_append(&a_modem, 0, "a=T38FaxUdpEC:%s\r\n", (p->t38.jointcapability & T38FAX_UDP_EC_REDUNDANCY) ? "t38UDPRedundancy" : "t38UDPFEC");
len = m_modem->used + a_modem->used;
@@ -8657,7 +8657,7 @@
headp = &chan->varshead;
if (!headp)
- ast_log(LOG_WARNING,"No Headp for the channel...ooops!\n");
+ ast_log(LOG_WARNING, "No Headp for the channel...ooops!\n");
else {
const struct ast_var_t *current;
AST_LIST_TRAVERSE(headp, current, entries) {
@@ -9246,7 +9246,7 @@
ast_string_field_set(p, qop, r->qop);
p->noncecount = ++r->noncecount;
- memset(digest,0,sizeof(digest));
+ memset(digest, 0, sizeof(digest));
if(!build_reply_digest(p, sipmethod, digest, sizeof(digest)))
add_header(&req, "Authorization", digest);
else
@@ -9485,7 +9485,7 @@
Only for realtime peers and autocreated peers
*/
if (peer->is_realtime)
- ast_debug(3,"-REALTIME- peer expired registration. Name: %s. Realtime peer objects now %d\n", peer->name, rpeerobjs);
+ ast_debug(3, "-REALTIME- peer expired registration. Name: %s. Realtime peer objects now %d\n", peer->name, rpeerobjs);
if (peer->selfdestruct ||
ast_test_flag(&peer->flags[1], SIP_PAGE2_RTAUTOCLEAR)) {
@@ -9860,7 +9860,7 @@
}
/* Only append the contact if we are dealing with a strict router */
- if (!head || (!ast_strlen_zero(head->hop) && strstr(head->hop,";lr") == NULL) ) {
+ if (!head || (!ast_strlen_zero(head->hop) && strstr(head->hop, ";lr") == NULL) ) {
/* 2nd append the Contact: if there is one */
/* Can be multiple Contact headers, comma separated values - we just take the first */
contact = get_header(req, "Contact");
@@ -10750,9 +10750,9 @@
}
if (!pedanticsipchecking)
- ast_debug(2,"Attended transfer: Will use Replace-Call-ID : %s (No check of from/to tags)\n", referdata->replaces_callid );
+ ast_debug(2, "Attended transfer: Will use Replace-Call-ID : %s (No check of from/to tags)\n", referdata->replaces_callid );
else
- ast_debug(2,"Attended transfer: Will use Replace-Call-ID : %s F-tag: %s T-tag: %s\n", referdata->replaces_callid, referdata->replaces_callid_fromtag ? referdata->replaces_callid_fromtag : "<none>", referdata->replaces_callid_totag ? referdata->replaces_callid_totag : "<none>" );
+ ast_debug(2, "Attended transfer: Will use Replace-Call-ID : %s F-tag: %s T-tag: %s\n", referdata->replaces_callid, referdata->replaces_callid_fromtag ? referdata->replaces_callid_fromtag : "<none>", referdata->replaces_callid_totag ? referdata->replaces_callid_totag : "<none>" );
}
}
@@ -10862,7 +10862,7 @@
}
if (ast_exists_extension(NULL, transfer_context, c, 1, NULL)) {
/* This is a blind transfer */
- ast_debug(1,"SIP Bye-also transfer to Extension %s@%s \n", c, transfer_context);
+ ast_debug(1, "SIP Bye-also transfer to Extension %s@%s \n", c, transfer_context);
ast_copy_string(referdata->refer_to, c, sizeof(referdata->refer_to));
ast_copy_string(referdata->referred_by, "", sizeof(referdata->referred_by));
ast_copy_string(referdata->refer_contact, "", sizeof(referdata->refer_contact));
@@ -10971,8 +10971,8 @@
/*! \brief Get caller id name from SIP headers */
static char *get_calleridname(const char *input, char *output, size_t outputsize)
{
- const char *end = strchr(input,'<'); /* first_bracket */
- const char *tmp = strchr(input,'"'); /* first quote */
+ const char *end = strchr(input, '<'); /* first_bracket */
+ const char *tmp = strchr(input, '"'); /* first quote */
int bytes = 0;
int maxbytes = outputsize - 1;
@@ -11021,7 +11021,7 @@
char *start;
char *end;
- start = strchr(input,':');
+ start = strchr(input, ':');
if (!start) {
output[0] = '\0';
return 0;
@@ -11029,15 +11029,15 @@
start++;
/* we found "number" */
- ast_copy_string(output,start,maxlen);
+ ast_copy_string(output, start, maxlen);
output[maxlen-1] = '\0';
- end = strchr(output,'@');
+ end = strchr(output, '@');
if (end)
*end = '\0';
else
output[0] = '\0';
- if (strstr(input,"privacy=full") || strstr(input,"privacy=uri"))
+ if (strstr(input, "privacy=full") || strstr(input, "privacy=uri"))
return AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED;
return 0;
@@ -11514,7 +11514,7 @@
ast_queue_frame(p->owner, &f);
transmit_response(p, "202 Accepted", req); /* We respond 202 accepted, since we relay the message */
} else { /* Message outside of a call, we do not support that */
- ast_log(LOG_WARNING,"Received message to %s from %s, dropped it...\n Content-Type:%s\n Message: %s\n", get_header(req,"To"), get_header(req,"From"), content_type, buf);
+ ast_log(LOG_WARNING, "Received message to %s from %s, dropped it...\n Content-Type:%s\n Message: %s\n", get_header(req, "To"), get_header(req, "From"), content_type, buf);
transmit_response(p, "405 Method Not Allowed", req); /* Good enough, or? */
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
}
@@ -11545,7 +11545,7 @@
if (a->argc < 3)
return CLI_SHOWUSAGE;
- if (a->argc == 4 && !strcmp(a->argv[3],"all"))
+ if (a->argc == 4 && !strcmp(a->argv[3], "all"))
showall = TRUE;
ast_cli(a->fd, FORMAT, "* User name", "In use", "Limit");
@@ -11841,7 +11841,7 @@
/* Inspired from chan_iax2 */
static int manager_sip_show_peers(struct mansession *s, const struct message *m)
{
- const char *id = astman_get_header(m,"ActionID");
+ const char *id = astman_get_header(m, "ActionID");
const char *a[] = {"sip", "show", "peers"};
char idtext[256] = "";
int total = 0;
@@ -11903,7 +11903,7 @@
realtimepeers = ast_check_realtime("sippeers");
if (s) { /* Manager - get ActionID */
- id = astman_get_header(m,"ActionID");
+ id = astman_get_header(m, "ActionID");
if (!ast_strlen_zero(id))
snprintf(idtext, sizeof(idtext), "ActionID: %s\r\n", id);
}
@@ -12350,7 +12350,7 @@
const char *a[4];
const char *peer;
- peer = astman_get_header(m,"Peer");
+ peer = astman_get_header(m, "Peer");
if (ast_strlen_zero(peer)) {
astman_send_error(s, m, "Peer: <name> missing.\n");
return 0;
@@ -12417,11 +12417,11 @@
peer = find_peer(argv[3], NULL, load_realtime);
if (s) { /* Manager */
if (peer) {
- const char *id = astman_get_header(m,"ActionID");
+ const char *id = astman_get_header(m, "ActionID");
astman_append(s, "Response: Success\r\n");
if (!ast_strlen_zero(id))
- astman_append(s, "ActionID: %s\r\n",id);
+ astman_append(s, "ActionID: %s\r\n", id);
} else {
snprintf (cbuf, sizeof(cbuf), "Peer %s not found.\n", argv[3]);
astman_send_error(s, m, cbuf);
@@ -12430,7 +12430,7 @@
}
if (peer && type==0 ) { /* Normal listing */
struct ast_str *mailbox_str = ast_str_alloca(512);
- ast_cli(fd,"\n\n");
+ ast_cli(fd, "\n\n");
ast_cli(fd, " * Name : %s\n", peer->name);
if (realtimepeers) { /* Realtime is enabled */
ast_cli(fd, " Realtime peer: %s\n", peer->is_realtime ? "Yes, cached" : "No");
@@ -12525,7 +12525,7 @@
ast_cli(fd, " 100 on REG : %s\n", ast_test_flag(&peer->flags[1], SIP_PAGE2_REGISTERTRYING) ? "Yes" : "No");
ast_cli(fd, " Status : ");
peer_status(peer, status, sizeof(status));
- ast_cli(fd, "%s\n",status);
+ ast_cli(fd, "%s\n", status);
ast_cli(fd, " Useragent : %s\n", peer->useragent);
ast_cli(fd, " Reg. Contact : %s\n", peer->fullcontact);
ast_cli(fd, " Qualify Freq : %d ms\n", peer->qualifyfreq);
@@ -12539,7 +12539,7 @@
ast_cli(fd, " Sess-Refresh : %s\n", strefresher2str(peer->stimer.st_ref));
ast_cli(fd, " Sess-Expires : %d secs\n", peer->stimer.st_max_se);
ast_cli(fd, " Min-Sess : %d secs\n", peer->stimer.st_min_se);
- ast_cli(fd,"\n");
+ ast_cli(fd, "\n");
unref_peer(peer);
} else if (peer && type == 1) { /* manager listing */
char buf[256];
@@ -12572,7 +12572,7 @@
astman_append(s, "MaxCallBR: %d kbps\r\n", peer->maxcallbitrate);
astman_append(s, "Dynamic: %s\r\n", peer->host_dynamic?"Y":"N");
astman_append(s, "Callerid: %s\r\n", ast_callerid_merge(cbuf, sizeof(cbuf), peer->cid_name, peer->cid_num, ""));
- astman_append(s, "RegExpire: %ld seconds\r\n", ast_sched_when(sched,peer->expire));
+ astman_append(s, "RegExpire: %ld seconds\r\n", ast_sched_when(sched, peer->expire));
astman_append(s, "SIP-AuthInsecure: %s\r\n", insecure2str(ast_test_flag(&peer->flags[0], SIP_INSECURE)));
astman_append(s, "SIP-NatSupport: %s\r\n", nat2str(ast_test_flag(&peer->flags[0], SIP_NAT)));
astman_append(s, "ACL: %s\r\n", (peer->ha?"Y":"N"));
@@ -12600,11 +12600,11 @@
astman_append(s, "CodecOrder: ");
pref = &peer->prefs;
for(x = 0; x < 32 ; x++) {
- codec = ast_codec_pref_index(pref,x);
+ codec = ast_codec_pref_index(pref, x);
if (!codec)
break;
astman_append(s, "%s", ast_getformatname(codec));
- if (x < 31 && ast_codec_pref_index(pref,x+1))
+ if (x < 31 && ast_codec_pref_index(pref, x+1))
astman_append(s, ",");
}
@@ -12625,8 +12625,8 @@
unref_peer(peer);
} else {
- ast_cli(fd,"Peer %s not found.\n", argv[3]);
- ast_cli(fd,"\n");
+ ast_cli(fd, "Peer %s not found.\n", argv[3]);
+ ast_cli(fd, "\n");
}
return CLI_SUCCESS;
@@ -12660,7 +12660,7 @@
user = find_user(a->argv[3], load_realtime);
if (user) {
- ast_cli(a->fd,"\n\n");
+ ast_cli(a->fd, "\n\n");
ast_cli(a->fd, " * Name : %s\n", user->name);
ast_cli(a->fd, " Secret : %s\n", ast_strlen_zero(user->secret)?"<Not set>":"<Set>");
ast_cli(a->fd, " MD5Secret : %s\n", ast_strlen_zero(user->md5secret)?"<Not set>":"<Set>");
@@ -12695,12 +12695,12 @@
ast_cli(a->fd, " %s = %s\n", v->name, v->value);
}
- ast_cli(a->fd,"\n");
+ ast_cli(a->fd, "\n");
unref_user(user);
} else {
- ast_cli(a->fd,"User %s not found.\n", a->argv[3]);
- ast_cli(a->fd,"\n");
+ ast_cli(a->fd, "User %s not found.\n", a->argv[3]);
+ ast_cli(a->fd, "\n");
}
return CLI_SUCCESS;
@@ -13268,7 +13268,7 @@
for (cur = dialoglist; cur; cur = cur->next) {
if (!strncasecmp(cur->callid, a->argv[3], len)) {
char formatbuf[SIPBUFSIZE/2];
- ast_cli(a->fd,"\n");
+ ast_cli(a->fd, "\n");
if (cur->subscribed != NONE)
ast_cli(a->fd, " * Subscription (type: %s)\n", subscription_type2str(cur->subscribed));
else
@@ -13373,7 +13373,7 @@
struct sip_history *hist;
int x = 0;
- ast_cli(a->fd,"\n");
+ ast_cli(a->fd, "\n");
if (cur->subscribed != NONE)
ast_cli(a->fd, " * Subscription\n");
else
@@ -13576,7 +13576,7 @@
ast_rdlock_call_features();
feat = ast_find_call_feature("automon");
if (!feat || ast_strlen_zero(feat->exten)) {
- ast_log(LOG_WARNING,"Recording requested, but no One Touch Monitor registered. (See features.conf)\n");
+ ast_log(LOG_WARNING, "Recording requested, but no One Touch Monitor registered. (See features.conf)\n");
/* 403 means that we don't support this feature, so don't request it again */
transmit_response(p, "403 Forbidden", req);
ast_unlock_call_features();
@@ -13842,7 +13842,7 @@
p->authtries++;
auth_headers(code, &header, &respheader);
- memset(digest,0,sizeof(digest));
+ memset(digest, 0, sizeof(digest));
if (reply_digest(p, req, header, SIP_REGISTER, digest, sizeof(digest))) {
/* There's nothing to use for authentication */
/* No digest challenge in request */
@@ -13979,7 +13979,7 @@
else if (!ast_strlen_zero(p->uri))
ast_copy_string(uri, p->uri, sizeof(uri));
else
- snprintf(uri, sizeof(uri), "sip:%s@%s",p->username, ast_inet_ntoa(p->sa.sin_addr));
+ snprintf(uri, sizeof(uri), "sip:%s@%s", p->username, ast_inet_ntoa(p->sa.sin_addr));
snprintf(cnonce, sizeof(cnonce), "%08lx", ast_random());
@@ -13991,7 +13991,7 @@
secret = auth->secret;
md5secret = auth->md5secret;
if (sipdebug)
- ast_debug(1,"Using realm %s authentication for call %s\n", p->realm, p->callid);
+ ast_debug(1, "Using realm %s authentication for call %s\n", p->realm, p->callid);
} else {
/* No authentication, use peer or register= config */
username = p->authname;
@@ -14002,19 +14002,19 @@
return -1;
/* Calculate SIP digest response */
- snprintf(a1,sizeof(a1),"%s:%s:%s", username, p->realm, secret);
- snprintf(a2,sizeof(a2),"%s:%s", sip_methods[method].text, uri);
+ snprintf(a1, sizeof(a1), "%s:%s:%s", username, p->realm, secret);
+ snprintf(a2, sizeof(a2), "%s:%s", sip_methods[method].text, uri);
if (!ast_strlen_zero(md5secret))
ast_copy_string(a1_hash, md5secret, sizeof(a1_hash));
else
- ast_md5_hash(a1_hash,a1);
- ast_md5_hash(a2_hash,a2);
+ ast_md5_hash(a1_hash, a1);
+ ast_md5_hash(a2_hash, a2);
p->noncecount++;
if (!ast_strlen_zero(p->qop))
- snprintf(resp,sizeof(resp),"%s:%s:%08x:%s:%s:%s", a1_hash, p->nonce, p->noncecount, cnonce, "auth", a2_hash);
+ snprintf(resp, sizeof(resp), "%s:%s:%08x:%s:%s:%s", a1_hash, p->nonce, p->noncecount, cnonce, "auth", a2_hash);
else
- snprintf(resp,sizeof(resp),"%s:%s:%s", a1_hash, p->nonce, a2_hash);
+ snprintf(resp, sizeof(resp), "%s:%s:%s", a1_hash, p->nonce, a2_hash);
ast_md5_hash(resp_hash, resp);
/* XXX We hard code our qop to "auth" for now. XXX */
if (!ast_strlen_zero(p->qop))
@@ -14823,7 +14823,7 @@
p->needdestroy = 1;
break;
case 404: /* Not found */
- ast_log(LOG_WARNING, "Got 404 Not found on SIP register to service %s@%s, giving up\n", p->registry->username,p->registry->hostname);
+ ast_log(LOG_WARNING, "Got 404 Not found on SIP register to service %s@%s, giving up\n", p->registry->username, p->registry->hostname);
p->needdestroy = 1;
r->call = NULL;
r->regstate = REG_STATE_REJECTED;
@@ -14862,7 +14862,7 @@
manager_event(EVENT_FLAG_SYSTEM, "Registry", "ChannelType: SIP\r\nUsername: %s\r\nDomain: %s\r\nStatus: %s\r\n", r->username, r->hostname, regstate2str(r->regstate));
break;
case 479: /* SER: Not able to process the URI - address is wrong in register*/
- ast_log(LOG_WARNING, "Got error 479 on register to %s@%s, giving up (check config)\n", p->registry->username,p->registry->hostname);
+ ast_log(LOG_WARNING, "Got error 479 on register to %s@%s, giving up (check config)\n", p->registry->username, p->registry->hostname);
p->needdestroy = 1;
r->call = NULL;
r->regstate = REG_STATE_REJECTED;
@@ -14927,7 +14927,7 @@
expires_ms = expires * 1000;
if (expires <= EXPIRY_GUARD_LIMIT)
- expires_ms -= MAX((expires_ms * EXPIRY_GUARD_PCT),EXPIRY_GUARD_MIN);
+ expires_ms -= MAX((expires_ms * EXPIRY_GUARD_PCT), EXPIRY_GUARD_MIN);
else
expires_ms -= EXPIRY_GUARD_SECS * 1000;
if (sipdebug)
@@ -15461,14 +15461,14 @@
transmit_response(transferer->tech_pvt, "202 Accepted", &req);
if (!res) {
/* Transfer succeeded */
- append_history(transferer->tech_pvt, "SIPpark","Parked call on %d", ext);
+ append_history(transferer->tech_pvt, "SIPpark", "Parked call on %d", ext);
transmit_notify_with_sipfrag(transferer->tech_pvt, d->seqno, "200 OK", TRUE);
transferer->hangupcause = AST_CAUSE_NORMAL_CLEARING;
ast_hangup(transferer); /* This will cause a BYE */
ast_debug(1, "SIP Call parked on extension '%d'\n", ext);
} else {
transmit_notify_with_sipfrag(transferer->tech_pvt, d->seqno, "503 Service Unavailable", TRUE);
- append_history(transferer->tech_pvt, "SIPpark","Parking failed\n");
+ append_history(transferer->tech_pvt, "SIPpark", "Parking failed\n");
ast_debug(1, "SIP Call parked failed \n");
/* Do not hangup call */
}
@@ -16056,7 +16056,7 @@
if (required_profile && required_profile != SIP_OPT_REPLACES && required_profile != SIP_OPT_TIMER) {
/* At this point we only support REPLACES and Session-Timer */
transmit_response_with_unsupported(p, "420 Bad extension (unsupported)", req, required);
- ast_log(LOG_WARNING,"Received SIP INVITE with unsupported required extension: %s\n", required);
+ ast_log(LOG_WARNING, "Received SIP INVITE with unsupported required extension: %s\n", required);
p->invitestate = INV_COMPLETED;
if (!p->lastinvite)
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
@@ -16143,7 +16143,7 @@
}
if (sipdebug)
- ast_debug(4,"Invite/replaces: Will use Replace-Call-ID : %s Fromtag: %s Totag: %s\n", replace_id, fromtag ? fromtag : "<no from tag>", totag ? totag : "<no to tag>");
+ ast_debug(4, "Invite/replaces: Will use Replace-Call-ID : %s Fromtag: %s Totag: %s\n", replace_id, fromtag ? fromtag : "<no from tag>", totag ? totag : "<no to tag>");
/* Try to find call that we are replacing
@@ -16424,7 +16424,7 @@
case SESSION_TIMER_MODE_REFUSE:
if (p->reqsipoptions == SIP_OPT_TIMER) {
transmit_response_with_unsupported(p, "420 Option Disabled", req, required);
- ast_log(LOG_WARNING,"Received SIP INVITE with supported but disabled option: %s\n", required);
+ ast_log(LOG_WARNING, "Received SIP INVITE with supported but disabled option: %s\n", required);
p->invitestate = INV_COMPLETED;
if (!p->lastinvite) {
sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
@@ -16976,7 +16976,7 @@
/* Guess we should masquerade or something here */
/* Until we figure it out, refuse transfer of such calls */
if (sipdebug)
- ast_debug(3,"Refused SIP transfer on non-bridged channel.\n");
+ ast_debug(3, "Refused SIP transfer on non-bridged channel.\n");
p->refer->status = REFER_FAILED;
append_history(p, "Xfer", "Refer failed. Non-bridged channel.");
transmit_response(p, "603 Declined", req);
@@ -17308,7 +17308,7 @@
if (bridged_to) {
/* Don't actually hangup here... */
ast_queue_control(c, AST_CONTROL_UNHOLD);
- ast_async_goto(bridged_to, p->context, p->refer->refer_to,1);
+ ast_async_goto(bridged_to, p->context, p->refer->refer_to, 1);
} else
ast_queue_hangup(p->owner);
}
@@ -17492,7 +17492,7 @@
if (p->subscribed == NONE) { /* if the subscribed field is not already set, and there is no accept header... */
transmit_response(p, "489 Bad Event", req);
- ast_log(LOG_WARNING,"SUBSCRIBE failure: no Accept header: pvt: stateid: %d, laststate: %d, dialogver: %d, subscribecont: '%s', subscribeuri: '%s'\n",
+ ast_log(LOG_WARNING, "SUBSCRIBE failure: no Accept header: pvt: stateid: %d, laststate: %d, dialogver: %d, subscribecont: '%s', subscribeuri: '%s'\n",
p->stateid, p->laststate, p->dialogver, p->subscribecontext, p->subscribeuri);
p->needdestroy = 1;
return 0;
@@ -17502,10 +17502,10 @@
} else {
/* Can't find a format for events that we know about */
char mybuf[200];
- snprintf(mybuf,sizeof(mybuf),"489 Bad Event (format %s)", accept);
+ snprintf(mybuf, sizeof(mybuf), "489 Bad Event (format %s)", accept);
transmit_response(p, mybuf, req);
- ast_log(LOG_WARNING,"SUBSCRIBE failure: unrecognized format: '%s' pvt: subscribed: %d, stateid: %d, laststate: %d, dialogver: %d, subscribecont: '%s', subscribeuri: '%s'\n",
+ ast_log(LOG_WARNING, "SUBSCRIBE failure: unrecognized format: '%s' pvt: subscribed: %d, stateid: %d, laststate: %d, dialogver: %d, subscribecont: '%s', subscribeuri: '%s'\n",
accept, (int)p->subscribed, p->stateid, p->laststate, p->dialogver, p->subscribecontext, p->subscribeuri);
p->needdestroy = 1;
return 0;
@@ -19263,7 +19263,7 @@
secret = strsep(&stringp, ":");
if (!secret) {
stringp = username;
- md5secret = strsep(&stringp,"#");
+ md5secret = strsep(&stringp, "#");
}
}
if (!(auth = ast_calloc(1, sizeof(*auth))))
@@ -19326,7 +19326,7 @@
struct ast_variable *tmpvar = NULL;
char *varname = ast_strdupa(buf), *varval = NULL;
- if ((varval = strchr(varname,'='))) {
+ if ((varval = strchr(varname, '='))) {
*varval++ = '\0';
if ((tmpvar = ast_variable_new(varname, varval, ""))) {
tmpvar->next = list;
@@ -19622,7 +19622,7 @@
if (realtime) {
rpeerobjs++;
- ast_debug(3,"-REALTIME- peer built. Name: %s. Peer objects: %d\n", name, rpeerobjs);
+ ast_debug(3, "-REALTIME- peer built. Name: %s. Peer objects: %d\n", name, rpeerobjs);
} else
speerobjs++;
ASTOBJ_INIT(peer);
@@ -19847,7 +19847,7 @@
if (sscanf(v->value, "%d", &i) == 1)
peer->qualifyfreq = i * 1000;
else {
- ast_log(LOG_WARNING, "Invalid qualifyfreq number '%s' at line %d of %s\n",v->value, v->lineno, config);
+ ast_log(LOG_WARNING, "Invalid qualifyfreq number '%s' at line %d of %s\n", v->value, v->lineno, config);
peer->qualifyfreq = global_qualifyfreq;
}
} else if (!strcasecmp(v->name, "maxcallbitrate")) {
@@ -20272,7 +20272,7 @@
while ((context = strsep(&stringp, "&"))) {
ast_copy_string(used_context, context, sizeof(used_context));
if (!ast_context_find(context))
- ast_context_create(NULL, context,"SIP");
+ ast_context_create(NULL, context, "SIP");
}
ast_copy_string(global_regcontext, v->value, sizeof(global_regcontext));
} else if (!strcasecmp(v->name, "regextenonqualify")) {
@@ -20513,7 +20513,7 @@
peer = build_peer(cat, gen, ast_variable_browse(ucfg, cat), 0);
if (peer) {
ast_device_state_changed("SIP/%s", peer->name);
- ASTOBJ_CONTAINER_LINK(&peerl,peer);
+ ASTOBJ_CONTAINER_LINK(&peerl, peer);
unref_peer(peer);
peer_count++;
}
@@ -20573,7 +20573,7 @@
if (is_user) {
user = build_user(cat, ast_variable_browse(cfg, cat), 0);
if (user) {
- ASTOBJ_CONTAINER_LINK(&userl,user);
+ ASTOBJ_CONTAINER_LINK(&userl, user);
unref_user(user);
user_count++;
}
@@ -20581,7 +20581,7 @@
if (is_peer) {
peer = build_peer(cat, ast_variable_browse(cfg, cat), NULL, 0);
if (peer) {
- ASTOBJ_CONTAINER_LINK(&peerl,peer);
+ ASTOBJ_CONTAINER_LINK(&peerl, peer);
unref_peer(peer);
peer_count++;
}
@@ -20997,24 +20997,24 @@
return 0;
}
sip_pvt_lock(p);
- if (!strcasecmp(mode,"info")) {
+ if (!strcasecmp(mode, "info")) {
ast_clear_flag(&p->flags[0], SIP_DTMF);
ast_set_flag(&p->flags[0], SIP_DTMF_INFO);
p->jointnoncodeccapability &= ~AST_RTP_DTMF;
- } else if (!strcasecmp(mode,"shortinfo")) {
+ } else if (!strcasecmp(mode, "shortinfo")) {
ast_clear_flag(&p->flags[0], SIP_DTMF);
ast_set_flag(&p->flags[0], SIP_DTMF_SHORTINFO);
p->jointnoncodeccapability &= ~AST_RTP_DTMF;
- } else if (!strcasecmp(mode,"rfc2833")) {
+ } else if (!strcasecmp(mode, "rfc2833")) {
ast_clear_flag(&p->flags[0], SIP_DTMF);
ast_set_flag(&p->flags[0], SIP_DTMF_RFC2833);
p->jointnoncodeccapability |= AST_RTP_DTMF;
- } else if (!strcasecmp(mode,"inband")) {
+ } else if (!strcasecmp(mode, "inband")) {
ast_clear_flag(&p->flags[0], SIP_DTMF);
ast_set_flag(&p->flags[0], SIP_DTMF_INBAND);
p->jointnoncodeccapability &= ~AST_RTP_DTMF;
} else
- ast_log(LOG_WARNING, "I don't know about this dtmf mode: %s\n",mode);
+ ast_log(LOG_WARNING, "I don't know about this dtmf mode: %s\n", mode);
if (p->rtp)
ast_rtp_setdtmf(p->rtp, ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_RFC2833);
if (ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_INBAND) {
@@ -21059,7 +21059,7 @@
if (ok) {
pbx_builtin_setvar_helper (chan, varbuf, inbuf);
if (sipdebug)
- ast_debug(1,"SIP Header added \"%s\" as %s\n", inbuf, varbuf);
[... 463 lines stripped ...]
More information about the asterisk-commits
mailing list