Type friend vs. type peer

There is a discrepancy between the docs and the code.
The latest (from 1.8.3.3) sip.conf.sample contains this section:

Looking at the code it seems nothing has changed from the good old days - friend is still user+peer:

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

freepbx.org/trac/ticket/5103

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

lists.digium.com/pipermail/aster … 32729.html

This has been filed as issue 16723 (aka ASTERISK-15537 in Jira).

and no updates for over a year … :blush:

That’s not true.

As linked from that issue, [ASTERISK-17763: sip.conf.sample incorrectly describes types (peer/user/friend)] 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.

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

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.