Commit Graph

22737 Commits

Author SHA1 Message Date
Kinsey Moore
de024296c1 Remove leading spaces from the CLI command before parsing
If you've mistakenly put a space before typing in a command, the
leading space will be included as part of the command, and the command
parser will not find the corresponding command. This patch rectifies
that situation by stripping the leading spaces on commands.

Review: https://reviewboard.asterisk.org/r/2709/
Patch-by: Tilghman Lesher


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396745 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-15 16:21:20 +00:00
Joshua Colp
0ea78acf7e Tweak comment for why usleep is used.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-14 19:05:41 +00:00
Joshua Colp
4f11241f70 Tweak test_hashtab_thrash test to allow the critical threads to execute.
Depending on certain conditions it was possible for the hashtab counting thread
to starve other threads, preventing them from executing in the expected fashion.
This change adds a sleep to allow the others to do what they need to do. While
this doesn't thrash the hashtab as much as previously, it at least works.

(closes issue ASTERISK-22276)
Reported by: Matt Jordan


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396619 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-14 18:07:37 +00:00
Walter Doekes
96a21654d2 chan_sip: Convert 'just did sched_add waitid...' from warning to debug message.
Patches:
    reviewboard-2377.patch uploaded by Paul Belanger
Review: https://reviewboard.asterisk.org/r/2377/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-13 18:44:21 +00:00
Walter Doekes
e09f917a75 chan_sip: Fix IP-addr in warning when rejecting a contact ACL.
Patches:
    reviewboard-2155.patch uploaded by Paul Belanger
Review: https://reviewboard.asterisk.org/r/2155/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-13 18:32:32 +00:00
Walter Doekes
ae157a6b66 Consistent memory allocation by ast_bt_get_symbols.
Always use ast_alloc/ast_free. This is handled differently in trunk (r391012).

Review: https://reviewboard.asterisk.org/r/2580/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-08 20:14:27 +00:00
Walter Doekes
612bf744b4 Check result of ast_var_assign() calls for memory allocation failure.
We try to keep the system running even when all available memory is
spent.

Review: https://reviewboard.asterisk.org/r/2734/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-06 08:14:59 +00:00
Michael L. Young
950419022f Fix Registration Failure When A Peer And TLS Are Used
If a peer is used in a register line and TLS is defined as the transport, the
registration fails since the transport on the dialog is never set properly
resulting in UDP being used instead of TLS.

This patch sets the dialog's transport based on the transport that was defined
in the register line.  If the register line does not specify a transport, the
parsing function for the register line always defaults back to UDP.

(closes issue ASTERISK-21964)
Reported by: Doug Bailey
Tested by: Doug Bailey
Patches:
    asterisk-21964-set-reg-dialog-transport.diff
					by Michael L. Young (license 5026)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-05 20:17:44 +00:00
Michael L. Young
4693ac4d0a Restore Extra Line Break Between Peers When Running AMI Action SIPPeers
The commit (r387133) for fixing ASTERISK-21466 accidentally removed an extra
line break between the peers returned by the AMI action SIPPeers.  This
results in some parsers breaking because they expect this extra line break.

This patch restores that extra line break.

(closes issue ASTERISK-22239)
Reported by: Jacek Konieczny
Tested by: Jacek Konieczny, Michael L. Young
Patches:
    asterisk-ami_sippeers_separator.patch by Jacek Konieczny (license 6298)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396236 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-05 19:45:49 +00:00
Michael L. Young
111a81b8d8 Adding a note to UPGRADE.txt about a change made to res_agi in order to
indicate when streaming an audio file fails like it is done in other parts
of the code to indicate an error.

Note was requested by Paul Belanger: 
http://lists.digium.com/pipermail/asterisk-dev/2013-July/061420.html

