[asterisk-dev] REFER too soon?

Joshua C. Colp jcolp at digium.com
Thu Aug 29 06:18:33 CDT 2019


On Thu, Aug 29, 2019, at 7:45 AM, Dennis Buteyn wrote:
> Been trying to perform a blind transfer for hours with a SIP client I'm 
> developing (using Sofia). Every time I sent a REFER request, Asterisk 
> would respond with 202, followed by a NOTIFY containing the ominous 
> phrase "503 Service Unavailable (can't handle one-legged xfers)".
> 
> At first, I thought maybe my SDP isn't good enough. So I copied some 
> Zoiper SDP. Nope, still receive 503.
> 
> So I turned Asterisk debug and verbose up to 11 and went caving in 
> Asterisk sources. As far as I could tell, it was 
> ast_bridge_transfer_blind that failed.
> 
> Then it hit me... maybe the transfer failed because the bridge hasn't 
> been created yet? Maybe I'm sending my REFER too soon?
> 
> So I added a sleep(1) just before sending my REFER... success?!?
> 
> Now, obviously sleep(1) isn't a good solution and I don't recall a 
> minimum required delay in the specs. Should I wait for the first RTP 
> packet to arrive? Is this a bug? I'm confused.

There is no minimum specified in the spec because it's dependent on the remote side itself (in this case Asterisk). Asterisk only allows blind transferring a channel (can't blind transfer the dialplan for example). Since things happen asynchronously if you do it too fast at answer there is certainly a window whereby it could not yet be in a situation where a transfer is possible and thus the transfer would fail. Waiting for RTP to arrive could work.

-- 
Joshua C. Colp
Digium - A Sangoma Company | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list