Here is my week report, Dtmf on RTP is building quickly :
1 - Transformer refactoring :
I refactor TransformConnector as a less specialized class : Connector.
Now a Connector can do transformation or NOT. (Transformer are used in
A connector is create like this :
connector = new Connector(bindAddress);
If you want this connector to do packetTransformation you just add a
TransformEngine like this :
ZRTPTransformEngine engine = new ZRTPTransformEngine();
With the connector you can inject packet (in progress, not finished)
connector.getDataOutputStream().write(buffer, offset, length);
Here is where i have problems :
When I call this function I have no error, but no DTMF packet are sent.
I did some debug :
int l = connector.getDataOutputStream().write(buffer, offset, length);
System.out.println("send DTMF "+dtmfTone+" len = "+length+" sent : "+l);
This is what I see :
send DTMF 0 len = 16 sent : 16
InetAddress is null. I think this is why nothing is sent.
An other thing, actually I am generating DtmfPacket, and the SequenceNumber
and Timestamp field are 0xFFFF....
I need those values. So I think that I will clone an audio packet, transform
it in a dtmf packet, and inject it using the connector. In so doing I keep
the timestamp and Sequence number.
2 - Configuration :
Now there is an option in the advanced SIP configuration called "Send DTMF
Tone on RTP: RFC4733".
You can see it in the screenshot
Now I need to get the configuration value in the media package. It looks
3 - Communication between OperationSetDTMF and CallSessionImpl :
OperationSetDTMF know when digits are pressed, CallSessionImpl has a
connector where I can inject packet, so I need communication between this
In order to do it I added a function in the CallSession interface :
And now I am able to call this function in OperationSetDTMF like this :
CallSipImpl call = (CallSipImpl) callParticipant.getCall();
CallSession cs = call.getMediaCallSession();
I don't know if it's the good way to do it. If not tell me, I will correct
4 - OperationSetDtmf like a dispatcher :
Because there is two ways to send Dtmf packets (RTP and SIP INFO),
OperationSetDTMF dispatch the sendDtmf(tone) call to DtmfRtpHandler or to
You can find the sources in the zip.
net.zip (554 KB)