type friend vs. type peer

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

type friend vs. type peer

Postby thor » Tue Apr 26, 2011 1:42 am

There is a discrepancy between the docs and the code.
The latest (from 1.8.3.3) sip.conf.sample contains this section:
The SIP channel has two types of devices, the friend and the peer.
; * The type=friend is a device type that accepts both incoming and outbound calls,
; where Asterisk match on the From: username on incoming calls.
; (A synonym for friend is "user"). This is a type you use for your local
; SIP phones.
; * The type=peer also handles both incoming and outbound calls. On inbound calls,
; Asterisk only matches on IP/port, not on names. This is mostly used for SIP
; trunks.


Looking at the code it seems nothing has changed from the good old days - friend is still user+peer:
Code: Select all
if (!strcasecmp(v->name, "type")) {
                                if (!strcasecmp(v->value, "peer")) {
                                        peer->type |= SIP_TYPE_PEER;
                                } else if (!strcasecmp(v->value, "user")) {
                                        peer->type |= SIP_TYPE_USER;
                                } else if (!strcasecmp(v->value, "friend")) {
                                        peer->type = SIP_TYPE_USER | SIP_TYPE_PEER;
                                }



Could we fix the docs ? This issue is causing confusion in the FreePBX world

http://www.freepbx.org/trac/ticket/5103

Also why would anyone use type=friend ? There is a memo from 2005 on the subject from Kevin:

http://lists.digium.com/pipermail/aster ... 32729.html
thor
Oldsterisk
 
Posts: 238
Joined: Thu Mar 18, 2010 12:19 pm

Re: type friend vs. type peer

Postby rmontgomery » Fri Jun 24, 2011 8:37 am

rmontgomery
Site Admin
 
Posts: 44
Joined: Thu Jan 18, 2007 4:47 pm

Re: type friend vs. type peer

Postby thor » Wed Jul 06, 2011 1:50 am

and no updates for over a year .... :oops:
thor
Oldsterisk
 
Posts: 238
Joined: Thu Mar 18, 2010 12:19 pm

Re: type friend vs. type peer

Postby roderickm » Wed Jul 13, 2011 4:18 pm

thor wrote:and no updates for over a year .... :oops:


That's not true.

As linked from that issue, [https://issues.asterisk.org/jira/browse/ASTERISK-17763] is under active discussion. Basically, someone needs to suggest a patch to the docs. If you think it's broken, please say how it should be fixed.
roderickm
Newsterisk
 
Posts: 12
Joined: Sat Dec 30, 2006 8:39 am

Re: type friend vs. type peer

Postby thor » Wed Jul 13, 2011 11:24 pm

That's not true.


It is true. Except for my recent update to link the other issue there have not been any updates since Feb 01, 2010.


As linked from that issue, [https://issues.asterisk.org/jira/browse/ASTERISK-17763] is under active discussion. Basically, someone needs to suggest a patch to the docs.


That someone is digium. I have no idea why we have type friend. I asked for an example where type=friend would be necessary. No one is coming forward - viewtopic.php?t=78679

Everybody is using type=friend and nobody knows why.
thor
Oldsterisk
 
Posts: 238
Joined: Thu Mar 18, 2010 12:19 pm


Return to Asterisk Support

Who is online

Users browsing this forum: Google [Bot] and 1 guest