Commit Graph

6786 Commits

Author SHA1 Message Date
Richard Mudgett
a77913a22d One way audio before answering call waiting call on analog port.
* Analog call waiting Caller ID spills could get stuck resulting in one
way audio until the waiting call is answered.  This only happens on the
second (and later) call waiting call if the active call is not the first
call.

* The CLI/AMI "dahdi show channel" command could report the wrong channel
information.

Must keep the struct analog_pvt.owner and struct dahdi_pvt.owner pointer
in sync.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@295747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-20 03:11:15 +00:00
Terry Wilson
1930461fa7 Merged revisions 295672 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r295672 | twilson | 2010-11-19 13:55:48 -0800 (Fri, 19 Nov 2010) | 15 lines
  
  Merged revisions 295628 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r295628 | twilson | 2010-11-19 12:53:36 -0800 (Fri, 19 Nov 2010) | 8 lines
    
    Discard responses with more than one Via
    
    This is not a perfect solution as headers that are joined via commas are not
    detected. This is a parsing issue that to fix "correctly" would necessitate 
    a new SIP parser.
    
    Review: https://reviewboard.asterisk.org/r/1019/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@295673 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-19 22:06:10 +00:00
Richard Mudgett
7fbafbd5df Bring sig_analog extraction more into alignment with orig-trunk/v1.6.2 chan_dahdi.
* Restore SMDI support.
* Fixed initial value of struct analog_pvt.use_callerid.  It may get
forced on depending upon other config options.
* Call analog_dnd() instead of manual inlined code.
* Removed unused struct analog_pvt.usedistinctiveringdetection.
* Removed the struct analog_pvt.unknown_alarm flag.  It was really the
struct analog_pvt.inalarm flag.
* Use ast_debug() instead of ast_log(LOG_DEBUG).
* Rename several function's index variable to idx.
* Some formatting tweaks.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@295516 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-19 16:47:11 +00:00
Richard Mudgett
ac9434aecc Merged revisions 294822 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r294822 | rmudgett | 2010-11-11 20:44:12 -0600 (Thu, 11 Nov 2010) | 18 lines
  
  Merged revisions 294821 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r294821 | rmudgett | 2010-11-11 20:41:13 -0600 (Thu, 11 Nov 2010) | 11 lines
    
    Asterisk is getting a "No D-channels available!" warning message every 4 seconds.
    
    Asterisk is just whining too much with this message: "No D-channels
    available!  Using Primary channel XXX as D-channel anyway!".
    
    Filtered the message so it only comes out once if there is no D channel
    available without an intervening D channel available period.
    
    (closes issue #17270)
    Reported by: jmls
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@294823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-12 02:45:22 +00:00
Jeff Peeler
01f31e0c50 Merged revisions 294733 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r294733 | jpeeler | 2010-11-11 15:57:22 -0600 (Thu, 11 Nov 2010) | 25 lines
  
  Merged revisions 294688 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r294688 | jpeeler | 2010-11-11 15:12:27 -0600 (Thu, 11 Nov 2010) | 18 lines
    
    Fix problem with qualify option packets for realtime peers never stopping.
    
    The option packets not only never stopped, but if a realtime peer was not in
    the peer list multiple options dialogs could accumulate over time. This
    scenario has the potential to progress to the point of saturating a link just
    from options packets. The fix was to ensure that the poke scheduler checks to
    see if a peer is in the peer list before continuing to poke. The reason a peer
    must be in the peer list to be able to properly manage an options dialog is
    because otherwise the call pointer is lost when the peer is regenerated from
    the database, which is how existing qualify dialogs are detected.
    
    (closes issue #16382)
    (closes issue #17779)
    Reported by: lftsy
    Patches: 
          bug16382-3.patch uploaded by jpeeler (license 325)
    Tested by: zerohalo
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@294734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-11 21:58:25 +00:00
Richard Mudgett
3f9644b7db Analog lines do not transfer CONNECTED LINE or execute the interception macros.
Add connected line update for sig_analog transfers and simplify the
corresponding sig_pri and chan_misdn transfer code.

Note that if you create a three-way call in sig_analog before transferring
the call, the distinction of the caller/callee interception macros make
little sense.  The interception macro writer needs to be prepared for
either caller/callee macro to be executed.  The current implementation
swaps which caller/callee interception macro is executed after a three-way
call is created.

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

JIRA ABE-2589
JIRA SWP-2372


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@294349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-09 16:55:32 +00:00
Matthew Nicholson
529b8fc988 Merged revisions 294242 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r294242 | mnicholson | 2010-11-08 14:50:21 -0600 (Mon, 08 Nov 2010) | 8 lines
  
  Go off hold when we get an empty reinvite telling us to.
  
  (closes issue 0014448)
  Reported by: frawd
  
  (closes issue #17878)
  Reported by: frawd
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@294243 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-08 20:56:30 +00:00
Richard Mudgett
4e39e38ac5 valgrind reported references to freed memory during a mISDN hangup collision.
Bad things have been happening in chan_misdn because the chan_misdn
channel private struct chan_list is not protected from reentrancy.  Hangup
collisions have be causing read and write accesses to freed memory.

Converted chan_misdn struct chan_list to an ao2 object for its reference
counting feature.

**********
Removed an impediment to converting chan_list to an ao2 object.

The use of the other_ch member in chan_list is shaky at best.  It is set
if the incoming and outgoing call legs are mISDN.  The use of the other_ch
member goes against the Asterisk architecture and can even cause problems.

1) It is used to disable echo cancellation.  This could be bad if the call
is forked and the winning call leg is not mISDN or the winning call leg is
not the last mISDN channel called by the fork.  The other_ch would become
a dangling pointer.

2) It is used when the far end is alerting to hear the far end's inband
audio instead of Asterisk's generated ringback tone.  This is bad if the
call is forked.  You would only hear the last forked mISDN channel and it
may not be ringing yet.

The other_ch would become a dangling pointer if the call is later
transferred.
**********

JIRA SWP-2423
JIRA ABE-2614


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@294125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-08 17:16:01 +00:00
Brett Bryant
e1a1360451 Fixed deadlock avoidance issues while locking channel when adding the
Max-Forwards header to a request.

(closes issue #17949)
(closes issue #18200)
Reported by: bwg

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@294084 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-05 22:03:11 +00:00
David Vossel
c34f40e710 Fixes ringback tone on sip semi-attended transfer.
ABE-2168


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-04 21:39:51 +00:00
Paul Belanger
5cf1c93fd5 Do not output port in IPaddress for AMI sippeers.
(closes issue #18248)
Reported by: orn
Patches: 
      ami_sippeers.patch uploaded by pabelanger (license 224)
Tested by: orn


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-04 13:27:54 +00:00
Richard Mudgett
252cffd38d Merged revisions 293806 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r293806 | rmudgett | 2010-11-03 13:31:57 -0500 (Wed, 03 Nov 2010) | 27 lines
  
  Merged revisions 293805 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r293805 | rmudgett | 2010-11-03 13:23:04 -0500 (Wed, 03 Nov 2010) | 20 lines
    
    Party A in an analog 3-way call would continue to hear ringback after party C answers.
    
    All parties are analog FXS ports.
    1) A calls B.
    2) A flash hooks to call C.
    3) A flash hooks to bring C into 3-way call before C answers.  (A and B hear ringback)
    4) C answers
    5) A continues to hear ringback during the 3-way call. (All parties can hear each other.)
    
    * Fixed use of wrong variable in dahdi_bridge() that stopped ringback on
    the wrong subchannel.
    
    * Made several debug messages have more information.
    
    A similar issue happens if B and C are SIP channels.  B continues to hear
    ringback.  For some reason this only affects v1.8 and trunk.
    
    * Don't start ringback on the real and 3-way subchannels when creating the
    3-way conference.  Removing this code is benign on v1.6.2 and earlier.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-03 18:35:19 +00:00
