Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -1890,15 +1890,18 @@ int agent_send_turn_allocate_request(juice_agent_t *agent, const agent_stun_entr
msg.msg_method = method;
memcpy(msg.transaction_id, entry->transaction_id, STUN_TRANSACTION_ID_SIZE);

msg.credentials = entry->turn->credentials;
msg.lifetime = TURN_LIFETIME / 1000; // seconds

// Include allocation attributes in Allocate request only
if (method == STUN_METHOD_ALLOCATE) {
msg.requested_transport = true;
}

const char *password = *msg.credentials.nonce != '\0' ? entry->turn->password : NULL;
const char *password = NULL;
if(*entry->turn->credentials.nonce != '\0') {
msg.credentials = entry->turn->credentials;
password = entry->turn->password;
}

char buffer[BUFFER_SIZE];
int size = stun_write(buffer, BUFFER_SIZE, &msg, password);
Expand Down