5 years ago, I built the same SMS gateway without using the AT command "Explicitly" [0], but by letting Kannel handle that for me. Thus, I had an endpoint generally usable. Kannel is still used by Mobile Network Operators in Africa.
[0]: https://hackernoon.com/build-an-sms-center-with-python-kanne...