(related to issue ASTERISK-21903)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@396196 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-05 18:40:13 +00:00
Matthew Jordan
f13faae4e1 Update copyright year to 2013 in asterisk.c; some whitespace fixes
(closes issue ASTERISK-22179)
Reported by: Malcolm Davenport


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@395032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-22 13:49:00 +00:00
Matthew Jordan
b179d1a71b Clean up documentation
This patch cleans up documentation in func_channel for the following items:
* rtpsource
* secure_signaling
* secure_media

(closes issue ASTERISK-20969)
Reported by: snuffy
patches:
  func_chan-update.diff uploaded by snuffy (License 5024)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@394980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-21 22:02:41 +00:00
Matthew Jordan
d1eee5436a Provide proper ring tone in indications.conf for Malaysia
The ring tone provided in the sample indications.conf was incorrect. This patch
modifies the sample ring tone to be what it should:
  ring = 425/400,0/200,425/400,0/2000

This brings it in line with the tone definition in DAHDI 2.7.0. (zonedata.c)

(closes issue ASTERISK-21997)
Reported by: Filip Jenicek
patches:
  malaysia_ring.patch uploaded by phill (License 6277)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@394940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-21 18:15:57 +00:00
Matthew Jordan
f612bec005 Tolerate presence of RFC2965 Cookie2 header by ignoring it
This patch modifies parsing of cookies in Asterisk's http server by doing an
explicit comparison of the "Cookie" header instead of looking at the first
6 characters to determine if the header is a cookie header. This avoids
parsing "Cookie2" headers and overwriting the previously parsed "Cookie"
header.

Note that we probably should be appending the cookies in each "Cookie"
header to the parsed results; however, while clients can send multiple
cookie headers they never really do. While this patch doesn't improve
Asterisk's behavior in that regard, it shouldn't make it any worse either.

Note that the solution in this patch was pointed out on the issue by the
issue reporter, Stuart Henderson.

(closes issue ASTERISK-21789)
Reported by: Stuart Henderson
Tested by: mjordan, Stuart Henderson


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@394899 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-21 03:09:16 +00:00
Matthew Jordan
90b4144bcc Update PostgreSQL realtime scripts with schema for queue_log table
This patch updates the realtime SQL scripts with an entry that will create the
queue_log table. This brings the PostgreSQL scripts inline with the MySQL
scripts, with respect to what tables they will create.

(closes issue ASTERISK-21021)
Reported by: Eugene
patches:
  queue_log.sql uploaded by varnav (license 6360)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@394896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-21 02:38:09 +00:00
Matthew Jordan
17fe92079e Document connectedline parameter for chan_iax2
The connectedline parameter for a chan_iax2 peer was undocumented. This patch
documents the options in the sample configuration file.

(closes issue ASTERISK-21953)
Reported by: Birger "WIMPy" Harzenetter



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@394886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-21 02:19:21 +00:00
Michael L. Young
6d49e9827b Properly indicate failure to open an audio stream in res_agi
If there is an error streaming an audio file, the current return status makes it
difficult for an AGI script to determine that there was an error with the audio
file.

This patches changes the result to return -1 and the function returns
RESULT_FAILURE instead of RESULT_SUCCESS.  From looking at other parts of
res_agi, this would appear to be the proper way to handle an error.

(closes issue ASTERISK-21903)
Reported by: Ariel Wainer
Tested by: Ariel Wainer
Patches:
	asterisk-21903-return-stream-res_1.8.diff
					by Michael L. Young (license 5026)

Review: https://reviewboard.asterisk.org/r/2625/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@394640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-18 12:51:22 +00:00
Matthew Jordan
a2ea7084c0 Clarify documentation for function PASSTHRU
It is not apparent to the average user that the PASSTHRU function should not
be passed as ${PASSTHRU(string)} but just as PASSTHRU(string) to functions
which take a variable name and not its contents.

This patch clarifies the behavior in the documentation and provides an example.

(closes issue ASTERISK-21717)
Reported by: Richard Miller
patches:
  func_strings.diff uploaded by Richard Miller (license 5685)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@394302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-14 01:53:15 +00:00
Moises Silva
9503a17a05 Fix a longstanding issue with MFC-R2 configuration that prevented users
from mixing different variants or general MFC-R2 settings within the same E1 line.

