I have an incoming call from, say, extension 1000 and IP address 192.168.10.4 in Asterisk. There is no user 1000 defined in sip.conf and allowguest=no. Here is what sip.conf has: [general] allowguest=no Context=default [proxy1-in] type=user host=192.168.10.4 insecure=very context=Company1 [proxy1] type=peer host=192.168.10.4 insecure=very context=Company1 qualify=yes When this call comes in, Asterisk logs: --- (16 headers 9 lines)--- Using INVITE request as basis request - c594f217-59d20131-b33f740c@192.168.10.123 Sending to 192.168.10.4 : 5060 (non-NAT) Found peer 'proxy1' I'm wondering why it matched against the peer before the user, when this was an incoming call. Shouldn't an incoming call match a 'user' before a 'peer', if at all on the peer. Thanks, Doug.
Hello Doug, A user is only matched on when the user part of the SIP URI matches the name of one in sip.conf, Asterisk then challenges for credentials. A user is only used when username/password authentication occurs. In your scenario, this doesn't occur. A peer can be matched on for incoming calls using the insecure option, this causes it to match based on the IP address. Joshua Colp -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Douglas Garstang Sent: Friday, December 23, 2005 2:00 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [Asterisk-Users] Matching SIP users and peers I have an incoming call from, say, extension 1000 and IP address 192.168.10.4 in Asterisk. There is no user 1000 defined in sip.conf and allowguest=no. Here is what sip.conf has: [general] allowguest=no Context=default [proxy1-in] type=user host=192.168.10.4 insecure=very context=Company1 [proxy1] type=peer host=192.168.10.4 insecure=very context=Company1 qualify=yes When this call comes in, Asterisk logs: --- (16 headers 9 lines)--- Using INVITE request as basis request - c594f217-59d20131-b33f740c@192.168.10.123 Sending to 192.168.10.4 : 5060 (non-NAT) Found peer 'proxy1' I'm wondering why it matched against the peer before the user, when this was an incoming call. Shouldn't an incoming call match a 'user' before a 'peer', if at all on the peer. Thanks, Doug. _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
On 12/23/05, Douglas Garstang <dgarstang@oneeighty.com> wrote:> I have an incoming call from, say, extension 1000 and IP address 192.168.10.4 in Asterisk. There is no user 1000 defined in sip.conf and allowguest=no. Here is what sip.conf has: > > [general] > allowguest=no > Context=default > > [proxy1-in] > type=user > host=192.168.10.4 > insecure=very > context=Company1 > > [proxy1] > type=peer > host=192.168.10.4 > insecure=very > context=Company1 > qualify=yes > > When this call comes in, Asterisk logs: > --- (16 headers 9 lines)--- > Using INVITE request as basis request - c594f217-59d20131-b33f740c@192.168.10.123 > Sending to 192.168.10.4 : 5060 (non-NAT) > Found peer 'proxy1' > > I'm wondering why it matched against the peer before the user, when this was an incoming call. Shouldn't an incoming call match a 'user' before a 'peer', if at all on the peer. >type=user cannot accept incoming calls in SIP. It will always match from the list of peers on inbound calls. -- Bird's The Word Technologies, Inc. http://www.btwtech.com/
On 12/23/05, Douglas Garstang <dgarstang@oneeighty.com> wrote:> I have an incoming call from, say, extension 1000 and IP address 192.168.10.4 in Asterisk. There is no user 1000 defined in sip.conf and allowguest=no. Here is what sip.conf has:I'm not sure what you mean by extension 1000, but I'm assuming you mean that the invite includes 1000 in it.> > [general] > allowguest=no > Context=default > > [proxy1-in] > type=user > host=192.168.10.4 > insecure=very > context=Company1 > > [proxy1] > type=peer > host=192.168.10.4 > insecure=very > context=Company1 > qualify=yes > > When this call comes in, Asterisk logs: > --- (16 headers 9 lines)--- > Using INVITE request as basis request - c594f217-59d20131-b33f740c@192.168.10.123 > Sending to 192.168.10.4 : 5060 (non-NAT) > Found peer 'proxy1' >Asterisk in this case is matching against the IP, since you have an entery as a peer using this IP, asterisk is matching this agains this peer.> I'm wondering why it matched against the peer before the user, when this was an incoming call. Shouldn't an incoming call match a 'user' before a 'peer', if at all on the peer.Is asterisk matching this agains the user as welll, and you just trying to figure out why? or is asterisk not matching it agains the user at all, and that is the problem you are having? If the former, if it would match against the user first, then the question would have been the other way around :). Asterisk doesn't always read config files from top to bottom, take this as an example: http://www.voip-info.org/wiki-Asterisk+config+extensions.conf+sorting But you are trying to imply that since it's an incoming call it should match against users, then friends and then peers, I guess the programming wasn't written that way, but that it matches against all the enteries in sip.conf, then sees which entery matches to handle this call. In any case, what is the purpose of having 2 enteries for the same IP address, why can't you give one entry as friend? BTW, a peer doens't need a context.> > Thanks, > Doug. > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > Asterisk-Users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
Joshua, I thought it was matched on the from: field for type=user. Anyway, I guess I'll just stick with it matching against a peer. It should suffice. We definitely don't want to be asking for credentials, because of the way this is architected. -----Original Message----- From: Joshua Colp [mailto:joshnet@nbnet.nb.ca] Sent: Friday, December 23, 2005 11:19 AM To: 'Asterisk Users Mailing List - Non-Commercial Discussion' Subject: RE: [Asterisk-Users] Matching SIP users and peers Hello Doug, A user is only matched on when the user part of the SIP URI matches the name of one in sip.conf, Asterisk then challenges for credentials. A user is only used when username/password authentication occurs. In your scenario, this doesn't occur. A peer can be matched on for incoming calls using the insecure option, this causes it to match based on the IP address. Joshua Colp -----Original Message----- From: asterisk-users-bounces@lists.digium.com [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Douglas Garstang Sent: Friday, December 23, 2005 2:00 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [Asterisk-Users] Matching SIP users and peers I have an incoming call from, say, extension 1000 and IP address 192.168.10.4 in Asterisk. There is no user 1000 defined in sip.conf and allowguest=no. Here is what sip.conf has: [general] allowguest=no Context=default [proxy1-in] type=user host=192.168.10.4 insecure=very context=Company1 [proxy1] type=peer host=192.168.10.4 insecure=very context=Company1 qualify=yes When this call comes in, Asterisk logs: --- (16 headers 9 lines)--- Using INVITE request as basis request - c594f217-59d20131-b33f740c@192.168.10.123 Sending to 192.168.10.4 : 5060 (non-NAT) Found peer 'proxy1' I'm wondering why it matched against the peer before the user, when this was an incoming call. Shouldn't an incoming call match a 'user' before a 'peer', if at all on the peer. Thanks, Doug. _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users _______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Douglas Garstang wrote:> I'm wondering why it matched against the peer before the user, when this was an incoming call. Shouldn't an incoming call match a 'user' before a 'peer', if at all on the peer.'user' entries are never matched by IP address. As of Asterisk 1.2, there is no reason to actually use 'user' entries any more at all; you can use 'type=peer' for everything and the behavior will be much more consistent.
The reason for having two entries with the same IP was for a logical separation of function. The host in this case was a proxy server(OpenSER). Calls can either come from it, or be sent to it. It just made sense to me to have two separate entries. one with user (for incoming) and with peer (for outgoing). But I guess it doesn't work that way. I'll just stick with one entry and call it a peer. It'd be nice if it wasn't this hard, and we didn't have to wack SER in between the phones and Asterisk. We have to though, because Asterisk has no way to replicate registration info. That's where SER comes in. Upon registration from a phone, it uses SER's forward() command to copy the registration to all the Asterisk systems. If Asterisk was asking for credentials, each Asterisk system would ask for credentials, and OpenSER passes it back to the phone. The phone goes "Huh? I already supplied you with credentials. What are you asking again for?" and fails to send them a second time to the additional Asterisk systems. Ugh! -----Original Message----- From: C F [mailto:shmaltz@gmail.com] Sent: Friday, December 23, 2005 11:24 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [Asterisk-Users] Matching SIP users and peers On 12/23/05, Douglas Garstang <dgarstang@oneeighty.com> wrote:> I have an incoming call from, say, extension 1000 and IP address 192.168.10.4 in Asterisk. There is no user 1000 defined in sip.conf and allowguest=no. Here is what sip.conf has:I'm not sure what you mean by extension 1000, but I'm assuming you mean that the invite includes 1000 in it.> > [general] > allowguest=no > Context=default > > [proxy1-in] > type=user > host=192.168.10.4 > insecure=very > context=Company1 > > [proxy1] > type=peer > host=192.168.10.4 > insecure=very > context=Company1 > qualify=yes > > When this call comes in, Asterisk logs: > --- (16 headers 9 lines)--- > Using INVITE request as basis request - c594f217-59d20131-b33f740c@192.168.10.123 > Sending to 192.168.10.4 : 5060 (non-NAT) > Found peer 'proxy1' >Asterisk in this case is matching against the IP, since you have an entery as a peer using this IP, asterisk is matching this agains this peer.> I'm wondering why it matched against the peer before the user, when this was an incoming call. Shouldn't an incoming call match a 'user' before a 'peer', if at all on the peer.Is asterisk matching this agains the user as welll, and you just trying to figure out why? or is asterisk not matching it agains the user at all, and that is the problem you are having? If the former, if it would match against the user first, then the question would have been the other way around :). Asterisk doesn't always read config files from top to bottom, take this as an example: http://www.voip-info.org/wiki-Asterisk+config+extensions.conf+sorting But you are trying to imply that since it's an incoming call it should match against users, then friends and then peers, I guess the programming wasn't written that way, but that it matches against all the enteries in sip.conf, then sees which entery matches to handle this call. In any case, what is the purpose of having 2 enteries for the same IP address, why can't you give one entry as friend? BTW, a peer doens't need a context.> > Thanks, > Doug. > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > Asterisk-Users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >_______________________________________________ --Bandwidth and Colocation provided by Easynews.com -- Asterisk-Users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users