asterisk/asterisk.git
15 years agolocalize some variables
Luigi Rizzo [Wed, 19 Apr 2006 16:10:11 +0000 (16:10 +0000)]
localize some variables

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21535 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoextract a common condition.
Luigi Rizzo [Wed, 19 Apr 2006 15:15:03 +0000 (15:15 +0000)]
extract a common condition.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21508 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agofix indentation of some large blocks after previous changes
Luigi Rizzo [Wed, 19 Apr 2006 14:53:18 +0000 (14:53 +0000)]
fix indentation of some large blocks after previous changes

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21481 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agomore simplifications - use a local variable c instead of o->chan,
Luigi Rizzo [Wed, 19 Apr 2006 14:50:17 +0000 (14:50 +0000)]
more simplifications - use a local variable c instead of o->chan,
use S_OR as appropriate.

Still need to fix the indentation of some blocks.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21480 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agomore simplifications
Luigi Rizzo [Wed, 19 Apr 2006 14:14:40 +0000 (14:14 +0000)]
more simplifications

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21479 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agostart cleaning up this code so we can split the 900 lines function
Luigi Rizzo [Wed, 19 Apr 2006 14:02:49 +0000 (14:02 +0000)]
start cleaning up this code so we can split the 900 lines function
into manageable chunks.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21468 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agosupport 'languageprefix' in asterisk.conf to modify the algorithm
Luigi Rizzo [Wed, 19 Apr 2006 13:59:34 +0000 (13:59 +0000)]
support 'languageprefix' in asterisk.conf to modify the algorithm
to build pathnames for language-specific files (see file.c for
a description)

Default, of course, to the standard behaviour.

We don't have an asterisk.conf.sample to put an example of use!

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21451 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoadd experimental code for new-style "say" application.
Luigi Rizzo [Wed, 19 Apr 2006 10:27:31 +0000 (10:27 +0000)]
add experimental code for new-style "say" application.
The rules for spelling out numbers and dates are in the config
file "say.conf", which can be edited to implement national
or even local language rules.

The new code can be enabled through the cli command
'say load new'
while the old code can be restored with
'say load old'

Eventually, this code should go to a better place,
but for the time being we keep here as it provides
very similar functions.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21421 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoadd example syntax for new-style number and date spelling
Luigi Rizzo [Wed, 19 Apr 2006 10:21:58 +0000 (10:21 +0000)]
add example syntax for new-style number and date spelling

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21420 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoone more client for find_context_locked(),
Luigi Rizzo [Wed, 19 Apr 2006 09:31:41 +0000 (09:31 +0000)]
one more client for find_context_locked(),
plus a few minor fixes.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21393 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agouse a function, set_ext_pri(), to assign extension and priority.
Luigi Rizzo [Wed, 19 Apr 2006 09:18:30 +0000 (09:18 +0000)]
use a function, set_ext_pri(), to assign extension and priority.
On passing, fix a bug in __ast_pbx_run() where the wrong priority
was used in a call to ast_exists_extension() (see comment in the code).

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21392 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoreplace repeated code to walk contexts with a function,
Luigi Rizzo [Wed, 19 Apr 2006 08:52:15 +0000 (08:52 +0000)]
replace repeated code to walk contexts with a function,
find_context_locked()

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21365 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agomove to a different file (channel.c for the time being) the
Luigi Rizzo [Wed, 19 Apr 2006 07:23:22 +0000 (07:23 +0000)]
move to a different file (channel.c for the time being) the
wrappers around the basic 'say' functions, and redeclare these
wrappers as ordinary functions rather than function pointers.