Most users do not have a problem with this since MFC-R2 lines are usually fractional E1s, or
the whole E1 has the same country variant and R2 settings.

In Venezuela however is common to have inbound MFC-R2 and outbound DTMF-R2 within the same E1.

This fix now properly parses the chan_dahdi.conf file to generate a new openr2 context every
time a new channel => section is found and the configuration was changed.

(closes issue ASTERISK-21117)
Reported by: Rafael Angulo
Related Elastix issue: http://bugs.elastix.org/view.php?id=1612


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@394106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-11 16:25:39 +00:00
Russell Bryant
4a6c3a4237 astobj2-ify the SLA code
The SLA code within app_meetme was written before asotbj2 had been
merged into Asterisk.  Worse, support for reloads did not exist at first
and was added later as a bolt-on feature.  I knew at the time that
reloading was not safe at all while SLA was in use, so the reload would
be queued up to execute when the system was idle.  Unfortunately, this
approach was still prone to errors beyond the fact that this was the
only place in Asterisk where configuration was not reloaded
instantly when requested.

This patch converts various SLA objects to be reference counted objects
using astobj2.  This allows reloads to be processed while the system is
in use.  The code ensures that the objects will not disappear while one
of the other threads is using them.  However, they will be immediately
removed from the global trunk and station containers so no new calls
will use them if removed from configuration.

Review: https://reviewboard.asterisk.org/r/2581/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@393928 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-10 01:41:42 +00:00
Richard Mudgett
0afaac5423 chan_dahdi: Fix segfault reloading chan_dahdi when round robin is used.
* Clear round_robin[] in dahdi_restart().

(closes issue ASTERISK-21847)
Reported by: Ivo Andonov
Patches:
      jira_asterisk_21847_v1.8.patch (license #5621) patch uploaded by rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@393627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-07-03 23:27:52 +00:00
Jonathan Rose
0630ac71c2 app_mixmonitor: Fix crashes caused by unloading app_mixmonitor
Unloading app_mixmonitor while active mixmonitors were running would
cause a segfault. This patch fixes that by making it impossible to
unload app_mixmonitor while mixmonitors are active.

Review: https://reviewboard.asterisk.org/r/2624/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@391778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-14 16:14:48 +00:00
Matthew Jordan
f13bd7d90f Fix memory leak while loading priority modules
When we load a module with the LOAD_PRIORITY flag, we remove its entry from
the load order list. Unfortunately, we don't free the memory associated with
entry in the list. This patch corrects that and properly frees the memory for
the module in the list.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@391489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-12 02:19:52 +00:00
Alec L Davis
fe05e0d821 IAX2: Transfer Reject: Lock bridgecallno before touching it, refactor
1). When touching the bridgecallno, we need to lock it.

2). Remove magic number '0' and replace with TRANSFER_NONE.

3). Exit early if no bridgecallno.

4). Reduce indentation.

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

Review https://reviewboard.asterisk.org/r/2613/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@391333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-11 08:03:38 +00:00
Matthew Jordan
0897f95b39 Add announce-to-first-user option for app_queue
In r386792, the ability to play prompts to the first caller in a call queue was
added. While this is arguably a bug fix for those who expect the first caller
to continue receiving prompts while the agent is dialed, it has the side effect
of preventing the first caller from hearing the agent immediately upon
bridging. This may not be a problem for those who really want this option, but
for those who didn't care whether or not the first caller in queue heard their
position, it was an issue.

This patch disables the ability for the first caller in the queue to hear
prompts and adds a new option, announce-to-first-user, to queues.conf. Those
who the behavior can enable it by setting this value to True.

Note that if we ever implement the ability to have the prompts be stopped
upon bridging, this option can be removed.

