[Freeswitch-users] R: CoreSession::hangup after MOVED on IVR calls

Piccinin Francesco francesco.piccinin at insiel.it
Wed Mar 29 19:17:45 MSD 2017


Hi Brian,
many thanks for your feedback!

Find below some extract from our FS dialplan.
Our SIP system is composed by an Opensips front-end that balances calls on Freeswitch hosts. Realtime data and static config are backended on mysql db.


default.xml: a lua script profiling caller / called setting channel_variables.

services.xml:
<include>
  <condition field="${service_type}" expression="IVR" break="on-true">
        <action application="set" data="default_language=it"/>
        <action application="set" data="hangup_after_bridge=false"/>
        <action application="set" data="force_transfer_context=ivrs"/>
        <action application="lua" data="services/ivr.lua ${did}" inline="true"/>
        <action application="answer"/>
        <action application="ivr" data="${ivr_name}"/>
        <action application="transfer" data="${fallback}"/>
  </condition>
</include>

calls.xml:
<include>
  <condition field="${service_type}" expression="^NONE$"  break="on-true">
      <action application="info"/>
      <action application="lua" data="functions/consult_xfer_limit_int.lua ${ext} ${cCalled} ${domain_name} ${maxcalls} ${busytriggerA} ${shd_line} ${maxcallsB} ${busytriggerB}"/>
      <action application="set" data="effective_caller_id_number=${ext}"/>
      <action application="set" data="effective_caller_id_name=${my_dname}"/>
      <action application="set" data="hold_music=${moh_path}" inline="true"/>
      <action application="set" data="transfer_ringback=${moh_path}"/>
      <action application="export" data="pbx=${pbx}"/>
      <action application="export" data="domain_name=${domain_name}"/>
      <action application="export" data="maxcalls=${maxcalls}"/>
      <action application="limit" data="db ${domain_name} BSY_${cCalled} ${busytriggerB} !USER_BUSY"/>
      <action application="limit" data="db ${domain_name} MAX_${ext} ${maxcalls} !USER_BUSY"/>
      <action application="limit" data="db ${domain_name} BSY_${ext} ${busytriggerA} !USER_BUSY"/>-->
      <action application="bind_meta_app" data="1 ab s execute_extension::dx XML features"/>
      <action application="bind_meta_app" data="2 ab s execute_extension::att_xfer XML features"/>
      <action application="bind_meta_app" data="3 ab s execute_extension::parking XML features"/>
      <action application="set" data="hangup_after_bridge=true"/>
      <action application="set" data="continue_on_fail=true"/>
      <action application="export" data="alert_info=http://127.0.0.1/ring.wav;info=${alert_info};x-line-id=0"/>
      <action application="set" data="bypass_media=${lan}"/>
      <action application="set" data="t38_passthru=true"/>
      <action application="export" data="t38_passthru=true"/>
      <action application="set" data="disable_q850_reason=true"/>
      <action application="set" data="sip_redirect_context=redir"/>
      <action application="export" data="sip_redirect_context=redir"/>
      <action application="export" data="nolocal:execute_on_answer=lua functions/clean_pickup.lua ${uuid}"/>
      <action application="set" data="callee_id_name=${cid_name}"/>
      <action application="export" data="callee_id_name=${cid_name}"/>
      <action application="set_profile_var" data="callee_id_name=${cid_name}"/>
      <action application="set" data="leg=A"/>
      <action application="export" data="nolocal:leg=B"/>
      <action application="bridge" data="{sip_invite_domain=${domain_name},sip_cid_type=pid,presence_id=${cCalled}@${domain_name}}${sofia_contact(${cCalled}@${domain_name})}"/>
      <action application="set" data="continue_on_fail=USER_BUSY,ORIGINATOR_CANCEL"/>
      <action application="hangup" data="USER_BUSY"/>
  </condition>
</include>

  
redir.xml:
<include>
  <context name="redir">
    <!-- On Moved , manage redirection -->
    <extension name="redirections">
      <condition field="destination_number" expression="^(\d+)$">
            <action application="log" data="INFO REDIRECTED"/>
            <action application="info"/>
            <action application="set" data="ignore_early_media=true"/>
            <action application="set" data="hangup_after_bridge=false"/>
            <action application="set" data="continue_on_fail=true"/>
            <action application="set" data="bypass_media=false"/>
            <!--<action application="answer"/>-->
            <action application="set" data="leg=A"/>
            <action application="export" data="nolocal:leg=B"/>
            <action application="lua" data="functions/call_redirect.lua  ${cCalled} ${destination_number}"/>
      </condition>
    </extension>
  </context>
</include>


call_redirect.lua profile cCalled (forwarder ext) and destination_number (forward destination)
check session status with session:ready() and execute a bridge with:

app="{ignore_early_media=true,hangup_after_bridge=true,origination_caller_id_name='Da:"..caller.."',originate_timeout=25}sofia/gateway/"..gw[i].."/"..redirected;
session:execute("bridge", app);

Please note that a-leg is terminated just after b-leg is terminated with originator_cancel (sip 487) on SIP moved received from forwarded extensions.

Thanks in advance for you help

Francesco

Da: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] Per conto di Brian West
Inviato: martedì 28 marzo 2017 22:11
A: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>
Oggetto: Re: [Freeswitch-users] CoreSession::hangup after MOVED on IVR calls

Its all going to depend on what exactly you're doing in your script.... can you show us an example?

/b


On Tue, Mar 28, 2017 at 4:09 AM, Piccinin Francesco <mailto:francesco.piccinin at insiel.it> wrote:
Hi all,
we are experiencing a call drop issue when users configure call forward unconditional on their extensions.
Call drops when these extensions are reached from pstn and through an IVR post selection.

Freeswitch recived a SIP 302 Moved from these endpoints, call are processed on sip_redirect_context but freeswitch first send a SOFIA DESTROY to forwarding extension (correct) and then KILL A-leg (IVR) with the following error: CoreSession::hangup

It seems freeswitch does not keep alive a-leg in this scenario.

Can you please help us?

Thanks
Francesco

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
mailto:consulting at freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
mailto:FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

-- 
Brian West
mailto:brian at freeswitch.org
Twitter: @FreeSWITCH , @briankwest
http://www.freeswitchbook.com 
http://www.freeswitchcookbook.com

Allison prompts for FreeSWITCH:
https://www.gofundme.com/allison-prompts-for-freeswitch
Got Bugs? Report them https://freeswitch.org/jira! | Reddit: https://www.reddit.com/r/freeswitch
T:+19184209001 | F:+19184209002 | M:+1918424WEST (9378)
Skype:briankwest


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list