Terry Wilson
6dfc9dddd8 Avoid valgrind warnings for ast_rtp_instance_get_xxx_address
The documentation for ast_rtp_instance_get_(local/remote)_address stated that
they returned 0 for success and -1 on failure. Instead, they returned 0 if the
address structure passed in was already equivalent to the address instance
local/remote address or 1 otherwise. 90% of the calls to these functions
completely ignored the return address and passed in an uninitialized struct,
which would make valgrind complain even though the operation was technically
safe.

This patch fixes the documentation and converts the get_xxx_address functions
to void since all they really do is copy the address and cannot fail.
Additionally two new functions
(ast_rtp_instance_get_and_cmp_(local/remote)_address) are created for the 3
times where the return value was actually checked. The
get_and_cmp_local_address function is currently unused, but exists for the sake
of symmetry.

The only functional change as a result of this change is that we will not do an
ast_sockaddr_cmp() on (mostly uninitialized) addresses before doing the
ast_sockaddr_copy() in the get_*_address functions. So, even though it is an
API change, it shouldn't have a noticeable change in behavior.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-03 18:05:14 +00:00
Jeff Peeler
9a482b0724 Merged revisions 293723 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r293723 | jpeeler | 2010-11-02 18:07:13 -0500 (Tue, 02 Nov 2010) | 15 lines
  
  Merged revisions 293722 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r293722 | jpeeler | 2010-11-02 18:02:51 -0500 (Tue, 02 Nov 2010) | 8 lines
    
    Add enabled/disabled information for rtautoclear sip show settings output.
    
    When setting to zero/"no", the numeric default was shown making it not obvious
    the disabled setting was respected.
    
    (closes issue #18123)
    Reported by: zerohalo
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-02 23:09:06 +00:00
Richard Mudgett
643d500d66 Merged revisions 293647 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r293647 | rmudgett | 2010-11-02 16:26:30 -0500 (Tue, 02 Nov 2010) | 13 lines
  
  Merged revisions 293639 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r293639 | rmudgett | 2010-11-02 16:24:13 -0500 (Tue, 02 Nov 2010) | 6 lines
    
    Make warning message have more useful information in it.
    
    Change "Unable to get index, and nullok is not asserted" to "Unable to get
    index for '<channel-name>' on channel <number> (<function>(), line
    <number>)".
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293648 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-02 21:29:25 +00:00
Richard Mudgett
ea00bff969 Analog 3-way call would not connect all parties if one was using sig_pri.
Also the "dahdi show channel" would not show the correct 3-way call
status.

* Synchronized the inthreeway flag between chan_dahdi and sig_analog.

* Fixed a my_set_linear_mode() sign error and made take an analog sub
channel enum.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293530 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-01 17:29:30 +00:00
Paul Belanger
8b53a54dc3 Use ast_sockaddr_from_sin function not memcpy
This resolves some IAX2 registration issue report on the 
asterisk-users mailing list. 

(closes issue #18202)
Reported by: pabelanger
Patches: 
      update_registry.patch.v2 uploaded by pabelanger (license 224)
Tested by: pabelanger, Nic Colledge (mailing list)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293496 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-01 16:09:05 +00:00
Terry Wilson
de440fa10d Only offer codecs both sides support for directmedia
When using directmedia, Asterisk needs to limit the codecs offered to just
the ones that both sides recognize, otherwise they may end up sending audio
that the other side doesn't understand.

(closes issue #17403)
Reported by: one47
Patches: 
      sip_codecs_simplified4 uploaded by one47 (license 23)
Tested by: one47, falves11

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-01 14:58:00 +00:00
Richard Mudgett
651d43c698 Merged revisions 293417 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r293417 | rmudgett | 2010-10-29 20:49:15 -0500 (Fri, 29 Oct 2010) | 9 lines
  
  Merged revisions 293416 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r293416 | rmudgett | 2010-10-29 20:45:49 -0500 (Fri, 29 Oct 2010) | 1 line
    
    Remove some more code that serves no purpose.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-30 01:53:29 +00:00
Richard Mudgett
55a1b13da8 Merged revisions 293340 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r293340 | rmudgett | 2010-10-29 19:40:10 -0500 (Fri, 29 Oct 2010) | 9 lines
  
  Merged revisions 293339 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r293339 | rmudgett | 2010-10-29 19:34:12 -0500 (Fri, 29 Oct 2010) | 1 line
    
    Remove some code that serves no purpose.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-30 00:46:41 +00:00
Jeff Peeler
da39c33809 Modify sip_setoption to not complain about unknown options.
This now behaves just like the other setoption callbacks. For the curious the
offending option for the reporter was AST_OPTION_CHANNEL_WRITE which was getting
passed due to a fix for chan_local in 286189.

(closes issue #17985)
Reported by: globalnetinc


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293305 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-29 21:48:38 +00:00
Richard Mudgett
70415ccdfd No need to define the struct if there are no users.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293081 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-26 16:32:59 +00:00
Richard Mudgett
d411ade931 Allow the DAHDI driver to compile, even with a sufficiently older version of libpri.
Fixes our Bamboo builds.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-26 15:53:58 +00:00
Tilghman Lesher
d1aceac167 Several more defines that need to be altered for compiling against an older version of libpri
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292969 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-25 21:15:19 +00:00
Tilghman Lesher
cdc420235e Allow the DAHDI driver to compile, even with a sufficiently older version of libpri.
Fixes our Bamboo builds.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-25 19:28:35 +00:00
David Vossel
3020818583 Merged revisions 292867 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r292867 | dvossel | 2010-10-25 14:06:21 -0500 (Mon, 25 Oct 2010) | 32 lines
  
  Merged revisions 292866 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r292866 | dvossel | 2010-10-25 14:05:07 -0500 (Mon, 25 Oct 2010) | 27 lines
    
    This patch turns chan_local pvts into astobj2 objects.
    
    chan_local does some dangerous things involving deadlock avoidance.
    tech_pvt functions like hangup and queue_frame are provided with a
    locked channel upon entry.  Those functions are completely safe as
    long as you don't attempt to give up that channel lock, but that is
    impossible to guarantee due to the required deadlock avoidance necessary
    to lock both the tech_pvt and both channels involved.
    
    In the past, we have tried to account for this by doing things like
    setting a "glare" flag that indicates what function should destroy the
    pvt.  This was used in local_hangup and local_queue_frame to decided
    who should destroy the pvt if they collided in separate threads.  I
    have removed the need to do this by converting all chan_local tech_pvts
    to astobj2.  This means we can ref a pvt before deadlock avoidance
    and not have to worry about that pvt possibly getting destroyed under
    us.  It also cleans up where we destroy the tech_pvt.  The only unlink
    from the tech_pvt container occurs in local_hangup now, which is where
    it should occur.
    
    Since there still may be thread collisions on some functions like
    local_hangup after deadlock avoidance, I have added some checks to detect
    those collisions and exit appropriately.  I think this patch is going to
    solve quite a bit of weirdness we have had with local channels in the past.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-25 19:07:50 +00:00
Leif Madsen
9baf979137 Merged revisions 292786 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r292786 | lmadsen | 2010-10-22 16:16:12 -0500 (Fri, 22 Oct 2010) | 13 lines
  
  Update the LDIF file for LDAP.
  The LDIF file asterisk.ldif was quite a bit out of date from the asterisk.ldap-schema file, so I've
  now updated that to be in sync. The asterisk.ldif file being out of sync was a problem on my systems
  where I was doing an ldapadd to import the schema into the LDAP database, and the existing file
  would cause problems and ERROR messages when registering.
  
  Additional documention has been added based on feedback in the issue I'm closing.
  
  (closes issue #13861)
  Reported by: scramatte
  Patches:
        ldap-update.txt uploaded by lmadsen (license 10)
  Tested by: lmadsen, jcovert, suretec, rgenthner
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-22 21:28:43 +00:00
Richard Mudgett
eeec27dafc Connected line is not updated when chan_dahdi/sig_pri or chan_misdn transfers a call.
When a call is transfered by ECT or implicitly by disconnect in sig_pri or
implicitly by disconnect in chan_misdn, the connected line information is
not exchanged.  The connected line interception macros also need to be
executed if defined.

The CALLER interception macro is executed for the held call.
The CALLEE interception macro is executed for the active/ringing call.

JIRA ABE-2589
JIRA SWP-2296

Patches:
      abe_2589_c3bier.patch uploaded by rmudgett (license 664)
      abe_2589_v1.8_v2.patch uploaded by rmudgett (license 664)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292704 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-22 15:47:08 +00:00
Tilghman Lesher
cb0d414f4b Compile correctly on Linux (asterisk/localtime.h depends upon asterisk/autoconfig.h loading first).
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292667 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-21 22:09:25 +00:00
Richard Mudgett
7e28c7c90d Send CONNECT_ACKNOWLEDGE for CIS calls too.
The originator of the Q.SIG call completion signaling link was not changed
to the active state when the CONNECT message came in.  The T309 processing
would immediately kill the signaling link because it was not in the active
state.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-21 01:02:50 +00:00
Terry Wilson
668d532d6b Add sip show peer info about crypto and remove dated comment
This patch adds information about the encryption setting to 'sip show
peers' and removes an out-of-date comment from res_srtp.c and instead
directs users to the proper documentation.

(closes issue #18140)
Reported by: chodorenko



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-19 19:27:32 +00:00
David Vossel
3e3ea54864 Fixes peer's host port information being lost on sip reload.
(closes issue #18135)
Reported by: lmadsen
Patches:
      crazy_ports_v2.diff uploaded by dvossel (license 671)
Tested by: lmadsen


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291942 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-15 20:12:04 +00:00
David Vossel
24941a72ad Safer xml parsing, treat all clients the same, and better local candidate selection.
The gtalk channel driver was doing several unsafe operations
in regards to how it parsed incoming XML messages.  I have cleaned
that code up so it should be much safer now.

We now treat all clients types the same.  We have no reason to
distinguish between GMAIL and GOOGLE VOICE clients anymore because
they all work the same way.

I also modified how the local ip is found.  If no bindaddress is provided
in the config file, we attempt to determine the local ip we
would use to connect to google.com.  If that fails, then
we fall back to the ast_find_ourip() function as a last resort.
Using the new method makes it much less likely that we would ever
advertise a local RTP candidate as a loopback address.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291827 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-14 21:27:42 +00:00
Paul Belanger
a37956721c Add the ability for ast_find_ourip to return IPv4, IPv6 or both.
While testing chan_gtalk I noticed jabber was using my IPv6 address
and not IPv4. When using bindaddr=0.0.0.0 it is possible for ast_find_ourip()
to return both IPv6 and IPv4 results.  Adding a family parameter gives you
the ablility to choose.

Since jabber/gtalk/h323 do not support IPv6, we should only return IPv4 results.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291758 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-14 15:15:12 +00:00
Richard Mudgett
b8f40f4805 Merged revisions 291655 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r291655 | rmudgett | 2010-10-13 18:36:50 -0500 (Wed, 13 Oct 2010) | 27 lines
  
  Merged revisions 291643 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r291643 | rmudgett | 2010-10-13 18:29:58 -0500 (Wed, 13 Oct 2010) | 20 lines
    
    Deadlock between dahdi_exception() and dahdi_indicate().
    
    There is a deadlock between dahdi_exception() and dahdi_indicate() for
    analog ports.  The call-waiting and three-way-calling feature can
    experience deadlock if these features are trying to do something and an
    event from the bridged channel happens at the same time.
    
    Deadlock avoidance code added to obtain necessary channel locks before
    attemting an operation with call-waiting and three-way-calling.
    
    (closes issue #16847)
    Reported by: shin-shoryuken
    Patches:
          issue_16847_v1.4.patch uploaded by rmudgett (license 664)
          issue_16847_v1.6.2.patch uploaded by rmudgett (license 664)
          issue_16847_v1.8_v2.patch uploaded by rmudgett (license 664)
    Tested by: alecdavis, rmudgett
    
    Review: https://reviewboard.asterisk.org/r/971/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-13 23:45:11 +00:00
David Vossel
912ead1a24 More fixup for chan_gtalk.
This patch makes the xml parsing safer.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291578 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-13 22:46:34 +00:00
Richard Mudgett
d8225d08b9 The chan_dahdi faxdetect option only works for the first FAX call.
The chan_dahdi faxdetect option only works for the first call.  After that
the option no longer works.  The struct dahdi_pvt.callprogress member is
the encoded user config setting for the callprogress and faxdetect config
options.  Changing this value alters the configuration for all following
calls until the chan_dahdi.conf file is reloaded.

* Fixed the chan_dahdi ast_channel_setoption callback to not change the
users faxdetect config setting except for the current call.

* Fixed the chan_dahdi ast_channel_queryoption callback to read the active
DSP setting of the faxdetect option.

* Made actually disable the active faxdetect DSP setting for the current
call on the analog port.  my_handle_dtmfup() is used for normal analog
ports.  dahdi_handle_dtmfup() is the legacy code and is no longer used
unless in a radio mode.

(closes issue #18116)
Reported by: seandarcy
Patches:
      issue18116_v1.8.patch uploaded by rmudgett (license 664)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-13 20:21:02 +00:00
Richard Mudgett
84b12f0c4d Merged revision 291504 from
https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier

..........
  r291504 | rmudgett | 2010-10-13 13:30:21 -0500 (Wed, 13 Oct 2010) | 11 lines

  Hold off ast_hangup() from destroying the ast_channel.

  Must get the ast_channel lock before proceeding with release_chan() and
  release_chan_early() to hold off ast_hangup() from destroying the
  ast_channel.

  Missed this change for -r291468.

  JIRA ABE-2598
  JIRA SWP-2317
..........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-13 19:01:48 +00:00
Richard Mudgett
a5a798aefa Merge revision 291468 from
https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier

..........
  r291468 | rmudgett | 2010-10-13 12:39:02 -0500 (Wed, 13 Oct 2010) | 16 lines

  Memory overwrites when releasing mISDN call.

  Phone <--> Asterisk
  <-- ALERTING
  --> DISCONNECT
  <-- RELEASE
  --> RELEASE_COMPLETE

  * Add lock protection around channel list for find/add/delete operations.

  * Protect misdn_hangup() from release_chan() and vise versa using the
  release_lock.

  JIRA ABE-2598
  JIRA SWP-2317
..........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291469 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-13 18:10:21 +00:00
Russell Bryant
ec05b242dd Merged revisions 291393 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r291393 | russell | 2010-10-13 10:29:21 -0500 (Wed, 13 Oct 2010) | 13 lines
  
  Merged revisions 291392 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r291392 | russell | 2010-10-13 10:23:19 -0500 (Wed, 13 Oct 2010) | 6 lines
    
    Lock pvt so pvt->owner can't disappear when queueing up a frame.
    
    This fixes a crash due to a hangup race condition.
    
    ABE-2601
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291394 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-13 15:46:39 +00:00
David Vossel
f5782280d8 Gtalk enhancements and general code cleanup.
This patch includes several chan_gtalk enhancements.
Two new gtalk.conf options have been added, externip
and stunadd.  Setting externip allows us to
manually specify what the external IP address is
outside of a NAT environment.  Setting the stunaddr
option to a valid stun server allows for that external
ip to be retrieved via a STUN server automatically.  This
external IP is then advertised during call setup as
a possible candidate.

I have also attempted to clean up chan_gtalk's code
so it meets our coding guidelines. During this cleanup
I noticed several things that need to be done in the
code and made a TODO section at the top of the file.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291192 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-11 21:38:39 +00:00
Richard Mudgett
184d0e7f1b Move declaration closer to where now used.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291113 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-11 18:51:13 +00:00
Richard Mudgett
a96796cc44 Merged revisions 291110-291111 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r291110 | rmudgett | 2010-10-11 13:34:22 -0500 (Mon, 11 Oct 2010) | 9 lines
  
  Merged revisions 291109 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r291109 | rmudgett | 2010-10-11 13:29:43 -0500 (Mon, 11 Oct 2010) | 1 line
    
    Add missing unlock to an exception condition in reload_config().
  ........
................
  r291111 | rmudgett | 2010-10-11 13:39:06 -0500 (Mon, 11 Oct 2010) | 1 line
  
  Make exit from handle_request_do() consistent.
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-11 18:48:15 +00:00
David Vossel
6412f8d665 Make outbound Google Voice calls.
This patch allows for outbound Google Voice calls to be
dialed from Asterisk using chan_gtalk. Below is an example
dialstring.

exten -> blah,1,Dial(Gtalk/asterisk/+15552225555@voice.google.com,,)

In this example, 'asterisk' is the jabber.conf profile configured
to connect to your gmail account. In order to receive Google Voice
calls make sure to enable 'allowguest=yes' in gtalk.conf.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@290973 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-08 20:44:59 +00:00
David Vossel
45a6b95d93 Add Philippe Sultan to chan_gtalk author list.
Philippe has made some notable contributions to the
gtalk channel driver.  His name deserves to be listed
amoung the authors of that file.  Thanks Philippe!


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@290829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-07 22:38:05 +00:00
David Vossel
90be613635 Outbound gtalk calls now work correctly.
There was a problem with how the candidates were being
built on an outbound call. This patch fixes that.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@290828 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-07 21:44:58 +00:00
David Vossel
7853c1cd2f Fixes commented out code to use #if 0 instead.
Thanks to rmudgett for catching this!


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@290674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-06 21:22:51 +00:00
David Vossel
1d19ab1a63 Fixes gtalk outbound DTMF to work properly.
Outbound DTMF with gtalk needs to be done within the RTP stream.  I discovered
this after investigating a packet capture from the gmail client.  Instead of
performing jingle signaling DTMF, the gtalk servers expect all DTMF to arrive
on the RTP stream using RFC2833 way of doing things.  Chan_gtalk also had an issue
with negotiating RTP payload type 106 for the telephony-event and then sending
DTMF as payload 101.  This has been resolved by always negotiating 101 as the payload
type like we do everywhere else.  With this patch, incoming google voice calls forwarded
to Asterisk via gtalk work.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@290648 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-06 21:08:19 +00:00
David Vossel
cb0e2d3bd7 Fixes uninitialized memory problem in 'iax2 set debug peer' option.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@290506 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-05 22:23:00 +00:00
David Vossel
f87133b078 Fixes chan_gtalk to work with gmail client
This patch was written by Philippe Sultan (phsultan). Thanks
for keeping this up to date!



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@290479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-05 22:00:43 +00:00