Is there any way to use PJSIP_SEND_SESSION_REFRESH before answer?

We are in the process of migrating the version from 13 to 18.15, and have a problem about codec negotiation.

We want to change codec between extension and outside line.
So, our extensions.conf includes below lines. It’s followed by a dial.
It works well in Asterisk13, but it doesn’t work in Asterisk18.
Using this function on preanswer channel seems to be prohibited in Asterisk18.
Is there any way to change codec for both caller and callee channel?
I know several parameters of endpoint are added in Asterisk18, but they don’t seem to fulfill my purpose…

same => n,Set(PJSIP_MEDIA_OFFER(audio)=!all,myopus)
same => n,Set(PJSIP_SEND_SESSION_REFRESH()=invite)

Finally, we find the way.
But this solution have several problems.(ex. Unnecessary wait)
So, we decided to deal with it on the peer app side.
We hope future Pjsip deal with this!

same => n,Dial(Local/2001@extension&Local/s@no-op,180,TG(update-media^s^1))

[update-media]
exten => s,1,NoOp(update media)
same => n,Answer
same => n,Wait(3)   <-Without it, operation is not stable. I think it takes time for pjsip to complete answer processing 
same => n,Set(PJSIP_MEDIA_OFFER(audio)=!all,tblopus)
same => n,Set(PJSIP_SEND_SESSION_REFRESH()=invite)
same => n,Wait(3)
same => n,Bridge(${MASTER_CHANNEL(CHANNEL)},tT)
same => n,Playtones(busy)
same => n,Wait(3)
same => n,Hangup()

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.