This way, alternative implementations of the 'say' functions
will only have to implement the basic functions and not the
wrappers.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21338 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years ago- use ast_calloc instead of ast_malloc
Luigi Rizzo [Wed, 19 Apr 2006 06:58:20 +0000 (06:58 +0000)]
- use ast_calloc instead of ast_malloc
- use ast_channel_lock/unlock in a few places
- comment some dubious pieces of code
- use memset to zero a buffer

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21311 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoAdd reference to RFC for mailbox notification
Olle Johansson [Wed, 19 Apr 2006 00:45:37 +0000 (00:45 +0000)]
Add reference to RFC for mailbox notification

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21277 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoCosmetic fixes to code...
Olle Johansson [Wed, 19 Apr 2006 00:04:03 +0000 (00:04 +0000)]
Cosmetic fixes to code...

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21262 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agofix obvious breakage
Kevin P. Fleming [Tue, 18 Apr 2006 23:50:59 +0000 (23:50 +0000)]
fix obvious breakage

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21239 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agodoh! don't double-increment the bracket count for embedded references
Kevin P. Fleming [Tue, 18 Apr 2006 23:25:22 +0000 (23:25 +0000)]
doh! don't double-increment the bracket count for embedded references

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21236 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agodon't ignore left-curly-braces when searching for the end of a variable/function...
Kevin P. Fleming [Tue, 18 Apr 2006 23:24:02 +0000 (23:24 +0000)]
don't ignore left-curly-braces when searching for the end of a variable/function reference; match them up with right-curly-braces so we choose the proper brace to end the reference (will still fail to parse properly if the reference contains unbalanced braces)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21235 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agocorrect array index calculation (thanks mtaht3!)
Kevin P. Fleming [Tue, 18 Apr 2006 21:39:20 +0000 (21:39 +0000)]
correct array index calculation (thanks mtaht3!)
update header file comments to reflect new usage of structure field

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21207 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoupdate res_odbc to support pooled connections
Russell Bryant [Tue, 18 Apr 2006 18:16:32 +0000 (18:16 +0000)]
update res_odbc to support pooled connections
(from tilghman's developer branch, res_odbc_rewrite)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21181 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years ago- call parking improvements (part of the siptransfer branch)
Olle Johansson [Tue, 18 Apr 2006 15:09:01 +0000 (15:09 +0000)]
- call parking improvements (part of the siptransfer branch)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21157 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoImplement somewhat improved support for 481 Call leg does not exist responses...
Olle Johansson [Tue, 18 Apr 2006 14:50:30 +0000 (14:50 +0000)]
Implement somewhat improved support for 481 Call leg does not exist responses...
- There are some questions on what to do here, but it is a first step.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21131 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoDo not depend on having an end sound for stopping the bridge when time runs out....
Joshua Colp [Tue, 18 Apr 2006 14:43:32 +0000 (14:43 +0000)]
Do not depend on having an end sound for stopping the bridge when time runs out. (issue #6979 reported by ppyy)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21130 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoClean up handle_response_peerpoke
Olle Johansson [Tue, 18 Apr 2006 14:41:57 +0000 (14:41 +0000)]
Clean up handle_response_peerpoke

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21129 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoChange sip show channels to include refer status
Olle Johansson [Tue, 18 Apr 2006 14:37:54 +0000 (14:37 +0000)]
Change sip show channels to include refer status

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21128 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years ago- Deallocate refer structure at sip_destroy time
Olle Johansson [Tue, 18 Apr 2006 14:35:15 +0000 (14:35 +0000)]
- Deallocate refer structure at sip_destroy time
- Implement new sip_transfer() function

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21127 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agosimplify logic in iax2_bridge()
Luigi Rizzo [Tue, 18 Apr 2006 14:23:14 +0000 (14:23 +0000)]
simplify logic in iax2_bridge()

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21126 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agosimplify logic in various functions, remove unnecessary variables
Luigi Rizzo [Tue, 18 Apr 2006 13:37:07 +0000 (13:37 +0000)]
simplify logic in various functions, remove unnecessary variables

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21099 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoremove a line that was added by mistake
Luigi Rizzo [Tue, 18 Apr 2006 13:17:44 +0000 (13:17 +0000)]
remove a line that was added by mistake

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21098 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agosimplify the flow of builtin_atxfer().
Luigi Rizzo [Tue, 18 Apr 2006 13:05:48 +0000 (13:05 +0000)]
simplify the flow of builtin_atxfer().

There is still a lot of similarity with builtin_blindtransfer()
which should be removed by definining functions for the common
pieces of code (eg in the first part).

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21097 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoIt's critical that we get an ACK on a 200 OK to an INVITE. If we do not get the ACK,
Olle Johansson [Tue, 18 Apr 2006 07:03:36 +0000 (07:03 +0000)]
It's critical that we get an ACK on a 200 OK to an INVITE. If we do not get the ACK,
tear down the call. (Discovered at SIPit18)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21061 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agouse XMIT_RELIABLE ...
Olle Johansson [Tue, 18 Apr 2006 07:00:27 +0000 (07:00 +0000)]
use XMIT_RELIABLE ...

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21043 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years ago- Move subscribeuri away from refer-to, since refer-to is moving away from sip_pvt
Olle Johansson [Tue, 18 Apr 2006 06:40:01 +0000 (06:40 +0000)]
- Move subscribeuri away from refer-to, since refer-to is moving away from sip_pvt

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21039 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoMerged revisions 21037 via svnmerge from
Tilghman Lesher [Tue, 18 Apr 2006 06:29:30 +0000 (06:29 +0000)]
Merged revisions 21037 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r21037 | tilghman | 2006-04-18 01:26:04 -0500 (Tue, 18 Apr 2006) | 2 lines

Bug 6984 - off by one error in Random()

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21038 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoMerged revisions 20966 via svnmerge from
Tilghman Lesher [Mon, 17 Apr 2006 17:17:41 +0000 (17:17 +0000)]
Merged revisions 20966 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r20966 | tilghman | 2006-04-17 12:00:16 -0500 (Mon, 17 Apr 2006) | 2 lines

Bug 6544 - when we remove a music class, the thread servicing it should die

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21002 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoactually return the number steps... not the number of steps minus 1
Kevin P. Fleming [Mon, 17 Apr 2006 16:43:55 +0000 (16:43 +0000)]
actually return the number steps... not the number of steps minus 1

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20964 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agomore module loader related fixes
Kevin P. Fleming [Mon, 17 Apr 2006 16:42:21 +0000 (16:42 +0000)]
more module loader related fixes

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20963 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoadd an API so that the number of steps required for a translation path can be acquired
Kevin P. Fleming [Mon, 17 Apr 2006 16:42:03 +0000 (16:42 +0000)]
add an API so that the number of steps required for a translation path can be acquired
don't transcode via SLINEAR when the option is enabled but there is a direct path from the source to the destination

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20962 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoSet timeout timers to Timer A and F in rfc 3261, section 17
Olle Johansson [Mon, 17 Apr 2006 14:22:16 +0000 (14:22 +0000)]
Set timeout timers to Timer A and F in rfc 3261, section 17

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20932 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoChange transmit_invite(). SIP Transfers are now broken officially, while
Olle Johansson [Mon, 17 Apr 2006 14:07:50 +0000 (14:07 +0000)]
Change transmit_invite(). SIP Transfers are now broken officially, while
waiting for the rest of the patches... This is the dev branch, after all.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20931 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years ago- Add supported header
Olle Johansson [Mon, 17 Apr 2006 14:00:44 +0000 (14:00 +0000)]
- Add supported header
- Send cause codes as well

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20908 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoAdd more history on masqs
Olle Johansson [Mon, 17 Apr 2006 13:52:53 +0000 (13:52 +0000)]
Add more history on masqs

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20903 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years ago- Implementing the new SIP transfer data structure
Olle Johansson [Mon, 17 Apr 2006 13:47:30 +0000 (13:47 +0000)]
- Implementing the new SIP transfer data structure
- Changing SIP call to support sending INVITEs as part of call transfers

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20902 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years ago- Documentation update
Olle Johansson [Mon, 17 Apr 2006 13:22:31 +0000 (13:22 +0000)]
- Documentation update
- Formatting change

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20901 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoDocumentation update
Olle Johansson [Mon, 17 Apr 2006 13:08:24 +0000 (13:08 +0000)]
Documentation update

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20900 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoRemove ignore from handle_respons_refer
Olle Johansson [Mon, 17 Apr 2006 09:21:56 +0000 (09:21 +0000)]
Remove ignore from handle_respons_refer

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20872 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoClean up handle_response_invite
Olle Johansson [Mon, 17 Apr 2006 08:15:38 +0000 (08:15 +0000)]
Clean up handle_response_invite

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20844 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years ago- Drop too bad SIP requests in order to avoid some UDP misuse (hello Edwin)
Olle Johansson [Mon, 17 Apr 2006 05:32:22 +0000 (05:32 +0000)]
- Drop too bad SIP requests in order to avoid some UDP misuse (hello Edwin)
- Clean up initialization of initatial request initialization

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20816 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years ago- Doxygen formatting
Olle Johansson [Mon, 17 Apr 2006 04:31:21 +0000 (04:31 +0000)]
- Doxygen formatting
  Please place a Doxygen todo marker before things that needs to be checked up later
  by someone - it's like /*! \todo We really need to implement this in C++ */

- option_debug checking before logging to DEBUG channel

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20790 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agowhitespace and spelling (recieve instead of receive) fixes
North Antara [Mon, 17 Apr 2006 01:17:03 +0000 (01:17 +0000)]
whitespace and spelling (recieve instead of receive) fixes

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20759 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agopreparation for reduction of the nesting of a large function
Luigi Rizzo [Sun, 16 Apr 2006 23:05:42 +0000 (23:05 +0000)]
preparation for reduction of the nesting of a large function

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20733 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agomore usages of stream_and_wait
Luigi Rizzo [Sun, 16 Apr 2006 22:46:00 +0000 (22:46 +0000)]
more usages of stream_and_wait

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20707 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agomore usages of function 'finishup()'
Luigi Rizzo [Sun, 16 Apr 2006 22:22:53 +0000 (22:22 +0000)]
more usages of function 'finishup()'

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20705 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoone more instance of stream_and_wait, and remove an extra
Luigi Rizzo [Sun, 16 Apr 2006 22:02:30 +0000 (22:02 +0000)]
one more instance of stream_and_wait, and remove an extra
'error = 1' line put in by miustake

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20693 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agosimplify a couple of functions.
Luigi Rizzo [Sun, 16 Apr 2006 21:57:02 +0000 (21:57 +0000)]
simplify a couple of functions.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20679 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agomore replaceemnt of dup code with functions.
Luigi Rizzo [Sun, 16 Apr 2006 21:41:06 +0000 (21:41 +0000)]
more replaceemnt of dup code with functions.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20678 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agolocalize several variables, and simplify the last part of park_exec()
Luigi Rizzo [Sun, 16 Apr 2006 20:32:14 +0000 (20:32 +0000)]
localize several variables, and simplify the last part of park_exec()

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20653 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agomore formatting cleanup including removal of a useless check
Luigi Rizzo [Sun, 16 Apr 2006 20:09:01 +0000 (20:09 +0000)]
more formatting cleanup including removal of a useless check
for f == NULL

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20652 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agorename a variable same as used in a very similar function,
Luigi Rizzo [Sun, 16 Apr 2006 19:56:08 +0000 (19:56 +0000)]
rename a variable same as used in a very similar function,
to reduce code differences.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20627 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agos/pu->chan/chan in a few places;
Luigi Rizzo [Sun, 16 Apr 2006 19:41:12 +0000 (19:41 +0000)]
s/pu->chan/chan in a few places;

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20626 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoput some common code into functions (still more instances to be replaced)
Luigi Rizzo [Sun, 16 Apr 2006 19:26:57 +0000 (19:26 +0000)]
put some common code into functions (still more instances to be replaced)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20625 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoproperly reindent a large block.
Luigi Rizzo [Sun, 16 Apr 2006 19:12:51 +0000 (19:12 +0000)]
properly reindent a large block.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20624 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agomore readability fixes - localize some variables and invert
Luigi Rizzo [Sun, 16 Apr 2006 19:05:19 +0000 (19:05 +0000)]
more readability fixes - localize some variables and invert
a condition in an 'if' statement to reduce the nesting depth.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20623 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agointroduce a function to set context, extension and priority
Luigi Rizzo [Sun, 16 Apr 2006 18:49:46 +0000 (18:49 +0000)]
introduce a function to set context, extension and priority
replacing some common blocks of code (there are still a few
instances where it can be used)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20598 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agominor readability fixes in preparation for more work on this file:
Luigi Rizzo [Sun, 16 Apr 2006 18:37:01 +0000 (18:37 +0000)]
minor readability fixes in preparation for more work on this file:
- replace nested 'if' with '&&'
- fix indentation
- annotate the end brace of some huge block
- remove useless parentheses

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20597 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agominor formatting fixes
Luigi Rizzo [Sun, 16 Apr 2006 18:10:10 +0000 (18:10 +0000)]
minor formatting fixes

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20596 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agomove some duplicated code outside an if/then/else block
Luigi Rizzo [Sun, 16 Apr 2006 17:59:37 +0000 (17:59 +0000)]
move some duplicated code outside an if/then/else block

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20570 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agomake sure there is [almost] only a single exit point for a very long
Luigi Rizzo [Sun, 16 Apr 2006 17:41:05 +0000 (17:41 +0000)]
make sure there is [almost] only a single exit point for a very long
function so the flow is easier to follow.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20569 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agosimplify the ast_channel walking routines.
Luigi Rizzo [Sun, 16 Apr 2006 16:58:56 +0000 (16:58 +0000)]
simplify the ast_channel walking routines.
(the previous version was mine, but this way it is definitely
more readable).

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20543 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agomove common conditions to the outside block.
Luigi Rizzo [Sun, 16 Apr 2006 16:04:24 +0000 (16:04 +0000)]
move common conditions to the outside block.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20540 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agosimplify logic in ast_generic_bridge()
Luigi Rizzo [Sun, 16 Apr 2006 15:51:53 +0000 (15:51 +0000)]
simplify logic in ast_generic_bridge()

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20514 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agomove common code in one place
Luigi Rizzo [Sun, 16 Apr 2006 15:27:58 +0000 (15:27 +0000)]
move common code in one place

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20513 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoavoid returning in the middle of a switch() in ast_answer()
Luigi Rizzo [Sun, 16 Apr 2006 15:22:13 +0000 (15:22 +0000)]
avoid returning in the middle of a switch() in  ast_answer()

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20512 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agosimplify function __ast_request_and_dial() as follows:
Luigi Rizzo [Sun, 16 Apr 2006 15:13:39 +0000 (15:13 +0000)]
simplify function __ast_request_and_dial() as follows:
- handle immediately failures in ast_request();
  This removes the need for checking 'chan' multiple times afterwards.
- handle immediately failures in ast_call(), by moving the one-line
  case at the top of the 'if' statement;
- use ast_strlen_zero in several places instead of expanding it inline;
- make outstate always a valid pointer;
On passing mark an unclear statement and replace a magic number
with sizeof(tmp).

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20511 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoproperly reindent a block
Luigi Rizzo [Sun, 16 Apr 2006 14:14:16 +0000 (14:14 +0000)]
properly reindent a block

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20484 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoadd a missing ast_channel_unlock() evidenced by previous commits.
Luigi Rizzo [Sun, 16 Apr 2006 14:03:43 +0000 (14:03 +0000)]
add a missing ast_channel_unlock() evidenced by previous commits.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20477 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoremove an extra lock.
Luigi Rizzo [Sun, 16 Apr 2006 14:00:17 +0000 (14:00 +0000)]
remove an extra lock.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20456 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years ago- replace some nested 'if' with '&&'
Luigi Rizzo [Sun, 16 Apr 2006 13:58:43 +0000 (13:58 +0000)]
- replace some nested 'if' with '&&'
- bring the short case at the top of an 'if' statement
  (also fix misformatting)
- replace several 'if' with the '?' operator;

- invert the condition on an 'if' to reduce the nesting depth
  (reindentation to be done later).

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20454 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoLocalize some variables documenting their usage.
Luigi Rizzo [Sun, 16 Apr 2006 13:27:58 +0000 (13:27 +0000)]
Localize some variables documenting their usage.
Comment a possible problem with locking.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20453 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years ago- Fixes to ast_channel_lock functions
Olle Johansson [Sun, 16 Apr 2006 12:57:15 +0000 (12:57 +0000)]
- Fixes to ast_channel_lock functions
- New get_sip_pvt_byid function (not really used correctly yet...)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20424 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agolocalize some variables, add some comments.
Luigi Rizzo [Sun, 16 Apr 2006 08:01:10 +0000 (08:01 +0000)]
localize some variables, add some comments.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20396 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoimplement ast_waitfordigit() and ast_readstring() in terms
Luigi Rizzo [Sun, 16 Apr 2006 07:53:25 +0000 (07:53 +0000)]
implement ast_waitfordigit() and ast_readstring() in terms
of their '_full()' version, so we can remove the replicated
implementation and, especially, the risk that they get out of sync.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20389 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoMove a bit more stuff over to the datadir (issue #6967 reported by tzafrir patch...
Joshua Colp [Sat, 15 Apr 2006 23:37:29 +0000 (23:37 +0000)]
Move a bit more stuff over to the datadir (issue #6967 reported by tzafrir patch by north)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20358 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoAllow the attachment format to be specified differently for different mailboxes ...
Joshua Colp [Sat, 15 Apr 2006 23:05:18 +0000 (23:05 +0000)]
Allow the attachment format to be specified differently for different mailboxes (issue #6961 reported by the ever fabulous Corydon76)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20357 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoWe are shaking up trunk tonight! allow data dir to be specified (issue #6967 reported...
Joshua Colp [Sat, 15 Apr 2006 22:53:53 +0000 (22:53 +0000)]
We are shaking up trunk tonight! allow data dir to be specified (issue #6967 reported by tzafrir)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20330 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoadd indications for Thailand (issue #6971)
Russell Bryant [Sat, 15 Apr 2006 22:49:45 +0000 (22:49 +0000)]
add indications for Thailand (issue #6971)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20329 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoadd the ability to turn off the feature that allows agents to end calls
Russell Bryant [Sat, 15 Apr 2006 22:32:23 +0000 (22:32 +0000)]
add the ability to turn off the feature that allows agents to end calls
by pressing '*'.  This is still on by default. (issue #6897)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20328 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoBig oops. I did this from my trunk directory instead of autoconf_and_menuselect ...
Russell Bryant [Sat, 15 Apr 2006 15:34:57 +0000 (15:34 +0000)]
Big oops.  I did this from my trunk directory instead of autoconf_and_menuselect ...

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20297 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoinclude autoconfig.h (casper)
Russell Bryant [Sat, 15 Apr 2006 15:33:00 +0000 (15:33 +0000)]
include autoconfig.h (casper)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20296 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoMore ast_channel_lock fixes
Olle Johansson [Sat, 15 Apr 2006 15:07:39 +0000 (15:07 +0000)]
More ast_channel_lock fixes
- Update lock.h with definitions of ast_channel_lock, ast_channel_unlock and ast_channel_trylock
- Convert some functions (but not all) in channel.c
- Fix some bugs in chan_sip.c
- Convert rest of chan_sip.c

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20295 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoNew functions for locking a channel - these simplify debugging
Olle Johansson [Sat, 15 Apr 2006 08:07:50 +0000 (08:07 +0000)]
New functions for locking a channel - these simplify debugging
when you have channel locking issues.
(Part of the SIP transfer patch, where I had a *lot* of
channel locking problems)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20264 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoapplied two of the 3 chunks in #6907, and a similar one
Luigi Rizzo [Sat, 15 Apr 2006 00:53:04 +0000 (00:53 +0000)]
applied two of the 3 chunks in #6907, and a similar one
(replace nested 'if' with '&&')
I cannot make sense of the first chunk of the proposed patch,
i think the original is correct.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20225 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years ago- use '=' to copy struct sockaddr_in
Luigi Rizzo [Sat, 15 Apr 2006 00:36:05 +0000 (00:36 +0000)]
- use '=' to copy struct sockaddr_in
- localize a variable
- replace three replicas of the same code with a much simpler construct
  removing replicated var = var->next;
- use '?' instead of 'if' for an assignment

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20224 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years ago- normalize for() loops to navigate through variables,
Luigi Rizzo [Sat, 15 Apr 2006 00:05:08 +0000 (00:05 +0000)]
- normalize for() loops to navigate through variables,
  removing replicated var = var->next;
- remove a potential infinite loop and document the problem
- remove useless checks and document why
- mark XXX a possible bug (to be investigated)
- use ast_strlen_zero() instead of expanding it inline
- fix indentation in one place
- replace a nested 'if' with '&&'

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20223 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years ago- use '?' instead of if statements for assignment;
Luigi Rizzo [Fri, 14 Apr 2006 23:30:18 +0000 (23:30 +0000)]
- use '?' instead of if statements for assignment;
- fix indentation in a few places
- use a variable to store the 'other' channel, thus removing
  the need for some duplicated code;
- use '=' instead of memcpy to copy struct sockaddr_in

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20197 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years ago- remove some unnecessary casts and braces;
Luigi Rizzo [Fri, 14 Apr 2006 23:20:29 +0000 (23:20 +0000)]
- remove some unnecessary casts and braces;
- add braces around a nested 'if'
- use S_OR and '?' to remove some duplicated function calls;
- replace nested 'if' with &&
- move out a common term in a sequence of 'if'
- add a comment on a potentially dangerous string manipulation

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20196 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agoremove some unnecessary braces
Luigi Rizzo [Fri, 14 Apr 2006 22:55:58 +0000 (22:55 +0000)]
remove some unnecessary braces

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20170 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agomisc. code cleanup
Luigi Rizzo [Fri, 14 Apr 2006 22:48:05 +0000 (22:48 +0000)]
misc. code cleanup

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20169 65c4cc65-6c06-0410-ace0-fbb531ad65f3

15 years agocode simplifications
Luigi Rizzo [Fri, 14 Apr 2006 22:32:13 +0000 (22:32 +0000)]
code simplifications

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@20168 65c4cc65-6c06-0410-ace0-fbb531ad65f3