[Home]

Summary:ASTERISK-05935: [patch] chan_sip doesn't recognize realtime peers by IP address correctly
Reporter:siacali (siacali)Labels:
Date Opened:2005-12-30 15:41:32.000-0600Date Closed:2008-01-15 17:04:09.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) asterisk-chan_sip_realtime_peer_fix-0.1.patch
Description:When trying to authenticate a peer by IP address only, host=<ipaddress> is sufficient in sip.conf.  Setting the realtime field 'host' to an IP address does not result in the peer being recognized (unless the peer is "loaded" via something like 'sip show peer foo load').  Apparently, the function realtime_peer() in chan_sip looks up peers by the field 'ipaddr' rather than 'host'.  

****** ADDITIONAL INFORMATION ******

I'm not sure if there is a valid reason to have a lookup by ipaddr as well as host, but I've included a simple patch that preserves the original lookup (by ipaddr) and adds a second one (by host).  Not elegant, but functional.
Comments:By: siacali (siacali) 2005-12-30 15:46:16.000-0600

This may or may not be similar to bug ASTERISK-4794, after reading the patch associated with that bug, I was really not sure what they're trying to accomplish.

By: Matt O'Gorman (mogorman) 2006-01-13 12:34:52.000-0600

can you confirm if the patch you provide solves your issue.  and can anyone else test and confirm it.

By: siacali (siacali) 2006-01-13 13:22:53.000-0600

Well, the patch does appear to resolve my issue, which is, of course,  why I posted it... :-)

I'll try to see if I can get some support from others to test this.

By: Pierre-Luc Quimper (plquimper) 2006-01-18 17:21:23.000-0600

We really need this patch to get added to the source tree.  It seems to work.  What can we do to move it along?

By: Olle Johansson (oej) 2006-01-24 11:46:04.000-0600

This makes a lot of sense. The current realtime system only handles peers that are dynamic, not fixed IP peers - which is a bug. I will take a look at this.

By: siacali (siacali) 2006-01-24 11:53:34.000-0600

Thanks for taking a look at this.  This is a the issue I had mentioned to you in IRC.  This (overly?) simple patch does seem to work, at least to meet our needs.  We've been running with it on 6 boxes for several weeks now, with no apparent detrimental effects.  It does (upon setting the username, fromuser, and secret fields to null, host to some appropriate IP, and nat to no) seem to work properly.

By: Olle Johansson (oej) 2006-01-24 12:07:55.000-0600

We need to match by "host" field before we match dynamic peers (peers that register). I've added a similar patch to svn trunk, but only when we have an IP address.

In the future, we have to consider matching by port in addition to IP address. At this point, I can't figure out wheather that would break any installations.

By: Olle Johansson (oej) 2006-01-24 12:09:08.000-0600

Fixed in svn trunk, revision 8560. Thank you for reporting this!

By: Russell Bryant (russell) 2006-02-27 08:16:41.000-0600

added to the 1.2 branch in revision 11280

By: Digium Subversion (svnbot) 2008-01-15 16:23:24.000-0600

Repository: asterisk
Revision: 8560

U   trunk/channels/chan_sip.c

------------------------------------------------------------------------
r8560 | oej | 2008-01-15 16:23:23 -0600 (Tue, 15 Jan 2008) | 2 lines

Issue ASTERISK-5935: Match realtime non-dynamic peers by IP. (siacali).

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=8560

By: Digium Subversion (svnbot) 2008-01-15 16:25:13.000-0600

Repository: asterisk
Revision: 8679

_U  team/oej/astum/
D   team/oej/astum/ChangeLog
U   team/oej/astum/apps/app_dial.c
U   team/oej/astum/asterisk.c
U   team/oej/astum/cdr/cdr_pgsql.c
U   team/oej/astum/channel.c
U   team/oej/astum/channels/chan_agent.c
U   team/oej/astum/channels/chan_features.c
U   team/oej/astum/channels/chan_iax2.c
U   team/oej/astum/channels/chan_sip.c
U   team/oej/astum/configs/sip.conf.sample
U   team/oej/astum/contrib/scripts/safe_asterisk
U   team/oej/astum/include/asterisk/channel.h
U   team/oej/astum/rtp.c
U   team/oej/astum/utils/astman.c

------------------------------------------------------------------------
r8679 | oej | 2008-01-15 16:25:13 -0600 (Tue, 15 Jan 2008) | 230 lines