(closes issue ASTERISK-21782)
Reported by: Remi Quezada



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@391215 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-10 14:15:19 +00:00
Alec L Davis
c2815b889e chan_iax2: nativebridge refactor, missed unlock bridgecallno
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@391143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-10 09:30:11 +00:00
Alec L Davis
ae28bf6e40 fix bad edit after conflict resolution
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@391107 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-10 08:32:34 +00:00
Alec L Davis
71e2747cd8 IAX2: refactor nativebridge transfer
remove triple checking of iaxs[fr->callno]->transferring

reduce indentation.

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

Review https://reviewboard.asterisk.org/r/2602/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@391065 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-10 07:56:49 +00:00
Alec L Davis
9144464185 IAX2: fix race condition with nativebridge transfers.
1). When touching the bridgecallno, we need to lock it.

2). stop_stuff() which calls iax2_destroy_helper()
    Assumes the lock on the pvt is already held, when iax2_destroy_helper() is called.
    Thus we need to lock the bridgecallno pvt before we call stop_stuff(iaxs[fr->callno]->bridgecallno);

3).   When evaluating the state of 'callno->transferring' of the current leg,
    we can't change it to READY unless the bridgecallno is locked.
      Why, if we are interrupted by the other call leg before 'transferring = TRANSFER_RELEASED',
    the interrupt will find that it is READY and that the bridgecallno is also READY so Releases the legs.

(closes issue ASTERISK-21409)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

Review https://reviewboard.asterisk.org/r/2594/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@391062 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-06-10 07:30:35 +00:00
Alexandr Anikin
a889d8768f reject call attempts when gatekeeper is configured but not registered
(closes issue ASTERISK-21800)
Reported by: Dmitry Melekhov
Patches:
        ASTERISK-21800-1.patch
Tested by: Dmitry Melekhov



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@390181 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-31 08:10:30 +00:00
Richard Mudgett
6683f94616 Fix segfault when dealing with chan_agent channels.
Check the returned bridged pointer for NULL to avoid a crash.  It looks
like chan_agent is returning a NULL pointer when it probably should be
returning a pointer to the channel the Agent channel is pretending to be.

