FreeSWITCH XML dialplan: call hangs up automatically after greeting API in IVR
02:28 20 Jan 2026

I am building a custom IVR using FreeSWITCH + mod_xml_curl + Node.js.

My dialplan is generated dynamically from an API and returned as XML.

  1. If the destination does not answer

  2. The call is transferred to ai_agent

  3. ai_agent should:

    • play greeting audio from API

    • record caller voice

    • send audio to backend

    • play AI response

    • loop the conversation

      The call reaches my greeting API and plays the greeting audio, but after that the call disconnects automatically.

      
        
      
          
      
          
          
          
          
          
      
          
          
      
          
          
      
          
      
          
          
          
      
          
      
          
      
          
      
          
      
          
            
          
      
          
      
        
      
      matchRules += `
      
        
      
          
          
      
          
          
            
            
            
            
          
      
          
          
      
          
          
      
            
      
      
      
             
             
             
      
        
      
      `;
      
node.js freeswitch