Merged revisions 8517,8523-8524,8531,8538-8539,8548,8554,8560-8561,8563,8571-8572,8574,8582,8587,8589-8597,8599,8609-8610,8618,8620,8633,8642-8643,8654,8664-8665,8667,8676,8678 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
r8517 | oej | 2006-01-24 11:36:45 +0100 (Tue, 24 Jan 2006) | 2 lines

Whitespace change, extra <tab> added from my tab storage.

................
r8523 | oej | 2006-01-24 12:42:09 +0100 (Tue, 24 Jan 2006) | 2 lines

Declaring conn and result static to avoid collission with realtime driver (issue 6336, pressureman)

................
r8524 | oej | 2006-01-24 12:46:29 +0100 (Tue, 24 Jan 2006) | 3 lines

- Adding whitespace that I found unused outside
- Adding "if (option_debug)" before outputting to DEBUG channel

................
r8531 | oej | 2006-01-24 13:48:44 +0100 (Tue, 24 Jan 2006) | 2 lines

- Report SIP reload in manager (issue 5742 with small changes)

................
r8538 | oej | 2006-01-24 14:21:13 +0100 (Tue, 24 Jan 2006) | 2 lines

Importing rev ASTERISK-8302 from 1.2, never send response to ACK (issue ASTERISK-6148)

................
r8539 | oej | 2006-01-24 14:53:45 +0100 (Tue, 24 Jan 2006) | 2 lines

Issue ASTERISK-6163, FreeBSD compatibility with compilation of func_odbc.c (reported by nulbyte)

................
r8548 | oej | 2006-01-24 18:47:41 +0100 (Tue, 24 Jan 2006) | 2 lines

Reverting change in revision 8539 - fixed wrong problem. Sorry.

................
r8554 | oej | 2006-01-24 19:15:20 +0100 (Tue, 24 Jan 2006) | 2 lines

Make it clear that caller ID in sip.conf is used only on incoming calls (inspired by bug ASTERISK-6026)

................
r8560 | oej | 2006-01-24 20:08:44 +0100 (Tue, 24 Jan 2006) | 2 lines

Issue ASTERISK-5935: Match realtime non-dynamic peers by IP. (siacali).

................
r8561 | oej | 2006-01-24 20:19:20 +0100 (Tue, 24 Jan 2006) | 2 lines

Issue 6114: Don't hangup on bye/also if there's no channel. (gst)

................
r8563 | oej | 2006-01-24 20:29:32 +0100 (Tue, 24 Jan 2006) | 2 lines

Blocking fix from 1.2 from being applied again.

................
r8571 | russell | 2006-01-24 21:20:05 +0100 (Tue, 24 Jan 2006) | 2 lines

convert ast_channel list to use linked list macros (issue ASTERISK-6178)

................
r8572 | russell | 2006-01-24 21:27:09 +0100 (Tue, 24 Jan 2006) | 2 lines

store the list of 'atexit' functions using linked list macros (issue ASTERISK-6169)

................
r8574 | oej | 2006-01-24 21:41:08 +0100 (Tue, 24 Jan 2006) | 2 lines

Don't reset scheduled ID until we actually end the scheduled event.

................
r8582 | mattf | 2006-01-24 22:45:42 +0100 (Tue, 24 Jan 2006) | 2 lines

Updates from royk to safe_asterisk (ASTERISK-5069) Thanks!

................
r8587 | mattf | 2006-01-24 23:06:37 +0100 (Tue, 24 Jan 2006) | 2 lines

Make sure safe_asterisk retains previous script defaults

................
r8589 | kpfleming | 2006-01-24 23:33:58 +0100 (Tue, 24 Jan 2006) | 1 line


................
r8590 | kpfleming | 2006-01-24 23:34:06 +0100 (Tue, 24 Jan 2006) | 1 line


................
r8591 | kpfleming | 2006-01-24 23:38:17 +0100 (Tue, 24 Jan 2006) | 10 lines

Merged revisions 8588 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r8588 | kpfleming | 2006-01-24 16:32:09 -0600 (Tue, 24 Jan 2006) | 2 lines

ensure that channel cannot become zombie after we check but before we try to start indications

........

................
r8592 | kpfleming | 2006-01-24 23:40:20 +0100 (Tue, 24 Jan 2006) | 1 line


................
r8593 | kpfleming | 2006-01-24 23:40:57 +0100 (Tue, 24 Jan 2006) | 1 line


