[FS-880] Enable late negotiation for calls with pre_answer or bridged out of IVR Created: 18/Oct/08  Updated: 24/Feb/14  Resolved: 08/Jan/10

Status: Closed
Project: FreeSWITCH
Component/s: mod_sofia
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: Pawel Pierscionek Assignee: Make Me New Stuff For Free
Resolution: Not A Bug Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

CPU Architecture:
FreeSWITCH GIT Revision: unknown
GIT Master Revision hash:: unknown

Am not sure if this issue fits here or in the CORE project.

Media bypass + late negotiation allows for unknown codecs to pass through FreeSwitch with media transparently negotiated between bridged endpoints.

Late negotiation works only if the channel being bridged to the final destination is not already transmitting any audio.

In case of pre_answer or some IVR scenario prior to the bridge FreeSwitch ignores late negotiation setting and sends it's first invite to the bridge endpoint with SDP containing only the codec negotiated for pre_answer or IVR stage. Also the re-invites that follow immediately after bridge setup to short-circuit the RTP path contain only the codec already negotiated with FreeSwitch.

So my request is to improve this scenario to allow the first invite out of FS to include original A leg SDP codec set and the later reinvites to include codec set from 200 OK from B leg.

Sample dialplan:
    <extension name="to_whatever">
      <condition field="destination_number" expression="^(123)$">
        <action application="set" data="bypass_media=true"/>
        <action application="set" data="ringback=ringbacktone.wav"/>
        <action application="set" data="transfer_ringback=ringbacktone.wav"/>
        <action application="pre_answer" />
        <action application="bridge" data="sofia/gateway/whatevergw/$1"/>

Sample sip-profile:
    <param name="inbound-no-media" value="true"/>
    <param name="inbound-late-negotiation" value="true"/>

Expected behavior - "A leg" is getting ringbacktone during RINGING phase and then the media path is short circuited when the bridge is answered but with new set of codecs - negotiated with "B leg" usig "A leg" set of codec - like with standard late-negotiation scenario.

Comment by Anthony Minessale II [ 20/Oct/08 ]
This is a lot of work, I'll be looking for a large bounty (at least 1k) to work on this.
 you can probably get the same effect by answering the call, playing your ringback then using refer "deflect" app
to blind transfer the call to the same box in proxy mode.
Comment by Pawel Pierscionek [ 20/Oct/08 ]
I am not looking to play announcement before connecting the call but playing custom ringback tones to ss7 gateway while connecting the call so workaround is not good for me. :)

Anyways - I'll email You details for the bounty so we can arrange for the assignee to change back to Anthony ;)

Comment by Brian West [ 08/Jan/10 ]
See http://wiki.freeswitch.org/wiki/Wish_list
Generated at Mon Jul 22 04:48:28 CDT 2019 using Jira 8.1.0#801000-sha1:2e1cd1bb771978cda2c5e8f3f10539ab180613f6.