mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
pjsip_transport_events: handle multiple addresses for a domain
The key used for transport monitors was the remote host name for the transport and not the remote address resolved for this domain. This was problematic for domains returning multiple addresses as several transport monitors were created with the same key. Whenever a subsystem wanted to register a callback it would always end up attached to the first transport monitor with a matching key. The key used for transport monitors is now the remote address and port the transport actually connected to. Fixes: #932
This commit is contained in:
@@ -88,10 +88,7 @@
|
||||
* \param _dest The destination buffer of at least IP6ADDR_COLON_PORT_BUFLEN bytes
|
||||
*/
|
||||
#define AST_SIP_MAKE_REMOTE_IPADDR_PORT_STR(_transport, _dest) \
|
||||
snprintf(_dest, IP6ADDR_COLON_PORT_BUFLEN, \
|
||||
PJSTR_PRINTF_SPEC ":%d", \
|
||||
PJSTR_PRINTF_VAR(_transport->remote_name.host), \
|
||||
_transport->remote_name.port);
|
||||
pj_sockaddr_print(&_transport->key.rem_addr, _dest, sizeof(_dest), 1);
|
||||
|
||||
/* Forward declarations of PJSIP stuff */
|
||||
struct pjsip_rx_data;
|
||||
|
Reference in New Issue
Block a user