(closes issue ASTERISK-21793)
Reported by: Rodrigo P. Telles
Patches:
      jira_asterisk_21793_v1.8.patch (license #5621) patch uploaded by rmudgett
Tested by: Rodrigo P. Telles


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@390044 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-29 20:10:04 +00:00
Jonathan Rose
51a6491c30 Fix a memory copying bug in slinfactory which was causing mixmonitor issues.
Reported by: Michael Walton
Tested by: Jonathan Rose
Patches:
    slinfactory.c.ASTERISK-21799.patch uploaded by Michael Walton (license 6502)
(closes issue ASTERISK-21799)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@389895 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-28 17:35:12 +00:00
Matthew Jordan
f318fa2c50 Print all logger messages on shutdown
When Asterisk shuts down and shuts down the loggin gsubsystem, any
messages currently in flight will not get logged. This patch prevents the
loop writing messages from breaking out prematurely, such that all of the
messages are logged.

(closes issue ASTERISK-21716)
Reported by: Corey Farrell
patches:
  logger-process-all-messages.patch uploaded by Corey Farrell (license 5909)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@389676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-24 11:42:38 +00:00
Jason Parker
c38badffda Add doxygen.log to svn:ignore property.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@389244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-20 17:43:07 +00:00
Kevin Harwell
05d11a66ea Fix for segfault in __ast_rwlock_destroy with DEBUG_THREADS
If DEBUG_THREADS is enabled __ast_rwlock_destroy causes a segfault while trying
to access a possible NULL t->track object.  A NULL check has been added before
trying to access the memory.

(closes issue ASTERISK-21724)
Reported by: Corey Farrell
Fixed by: Corey Farrell
Patches:
	ast_rwlock_destroy-segv.patch uploaded by Corey Farrell (license 5909)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388838 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-15 15:54:50 +00:00
Kinsey Moore
f0a8ba971b Use srtp_shutdown when available
This allows the SRTP library to be shut down properly when the
functionality is offered by libsrtp.

Review: https://reviewboard.asterisk.org/r/2538/
(closes issue ASTERISK-21719)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-15 12:37:29 +00:00
Kinsey Moore
556e0a26ff Revert r388529 for now
Adding the cleanup function needs some deeper thought since it
apparently doesn't exist for all variants of libsrtp.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388596 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-13 20:34:36 +00:00
Jonathan Rose
c8108a3503 pbx: Fix lack of cleanup on macrolock and context_table
(closes issue ASTERISK-21723)
Reported by: Corey Farrell
Patches:
    core-pbx-cleanup.patch uploaded by Correy Farrell (license 5909)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388532 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-13 18:16:21 +00:00
Kinsey Moore
95ad8ea190 Close libsrtp properly
Ensure that libsrtp is shutdown properly when res_srtp is unloaded.

(closes issue ASTERISK-21719)
Reported by: Corey Farrell
Patches:
    res_srtp-library-shutdown.patch uploaded by Corey Farrell


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388529 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-13 18:05:11 +00:00
Richard Mudgett
b7da14ecf4 Fix SendText AMI action to never return non-zero.
AMI actions must never return non-zero unless they intend to close the AMI
connection.  (Which is almost never.)

(closes issue ASTERISK-21779)
Reported by: Paul Goldbaum


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388477 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-13 14:24:47 +00:00
Richard Mudgett
af1711d17e Allow mISDN to send PROGRESS messsage.
* Made isdn_msg_parser.c build a progress message with the mandatory
progress indicator IE.  (The mISDNuser NT state machine rejected sending
the incomplete message.)

Note: The associated mISDN and mISDNuser patches respectively are viewable
here:
http://svnview.digium.com/svn/thirdparty?view=rev&rev=200
http://svnview.digium.com/svn/thirdparty?view=rev&rev=201

(closes issue AST-1153)
Reported by: Guenther Kelleter
Patches:
      progress-chan_misdn.diff (license #6372) patch uploaded by Guenther Kelleter
      progress-misdn.diff (license #6372) mISDN patch uploaded by Guenther Kelleter
      progress-misdnuser.diff (license #6372) mISDNuser patch uploaded by Guenther Kelleter


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-10 22:09:32 +00:00
Richard Mudgett
777d526415 Add version.c to list of ignored files in the utils directory.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-10 21:40:59 +00:00
Mark Michelson
6cbc641491 Fix memory leak in pbx_dundi
pbx_dundi added an io context without removing
it. This caused a memory leak when the module was
unloaded.

(closes ASTERISK-21718)
Reported by Corey Farrell
Patches:
	pbx_dundi-ast_io_remove.patch uploaded by Corey Farrell (License #5909)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388376 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-10 20:28:29 +00:00
Michael L. Young
276c5e6d45 Fix The Payload Being Set On CN Packets And Do Not Set Marker Bit
When we send out a CN packet (for instance, in the case of using rtpkeepalives),
we are not setting the payload code properly.  Also, we are setting the marker
bit when we shouldn't be according to RFC 3389, section 4.

AST_RTP_CN is not defined by AST_FORMAT codes.  Therefore, we should be using
ast_rtp_codecs_payload_code() rather than ast_rtp_codecs_payload_lookup().

11 and trunk already use the appropriate function.

* In 1.8, use ast_rtp_codecs_payload_code()

* Remove the setting of the marker bit

* Fix the debug message by incrementing the seqno after the debug message is set
  in order to display the correct seqno that was sent out

(closes issue ASTERISK-21246)
Reported by: Peter Katzmann
Tested by: Peter Katzmann, Michael L. Young
Patches:
    asterisk-21246-rtp-cng-payload-error_1.8_v2.diff
                                     uploaded by Michael L. Young (license 5026)

Review: https://reviewboard.asterisk.org/r/2500/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@388111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-09 03:58:42 +00:00
Alec L Davis
0d9cc94441 chan_sip: NOTIFYs for BLF start queuing up and fail to be sent out after retries fail
RFC6665 4.2.2: ... after a failed State NOTIFY transaction remove the subscription

The problem is that the State Notify requests rely on the 200OK reponse for pacing control
and to not confuse the notify susbsystem.
The issue is, the pendinginvite isn't cleared if a response isn't received,
thus further notify's are never sent.

The solution, follow RFC 6665 4.2.2's 'SHOULD' and remove the subscription after failure.
  
(closes issue ASTERISK-21677)

Reported by: Dan Martens
Tested by: Dan Martens, David Brillert, alecdavis
alecdavis (license 585)

Review https://reviewboard.asterisk.org/r/2475/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@387875 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-08 07:17:17 +00:00
Russell Bryant
7124314fb7 Make SLA reload more paranoid.
Reload support was originally not included for SLA.  It was added later,
but in a fairly non-traditional way.  It basically sets a flag
indicating that a reload is pending, and then waits for a time where it
thinks everything SLA related is idle and unused, and *then* executes
the reload.  It does this because the reload process is destructive.  It
starts by throwing everything away and starting over.

There are a number of problems with this approach.  One of them is that
the check to see if anything in use was incomplete.  This patch makes it
more complete and thus less likely for a crash to occur during reload
processing.  However, this approach still has problems so some much more
significant reworking of this code will need to come in as a next step.

Patch credit and testing by CoreDial, LLC.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@387688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-06 15:52:16 +00:00
Matthew Jordan
cc950e6a80 Update utils Makefile to handle r387294
Alec's patch that added the Asterisk version to 'core show locks' angered the
items in utils, as they exist somewhat outside of the Asterisk build system.
Some day, this Makefile should get nuked from high orbit, but for now, include
version.c in its list of stuff to pile in.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@387421 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-02 17:11:20 +00:00
Alec L Davis
05fb483da6 chan_sip: Session-Expires: Set timer to correctly expire at (~2/3) of the interval when not the refresher
RFC 4028 Section 10
	if the side not performing refreshes does not receive a
	session refresh request before the session expiration, it SHOULD send
	a BYE to terminate the session, slightly before the session
	expiration.  The minimum of 32 seconds and one third of the session
	interval is RECOMMENDED.

Prior to this asterisk would refresh at 1/2 the Session-Expires interval,
or if the remote device was the refresher, asterisk would timeout at interval end.

Now, when not refresher, timeout as per RFC noted above.

(closes issue ASTERISK-21742)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

Review https://reviewboard.asterisk.org/r/2488/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@387344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-02 07:53:55 +00:00
Alec L Davis
d6b88f6627 chan_sip: Honor Session-Expires in 200OK response when it's a RE-INVITE when asterisk is the refresher.
RFC 4028 Section 7.2
 "UACs MUST be prepared to receive a Session-Expires header field in a
 response, even if none were present in the request." 

What changed
  After ASTERISK-20787, inbound calls to asterisk with no Session-Expires in the INVITE are now are offered
  a Session-Expires (1800 asterisk default) in the response, with asterisk as the refresher.

Symptom:
  After 900 seconds (asterisk default refresher period 1800), asterisk RE-INVITEs the device, the device
   may respond with a much lower Session-Expires (180 in our case) value that it is now using.

  Asterisk ignores this response, as it's deemed both an INBOUND CALL, and a RE-INVITE.

  After 180 seconds the device times out and sends BYE (hangs up), asterisk is still working with the
  refresher period of 1800 as it ignored the 'Session Expires: 180' in the previous 200OK response.
 
Fix:
	handle_response_invite() when 200OK, remove check for outbound and reinvite.
  
(closes issue ASTERISK-21664)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)

Review https://reviewboard.asterisk.org/r/2463/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@387312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-02 07:20:54 +00:00
Alec L Davis
00c14d8c0d chan_dahdi: fix lower bound check with -ve integer conversion from a float
Lower bound of a 16bit signed int is -32768 not -32767

(closes issue ASTERISK-21744)

Reported by: alecdavis
Tested by: alecdavis
alecdavis (license 585)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@387297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-05-02 06:51:53 +00:00