The IP address is dynamically allocated to the device so you cannot normally use the phone number to look it up.
One way around this problem, which is common to many solutions and protocols, is to have your gate opener module register with a central server and supply its contact details to the server. You can then contact the central server and ask it to send a message to the gate module when you need to contact it via IP. The Gate module either needs to poll the server or support some form of notifications to get the message from the central server.
Another approach, if you gate module is Android based, is to send a SMS and register a listener in the manifest:
<receiver android:name=".YourSMSReceiveClass">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED"></action>
</intent-filter>
</receiver>
You can then add code to do whatever you require in the receiver.