Fix problem when receiving a call from asterisk - problem with contact headers.

cusax-fix
Damian Minkov 19 years ago
parent c785e0a591
commit 73f52e7913

@ -1320,22 +1320,18 @@ public ContactHeader getContactHeader()
{
if(this.genericContactHeader == null)
{
genericContactHeader = headerFactory.createContactHeader(
ourSipAddress);
try
{
genericContactHeader.getAddress()
.setDisplayName(getOurDisplayName());
}
catch (ParseException ex)
{
logger.error(
"Failed to set a display name on a Contact header."
, ex);
}
logger.debug("generated contactHeader:"
+ genericContactHeader);
try
{
genericContactHeader = getContactHeader(
sipRegistrarConnection.getRegistrarAddress(),
sipRegistrarConnection.getRegistrarListeningPoint());
}
catch(OperationFailedException ex)
{
logger.error("Failed to create Contact header.", ex);
}
logger.debug("generated contactHeader:"
+ genericContactHeader);
}
return genericContactHeader;
}
@ -1344,7 +1340,7 @@ public ContactHeader getContactHeader()
* Retrns a Contact header containing a sip URI base on a localhost address
* and thereforeusable in REGISTER requests only.
*
* @param registrarAddress the address of the registrar that this contact
* @param targetAddress the address of the registrar that this contact
* header is meant for.
* @param srcListeningPoint the listening point that will be used when
* accessing the registrar.
@ -1353,8 +1349,8 @@ public ContactHeader getContactHeader()
* @throws OperationFailedException if we fail constructing the contact
* header.
*/
ContactHeader getRegistrationContactHeader(InetAddress registrarAddress,
ListeningPoint srcListeningPoint)
ContactHeader getContactHeader(InetAddress targetAddress,
ListeningPoint srcListeningPoint)
throws OperationFailedException
{
ContactHeader registrationContactHeader = null;
@ -1362,7 +1358,7 @@ ContactHeader getRegistrationContactHeader(InetAddress registrarAddress,
{
InetSocketAddress localAddress = SipActivator
.getNetworkAddressManagerService()
.getPublicAddressFor(registrarAddress
.getPublicAddressFor(targetAddress
, srcListeningPoint.getPort());
SipURI contactURI = addressFactory.createSipURI(

@ -301,7 +301,7 @@ void register()
//Contact Header (should contain IP)
ContactHeader contactHeader
= sipProvider.getRegistrationContactHeader(
= sipProvider.getContactHeader(
registrarAddress, getRegistrarListeningPoint());
//add expires in the contact header as well in case server likes it
@ -737,7 +737,7 @@ public InetAddress getRegistrarAddress()
* @return the listening point that should be used for communiction with our
* current registrar.
*/
private ListeningPoint getRegistrarListeningPoint()
ListeningPoint getRegistrarListeningPoint()
{
return sipProvider.getListeningPoint(registrarURI.getTransportParam());
}

Loading…
Cancel
Save