Getting 401 unauthorized for refer


I am a newbie in asterisk world. i installed asterisk 1.4 latest version from svn. and added this context in the extension.conf

exten => _XXXX,1,Answer()
exten => _XXXX,n,Wait(2)
exten => _XXXX,n,Transfer(SIP/

and in the sip.conf

register =>


what i wanted to do is transfer any incoming call, to ‘queue’ context, to 7005 number. asterisk sends a REFER message and gets 401 Unauthorized.

Can anybody tell me where to provide the authentication information so that the call gets transferred???

because asterisk can authenticate when registration is challenged…

please help.


My impression of Transfer is that is is not a newbie application and is not particularly resillient.

In this case, why are you answering, as I would have thought that that 302 Temporarily Moved would be more reliable than using REFER?

well if im not wrong then 302 temporarily moved is an error response and REFER is a request method that is meant to be used for call transfer. can you please clarify what u meant? :confused: thanx.

[sorry if im wrong.]

30x aren’t really errors. 302 is a redirect before answer, which is better supported that redirect after answer, and can avoid the caller getting billed. 302 is typically how SIP phones handle divert on xxxx.

302 is actually a very comon response on the web; these numbers are based on the HTTP numbers.

If you use Transfer() before Answer, Asterisk will respond to the INVITE with a 302 response, telling it where to go.

thanx david… using Transfer in the first step does use 302 message. i didnt know that. :smiley:

the problem is i need to answer the call first and pass some message before transferring the call. i kind of need to use the refer message… :-S… i successfully transferred the call using refer message, by ‘disabling the authentication policy’ of the user(7000) used in asterisk. can i do it by configuring the sip.conf?