Feature Request - Allow transfer of call passed thru PBX to cell phone by receiving cell phone or hard phone.

kenn10

Active Member
Sep 11, 2018
149
38
28
70
On FreePBX systems, if I receive a call on my cell phone that was forwarded by the PBX via no-answer forward or ring-group forward, I can press a couple of digits like **+ext that allow me to transfer the call away from my cell phone and back into the PBX extension, call-park, IVR or ring group that I dial. I'd like to see that functionality in FSPBX along with ability to turn on/off call recording by dial code.
 
  • Like
Reactions: yaboc
This may be a freeswitch limitation. Asterisk supports in-call dialing of DTMF digits and can translate them into features. I never heard of freeswitch being able to do this.
 
Gemini seems to think FreeSwitch can do this. I'll play around when I have time.

FreeSWITCH can be configured so an external answerer (like a cell phone on the B-leg) can use DTMF keypresses to control, transfer, or park an inbound call.

Key Technical Considerations​

  1. DTMF Interception (bind_digit_action):Standard FreeSWITCH bridging connects audio directly between both legs. To capture DTMF digits from the B-leg (the cell phone) after the call connects, you must attach digit bindings specifically to the B-leg using export and bind_digit_action before calling bridge.
  2. In-Band DTMF Detection (start_dtmf):Cell phone carriers frequently compress audio or drop RFC 2833 / Out-Of-Band SIP INFO events. To ensure keypresses from a mobile phone are consistently detected, you should invoke start_dtmf on the B-leg to run an in-band DTMF detector over the media stream.

Dialplan Implementation Example​

Add the following setup to your inbound dialplan XML before the bridge application:
Code:
XML
<extension name="inbound_to_cell_with_dtmf_control">
  <condition field="destination_number" expression="^1000$">
    <!-- Start in-band DTMF detection on the cell phone leg upon answer -->
    <action application="export" data="nolocal:execute_on_answer=start_dtmf"/>

    <!-- Bind DTMF digit sequences on the cell phone (B-leg) -->
    <!-- Pressing *1 transfers the caller to extension 2000 in the default context -->
    <action application="export" data="nolocal:bind_digit_action=cell_controls,*1,exec:transfer,2000 XML default,b,s"/>
    
    <!-- Pressing *2 parks the caller in the call park context/valet park -->
    <action application="export" data="nolocal:bind_digit_action=cell_controls,*2,exec:transfer,5555 XML default,b,s"/>
    
    <!-- Enable the digit binding group for the call session -->
    <action application="export" data="nolocal:digit_action_set_realm=cell_controls"/>

    <!-- Dial the external cell phone number via your provider trunk -->
    <action application="bridge" data="sofia/gateway/my_provider_trunk/15551234567"/>
  </condition>
</extension>

How it Works​

  • nolocal:export: Pushes the variable setting to the outbound B-leg (the cell phone), ignoring the inbound A-leg.
  • execute_on_answer=start_dtmf: Ensures the in-band media analyzer begins listening for dual-tone frequencies as soon as the cell phone picks up.
  • bind_digit_action: Listens for specific key combinations (e.g., *1 or *2).
    • Target flags b,s state that the action applies to the B-leg (b) and operates self-target/executes on the channel (s).
  • Transfer (*1): Executes transfer 2000 XML default, breaking the bridge and sending the inbound caller to extension 2000.
  • Park (*2): Executes transfer 5555 XML default, sending the inbound caller into your Valet Park lot or parking extension.
 
This XML would allow transfer to variable extensions:

Code:
XML
<extension name="inbound_to_cell_dynamic_dtmf">
  <condition field="destination_number" expression="^1000$">
    <!-- Start in-band DTMF detection on the cell phone leg upon answer -->
    <action application="export" data="nolocal:execute_on_answer=start_dtmf"/>

    <!-- Dynamic binding: Matches *1 followed by 3 to 5 digits, capturing the extension into $1 -->
    <action application="export" data="nolocal:bind_digit_action=cell_controls,~\*1(\d{3,5}),exec:transfer,$1 XML default,b,s"/>
    
    <!-- Enable the digit binding group for the call session -->
    <action application="export" data="nolocal:digit_action_set_realm=cell_controls"/>

    <!-- Dial out to the external cell phone -->
    <action application="bridge" data="sofia/gateway/my_provider_trunk/15551234567"/>
  </condition>
</extension>