................
r8594 | kpfleming | 2006-01-24 23:41:45 +0100 (Tue, 24 Jan 2006) | 1 line


................
r8595 | kpfleming | 2006-01-24 23:42:43 +0100 (Tue, 24 Jan 2006) | 10 lines

Merged revisions 8173 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r8173 | russell | 2006-01-17 20:49:21 -0600 (Tue, 17 Jan 2006) | 2 lines

remove ChangeLog from the 1.2 branch.  It will only be present in the tags.

........

................
r8596 | kpfleming | 2006-01-24 23:43:30 +0100 (Tue, 24 Jan 2006) | 1 line


................
r8597 | kpfleming | 2006-01-24 23:43:57 +0100 (Tue, 24 Jan 2006) | 2 lines

clean up remaining already-merged revisions

................
r8599 | kpfleming | 2006-01-24 23:45:41 +0100 (Tue, 24 Jan 2006) | 2 lines

remove extraneous characters from property

................
r8609 | kpfleming | 2006-01-25 02:52:58 +0100 (Wed, 25 Jan 2006) | 10 lines

Merged revisions 8608 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r8608 | kpfleming | 2006-01-24 19:50:52 -0600 (Tue, 24 Jan 2006) | 2 lines

ensure hangup cause code is handled properly when channel does not return a frame (issue ASTERISK-6186)

........

................
r8610 | kpfleming | 2006-01-25 02:53:15 +0100 (Wed, 25 Jan 2006) | 1 line


................
r8618 | russell | 2006-01-25 06:37:29 +0100 (Wed, 25 Jan 2006) | 3 lines

don't leak almost 200 bytes for each new channel and store the active
channel list using the linked list macros (issue ASTERISK-6170)

................
r8620 | russell | 2006-01-25 06:39:25 +0100 (Wed, 25 Jan 2006) | 1 line


................
r8633 | oej | 2006-01-25 10:50:28 +0100 (Wed, 25 Jan 2006) | 2 lines

Issue ASTERISK-6189 - patch by markster, imported from 1.2

................
r8642 | oej | 2006-01-25 13:01:07 +0100 (Wed, 25 Jan 2006) | 3 lines

From now on, apply maxexpiry and minexpiry to all subscriptions. Thanks to fourcheeze in the IRC channel
for pointing this out.

................
r8643 | oej | 2006-01-25 13:11:30 +0100 (Wed, 25 Jan 2006) | 3 lines

- Remove unused option to transmit_state_notify
- Allow for expiry=0 in subscription requests that only wants *one* update and that's it.

................
r8654 | kpfleming | 2006-01-25 15:52:43 +0100 (Wed, 25 Jan 2006) | 3 lines

don't queue a congestion frame on a channel that will be immediately hung up anyway
clean up/organize code block

................
r8664 | russell | 2006-01-25 19:12:55 +0100 (Wed, 25 Jan 2006) | 2 lines

store agent_pvt list using linked list macros (issue ASTERISK-6182)

................
r8665 | russell | 2006-01-25 19:24:32 +0100 (Wed, 25 Jan 2006) | 3 lines

store feature_pvt list using linked list macros
(issue ASTERISK-6190, with additional changes to prevent a memory leak in unload_module)

................
r8667 | russell | 2006-01-25 19:41:12 +0100 (Wed, 25 Jan 2006) | 1 line


................
r8676 | russell | 2006-01-25 20:06:37 +0100 (Wed, 25 Jan 2006) | 2 lines

use arg parsing macros in the AGENT dialplan function (issue ASTERISK-6078, with small mods)

................
r8678 | russell | 2006-01-25 20:16:14 +0100 (Wed, 25 Jan 2006) | 11 lines

Merged revisions 8677 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r8677 | russell | 2006-01-25 14:14:43 -0500 (Wed, 25 Jan 2006) | 3 lines

don't call ast_update_realtime with uninitialized variables if we get a
registration with an expirey of 0 seconds (issue ASTERISK-6016)

........

................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=8679

By: Digium Subversion (svnbot) 2008-01-15 17:04:09.000-0600

Repository: asterisk
Revision: 11279

U   branches/1.2/channels/chan_sip.c

------------------------------------------------------------------------
r11279 | russell | 2008-01-15 17:04:09 -0600 (Tue, 15 Jan 2008) | 2 lines

fix finding realtime peers that are not dynamic by ip address (issue ASTERISK-5935)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=11279