I'm trying to use freeswitch as a transcription gateway :

The goal is to allow a PSTN subscriber (A_party) to call another (B_party) through freeswitch : freeswitch being used to record and transcript the call.

This is the scenario i'm trying to acheive :

1/ A_party call freeswitch through a PSTN gateway.

2/ freeswitch execute a lua script (IVRPrompt8.lua) that :
* query the service database
* Initialize few sessions variables
* Play A_party a vocal prompt.
* Attempt to bridge B_party.

3/ When B_party answer, a lua script is called : catchBAnswer2.lua
This script is used to initialise several session variable and play legal warning to both party.

<extension name="experimental_dialplan">
      <condition field="destination_number" expression="^(\+33XXXXXXXXX)$">

<!-- Play IVR to get the destination number and service parameters -->
<action inline="true" application="lua" data="IVRPrompt8.lua" />

<!-- Set channel record settings -->
<action application="export" data="RECORD_READ_ONLY=true"/>
<action application="export" data="RECORD_STEREO=false"/>

<!-- Free the "#" terminator from other use-->
<action application="set" data="ivr_menu_terminator=none"/>

<action application="export" data="nolocal:execute_on_answer=lua catchBAnswer2.lua"/>

<!-- Finally bridge the call -->
<action application="bridge" data="sofia/gateway/ippi_33XXXXXXXXX/${destination_number}"/>

</condition>
    </extension>

Sometimes the scenario works just fine, but most of the time it crash when calling catchBAnswer2.lua, as show the last console logs (DEBUG LEVEL):

2018-10-12 09:42:26.812449 [NOTICE] sofia.c:7304 Pre-Answer sofia/external5090/0665199963!
2018-10-12 09:42:26.812449 [DEBUG] switch_channel.c:3482 (sofia/external5090/0665199963) Callstate Change RINGING -> EARLY
2018-10-12 09:42:26.812449 [DEBUG] sofia.c:7291 Channel sofia/external5090/0665199963 entering state [ready][200]
2018-10-12 09:42:26.812449 [DEBUG] switch_core_media.c:5478 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMA:8:8000:20:64000:1]
2018-10-12 09:42:26.812449 [DEBUG] switch_core_media.c:5533 Audio Codec Compare [PCMA:8:8000:20:64000:1] ++++ is saved as a match
2018-10-12 09:42:26.812449 [DEBUG] switch_core_media.c:5394 Set telephone-event payload to 101@8000
2018-10-12 09:42:26.812449 [DEBUG] switch_core_media.c:3781 Set Codec sofia/external5090/0665199963 PCMA/8000 20 ms 160 samples 64000 bits 1 channels
2018-10-12 09:42:26.812449 [DEBUG] switch_core_codec.c:111 sofia/external5090/0665199963 Original read codec set to PCMA:8
2018-10-12 09:42:26.812449 [DEBUG] switch_core_media.c:5737 Set telephone-event payload to 101@8000
2018-10-12 09:42:26.812449 [DEBUG] switch_core_media.c:5795 sofia/external5090/0665199963 Set 2833 dtmf send payload to 101 recv payload to 101
2018-10-12 09:42:26.812449 [DEBUG] switch_core_media.c:8511 AUDIO RTP [sofia/external5090/0665199963] 94.23.42.139 port 29498 -> 194.169.214.61 port 59684 codec: 8 ms: 20
2018-10-12 09:42:26.812449 [DEBUG] switch_rtp.c:4300 Starting timer [soft] 160 bytes per 20ms
2018-10-12 09:42:26.812449 [DEBUG] switch_core_media.c:8815 sofia/external5090/0665199963 Set 2833 dtmf send payload to 101
2018-10-12 09:42:26.812449 [DEBUG] switch_core_media.c:8822 sofia/external5090/0665199963 Set 2833 dtmf receive payload to 101
2018-10-12 09:42:26.812449 [DEBUG] switch_core_media.c:8845 sofia/external5090/0665199963 Set rtp dtmf delay to 40
2018-10-12 09:42:26.812449 [NOTICE] sofia.c:8429 Channel [sofia/external5090/0665199963] has been answered
EXECUTE sofia/external5090/0665199963 lua(catchBAnswer2.lua)

** CORE DUMP **

I have no clues why this is happening, so i included the backtrack enclosed to have feedbacks (https://freeswitch.org/jira/browse/FS-11456).

Can somebody have a look and give a more precise idea on what is making freeswitch to crash ?

I can then setup monitoring and collect additional traces if needed (SIP, RTP, etc..).

J. Terrasson