Summary:ASTERISK-16862: Exchange UM and SIP 302 sets Diversion on INVITE
Reporter:rsw686 (rsw686)Labels:
Date Opened:2010-10-24 08:38:25Date Closed:2012-02-27 10:24:19.000-0600
Versions:Frequency of
Environment:Attachments:( 0) exchangeum_debug.txt
Description:When a call goes into Exchange UM on port 5060 it send back a SIP 302 Moved Temporarily with port 5065 or 5067. With Asterisk 1.6.1 and 1.6.2 everything worked. With Asterisk 1.8 a Diversion: reason=unconditional header is added to the INVITE sent back to Exchange UM added due to the 302 response.

Exchange UM uses the Diversion header to know which mailbox to play the greeting for. When no Diversion header is present it provides voice mail access to check messages. Since there is always a Diversion header you can't access voice mail.

I've temporarily added the following to add_diversion_header so that the Diversion header isn't added when unconditional. This fixes the problem, but isn't the correct way to handle this

if(pvt->owner->redirecting.reason == AST_REDIRECTING_REASON_UNCONDITIONAL)
Comments:By: Jonathan Rose (jrose) 2012-02-27 10:07:40.625-0600

I'm adding a feature into trunk right now which makes it so that you can prevent Diversion headers from being added automatically. That way you can still send Diversions by using SIPAddHeader. It won't be going into 1.8 though since this isn't really a bug on our part.

We do have a workaround though.  You can use the REDIRECTING function to keep that header from being sent as well.  You'd have to change your dialplan, but if you'd rather just try to apply the patch, it'll get attached to this issue once it's committed.  It might not apply perfectly cleanly to any version of 1.8 though.