system
April 26, 2011, 7:42am
1
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:
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
and no updates for over a year …
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.
system
July 14, 2011, 5:24am
5
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.