Call deflection 302 Moved Temporarily not working on newly installed FreePBX 17

Hi there,

I just installed a new VM with a public IP, latest Debian+FreePBX+Asterisk, all by the book.
I set Extensions and Trunks up, and got calls running across the dialplan smoothly.

The problem started when I tried to make a call deflection by sending a 302 Moved Temporarily message to my trunk via a Transfer(PJSIP/sip:[email protected]:port)

It actually does nothing: no reaction in the logs, no errors, no 302 Message is generated and only the TRANSFERSTATUS variable gets a FAILURE value (if I strip the PJSIP from the Transfer app parameters, I get UNSUPPORTED instead).

I’ve looked everywhere, but cannot find anything related to this (I was expecting for some headers to be set prior to the Transfer(), but nothing is documented anywhere). I’d really appreciate any hints on what could be the problem here…

Tested so far:

  • adding allow_transfer=yesto the endpoint at pjsip_custom.conf
  • adding canreinvite=yes to the endpoint at pjsip_custom.conf (I suppose that is not even supported on Asterisk 21)
  • adding redirect_method=pjsip_uri to the endpoint (same place as before, but not showing when a “pjsip show endpoint my_endpoint” is issued).
  • setting direct_media = yes on the FreePBX GUI (not really related, I know, but…)
  • All kind of variations on the Transfer parameters (with/without specifying Technology, using SIP URIs, number@trunk as detinations, marking with <>…

Thanks for any ideas! (really running out of them right now…)

How did you add this in the custom.conf file? You may not be doing it right.

Also, call logs of this nor working would be helpful

Hi Tom,

My pjsip_custom.conf looks like this (please note that after all these testings there may be some unexpected contents or not_in_their_place items):

[NE_Monodosis](+)
allow_transfer=yes

And my pjsip.endpoint_custom.conf is

[NE_Monodosis](+)
redirect_method=uri_pjsip

I also created an extensions_custom.conf file to include the extension to transfer in a context:

[extensiones_custom]
exten => ivan_movil,1,Transfer(PJSIP/sip:[email protected]:theirport)                 
exten => ivan_movil,n,NoOp(TRANSFERSTATUS=${TRANSFERSTATUS}  PROTOCOL=${TRANSFERSTATUSPROTOCOL})
exten => ivan_movil,n,Hangup()

and the extension is included in an existing queue via a queues_custom.conf containing:

[5900]
member=Local/ivan_movil@extensiones_custom/n,0
member=Local/6990@ext-local/n,0,"MNDS Ext 0",hint:6990@ext-local

When a call reaches the queue, the log shows it passing through the Transfer() application but that’s it, no 302 message sent to the trunk, no errors displayed, nothing (set aside the other extension in the queue rings normally):

Executing [5900@ext-queues:53] Queue("PJSIP/NE_Monodosis-000000ab", "5900,t,,,,,,,,") in new stack
    -- Started music on hold, class 'default', on channel 'PJSIP/NE_Monodosis-000000ab'
    -- Called Local/ivan_movil@extensiones_custom/n
    -- Executing [ivan_movil@extensiones_custom:1] Transfer("Local/ivan_movil@extensiones_custom-000000c3;2", "PJSIP/sip:[email protected]:5060") in new stack
    -- Executing [ivan_movil@extensiones_custom:2] NoOp("Local/ivan_movil@extensiones_custom-000000c3;2", "TRANSFERSTATUS=FAILURE  PROTOCOL=0") in new stack
    -- Executing [ivan_movil@extensiones_custom:3] Hangup("Local/ivan_movil@extensiones_custom-000000c3;2", "") in new stack
  == Spawn extension (extensiones_custom, ivan_movil, 3) exited non-zero on 'Local/ivan_movil@extensiones_custom-000000c3;2'
[2025-01-17 18:08:14] WARNING[213126][C-0000004d]: taskprocessor.c:1225 taskprocessor_push: The 'stasis/pool-control' task processor queue reached 500 scheduled tasks again.
    -- Called Local/6990@ext-local/n
    -- Nobody picked up in 0 ms
    -- Executing [6990@ext-local:1] Set("Local/6990@ext-local-000000c4;2", "__RINGTIMER=15") in new stack
    -

…and that’s mostly it. Really appreciate any ideas of what to look at. Thank you!

The “allow_transfer” and “redirect_method” options don’t apply to Transfer. They are for transfers from the remote party.

You are invoking Transfer on a Local channel, not the PJSIP channel, which is unsupported and won’t work. It has to be invoked on a PJSIP channel.

This needs to be [NE_Monodosis](+type=endpoint) for it to be added.

Thanks Tom, noted and applied, although I suppose that is not fixing it by itself. As jcolp mentions in the other reply, looks like I need to invoke the transfer within a PJSIP channel, looking into it right now… Thanks again!

Great! Somewhere to look at, Big thanks Joshua!.
Trying to see now if I can do that within FreePBX or the custom dialplan files or will need to handle it externally.
First idea: I suppose adding a PJSIP extension instead of Local one to the Queue and then invoking the Transfer() from there somehow (not sure of the specifics to accomplish that).