[sip-comm-dev] [PATCH] Fix sending DTMF to CallParticipant (UI related)


#1

Hi all,

Please, find enclosed my first patch to this great community.
It fixes a couple of bugs discovered when sending DTMF codes to
CallParticipants in the DialPanel.

Hope this helps!
Best Regards,
Javier Mendiara Cañardo

UI-DialDTMF.patch (5.31 KB)


#2

Hi Javier,

Thanks for the patch! I have already committed the part that fixes the NullPointerException in the dialpad during a call. I'm not sure though about the "if(parentCallPanel == null)" check that you make. Could you tell us more about what problem does this code fix?

Thanks!
Yana

Javier Mendiara Ca�ardo wrote:

···

Hi all,

Please, find enclosed my first patch to this great community.
It fixes a couple of bugs discovered when sending DTMF codes to
CallParticipants in the DialPanel.

Hope this helps!
Best Regards,
Javier Mendiara Ca�ardo

------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Yes sure! :wink:

One bug was the NullPointerException that you identified.
The other bug was in DialPanel.sendDtmfTone. In this function you go
through all callParticipants using an Iterator. But the Iterator
interface doesn't allow you to rewind once it !hasNext(). So, If you
wanted to send multiple DTMFs codes to the callParticipants, without
the patch , only the first DTMF code was sent, because the Iterator
was in the last position and !hasNext() in the following calls to
sendDtmfTone. This is why I'm creating in
public DialPanel(Iterator<CallParticipant> callParticipants),
a new LinkedList with the results of the Iterator.next(), and in
sendDtmfTone I obtain the Iterator for each DTMF code the User wants
to send.
Therefore, this.callParticipants was not needed anymore, and I choose
to drop it from the code. But you discriminate in
DialPanel.mouseReleased(MouseEvent e)
which constructor from the two available was being called using
if(callParticipants != null)
so I changed this to
if(parentCallPanel == null)
that is another way to do the same with the current code organization.

Best regards,
Javier

PS: Nice design :wink:

···

2008/9/25 Yana Stamcheva <yana.stamcheva@gmail.com>:

Hi Javier,

Thanks for the patch! I have already committed the part that fixes the
NullPointerException in the dialpad during a call. I'm not sure though about
the "if(parentCallPanel == null)" check that you make. Could you tell us
more about what problem does this code fix?

Thanks!
Yana

Javier Mendiara Cañardo wrote:

Hi all,

Please, find enclosed my first patch to this great community.
It fixes a couple of bugs discovered when sending DTMF codes to
CallParticipants in the DialPanel.

Hope this helps!
Best Regards,
Javier Mendiara Cañardo

------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

Hi Javier,

Absolutely correct:) Good catch!

The rest of your patch is committed and ack-ed on our contributors page.

Thanks!
Yana

Javier Mendiara Ca�ardo wrote:

···

Yes sure! :wink:

One bug was the NullPointerException that you identified.
The other bug was in DialPanel.sendDtmfTone. In this function you go
through all callParticipants using an Iterator. But the Iterator
interface doesn't allow you to rewind once it !hasNext(). So, If you
wanted to send multiple DTMFs codes to the callParticipants, without
the patch , only the first DTMF code was sent, because the Iterator
was in the last position and !hasNext() in the following calls to
sendDtmfTone. This is why I'm creating in
public DialPanel(Iterator<CallParticipant> callParticipants),
a new LinkedList with the results of the Iterator.next(), and in
sendDtmfTone I obtain the Iterator for each DTMF code the User wants
to send.
Therefore, this.callParticipants was not needed anymore, and I choose
to drop it from the code. But you discriminate in
DialPanel.mouseReleased(MouseEvent e)
which constructor from the two available was being called using
if(callParticipants != null)
so I changed this to
if(parentCallPanel == null)
that is another way to do the same with the current code organization.

Best regards,
Javier

PS: Nice design :wink:

2008/9/25 Yana Stamcheva <yana.stamcheva@gmail.com>:

Hi Javier,

Thanks for the patch! I have already committed the part that fixes the
NullPointerException in the dialpad during a call. I'm not sure though about
the "if(parentCallPanel == null)" check that you make. Could you tell us
more about what problem does this code fix?

Thanks!
Yana

Javier Mendiara Ca�ardo wrote:

Hi all,

Please, find enclosed my first patch to this great community.
It fixes a couple of bugs discovered when sending DTMF codes to
CallParticipants in the DialPanel.

Hope this helps!
Best Regards,
Javier Mendiara Ca�ardo

------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net