I have the following dialplan to transfer calls to an outbound SIP provider through Twilio (which is my SIP trunk) and it only supports transfers through SIP REFER and that’s why I can’t use the Dial Application:
exten = _XXXXXXXXX.,1,Verbose(1, "Transferring call to ${EXTEN}")
same = n,Answer()
same = n,Playtones(425/1500,0/1500)
same = n,Transfer(PJSIP/sip:${EXTEN})
same = n,Verbose("TRANSFERSTATUS is ${TRANSFERSTATUS}")
same = n,Hangup()
When the call is being transferred, the calling party can’t hear the play tones but if the user on the other end picks up the phone, everything works as expected. I don’t know if this issue is related with Asterisk or with the phone terminal. Any tips?
FYI: I have also configured the endpoint with inband_progress=yes but it didn’twork.
Once Transfer is done the call is no longer in Asterisk, and Asterisk can no longer provide media to it. There’s nothing you can do to overcome that, it’s up to that which handles the Transfer request to do anything.
There is nothing in SIP that allows one to request a particular tone to be generated remotely, other than sending it as actual media.
I guess you are trying emulate a 302 redirect with REFER. It is too late for Ringing to be honoured on the caller’s side because you had to answer their call in order to use Refer. I suppose Twilio could turn Ringing into media generated by Twilio, but that media cannot be determined by what you did with Asterisk.