예제 #1
0
void CMyPhoneEndPoint::OnConnectionEstablished(H323Connection & connection, const PString & token)
{
	m_dialog->m_token = token;
	CString goodName = (LPCTSTR)connection.GetRemotePartyName();
	// store last number in combobox
	if(!connection.HadAnsweredCall())
	{
		m_dialog->PhoneBookAddCall(1, CString((LPCTSTR)connection.GetRemotePartyName()), m_dialog->GetSimpleAdr(CString((LPCTSTR)connection.GetRemotePartyAddress())));
		m_dialog->StoreDestonation(goodName /*(const char *)connection.GetRemotePartyName()*/);
	}
	else
	{
		// store in Address Book
		m_dialog->PhoneBookAddCall(2, CString((LPCTSTR)connection.GetRemotePartyName()), m_dialog->GetSimpleAdr(CString((LPCTSTR)connection.GetRemotePartyAddress())));
		if(m_dialog->autoAddInAddr)
			m_dialog->StoreDestonation(goodName /*(const char *)connection.GetRemotePartyName()*/, TRUE);
	}
	m_dialog->OnConnectionEstablished(m_dialog->FindContactName(connection) /*(const char *)connection.GetRemotePartyName()*/);
}