@Override
public String toString()
{
final StringBuffer sb;
final AsteriskChannel dialedChannel;
final AsteriskChannel dialingChannel;
final AsteriskChannel linkedChannel;
sb = new StringBuffer("AsteriskChannel[");
synchronized (this)
{
sb.append("id='").append(getId()).append("',");
sb.append("name='").append(getName()).append("',");
sb.append("callerId='").append(getCallerId()).append("',");
sb.append("state='").append(getState()).append("',");
sb.append("account='").append(getAccount()).append("',");
sb.append("dateOfCreation=").append(getDateOfCreation()).append(",");
dialedChannel = this.dialedChannel;
dialingChannel = this.dialingChannel;
linkedChannel = this.linkedChannel;
}
if (dialedChannel == null)
{
sb.append("dialedChannel=null,");
}
else
{
sb.append("dialedChannel=AsteriskChannel[");
synchronized (dialedChannel)
{
sb.append("id='").append(dialedChannel.getId()).append("',");
sb.append("name='").append(dialedChannel.getName()).append("'],");
}
}
if (dialingChannel == null)
{
sb.append("dialingChannel=null,");
}
else
{
sb.append("dialingChannel=AsteriskChannel[");
synchronized (dialingChannel)
{
sb.append("id='").append(dialingChannel.getId()).append("',");
sb.append("name='").append(dialingChannel.getName()).append("'],");
}
}
if (linkedChannel == null)
{
sb.append("linkedChannel=null");
}
else
{
sb.append("linkedChannel=AsteriskChannel[");
synchronized (linkedChannel)
{
sb.append("id='").append(linkedChannel.getId()).append("',");
sb.append("name='").append(linkedChannel.getName()).append("']");
}
}
sb.append("]");
return sb.toString();