Steve Murphy [Tue, 15 Aug 2006 16:35:06 +0000 (16:35 +0000)]
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.
Russell Bryant [Mon, 14 Aug 2006 03:24:06 +0000 (03:24 +0000)]
add MacroExclusive application, a Macro that only one call can executed at
a time (issue #7366, Steve Davies, with mods by me as discussed in the report)
Russell Bryant [Mon, 14 Aug 2006 02:14:14 +0000 (02:14 +0000)]
When taking a substring and a negative length is provided, instead of just
ignoring it, allow this to mean that we want that many characters off of
the end of the string so that ${EXTEN:0:$[${LEN(${EXTEN}) - 1]} can become
${EXTEN:0:-1}. (issue #7586, Corydon)
Nadi Sarrar [Tue, 8 Aug 2006 18:13:40 +0000 (18:13 +0000)]
* first bits of decoding facility information elements
* fail on misdn_cfg_init() if elements in the config enum don't match with the config structs in misdn_config.c
* implemented first bits for encoding ISDN facility information elements via ASN.1 descriptions
* using unnamed semaphore for syncing in misdn_thread
* advanced fax detection: configurable detect timeout and context to jump into
Joshua Colp [Tue, 8 Aug 2006 17:02:45 +0000 (17:02 +0000)]
Add support for Sigma Designs cards. These basically allow you to offload dialtone generation to the board. If you're using a quicknet board where this might work, give it a try as well. (issue #6092 reported by ywalther - minor mods by moi)
* added possibility to change echocancel settings during calls
* removed the holded element from the chan_list struct, we know this from the
state already
* added a few tweaks to make HOLD/RETRIEVE work again (TRANSFER does not work
yet)
* added possibility to debug mISDN frames via syslog
* added misdn_lib_port_is_blocked function to check if a port is blocked
* removed ec_training=1 from empty_bc, we don't use ec_training anymore
* removed unused misdn_lib_get_l2_status function
* added the nt bit to dummy misdn_bchannel objects
* setting bc->out_fac_type to FACILITY_NONE defaultly
* removed HANDLER_DEBUG stuff for better readability
Russell Bryant [Tue, 8 Aug 2006 06:32:04 +0000 (06:32 +0000)]
Merge team/russell/ast_verbose_threadstorage
- instead of defining a free() wrapper in a bunch of files, define it as
ast_free() in utils.h and remove the copies from all the files.
- centralize and abstract the code used for doing thread storage. The code
lives in threadstorage.h, with one function being implemented in utils.c.
This new API includes generic thread storage as well as special functions
for handling thread local dynamic length string buffers.
- update ast_inet_ntoa() to use the new threadstorage API
- update ast_state2str() to use the new threadstorage API
- update ast_cli() to use the new threadstorage API
- Modify manager_event() to use thread storage. Instead of using a buffer of
4096 characters as the workspace for building the manager event, use a thread
local dynamic string. Now there is no length limitation on the length of the
body of a manager event.
- Significantly simplify the handling of ast_verbose() ...
- Instead of using a static char buffer and a lock to make sure only one
thread can be using ast_verbose() at a time, use a thread local dynamic
string as the workspace for preparing the verbose message. Instead of
locking around the entire function, the only locking done now is when the
message has been built and is being deliviered to the list of registered
verbose message handlers.
- This function was doing a strdup() on every message passed to it and
keeping a queue of the last 200 messages in memory. This has been
completely removed. The only place this was used was that if there were
any messages in the verbose queue when a verbose handler was registered,
all of the messages in the queue would be fed to it. So, I just made sure
that the console verbose handler and the network verbose handler (for
remote asterisk consoles) were registered before any verbose messages.
pbx_gtkconsole and pbx_kdeconsole will now lose a few verbose messages at
startup, but I didn't feel the performance hit of this message queue was
worth saving the initial verbose output for these very rarely used modules.
- I have removed the last three arguments to the verbose handlers, leaving
only the string itself because they aren't needed anymore. For example,
ast_verbose had some logic for telling the verbose handler to add
a newline if the buffer was completely full. Now that the buffer can grow
as needed, this doesn't matter anymore.
- remove unused function, ast_verbose_dmesg() which was to dispatch the
message queue
- Convert the list of verbose handlers to use the linked list macros.
- add missing newline characters to a few ast_verbose() calls
- convert the list of log channels to use the linked list macros in logger.c
- fix close_logger() to close all of the files it opened for logging
- update ast_log() to use a thread local dynamic string for its workspace
for preparing log messages instead of a buffer of size BUFSIZ (8kB on my
system) allocated on the stack. The dynamic string in this case is limited
to only growing to a maximum size of BUFSIZ.
Steve Murphy [Mon, 7 Aug 2006 18:12:51 +0000 (18:12 +0000)]
This commit folds in changes to both stringfields (some enhancements to the ...field_set() macro, to optimize setting strings to empty, resetting strings to shorter contents, etc.) and to chan_iax2.c, to use stringfields in the user, peer, and pvt structs. Has been running stably on iaxtel, but while iaxtel has a large registration volume, it doesn't seem to have a high call volume. So far, it seems to reduce heap usage by over half. YMMV\! Please report any IAX bugs that might involve stringfields\!
Olle Johansson [Mon, 7 Aug 2006 17:01:40 +0000 (17:01 +0000)]
Add placeholder for sla.conf sample in configs/. Please update with
correct information not to overload the switchboard with calls to sales.
Thank you! ;-)
Russell Bryant [Mon, 7 Aug 2006 04:15:52 +0000 (04:15 +0000)]
Merge my applicationmap_fixup branch to address the issues described in this
post to the asterisk-dev mailing list:
http://lists.digium.com/pipermail/asterisk-dev/2006-August/022174.html
This implements full control over both which channel(s) can activate a dynamic
feature, as well as which channel to run the application on. I also updated
the documentation on the applicationmap in features.conf.sample in hopes that
the configuration is more clear.
Russell Bryant [Mon, 7 Aug 2006 01:32:51 +0000 (01:32 +0000)]
Merged revisions 39081 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r39081 | russell | 2006-08-06 21:28:29 -0400 (Sun, 06 Aug 2006) | 7 lines
Fix a crash reported to me by hads on IRC. This crash would occur with the use
of the "distinctiveringaftercid" option. Also, on this user's system, the crash
would only occur when built without optimizations. This is because the bug is
that the code would write past the end of an array that was allocated on the
stack, and the structure of the stack is different with or without optimizations
enabled.
Russell Bryant [Mon, 7 Aug 2006 00:26:11 +0000 (00:26 +0000)]
minor cleanups
- use appropriate types in some assignments
- use ast_strlen_zero()
- don't manually free cid fields since ast_set_callerid() will handle it
Reset our stream and vstream pointers back to NULL so that any generator that uses them (file based MOH) will not try to close them again. (issue #7668 reported by jmls)
Russell Bryant [Sat, 5 Aug 2006 20:58:47 +0000 (20:58 +0000)]
- add DIALING_OFFHOOK and PRERING to ast_state2str
- don't include a newline character when building a response for an unknown
state
(issue #7645, jonty)
Russell Bryant [Sat, 5 Aug 2006 09:03:27 +0000 (09:03 +0000)]
Merged revisions 38982 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r38982 | russell | 2006-08-05 05:01:37 -0400 (Sat, 05 Aug 2006) | 6 lines
Always generate a Newstate event in ast_setstate() instead of making it a
Newchannel event if the state was AST_STATE_DOWN. The Newchannel event will
always be generated in ast_request(), so this just causes a duplicated
Newchannel event in some cases.
(issue #7506, repoted by capouch, fixed by me)
Russell Bryant [Sat, 5 Aug 2006 05:26:29 +0000 (05:26 +0000)]
Merged revisions 38903-38904 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r38903 | russell | 2006-08-05 01:07:39 -0400 (Sat, 05 Aug 2006) | 2 lines
suppress a compiler warning about the usage of a potentially uninitialized variable
........
r38904 | russell | 2006-08-05 01:08:50 -0400 (Sat, 05 Aug 2006) | 10 lines
Fix an issue that would cause a NewCallerID manager event to be generated
before the channel's NewChannel event. This was due to a somewhat recent
change that included using ast_set_callerid() where it wasn't before. This
function should not be used in the channel driver "new" functions.
(issue #7654, fixed by me)
Also, fix a couple minor bugs in usecount handling. chan_iax2 could have
increased the usecount but then returned an error. The place where chan_sip
increased the usecount did not call ast_update_usecount()
* removed pp_l2_check (fixed L2 bug in mISDNuser)
* added blocking flag to stack object. A port can be blocked/unblocked from the
cli
* added EVENT_PORT_ALARM to send alarm infos to the chan_misdn.c layer (later
we can add a manager event for that)
* added block_on_alarm option, to block the port whenever a ALARM occurs
* added need_busy flag to indicate if we've sended a CONTROL_BUSY already
* changed a bunch of cb_log(-1,..) to cb_log(0,..) due to funny behaviour in
recent asterisk ast_log messages..
* fixed a few ETSI state violations, especially when finishing calls in
different seldom states
* changed debug levels a lot to make the log more readable in low debuglevels
* some first fixes for the HOLD/RETRIEVE stuff (doesn't work totally still)
* removed the PRECONNECTED state stuff
* added cause 27 when we get a CLEANUP directly after a outgoing SETUP, this
creates a CHANISUNAVAIL instead of a NOANSWER
* removed the addr pointer from "misdn show stacks" that's not needed anymore
and makes the output more unreadable
* added cause saving on RELEASE/RELEASE_COMPLETE
* set cause to 16 on prepare_bc
* removed stack getting from ph_control functions, we don't really need it
there
* added beroec api
fix brain-damage I introduced when trying to fix the CANCEL/BYE sending mechanism for pending INVITES
accept unknown 1xx responses as 183 responses (as RFC3261 mandates we should do)
ensure that the 'feature digit timeout' value is taken into account when deciding how long the bridge should run (this fixes a problem report where a digit press that did not invoke a feature is never passed across the bridge)
Close the stream when file based MOH stop. This won't get rid of their position in the file but it will cause the translation path to be setup again. (issue #7634 reported by asimpson)
don't reissue hangup requests for SIP channels that have expired their RTP timeouts (one time is enough)
don't rescan the SIP private structure list too fast, it can cause channels to not be able to hang up (issue #7495, and probably others)
use ast_softhangup_nolock() since we already hold the channel's lock
Add missing code to bring transferee channel out of MOH/autoservice under certain circumstance (issue #7611 reported by guillecabeza with minor mods by myself)
Poking at a structure when it may not even be allocated is not healthy. Essentially make sure an RTCP structure exists before trying to delete it's scheduled item. (issue #7514 reported by jmls fixed by AuPix)
How many attempts does it take to make a SIP URI parser that works well? I'm up to 5 personally. On to the good stuff - parse the domain first, user second, and get rid of port & options/params last. (issue #7616 reported by andrew)
Russell Bryant [Fri, 28 Jul 2006 23:30:18 +0000 (23:30 +0000)]
the pure attribute was not implemented before gcc 2.96. Since we have this
version check here anwyay, define attribute_pure to be empty if it's an earlier
version.
Russell Bryant [Fri, 28 Jul 2006 22:14:49 +0000 (22:14 +0000)]
Add the function attribute "pure" or "const" to various functions that perform
int to string or string to int operations.
"pure" essentially says that this function has no side effects aside from its
result, and the result depends on nothing else other than its arguments and
global variables. "const" is a more strict form of "pure", where the function
also doesn't access any global variables.
From the gcc manual: "Such a function can be subject to common subexpression
elimination and loop optimization just as an arithmetic operator would be."
This also tells the compiler that it is safe to call the function fewer times
than the code says to, given the same arguments, since the result will always
be the same.
Russell Bryant [Fri, 28 Jul 2006 19:17:56 +0000 (19:17 +0000)]
As discussed and decided on the asterisk-dev mailing list ...
- Fix some breakage I introduced a while ago that made the timestamps option
not functional for CLI verbose output.
- Remove the use of the timestamps option for log output, since it was not
functional.
- clarify text referring to the timestamps option so that it is clear that it
only applies to CLI verbose output
Make a copy of the request URI in check_user_full instead of modifying the one on the structure, and also strip params properly from the user portion of the SIP URI so as to preserve the domain (issue #7552 reported by dan42)
Kevin P. Fleming [Fri, 28 Jul 2006 18:03:57 +0000 (18:03 +0000)]
more slinfactory structure definition to inside implementation module
make read/write/hold work on samples, not bytes
add an API call to find out how many samples are available in a slinfactory
Kevin P. Fleming [Thu, 27 Jul 2006 23:16:08 +0000 (23:16 +0000)]
more simplification, and correct a bug i introduced in the last commit
fix prototype for a channel walking function to use a const input pointer
use existing channel walk by name prefix instead of reproducing that code in this app
Kevin P. Fleming [Thu, 27 Jul 2006 23:00:27 +0000 (23:00 +0000)]
remove local channel finding wrappers
move guts of dialplan application into separate function, so it can be shared bythe new application i'm about to add :-)
Kevin P. Fleming [Thu, 27 Jul 2006 22:20:52 +0000 (22:20 +0000)]
various cleanups:
use API call for finding channel by name prefix
code formatting to match guidelines (lost about half the of the indenting)
remove useless automatic variable initializations
don't set the spying channel's read format to SLINEAR when we don't do anything with the voice frames we read from it anyway
use proper option argument checking for volume argument