I'm guessing you will need to register the yeastar as an extension, then write a dialplan step to send calls to that specific extension with a bridge statement. If it's a static IP then it shouldn't be that bad. If it's a dynamic IP, then you will need to lookup the registered extension, extract the IP, then use that IP address variable in the bridge statement. I've done something similar with other registered SIP trunks.
So here is a dialplan step I used for a dynamic registered SIP trunk. The trunk registered with extension 9750 and I'm sending 1234 to the gateway. You will need to adjust this to your needs.
I would run the "sofia_contact" command from fs_cli to get an idea of what your registered extension looks like for your system. You will probably need to adjust the bridge statement for transport, fs_nat, fs_path, etc.
Also note that each "condition field" is a dialplan group. This isn't one long dialplan group.
Code:
<extension name="registered_sip_trunk_test" continue="true">
<condition field="destination_number" expression="^1234$">
<action application="set" data="called_contact=${sofia_contact(*/9750@${domain_name})}" inline="true"/>
</condition>
<condition field="${called_contact}" expression="^.*sofia.*sofia.*$" break="on-true"/> <condition field="${called_contact}" expression="^.*sip:.*@(\b(?:\d{1,3}\.){3}\d{1,3}\b)" break="never">
<action application="set" data="called_contact_internal_ip=$1" inline="true"/>
<anti-action application="set" data="called_contact_internal_ip=unknown" inline="true"/>
</condition>
<condition field="${called_contact}" expression="^.*fs_path=sip%3A\d+%40((?:\d{1,3}\.){3}\d{1,3}.*)" break="never">
<action application="set" data="called_contact_public_ip=$1" inline="true"/>
<action application="bridge" data="sofia/internal/sip:1234@${called_contact_internal_ip};transport=tcp;fs_nat=yes;fs_path=sip:1234@${called_contact_public_ip}"/>
</condition>
</extension>
Good luck!