6 * Copyright (C) 2010-2019 SIPE Project <http://sipe.sourceforge.net/>
7 * Copyright (C) 2009 pier11 <pier11@operamail.com>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 * Documentation references:
28 * Microsoft DevNet: [MS-CONFIM]: Centralized Conference Control Protocol:
29 * Instant Messaging Extensions
30 * <http://msdn.microsoft.com/en-us/library/cc431500%28v=office.12%29.aspx>
44 #include "sipe-common.h"
46 #include "sip-transport.h"
47 #include "sipe-backend.h"
48 #include "sipe-buddy.h"
49 #include "sipe-chat.h"
50 #include "sipe-conf.h"
51 #include "sipe-core.h"
52 #include "sipe-core-private.h"
53 #include "sipe-appshare.h"
54 #include "sipe-dialog.h"
55 #include "sipe-http.h"
57 #include "sipe-media.h"
59 #include "sipe-session.h"
60 #include "sipe-subscriptions.h"
61 #include "sipe-user.h"
62 #include "sipe-utils.h"
66 * Invite counterparty to join conference.
67 * @param focus_uri (%s)
68 * @param subject (%s) of conference
70 #define SIPE_SEND_CONF_INVITE \
71 "<Conferencing version=\"2.0\">"\
72 "<focus-uri>%s</focus-uri>"\
73 "<subject>%s</subject>"\
74 "<im available=\"true\">"\
80 sipe_conf_check_for_lync_url(struct sipe_core_private
*sipe_private
,
83 static struct transaction
*
84 cccp_request(struct sipe_core_private
*sipe_private
, const gchar
*method
,
85 const gchar
*with
, struct sip_dialog
*dialog
,
86 TransCallback callback
, const gchar
*body
, ...)
92 gchar
*self
= sip_uri_self(sipe_private
);
96 struct transaction
*trans
;
98 headers
= g_strdup_printf(
99 "Supported: ms-sender\r\n"
101 "Content-Type: application/cccp+xml\r\n",
102 sipe_private
->contact
);
104 /* TODO: put request_id to queue to further compare with incoming one */
105 request
= g_strdup_printf(
106 "<?xml version=\"1.0\"?>"
107 "<request xmlns=\"urn:ietf:params:xml:ns:cccp\" "
108 "xmlns:mscp=\"http://schemas.microsoft.com/rtc/2005/08/cccpextensions\" "
117 sipe_private
->cccp_request_id
++,
121 va_start(args
, body
);
122 request_body
= g_strdup_vprintf(request
, args
);
127 trans
= sip_transport_request(sipe_private
,
137 g_free(request_body
);
143 process_conf_get_capabilities(SIPE_UNUSED_PARAMETER
struct sipe_core_private
*sipe_private
,
145 SIPE_UNUSED_PARAMETER
struct transaction
*trans
)
147 if (msg
->response
>= 400) {
148 SIPE_DEBUG_INFO_NOFORMAT("process_conf_get_capabilities: "
149 "getConferencingCapabilities failed.");
152 if (msg
->response
== 200) {
153 sipe_xml
*xn_response
= sipe_xml_parse(msg
->body
, msg
->bodylen
);
154 const sipe_xml
*node
;
155 gchar
*default_region
;
157 if (!sipe_strequal("success", sipe_xml_attribute(xn_response
, "code"))) {
161 node
= sipe_xml_child(xn_response
, "getConferencingCapabilities/mcu-types/mcuType");
162 for (;node
; node
= sipe_xml_twin(node
)) {
163 sipe_private
->conf_mcu_types
=
164 g_slist_append(sipe_private
->conf_mcu_types
,
165 sipe_xml_data(node
));
168 g_hash_table_remove_all(sipe_private
->access_numbers
);
169 node
= sipe_xml_child(xn_response
, "getConferencingCapabilities/pstn-bridging/access-numbers/region");
170 for (;node
; node
= sipe_xml_twin(node
)) {
171 gchar
*name
= g_strdup(sipe_xml_attribute(node
, "name"));
172 gchar
*number
= sipe_xml_data(sipe_xml_child(node
, "access-number/number"));
173 if (name
&& number
) {
174 g_hash_table_insert(sipe_private
->access_numbers
, name
, number
);
178 node
= sipe_xml_child(xn_response
, "getConferencingCapabilities/pstn-bridging/access-numbers/default-region");
179 default_region
= sipe_xml_data(node
);
180 if (default_region
) {
181 sipe_private
->default_access_number
=
182 g_hash_table_lookup(sipe_private
->access_numbers
, default_region
);
184 g_free(default_region
);
186 sipe_xml_free(xn_response
);
193 sipe_conf_get_capabilities(struct sipe_core_private
*sipe_private
)
195 cccp_request(sipe_private
, "SERVICE",
196 sipe_private
->focus_factory_uri
,
198 process_conf_get_capabilities
,
199 "<getConferencingCapabilities />");
203 sipe_conf_supports_mcu_type(struct sipe_core_private
*sipe_private
,
206 return g_slist_find_custom(sipe_private
->conf_mcu_types
, type
,
207 (GCompareFunc
)g_strcmp0
) != NULL
;
211 * Generates random GUID.
212 * This method is borrowed from pidgin's msnutils.c
217 return g_strdup_printf("%4X%4X-%4X-%4X-%4X-%4X%4X%4X",
218 rand() % 0xAAFF + 0x1111,
219 rand() % 0xAAFF + 0x1111,
220 rand() % 0xAAFF + 0x1111,
221 rand() % 0xAAFF + 0x1111,
222 rand() % 0xAAFF + 0x1111,
223 rand() % 0xAAFF + 0x1111,
224 rand() % 0xAAFF + 0x1111,
225 rand() % 0xAAFF + 0x1111);
228 /** Invite us to the focus callback */
230 process_invite_conf_focus_response(struct sipe_core_private
*sipe_private
,
232 SIPE_UNUSED_PARAMETER
struct transaction
*trans
)
234 struct sip_session
*session
= NULL
;
235 char *focus_uri
= sipmsg_parse_to_address(msg
);
237 session
= sipe_session_find_conference(sipe_private
, focus_uri
);
240 SIPE_DEBUG_INFO("process_invite_conf_focus_response: unable to find conf session with focus=%s", focus_uri
);
245 if (!session
->focus_dialog
) {
246 SIPE_DEBUG_INFO_NOFORMAT("process_invite_conf_focus_response: session's focus_dialog is NULL");
251 sipe_dialog_parse(session
->focus_dialog
, msg
, TRUE
);
253 if (msg
->response
>= 200) {
254 /* send ACK to focus */
255 session
->focus_dialog
->cseq
= 0;
256 sip_transport_ack(sipe_private
, session
->focus_dialog
);
257 session
->focus_dialog
->outgoing_invite
= NULL
;
258 session
->focus_dialog
->is_established
= TRUE
;
261 if (msg
->response
>= 400) {
262 gchar
*reason
= sipmsg_get_ms_diagnostics_reason(msg
);
264 SIPE_DEBUG_INFO_NOFORMAT("process_invite_conf_focus_response: INVITE response is not 200. Failed to join focus.");
265 sipe_backend_notify_error(SIPE_CORE_PUBLIC
,
266 _("Failed to join the conference"),
267 reason
? reason
: _("no reason given"));
270 sipe_session_remove(sipe_private
, session
);
273 } else if (msg
->response
== 200) {
274 sipe_xml
*xn_response
= sipe_xml_parse(msg
->body
, msg
->bodylen
);
275 const gchar
*code
= sipe_xml_attribute(xn_response
, "code");
276 if (sipe_strequal(code
, "success")) {
277 /* subscribe to focus */
278 sipe_subscribe_conference(sipe_private
,
279 session
->chat_session
->id
,
282 if (session
->is_call
)
283 sipe_core_media_connect_conference(SIPE_CORE_PUBLIC
,
284 session
->chat_session
);
287 sipe_xml_free(xn_response
);
295 parse_ocs_focus_uri(const gchar
*uri
)
297 const gchar
*confkey
;
303 // URI can have this prefix if it was typed in by the user
304 if (g_str_has_prefix(uri
, "meet:") || g_str_has_prefix(uri
, "conf:")) {
308 uri_len
= strlen(uri
);
310 if (!uri
|| !g_str_has_prefix(uri
, "sip:") ||
311 uri_len
== 4 || g_strstr_len(uri
, -1, "%")) {
315 confkey
= g_strstr_len(uri
, -1, "?");
317 /* TODO: Investigate how conf-key field should be used,
318 * ignoring for now */
319 uri_len
= confkey
- uri
;
322 return g_strndup(uri
, uri_len
);
326 extract_uri_from_html(const gchar
*body
,
328 guint prefix_skip_chars
)
331 const gchar
*start
= g_strstr_len(body
, -1, prefix
);
336 start
+= prefix_skip_chars
;
337 end
= strchr(start
, '"');
340 gchar
*html
= g_strndup(start
, end
- start
);
342 /* decode HTML entities */
343 gchar
*html_unescaped
= sipe_backend_markup_strip_html(html
);
346 if (!is_empty(html_unescaped
)) {
347 uri
= sipe_utils_uri_unescape(html_unescaped
);
350 g_free(html_unescaped
);
357 static void sipe_conf_lync_url_cb(struct sipe_core_private
*sipe_private
,
359 SIPE_UNUSED_PARAMETER GSList
*headers
,
361 gpointer callback_data
)
363 gchar
*uri
= callback_data
;
365 if (status
!= (guint
) SIPE_HTTP_STATUS_ABORTED
) {
366 gchar
*focus_uri
= NULL
;
370 * Extract focus URI from HTML, e.g.
372 * <a ... href="conf:sip:...ABCDEF%3Frequired..." ... >
374 gchar
*uri
= extract_uri_from_html(body
, "href=\"conf", 6);
375 focus_uri
= parse_ocs_focus_uri(uri
);
380 SIPE_DEBUG_INFO("sipe_conf_lync_url_cb: found focus URI"
383 sipe_conf_create(sipe_private
, NULL
, focus_uri
);
387 * If present, domainOwnerJoinLauncherUrl redirects to
388 * a page from where we still may extract the focus URI.
390 gchar
*launcher_url
= NULL
;
391 static const gchar
*launcher_url_prefix
[] = {
392 "var domainOwnerJoinLauncherUrl = \"",
393 "sb-data-domainOwnerJoinLauncherUrl=\"",
398 SIPE_DEBUG_INFO("sipe_conf_lync_url_cb: no focus URI "
399 "found from URL '%s'", uri
);
401 for (p
= launcher_url_prefix
; !launcher_url
&& *p
; ++p
) {
402 launcher_url
= extract_uri_from_html(body
,
408 sipe_conf_check_for_lync_url(sipe_private
, launcher_url
)) {
409 SIPE_DEBUG_INFO("sipe_conf_lync_url_cb: retrying with URL '%s'",
411 /* Ownership taken by sipe_conf_check_for_lync_url() */
416 error
= g_strdup_printf(_("Can't find a conference URI on this page:\n\n%s"),
419 sipe_backend_notify_error(SIPE_CORE_PUBLIC
,
420 _("Failed to join the conference"),
425 g_free(launcher_url
);
432 static gboolean
sipe_conf_check_for_lync_url(struct sipe_core_private
*sipe_private
,
435 struct sipe_http_request
*request
;
437 if (!(g_str_has_prefix(uri
, "https://") ||
438 g_str_has_prefix(uri
, "http://")))
441 /* URL points to a HTML page with the conference focus URI */
442 request
= sipe_http_request_get(sipe_private
,
445 sipe_conf_lync_url_cb
,
449 sipe_http_request_ready(request
);
456 static void sipe_conf_uri_error(struct sipe_core_private
*sipe_private
,
459 gchar
*error
= g_strdup_printf(_("\"%s\" is not a valid conference URI"),
461 sipe_backend_notify_error(SIPE_CORE_PUBLIC
,
462 _("Failed to join the conference"),
467 void sipe_core_conf_create(struct sipe_core_public
*sipe_public
,
469 const gchar
*organizer
,
470 const gchar
*meeting_id
)
472 struct sipe_core_private
*sipe_private
= SIPE_CORE_PRIVATE
;
474 /* SIP URI or HTTP URL */
476 gchar
*uri_ue
= sipe_utils_uri_unescape(uri
);
478 SIPE_DEBUG_INFO("sipe_core_conf_create: URI '%s' unescaped '%s'",
480 uri_ue
? uri_ue
: "<UNDEFINED>");
482 /* takes ownership of "uri_ue" if successful */
483 if (!sipe_conf_check_for_lync_url(sipe_private
, uri_ue
)) {
484 gchar
*focus_uri
= parse_ocs_focus_uri(uri_ue
);
487 sipe_conf_create(sipe_private
, NULL
, focus_uri
);
490 sipe_conf_uri_error(sipe_private
, uri
);
495 /* Organizer email and meeting ID */
496 } else if (organizer
&& meeting_id
) {
497 gchar
*tmp
= g_strdup_printf("sip:%s;gruu;opaque=app:conf:focus:id:%s",
498 organizer
, meeting_id
);
499 gchar
*focus_uri
= parse_ocs_focus_uri(tmp
);
501 SIPE_DEBUG_INFO("sipe_core_conf_create: organizer '%s' meeting ID '%s'",
506 sipe_conf_create(sipe_private
, NULL
, focus_uri
);
509 sipe_conf_uri_error(sipe_private
, tmp
);
513 sipe_backend_notify_error(SIPE_CORE_PUBLIC
,
514 _("Failed to join the conference"),
515 _("Incomplete conference information provided"));
519 /** Create new session with Focus URI */
521 sipe_conf_create(struct sipe_core_private
*sipe_private
,
522 struct sipe_chat_session
*chat_session
,
523 const gchar
*focus_uri
)
525 /* addUser request to the focus.
527 * focus_URI, from, endpoint_GUID
529 static const gchar CCCP_ADD_USER
[] =
531 "<conferenceKeys confEntity=\"%s\"/>"
532 "<ci:user xmlns:ci=\"urn:ietf:params:xml:ns:conference-info\" entity=\"%s\">"
534 "<ci:entry>attendee</ci:entry>"
536 "<ci:endpoint entity=\"{%s}\" "
537 "xmlns:msci=\"http://schemas.microsoft.com/rtc/2005/08/confinfoextensions\"/>"
542 struct sip_session
*session
= sipe_session_add_chat(sipe_private
,
547 session
->focus_dialog
= g_new0(struct sip_dialog
, 1);
548 session
->focus_dialog
->callid
= gencallid();
549 session
->focus_dialog
->with
= g_strdup(session
->chat_session
->id
);
550 session
->focus_dialog
->endpoint_GUID
= rand_guid();
551 session
->focus_dialog
->ourtag
= gentag();
553 self
= sip_uri_self(sipe_private
);
554 session
->focus_dialog
->outgoing_invite
=
555 cccp_request(sipe_private
, "INVITE",
556 session
->focus_dialog
->with
, session
->focus_dialog
,
557 process_invite_conf_focus_response
,
559 session
->focus_dialog
->with
, self
,
560 session
->focus_dialog
->endpoint_GUID
);
562 /* Rejoin existing session? */
564 SIPE_DEBUG_INFO("sipe_conf_create: rejoin '%s' (%s)",
567 sipe_backend_chat_rejoin(SIPE_CORE_PUBLIC
,
568 chat_session
->backend
,
570 chat_session
->title
);
577 /** Modify User Role */
579 sipe_conf_modify_user_role(struct sipe_core_private
*sipe_private
,
580 struct sip_session
*session
,
583 /* modifyUserRoles request to the focus. Makes user a leader.
588 static const gchar CCCP_MODIFY_USER_ROLES
[] =
590 "<userKeys confEntity=\"%s\" userEntity=\"%s\"/>"
591 "<user-roles xmlns=\"urn:ietf:params:xml:ns:conference-info\">"
592 "<entry>presenter</entry>"
594 "</modifyUserRoles>";
596 if (!session
->focus_dialog
|| !session
->focus_dialog
->is_established
) {
597 SIPE_DEBUG_INFO_NOFORMAT("sipe_conf_modify_user_role: no dialog with focus, exiting.");
601 cccp_request(sipe_private
, "INFO", session
->focus_dialog
->with
,
602 session
->focus_dialog
, NULL
,
603 CCCP_MODIFY_USER_ROLES
,
604 session
->focus_dialog
->with
, who
);
608 * Check conference lock status
610 sipe_chat_lock_status
sipe_core_chat_lock_status(struct sipe_core_public
*sipe_public
,
611 struct sipe_chat_session
*chat_session
)
613 struct sipe_core_private
*sipe_private
= SIPE_CORE_PRIVATE
;
614 sipe_chat_lock_status status
= SIPE_CHAT_LOCK_STATUS_NOT_ALLOWED
;
617 (chat_session
->type
== SIPE_CHAT_TYPE_CONFERENCE
)) {
618 struct sip_session
*session
= sipe_session_find_chat(sipe_private
,
621 gchar
*self
= sip_uri_self(sipe_private
);
623 /* Only operators are allowed to change the lock status */
624 if (sipe_backend_chat_is_operator(chat_session
->backend
, self
)) {
625 status
= session
->locked
?
626 SIPE_CHAT_LOCK_STATUS_LOCKED
:
627 SIPE_CHAT_LOCK_STATUS_UNLOCKED
;
638 * Modify Conference Lock
639 * Sends request to Focus.
640 * INFO method is a carrier of application/cccp+xml
643 sipe_core_chat_modify_lock(struct sipe_core_public
*sipe_public
,
644 struct sipe_chat_session
*chat_session
,
645 const gboolean locked
)
647 /* modifyConferenceLock request to the focus. Locks/unlocks conference.
650 * locked (%s) "true" or "false" values applicable
652 static const gchar CCCP_MODIFY_CONFERENCE_LOCK
[] =
653 "<modifyConferenceLock>"
654 "<conferenceKeys confEntity=\"%s\"/>"
655 "<locked>%s</locked>"
656 "</modifyConferenceLock>";
658 struct sipe_core_private
*sipe_private
= SIPE_CORE_PRIVATE
;
660 struct sip_session
*session
= sipe_session_find_chat(sipe_private
,
663 if (!session
) return;
664 if (!session
->focus_dialog
|| !session
->focus_dialog
->is_established
) {
665 SIPE_DEBUG_INFO_NOFORMAT("sipe_conf_modify_conference_lock: no dialog with focus, exiting.");
669 cccp_request(sipe_private
, "INFO", session
->focus_dialog
->with
,
670 session
->focus_dialog
, NULL
,
671 CCCP_MODIFY_CONFERENCE_LOCK
,
672 session
->focus_dialog
->with
,
673 locked
? "true" : "false");
676 /** Modify Delete User */
678 sipe_conf_delete_user(struct sipe_core_private
*sipe_private
,
679 struct sip_session
*session
,
682 /* deleteUser request to the focus. Removes a user from the conference.
687 static const gchar CCCP_DELETE_USER
[] =
689 "<userKeys confEntity=\"%s\" userEntity=\"%s\"/>"
692 if (!session
->focus_dialog
|| !session
->focus_dialog
->is_established
) {
693 SIPE_DEBUG_INFO_NOFORMAT("sipe_conf_delete_user: no dialog with focus, exiting.");
697 cccp_request(sipe_private
, "INFO", session
->focus_dialog
->with
,
698 session
->focus_dialog
, NULL
,
700 session
->focus_dialog
->with
, who
);
704 sipe_conf_announce_audio_mute_state(struct sipe_core_private
*sipe_private
,
705 struct sip_session
*session
,
708 // See [MS-CONFAV] 3.2.5.4 and 4.3
709 static const gchar CCCP_MODIFY_ENDPOINT_MEDIA
[] =
710 "<modifyEndpointMedia mscp:mcuUri=\"%s\""
711 " xmlns:mscp=\"http://schemas.microsoft.com/rtc/2005/08/cccpextensions\">"
712 "<mediaKeys confEntity=\"%s\" userEntity=\"%s\""
713 " endpointEntity=\"%s\" mediaId=\"%d\"/>"
715 " xmlns:ci=\"urn:ietf:params:xml:ns:conference-info\" id=\"%d\">"
716 "<ci:type>audio</ci:type>"
717 "<ci:status>%s</ci:status>"
718 "<media-ingress-filter"
719 " xmlns=\"http://schemas.microsoft.com/rtc/2005/08/confinfoextensions\">"
721 "</media-ingress-filter>"
723 "</modifyEndpointMedia>";
725 gchar
*mcu_uri
= sipe_conf_build_uri(session
->focus_dialog
->with
,
727 gchar
*self
= sip_uri_self(sipe_private
);
729 cccp_request(sipe_private
, "INFO", session
->focus_dialog
->with
,
730 session
->focus_dialog
, NULL
,
731 CCCP_MODIFY_ENDPOINT_MEDIA
,
732 mcu_uri
, session
->focus_dialog
->with
, self
,
733 session
->audio_video_entity
,
734 session
->audio_media_id
, session
->audio_media_id
,
735 is_muted
? "recvonly" : "sendrecv",
736 is_muted
? "block" : "unblock");
742 /** Invite counterparty to join conference callback */
744 process_invite_conf_response(struct sipe_core_private
*sipe_private
,
746 SIPE_UNUSED_PARAMETER
struct transaction
*trans
)
748 struct sip_dialog
*dialog
= g_new0(struct sip_dialog
, 1);
750 dialog
->callid
= g_strdup(sipmsg_find_header(msg
, "Call-ID"));
751 dialog
->cseq
= sipmsg_parse_cseq(msg
);
752 dialog
->with
= sipmsg_parse_to_address(msg
);
753 sipe_dialog_parse(dialog
, msg
, TRUE
);
755 if (msg
->response
>= 200) {
756 /* send ACK to counterparty */
758 sip_transport_ack(sipe_private
, dialog
);
759 dialog
->outgoing_invite
= NULL
;
760 dialog
->is_established
= TRUE
;
763 if (msg
->response
>= 400) {
764 SIPE_DEBUG_INFO("process_invite_conf_response: INVITE response is not 200. Failed to invite %s.", dialog
->with
);
765 /* @TODO notify user of failure to invite counterparty */
766 sipe_dialog_free(dialog
);
770 if (msg
->response
>= 200) {
771 struct sip_session
*session
= sipe_session_find_im(sipe_private
, dialog
->with
);
772 struct sip_dialog
*im_dialog
= sipe_dialog_find(session
, dialog
->with
);
774 /* close IM session to counterparty */
776 sip_transport_bye(sipe_private
, im_dialog
);
777 sipe_dialog_remove(session
, dialog
->with
);
781 sipe_dialog_free(dialog
);
786 * Invites counterparty to join conference.
789 sipe_invite_conf(struct sipe_core_private
*sipe_private
,
790 struct sip_session
*session
,
796 struct sip_dialog
*dialog
= NULL
;
798 /* It will be short lived special dialog.
799 * Will not be stored in session.
801 dialog
= g_new0(struct sip_dialog
, 1);
802 dialog
->callid
= gencallid();
803 dialog
->with
= g_strdup(who
);
804 dialog
->ourtag
= gentag();
806 contact
= get_contact(sipe_private
);
807 hdr
= g_strdup_printf(
808 "Supported: ms-sender\r\n"
810 "Content-Type: application/ms-conf-invite+xml\r\n",
814 body
= g_strdup_printf(
815 SIPE_SEND_CONF_INVITE
,
816 session
->chat_session
->id
,
817 session
->subject
? session
->subject
: ""
820 sip_transport_invite(sipe_private
,
824 process_invite_conf_response
);
826 sipe_dialog_free(dialog
);
831 /** Create conference callback */
833 process_conf_add_response(struct sipe_core_private
*sipe_private
,
835 struct transaction
*trans
)
837 if (msg
->response
>= 400) {
838 SIPE_DEBUG_INFO_NOFORMAT("process_conf_add_response: SERVICE response is not 200. Failed to create conference.");
839 /* @TODO notify user of failure to create conference */
842 if (msg
->response
== 200) {
843 sipe_xml
*xn_response
= sipe_xml_parse(msg
->body
, msg
->bodylen
);
844 if (sipe_strequal("success", sipe_xml_attribute(xn_response
, "code")))
846 gchar
*who
= trans
->payload
->data
;
847 const sipe_xml
*xn_conference_info
= sipe_xml_child(xn_response
, "addConference/conference-info");
848 struct sip_session
*session
= sipe_conf_create(sipe_private
,
850 sipe_xml_attribute(xn_conference_info
,
853 SIPE_DEBUG_INFO("process_conf_add_response: session->focus_uri=%s",
854 session
->chat_session
->id
);
856 session
->pending_invite_queue
= sipe_utils_slist_insert_unique_sorted(session
->pending_invite_queue
,
858 (GCompareFunc
)strcmp
,
861 sipe_xml_free(xn_response
);
868 * Creates conference.
871 sipe_conf_add(struct sipe_core_private
*sipe_private
,
874 gchar
*conference_id
;
875 struct transaction
*trans
;
876 time_t expiry
= time(NULL
) + 7*60*60; /* 7 hours */
879 /* addConference request to the focus factory.
881 * conference_id (%s) Ex.: 8386E6AEAAA41E4AA6627BA76D43B6D1
882 * expiry_time (%s) Ex.: 2009-07-13T17:57:09Z
883 * conference_view (%s) Ex.: <msci:entity-view entity="chat"/>
885 static const gchar CCCP_ADD_CONFERENCE
[] =
887 "<ci:conference-info xmlns:ci=\"urn:ietf:params:xml:ns:conference-info\" "
889 "xmlns:msci=\"http://schemas.microsoft.com/rtc/2005/08/confinfoextensions\">"
890 "<ci:conference-description>"
892 "<msci:conference-id>%s</msci:conference-id>"
893 "<msci:expiry-time>%s</msci:expiry-time>"
894 "<msci:admission-policy>openAuthenticated</msci:admission-policy>"
895 "</ci:conference-description>"
896 "<msci:conference-view>%s</msci:conference-view>"
897 "</ci:conference-info>"
900 static const gchar
*DESIRED_MCU_TYPES
[] = {
906 "applicationsharing",
911 GString
*conference_view
= g_string_new("");
914 for (type
= DESIRED_MCU_TYPES
; *type
; ++type
) {
915 if (sipe_conf_supports_mcu_type(sipe_private
, *type
)) {
916 g_string_append(conference_view
, "<msci:entity-view entity=\"");
917 g_string_append(conference_view
, *type
);
918 g_string_append(conference_view
, "\"/>");
922 expiry_time
= sipe_utils_time_to_str(expiry
);
923 conference_id
= genconfid();
924 trans
= cccp_request(sipe_private
, "SERVICE", sipe_private
->focus_factory_uri
,
925 NULL
, process_conf_add_response
,
927 conference_id
, expiry_time
, conference_view
->str
);
928 g_free(conference_id
);
930 g_string_free(conference_view
, TRUE
);
933 struct transaction_payload
*payload
= g_new0(struct transaction_payload
, 1);
935 payload
->destroy
= g_free
;
936 payload
->data
= g_strdup(who
);
937 trans
->payload
= payload
;
942 accept_incoming_invite_conf(struct sipe_core_private
*sipe_private
,
947 struct sip_session
*session
;
949 /* acknowledge invite */
950 sipmsg_update_to_header_tag(msg
);
951 sip_transport_response(sipe_private
, msg
, 200, "OK", NULL
);
953 /* add self to conf */
954 session
= sipe_conf_create(sipe_private
, NULL
, focus_uri
);
955 session
->is_call
= audio
;
958 struct conf_accept_ctx
{
961 struct sipe_user_ask_ctx
*ask_ctx
;
963 SipeUserAskCb accept_cb
;
964 SipeUserAskCb decline_cb
;
970 conf_accept_ctx_free(struct conf_accept_ctx
*ctx
)
972 g_return_if_fail(ctx
!= NULL
);
974 sipmsg_free(ctx
->msg
);
975 g_free(ctx
->focus_uri
);
980 conf_accept_cb(struct sipe_core_private
*sipe_private
, struct conf_accept_ctx
*ctx
)
982 accept_incoming_invite_conf(sipe_private
, ctx
->focus_uri
, TRUE
, ctx
->msg
);
986 conf_decline_cb(struct sipe_core_private
*sipe_private
, struct conf_accept_ctx
*ctx
)
988 sip_transport_response(sipe_private
,
990 603, "Decline", NULL
);
994 sipe_conf_cancel_unaccepted(struct sipe_core_private
*sipe_private
,
997 const gchar
*callid1
= msg
? sipmsg_find_header(msg
, "Call-ID") : NULL
;
998 GSList
*it
= sipe_private
->sessions_to_accept
;
1000 struct conf_accept_ctx
*ctx
= it
->data
;
1001 const gchar
*callid2
= NULL
;
1003 if (msg
&& ctx
->msg
)
1004 callid2
= sipmsg_find_header(ctx
->msg
, "Call-ID");
1006 if (sipe_strequal(callid1
, callid2
)) {
1010 sip_transport_response(sipe_private
, ctx
->msg
,
1011 487, "Request Terminated", NULL
);
1014 sip_transport_response(sipe_private
, msg
, 200, "OK", NULL
);
1016 sipe_user_close_ask(ctx
->ask_ctx
);
1017 conf_accept_ctx_free(ctx
);
1022 sipe_private
->sessions_to_accept
=
1023 g_slist_delete_link(sipe_private
->sessions_to_accept
, tmp
);
1033 accept_invitation_cb(struct sipe_core_private
*sipe_private
, gpointer data
)
1035 struct conf_accept_ctx
*ctx
= data
;
1037 sipe_private
->sessions_to_accept
=
1038 g_slist_remove(sipe_private
->sessions_to_accept
, ctx
);
1040 if (ctx
->accept_cb
) {
1041 ctx
->accept_cb(sipe_private
, ctx
);
1044 conf_accept_ctx_free(ctx
);
1048 decline_invitation_cb(struct sipe_core_private
*sipe_private
, gpointer data
)
1050 struct conf_accept_ctx
*ctx
= data
;
1052 sipe_private
->sessions_to_accept
=
1053 g_slist_remove(sipe_private
->sessions_to_accept
, ctx
);
1055 if (ctx
->decline_cb
) {
1056 ctx
->decline_cb(sipe_private
, ctx
);
1059 conf_accept_ctx_free(ctx
);
1063 ask_accept_invitation(struct sipe_core_private
*sipe_private
,
1064 const gchar
*focus_uri
,
1065 const gchar
*question
,
1067 SipeUserAskCb accept_cb
,
1068 SipeUserAskCb decline_cb
,
1073 gchar
*question_str
;
1074 struct conf_accept_ctx
*ctx
;
1076 parts
= g_strsplit(focus_uri
, ";", 2);
1077 alias
= sipe_buddy_get_alias(sipe_private
, parts
[0]);
1079 question_str
= g_strdup_printf("%s %s", alias
? alias
: parts
[0], question
);
1084 ctx
= g_new0(struct conf_accept_ctx
, 1);
1085 sipe_private
->sessions_to_accept
=
1086 g_slist_append(sipe_private
->sessions_to_accept
, ctx
);
1088 ctx
->focus_uri
= g_strdup(focus_uri
);
1089 ctx
->msg
= msg
? sipmsg_copy(msg
) : NULL
;
1090 ctx
->accept_cb
= accept_cb
;
1091 ctx
->decline_cb
= decline_cb
;
1092 ctx
->user_data
= user_data
;
1093 ctx
->ask_ctx
= sipe_user_ask(sipe_private
, question_str
,
1094 _("Accept"), accept_invitation_cb
,
1095 _("Decline"), decline_invitation_cb
,
1098 g_free(question_str
);
1102 ask_accept_voice_conference(struct sipe_core_private
*sipe_private
,
1103 const gchar
*focus_uri
,
1105 SipeUserAskCb accept_cb
,
1106 SipeUserAskCb decline_cb
)
1109 const gchar
*novv_note
;
1114 novv_note
= _("\n\nAs this client was not compiled with voice call "
1115 "support, if you accept, you will be able to contact "
1116 "the other participants only via IM session.");
1119 question
= g_strdup_printf(_("wants to invite you "
1120 "to a conference call%s"), novv_note
);
1122 ask_accept_invitation(sipe_private
, focus_uri
, question
, msg
,
1123 accept_cb
, decline_cb
, NULL
);
1129 process_incoming_invite_conf(struct sipe_core_private
*sipe_private
,
1132 sipe_xml
*xn_conferencing
= sipe_xml_parse(msg
->body
, msg
->bodylen
);
1133 const sipe_xml
*xn_focus_uri
= sipe_xml_child(xn_conferencing
, "focus-uri");
1134 const sipe_xml
*xn_audio
= sipe_xml_child(xn_conferencing
, "audio");
1135 gchar
*focus_uri
= sipe_xml_data(xn_focus_uri
);
1136 gboolean audio
= sipe_strequal(sipe_xml_attribute(xn_audio
, "available"), "true");
1138 sipe_xml_free(xn_conferencing
);
1140 SIPE_DEBUG_INFO("We have received invitation to Conference. Focus URI=%s", focus_uri
);
1143 sip_transport_response(sipe_private
, msg
, 180, "Ringing", NULL
);
1144 ask_accept_voice_conference(sipe_private
, focus_uri
, msg
,
1145 (SipeUserAskCb
) conf_accept_cb
,
1146 (SipeUserAskCb
) conf_decline_cb
);
1149 accept_incoming_invite_conf(sipe_private
, focus_uri
, FALSE
, msg
);
1158 process_conference_av_endpoint(const sipe_xml
*endpoint
,
1159 const gchar
*user_uri
,
1160 const gchar
*self_uri
,
1161 struct sip_session
*session
)
1163 const sipe_xml
*media
;
1164 const gchar
*new_entity
;
1166 if (!sipe_strequal(user_uri
, self_uri
)) {
1167 /* We are interested only in our own endpoint data. */
1171 new_entity
= sipe_xml_attribute(endpoint
, "entity");
1172 if (!sipe_strequal(session
->audio_video_entity
, new_entity
)) {
1173 g_free(session
->audio_video_entity
);
1174 session
->audio_video_entity
= g_strdup(new_entity
);
1177 session
->audio_media_id
= 0;
1179 media
= sipe_xml_child(endpoint
, "media");
1180 for (; media
; media
= sipe_xml_twin(media
)) {
1181 gchar
*type
= sipe_xml_data(sipe_xml_child(media
, "type"));
1183 if (sipe_strequal(type
, "audio")) {
1184 session
->audio_media_id
=
1185 sipe_xml_int_attribute(media
, "id", 0);
1190 if (session
->audio_media_id
!= 0) {
1197 call_accept_cb(struct sipe_core_private
*sipe_private
, struct conf_accept_ctx
*ctx
)
1199 struct sip_session
*session
;
1200 session
= sipe_session_find_conference(sipe_private
, ctx
->focus_uri
);
1203 sipe_core_media_connect_conference(SIPE_CORE_PUBLIC
,
1204 session
->chat_session
);
1208 #ifdef HAVE_APPSHARE
1210 sipe_core_conf_get_appshare_role(struct sipe_core_public
*sipe_public
,
1211 struct sipe_chat_session
*chat_session
)
1215 struct sipe_media_call
*call
;
1217 mcu_uri
= sipe_conf_build_uri(chat_session
->id
, "applicationsharing");
1219 call
= sipe_media_call_find(SIPE_CORE_PRIVATE
, mcu_uri
);
1224 return sipe_appshare_get_role(call
);
1228 return SIPE_APPSHARE_ROLE_NONE
;
1232 process_conference_appshare_endpoint(const sipe_xml
*endpoint
)
1234 gboolean presentation_added
= FALSE
;
1235 const sipe_xml
*media
;
1237 for (media
= sipe_xml_child(endpoint
, "media");
1238 media
&& !presentation_added
;
1239 media
= sipe_xml_twin(media
)) {
1244 type
= sipe_xml_data(sipe_xml_child(media
, "type"));
1245 media_state
= sipe_xml_data(sipe_xml_child(media
, "media-state"));
1246 status
= sipe_xml_data(sipe_xml_child(media
, "status"));
1248 if (sipe_strequal(type
, "applicationsharing") &&
1249 sipe_strequal(media_state
, "connected") &&
1250 sipe_strequal(status
, "sendonly")) {
1251 presentation_added
= TRUE
;
1255 g_free(media_state
);
1259 return(presentation_added
);
1261 #endif // HAVE_APPSHARE
1265 sipe_process_conference(struct sipe_core_private
*sipe_private
,
1268 sipe_xml
*xn_conference_info
;
1269 const sipe_xml
*node
;
1270 const sipe_xml
*xn_subject
;
1271 const gchar
*focus_uri
;
1272 struct sip_session
*session
;
1273 gboolean just_joined
= FALSE
;
1275 gboolean audio_was_added
= FALSE
;
1276 #ifdef HAVE_APPSHARE
1277 gboolean presentation_was_added
= FALSE
;
1281 if (msg
->response
!= 0 && msg
->response
!= 200) return;
1283 if (msg
->bodylen
== 0 || msg
->body
== NULL
|| !sipe_strequal(sipmsg_find_header(msg
, "Event"), "conference")) return;
1285 xn_conference_info
= sipe_xml_parse(msg
->body
, msg
->bodylen
);
1286 if (!xn_conference_info
) return;
1288 focus_uri
= sipe_xml_attribute(xn_conference_info
, "entity");
1289 session
= sipe_session_find_conference(sipe_private
, focus_uri
);
1292 SIPE_DEBUG_INFO("sipe_process_conference: unable to find conf session with focus=%s", focus_uri
);
1296 if (!session
->chat_session
->backend
) {
1297 gchar
*self
= sip_uri_self(sipe_private
);
1300 session
->chat_session
->backend
= sipe_backend_chat_create(SIPE_CORE_PUBLIC
,
1301 session
->chat_session
,
1302 session
->chat_session
->title
,
1305 /* @TODO ask for full state (re-subscribe) if it was a partial one -
1306 * this is to obtain full list of conference participants.
1312 if ((xn_subject
= sipe_xml_child(xn_conference_info
, "conference-description/subject"))) {
1313 g_free(session
->subject
);
1314 session
->subject
= sipe_xml_data(xn_subject
);
1315 sipe_backend_chat_topic(session
->chat_session
->backend
, session
->subject
);
1316 SIPE_DEBUG_INFO("sipe_process_conference: subject=%s", session
->subject
? session
->subject
: "");
1320 if (!session
->im_mcu_uri
) {
1321 for (node
= sipe_xml_child(xn_conference_info
, "conference-description/conf-uris/entry");
1323 node
= sipe_xml_twin(node
))
1325 gchar
*purpose
= sipe_xml_data(sipe_xml_child(node
, "purpose"));
1327 if (sipe_strequal("chat", purpose
)) {
1329 session
->im_mcu_uri
= sipe_xml_data(sipe_xml_child(node
, "uri"));
1330 SIPE_DEBUG_INFO("sipe_process_conference: im_mcu_uri=%s", session
->im_mcu_uri
);
1338 if (!session
->chat_session
->organizer
) {
1339 node
= sipe_xml_child(xn_conference_info
, "conference-description/organizer/display-name");
1341 session
->chat_session
->organizer
= sipe_xml_data(node
);
1346 if (!session
->chat_session
->join_url
) {
1347 node
= sipe_xml_child(xn_conference_info
, "conference-description/join-url");
1349 session
->chat_session
->join_url
= sipe_xml_data(node
);
1353 /* dial-in conference id */
1354 if (!session
->chat_session
->dial_in_conf_id
) {
1355 node
= sipe_xml_child(xn_conference_info
, "conference-description/pstn-access/id");
1357 session
->chat_session
->dial_in_conf_id
= sipe_xml_data(node
);
1362 for (node
= sipe_xml_child(xn_conference_info
, "users/user"); node
; node
= sipe_xml_twin(node
)) {
1363 const gchar
*user_uri
= sipe_xml_attribute(node
, "entity");
1364 const gchar
*state
= sipe_xml_attribute(node
, "state");
1365 gchar
*role
= sipe_xml_data(sipe_xml_child(node
, "roles/entry"));
1366 gboolean is_operator
= sipe_strequal(role
, "presenter");
1367 gboolean is_in_im_mcu
= FALSE
;
1368 gchar
*self
= sip_uri_self(sipe_private
);
1370 if (sipe_strequal("deleted", state
)) {
1371 if (sipe_backend_chat_find(session
->chat_session
->backend
, user_uri
)) {
1372 sipe_backend_chat_remove(session
->chat_session
->backend
,
1377 const sipe_xml
*endpoint
;
1378 for (endpoint
= sipe_xml_child(node
, "endpoint"); endpoint
; endpoint
= sipe_xml_twin(endpoint
)) {
1379 const gchar
*session_type
;
1380 gchar
*status
= sipe_xml_data(sipe_xml_child(endpoint
, "status"));
1381 gboolean connected
= sipe_strequal("connected", status
);
1387 session_type
= sipe_xml_attribute(endpoint
, "session-type");
1389 if (sipe_strequal("chat", session_type
)) {
1390 is_in_im_mcu
= TRUE
;
1391 if (!sipe_backend_chat_find(session
->chat_session
->backend
, user_uri
)) {
1392 sipe_backend_chat_add(session
->chat_session
->backend
,
1394 !just_joined
&& g_ascii_strcasecmp(user_uri
, self
));
1397 sipe_backend_chat_operator(session
->chat_session
->backend
,
1400 } else if (sipe_strequal("audio-video", session_type
)) {
1402 if (!session
->is_call
)
1403 audio_was_added
= TRUE
;
1404 process_conference_av_endpoint(endpoint
,
1409 } else if (sipe_strequal("applicationsharing", session_type
)) {
1410 #ifdef HAVE_APPSHARE
1411 if (sipe_core_conf_get_appshare_role(SIPE_CORE_PUBLIC
,
1412 session
->chat_session
) == SIPE_APPSHARE_ROLE_NONE
&&
1413 !sipe_strequal(user_uri
, self
)) {
1414 presentation_was_added
= process_conference_appshare_endpoint(endpoint
);
1419 if (!is_in_im_mcu
) {
1420 if (sipe_backend_chat_find(session
->chat_session
->backend
, user_uri
)) {
1421 sipe_backend_chat_remove(session
->chat_session
->backend
,
1431 if (audio_was_added
) {
1432 session
->is_call
= TRUE
;
1433 ask_accept_voice_conference(sipe_private
, focus_uri
, NULL
,
1434 (SipeUserAskCb
) call_accept_cb
,
1437 #ifdef HAVE_APPSHARE
1438 if (presentation_was_added
) {
1439 sipe_core_appshare_connect_conference(SIPE_CORE_PUBLIC
,
1440 session
->chat_session
,
1446 /* entity-view, locked */
1447 for (node
= sipe_xml_child(xn_conference_info
, "conference-view/entity-view");
1449 node
= sipe_xml_twin(node
)) {
1451 const sipe_xml
*xn_type
= sipe_xml_child(node
, "entity-state/media/entry/type");
1453 if (xn_type
&& sipe_strequal("chat", (tmp
= sipe_xml_data(xn_type
)))) {
1454 const sipe_xml
*xn_locked
= sipe_xml_child(node
, "entity-state/locked");
1456 gchar
*locked
= sipe_xml_data(xn_locked
);
1457 gboolean prev_locked
= session
->locked
;
1458 session
->locked
= sipe_strequal(locked
, "true");
1459 if (prev_locked
&& !session
->locked
) {
1460 sipe_user_present_info(sipe_private
, session
,
1461 _("This conference is no longer locked. Additional participants can now join."));
1463 if (!prev_locked
&& session
->locked
) {
1464 sipe_user_present_info(sipe_private
, session
,
1465 _("This conference is locked. Nobody else can join the conference while it is locked."));
1468 SIPE_DEBUG_INFO("sipe_process_conference: session->locked=%s",
1469 session
->locked
? "TRUE" : "FALSE");
1475 sipe_xml_free(xn_conference_info
);
1477 if (session
->im_mcu_uri
) {
1478 struct sip_dialog
*dialog
= sipe_dialog_find(session
, session
->im_mcu_uri
);
1480 dialog
= sipe_dialog_add(session
);
1482 dialog
->callid
= g_strdup(session
->callid
);
1483 dialog
->with
= g_strdup(session
->im_mcu_uri
);
1485 /* send INVITE to IM MCU */
1486 sipe_im_invite(sipe_private
, session
, dialog
->with
, NULL
, NULL
, NULL
, FALSE
);
1490 sipe_process_pending_invite_queue(sipe_private
, session
);
1494 sipe_conf_immcu_closed(struct sipe_core_private
*sipe_private
,
1495 struct sip_session
*session
)
1497 sipe_user_present_info(sipe_private
, session
,
1498 _("You have been disconnected from this conference."));
1499 sipe_backend_chat_close(session
->chat_session
->backend
);
1503 conf_session_close(struct sipe_core_private
*sipe_private
,
1504 struct sip_session
*session
)
1507 /* unsubscribe from focus */
1508 sipe_subscribe_conference(sipe_private
,
1509 session
->chat_session
->id
, TRUE
);
1511 if (session
->focus_dialog
) {
1512 /* send BYE to focus */
1513 sip_transport_bye(sipe_private
, session
->focus_dialog
);
1519 sipe_process_imdn(struct sipe_core_private
*sipe_private
,
1522 gchar
*with
= sipmsg_parse_from_address(msg
);
1523 const gchar
*callid
= sipmsg_find_header(msg
, "Call-ID");
1524 static struct sip_session
*session
;
1526 const sipe_xml
*node
;
1530 session
= sipe_session_find_chat_or_im(sipe_private
, callid
, with
);
1532 SIPE_DEBUG_INFO("sipe_process_imdn: unable to find conf session with callid=%s", callid
);
1537 xn_imdn
= sipe_xml_parse(msg
->body
, msg
->bodylen
);
1538 message_id
= sipe_xml_data(sipe_xml_child(xn_imdn
, "message-id"));
1540 message
= g_hash_table_lookup(session
->conf_unconfirmed_messages
, message_id
);
1543 for (node
= sipe_xml_child(xn_imdn
, "recipient"); node
; node
= sipe_xml_twin(node
)) {
1544 gchar
*tmp
= parse_from(sipe_xml_attribute(node
, "uri"));
1545 gchar
*uri
= parse_from(tmp
);
1546 gchar
*status
= sipe_xml_data(sipe_xml_child(node
, "status"));
1547 guint error
= status
? g_ascii_strtoull(status
, NULL
, 10) : 0;
1548 /* default to error if missing or conversion failed */
1549 if ((error
== 0) || (error
>= 300))
1550 sipe_user_present_message_undelivered(sipe_private
,
1561 sipe_xml_free(xn_imdn
);
1563 g_hash_table_remove(session
->conf_unconfirmed_messages
, message_id
);
1564 SIPE_DEBUG_INFO("sipe_process_imdn: removed message %s from conf_unconfirmed_messages(count=%d)",
1565 message_id
, g_hash_table_size(session
->conf_unconfirmed_messages
));
1570 void sipe_core_conf_make_leader(struct sipe_core_public
*sipe_public
,
1572 const gchar
*buddy_name
)
1574 struct sipe_core_private
*sipe_private
= SIPE_CORE_PRIVATE
;
1575 struct sipe_chat_session
*chat_session
= parameter
;
1576 struct sip_session
*session
;
1578 SIPE_DEBUG_INFO("sipe_core_conf_make_leader: chat_title=%s",
1579 chat_session
->title
);
1581 session
= sipe_session_find_chat(sipe_private
, chat_session
);
1582 sipe_conf_modify_user_role(sipe_private
, session
, buddy_name
);
1585 void sipe_core_conf_remove_from(struct sipe_core_public
*sipe_public
,
1587 const gchar
*buddy_name
)
1589 struct sipe_core_private
*sipe_private
= SIPE_CORE_PRIVATE
;
1590 struct sipe_chat_session
*chat_session
= parameter
;
1591 struct sip_session
*session
;
1593 SIPE_DEBUG_INFO("sipe_core_conf_remove_from: chat_title=%s",
1594 chat_session
->title
);
1596 session
= sipe_session_find_chat(sipe_private
, chat_session
);
1597 sipe_conf_delete_user(sipe_private
, session
, buddy_name
);
1601 sipe_conf_build_uri(const gchar
*focus_uri
, const gchar
*session_type
)
1603 gchar
**parts
= g_strsplit(focus_uri
, ":focus:", 2);
1604 gchar
*result
= NULL
;
1606 if (g_strv_length(parts
) == 2) {
1607 result
= g_strconcat(parts
[0], ":", session_type
, ":", parts
[1],
1616 access_numbers_info(struct sipe_core_public
*sipe_public
)
1618 GString
*result
= g_string_new("");
1619 GList
*keys
= g_hash_table_get_keys(SIPE_CORE_PRIVATE
->access_numbers
);
1620 keys
= g_list_sort(keys
, (GCompareFunc
)g_strcmp0
);
1622 for (; keys
; keys
= g_list_delete_link(keys
, keys
)) {
1624 value
= g_hash_table_lookup(SIPE_CORE_PRIVATE
->access_numbers
,
1627 g_string_append(result
, keys
->data
);
1628 g_string_append(result
, " ");
1629 g_string_append(result
, value
);
1630 g_string_append(result
, "<br/>");
1633 return g_string_free(result
, FALSE
);
1637 sipe_core_conf_entry_info(struct sipe_core_public
*sipe_public
,
1638 struct sipe_chat_session
*chat_session
)
1640 gchar
*access_info
= access_numbers_info(sipe_public
);
1641 gchar
*result
= g_strdup_printf(
1642 "<b><font size=\"+1\">%s</font></b><br/>"
1643 "<b>%s:</b> %s<br/>"
1644 "<b>%s:</b> %s<br/>"
1649 "<b>%s:</b> %s<br/>"
1651 "<b><font size=\"+1\">%s</font></b><br/>"
1655 SIPE_CORE_PRIVATE
->default_access_number
? SIPE_CORE_PRIVATE
->default_access_number
: "",
1657 chat_session
->dial_in_conf_id
? chat_session
->dial_in_conf_id
: "",
1659 chat_session
->join_url
? chat_session
->join_url
: "",
1661 chat_session
->organizer
? chat_session
->organizer
: "",
1662 _("Alternative dial-in numbers"),
1665 g_free(access_info
);