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
34 changes: 34 additions & 0 deletions src/mod/endpoints/mod_sofia/sofia_presence.c
Original file line number Diff line number Diff line change
Expand Up @@ -2234,6 +2234,23 @@ static void _send_presence_notify(sofia_profile_t *profile,
sofia_transport_t transport = sofia_glue_str2transport(tp);

switch (transport) {
char * colon;
char * at;
char * username;
int username_lenght;

case SOFIA_TRANSPORT_WSS:
switch_strdup(username, full_from);
colon = strchr(username, ':');
at = strchr(username, '@');
username_lenght = at - colon;
username = colon;
username[username_lenght] = '\0';
contact = switch_mprintf("sip%s@%s:%s;transport=wss", username, remote_ip, remote_port);

contact_str = profile->public_url;

break;
case SOFIA_TRANSPORT_TCP:
contact_str = profile->tcp_public_contact;
break;
Expand All @@ -2249,6 +2266,23 @@ static void _send_presence_notify(sofia_profile_t *profile,
} else {
sofia_transport_t transport = sofia_glue_str2transport(tp);
switch (transport) {
char * colon;
char * at;
char * username;
int username_lenght;

case SOFIA_TRANSPORT_WSS:
switch_strdup(username, full_from);
colon = strchr(username, ':');
at = strchr(username, '@');
username_lenght = at - colon;
username = colon;
username[username_lenght] = '\0';
contact = switch_mprintf("sip%s@%s:%s;transport=wss", username, remote_ip, remote_port);

contact_str = profile->url;

break;
case SOFIA_TRANSPORT_TCP:
contact_str = profile->tcp_contact;
break;
Expand Down
Loading