[Opalvoip-devel] OpalEndPoint::StartListeners
Brought to you by:
csoutheren,
rjongbloed
From: Adrian R. <ar...@rd...> - 2013-08-05 16:14:26
|
Hi, In endpoint.cxx, the OpalEndPoint::StartListeners crashed when I tried to set a listener address. Oddly enough, it crashed only with the latest stable Opal (3.12.4), not with the previous versions (for example, 3.12.3). Anyway, I changed it like this, and it seems to work now (but I didn't test it yet to see if it listens on what I want to): bool OpalEndPoint::StartListeners(const PStringArray & listenerAddresses, bool add) { OpalTransportAddressArray interfaces; if (listenerAddresses.IsEmpty()) { interfaces = GetDefaultListeners(); if (interfaces.IsEmpty()) return false; } else { for (PINDEX i = 0; i < listenerAddresses.GetSize(); i++) { if (listenerAddresses[i].Find('$') != P_MAX_INDEX) interfaces.AppendAddress(listenerAddresses[i]); else { PStringArray transports = GetDefaultTransport().Tokenise(','); for (PINDEX j = 0; j < transports.GetSize(); j++) { PString transport = transports[j]; WORD port = GetDefaultSignalPort(); PINDEX colon = transport.Find(':'); if (colon != P_MAX_INDEX) { port = (WORD)transport.Mid(colon+1).AsUnsigned(); transport.Delete(colon, P_MAX_INDEX); } interfaces.AppendAddress(OpalTransportAddress(/*interfaces[i]*/listenerAddresses[i], port, transport)); } } } } Please notice the /*interfaces[i]*/ which I replaced with listenerAddresses[i]. Adrian |