[asterisk-dev] [Code Review] SIP register not using peer's outbound proxy

Mark Michelson mmichelson at digium.com
Mon Jul 13 10:21:05 CDT 2009


Olle E. Johansson wrote:
> 10 jul 2009 kl. 22.48 skrev David Vossel:
> 
>> If callbackextension is defined for a peer it successfully causes a  
>> registration to occur, but the registration ignores the  
>> outboundproxy settings for the peer.  This is because the call to  
>> obproxy_get() in transmit_register() is not capable of passing a  
>> peer.  This patch adds the peername option, [peername?], to the  
>> register string allowing transmit_register to attempt to find the  
>> peer and use it's outbound proxy.
>>
>> register => [peername?][transport://]user[@domain] 
>> [:secret[:authuser]]@host[:port][/extension][~expiry]
>>
> The host is already the peer name - why have peer name twice?
> 
> The host part is first checked against peer names, then srv records,  
> domains, hosts and IP addresses.
> 
> We need to stop adding stuff that is not needed to the register=>  
> statement, it's already much too overloaded with information that  
> exists already in the peer section that you can use by refering to it  
> in the host part. The port number is not needed, and the expiry should  
> propably belong in the [peer] section for callbackextension  
> registrations anyway.
> 
> /O

Yeah, I'm in agreement with you there. Personally, I think that "register =" 
lines really shouldn't exist for chan_sip, and instead all outbound 
registrations should be configurable entirely inside a sip peer entry.

The reason for this specific change is due to the convoluted way that Asterisk 
handles the "callbackextension" option. It constructs a "register =" line and 
then passes the string to the function that parses register lines. I'm not 
kidding. So currently, without refactoring anything, the simple way to correct 
deficiencies with "callbackextension" is to change the way "register =" lines 
are parsed since that's what Asterisk compiles the option into anyway. David and 
I were on agreement that this particular change would never actually be needed 
by someone typing a "register =" line in sip.conf, so that's why the description 
of the change was not added to the sip.conf.sample file. Instead, this is 
something that is used internally when "callbackextension" is used in a sip peer 
entry.

Mark Michelson



More information about the asterisk-dev mailing list