How To Correctly Set REDIRECTING To Indicate Diversion Reason

Home » Asterisk Users » How To Correctly Set REDIRECTING To Indicate Diversion Reason
Asterisk Users 3 Comments

Hello List

Next question where google did not spit out an unsable answer.

When redirecting a call with Transfer, I would like to correctly indicate the reason.

I did try this:

exten => XX,1,NoOp(Call to ${EXTEN} from ${CALLERID(all)})
exten => XX,n,Dial(SIP/ZZ)
exten => XX,n,set(REDIRECTING(reason)=cfb)
exten => XX,n,Transfer(SIP/YY)

I did try with ‘reason’ ‘orig-reason’ I added cfb with and only quotes, I did try cfnr.

But the 302 message generated this way allways contains reason=unknown in the diversion header.

Any hint welcome.

-Benoît Panizzon-

I m p r o W a r e A G – Leiter Commerce Kunden

3 thoughts on - How To Correctly Set REDIRECTING To Indicate Diversion Reason

  • You need to set more redirecting information [1].

    In sip.conf send_diversion=yes needs to be in effect. You also need to setup the from party id information (at least the from number) to indicate where you are redirecting from. You should also increment the redirecting count.

    chan_pjsip has the same requirements. pjsip.conf send_diversion=yes needs to be in effect and you also need to setup the from party id information.

    Richard

    [1]
    https://wiki.asterisk.org/wiki/display/AST/Manipulating+Party+ID+Information

  • Hi Richard

    Thank you

    I’m back to chan_sip to get quicker progress in our test scenario as I
    know this better than pjsip 🙂

    send_diversion=yes is the default if it is not set, so that’s correctly set.

    I altered my test dialplan and got some success but also another weird problem now:

    exten => XX,1,NoOp(Call to ${EXTEN} from ${CALLERID(all)})
    exten => XX,n,Progress exten => XX,n,Ringing exten => XX,n,Wait(10)
    exten => XX,n,set(REDIRECTING(from-num)=${EXTEN})
    exten => XX,n,set(REDIRECTING(reason)=cfnr)
    exten => XX,n,Transfer(SIP/ZZ)

    How everytime REDIRECTING is called, this causes a 181 call is being forwarded to the caller, but containing no diversion information.

    The Transfer (302 Moved Temporarily) contains two Diversion: headers, one with reason=unknown and one with reason=no-answer which would be the correct one.

    I start to think I stumbled over a bug. Maybe using REDIRECTING() would set the correct headers if I used DIAL to forward the call. But I don’t want to create a second call leg. So maybe Transfer already is setting a Diversion: header with hardcoded reason ‘unknown’.

    -Benoît Panizzon-

    I m p r o W a r e A G – Leiter Commerce Kunden

  • You need to use the ‘i’ option of REDIRECTING here as described in the manipulating party id wiki page.

    That could be possible and would be a bug in chan_sip.

    Richard