Blank domain_name

I am using freeswitch as application server while Kamailio handles all registrations in a multi domain scenario.

I am able to route calls to Freeswitch via kamailio but I am not able to fetch the domain name in freeswitch dialplan.

I tried domain_name, dialed_domain variables and they are blank.

I have already commented force-register-domain, force-subscription-domain and force-register-db-domain in internal profile.

What is the best way to get domain from invite header ?

To fetch the domain name from the INVITE header in FreeSWITCH, you can use the $rd variable, which contains the destination domain from the SIP request. Here’s how you can access it in your FreeSWITCH dialplan:

xmlCopy code

<extension name="example_extension">
    <condition field="${rd}" expression="^([a-zA-Z0-9.-]+)$">
        <action application="log" data="Domain name: ${rd}" />
    </condition>
</extension>

In this example, when an INVITE is received, FreeSWITCH checks the destination domain ($rd) and logs it. You can replace the log action with whatever action you need to perform with the domain name.

Make sure that your FreeSWITCH configuration is properly set up to capture and handle SIP headers correctly.

Best Regard
Danish hafeez | QA Assistant
ICTInnovations