Skip to content

Commit

Permalink
Adds custom header to the outgoing call containing the room name.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Nov 5, 2015
1 parent 9b3dc7b commit a263b40
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion src/org/jitsi/jigasi/GatewaySession.java
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,38 @@ Exception onConferenceCallStarted(Call jvbConferenceCall)
//}

// Make an outgoing call
OperationSetBasicTelephony tele
final OperationSetBasicTelephony tele
= sipProvider.getOperationSet(
OperationSetBasicTelephony.class);
// add listener to detect call creation, and add extra headers
// before inviting, and remove the listener when job is done
tele.addCallListener(new CallListener()
{
@Override
public void incomingCallReceived(CallEvent callEvent)
{}

@Override
public void outgoingCallCreated(CallEvent callEvent)
{
String roomName = getJvbRoomName();
if(roomName != null)
{
Call call = callEvent.getSourceCall();
call.setData("EXTRA_HEADER_NAME.1",
"Jitsi-Conference-Room");
call.setData("EXTRA_HEADER_VALUE.1", roomName);
}

tele.removeCallListener(this);
}

@Override
public void callEnded(CallEvent callEvent)
{
tele.removeCallListener(this);
}
});
try
{
this.call = tele.createCall(destination);
Expand Down

0 comments on commit a263b40

Please sign in to comment.