Closed MayamaTakeshi closed 8 months ago
We would need to change this code:
void build_transport_tag(char *dest, const char *type, const char *address,
int port) {
sprintf(dest, "%s:%s:%d", type, address, port);
}
to check if address is a name and if yes, dns-resolve it.
But in pjsip, DNS resolution is done async: https://docs.pjsip.org/en/latest/api/generated/pjlib_util/group/group__PJ__DNS__SRV__RESOLVER.html
which will not work well for us (we immediately create transports and make calls). So let's see if there is some other alternative.
I tested by creating transport this way:
Then when making a call from t1 to t2 I go this error:
This is of course because localhost became 127.0.0.1 and so there was no match because the tag was set as "udp:localhost:5061".
Obs: this will be particularly problematic with services in a docker compose setup where the services talk to each other using the service names.