6 * Copyright (C) 2010-2017 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-core.h"
50 #include "sipe-chat.h"
51 #include "sipe-conf.h"
52 #include "sipe-core-private.h"
53 #include "sipe-dialog.h"
54 #include "sipe-http.h"
57 #include "sipe-session.h"
58 #include "sipe-subscriptions.h"
59 #include "sipe-user.h"
60 #include "sipe-utils.h"
64 * Invite counterparty to join conference.
65 * @param focus_uri (%s)
66 * @param subject (%s) of conference
68 #define SIPE_SEND_CONF_INVITE \
69 "<Conferencing version=\"2.0\">"\
70 "<focus-uri>%s</focus-uri>"\
71 "<subject>%s</subject>"\
72 "<im available=\"true\">"\
78 sipe_conf_check_for_lync_url(struct sipe_core_private
*sipe_private
,
81 static struct transaction
*
82 cccp_request(struct sipe_core_private
*sipe_private
, const gchar
*method
,
83 const gchar
*with
, struct sip_dialog
*dialog
,
84 TransCallback callback
, const gchar
*body
, ...)
90 gchar
*self
= sip_uri_self(sipe_private
);
94 struct transaction
*trans
;
96 headers
= g_strdup_printf(
97 "Supported: ms-sender\r\n"
99 "Content-Type: application/cccp+xml\r\n",
100 sipe_private
->contact
);
102 /* TODO: put request_id to queue to further compare with incoming one */
103 request
= g_strdup_printf(
104 "<?xml version=\"1.0\"?>"
105 "<request xmlns=\"urn:ietf:params:xml:ns:cccp\" "
106 "xmlns:mscp=\"http://schemas.microsoft.com/rtc/2005/08/cccpextensions\" "
115 sipe_private
->cccp_request_id
++,
119 va_start(args
, body
);
120 request_body
= g_strdup_vprintf(request
, args
);
125 trans
= sip_transport_request(sipe_private
,
135 g_free(request_body
);
141 process_conf_get_capabilities(SIPE_UNUSED_PARAMETER
struct sipe_core_private
*sipe_private
,
143 SIPE_UNUSED_PARAMETER
struct transaction
*trans
)
145 if (msg
->response
>= 400) {
146 SIPE_DEBUG_INFO_NOFORMAT("process_conf_get_capabilities: "
147 "getConferencingCapabilities failed.");
150 if (msg
->response
== 200) {
151 sipe_xml
*xn_response
= sipe_xml_parse(msg
->body
, msg
->bodylen
);
152 const sipe_xml
*node
;
153 gchar
*default_region
;
155 if (!sipe_strequal("success", sipe_xml_attribute(xn_response
, "code"))) {
159 node
= sipe_xml_child(xn_response
, "getConferencingCapabilities/mcu-types/mcuType");
160 for (;node
; node
= sipe_xml_twin(node
)) {
161 sipe_private
->conf_mcu_types
=
162 g_slist_append(sipe_private
->conf_mcu_types
,
163 sipe_xml_data(node
));
166 g_hash_table_remove_all(sipe_private
->access_numbers
);
167 node
= sipe_xml_child(xn_response
, "getConferencingCapabilities/pstn-bridging/access-numbers/region");
168 for (;node
; node
= sipe_xml_twin(node
)) {
169 gchar
*name
= g_strdup(sipe_xml_attribute(node
, "name"));
170 gchar
*number
= sipe_xml_data(sipe_xml_child(node
, "access-number/number"));
171 if (name
&& number
) {
172 g_hash_table_insert(sipe_private
->access_numbers
, name
, number
);
176 node
= sipe_xml_child(xn_response
, "getConferencingCapabilities/pstn-bridging/access-numbers/default-region");
177 default_region
= sipe_xml_data(node
);
178 if (default_region
) {
179 sipe_private
->default_access_number
=
180 g_hash_table_lookup(sipe_private
->access_numbers
, default_region
);
182 g_free(default_region
);
184 sipe_xml_free(xn_response
);
191 sipe_conf_get_capabilities(struct sipe_core_private
*sipe_private
)
193 cccp_request(sipe_private
, "SERVICE",
194 sipe_private
->focus_factory_uri
,
196 process_conf_get_capabilities
,
197 "<getConferencingCapabilities />");
201 sipe_conf_supports_mcu_type(struct sipe_core_private
*sipe_private
,
204 return g_slist_find_custom(sipe_private
->conf_mcu_types
, type
,
205 sipe_strcompare
) != NULL
;
209 * Generates random GUID.
210 * This method is borrowed from pidgin's msnutils.c
215 return g_strdup_printf("%4X%4X-%4X-%4X-%4X-%4X%4X%4X",
216 rand() % 0xAAFF + 0x1111,
217 rand() % 0xAAFF + 0x1111,
218 rand() % 0xAAFF + 0x1111,
219 rand() % 0xAAFF + 0x1111,
220 rand() % 0xAAFF + 0x1111,
221 rand() % 0xAAFF + 0x1111,
222 rand() % 0xAAFF + 0x1111,
223 rand() % 0xAAFF + 0x1111);
226 /** Invite us to the focus callback */
228 process_invite_conf_focus_response(struct sipe_core_private
*sipe_private
,
230 SIPE_UNUSED_PARAMETER
struct transaction
*trans
)
232 struct sip_session
*session
= NULL
;
233 char *focus_uri
= parse_from(sipmsg_find_header(msg
, "To"));
235 session
= sipe_session_find_conference(sipe_private
, focus_uri
);
238 SIPE_DEBUG_INFO("process_invite_conf_focus_response: unable to find conf session with focus=%s", focus_uri
);
243 if (!session
->focus_dialog
) {
244 SIPE_DEBUG_INFO_NOFORMAT("process_invite_conf_focus_response: session's focus_dialog is NULL");
249 sipe_dialog_parse(session
->focus_dialog
, msg
, TRUE
);
251 if (msg
->response
>= 200) {
252 /* send ACK to focus */
253 session
->focus_dialog
->cseq
= 0;
254 sip_transport_ack(sipe_private
, session
->focus_dialog
);
255 session
->focus_dialog
->outgoing_invite
= NULL
;
256 session
->focus_dialog
->is_established
= TRUE
;
259 if (msg
->response
>= 400) {
260 gchar
*reason
= sipmsg_get_ms_diagnostics_reason(msg
);
262 SIPE_DEBUG_INFO_NOFORMAT("process_invite_conf_focus_response: INVITE response is not 200. Failed to join focus.");
263 sipe_backend_notify_error(SIPE_CORE_PUBLIC
,
264 _("Failed to join the conference"),
265 reason
? reason
: _("no reason given"));
268 sipe_session_remove(sipe_private
, session
);
271 } else if (msg
->response
== 200) {
272 sipe_xml
*xn_response
= sipe_xml_parse(msg
->body
, msg
->bodylen
);
273 const gchar
*code
= sipe_xml_attribute(xn_response
, "code");
274 if (sipe_strequal(code
, "success")) {
275 /* subscribe to focus */
276 sipe_subscribe_conference(sipe_private
,
277 session
->chat_session
->id
,
280 if (session
->is_call
)
281 sipe_core_media_connect_conference(SIPE_CORE_PUBLIC
,
282 session
->chat_session
);
285 sipe_xml_free(xn_response
);
293 parse_ocs_focus_uri(const gchar
*uri
)
295 const gchar
*confkey
;
301 // URI can have this prefix if it was typed in by the user
302 if (g_str_has_prefix(uri
, "meet:") || g_str_has_prefix(uri
, "conf:")) {
306 uri_len
= strlen(uri
);
308 if (!uri
|| !g_str_has_prefix(uri
, "sip:") ||
309 uri_len
== 4 || g_strstr_len(uri
, -1, "%")) {
313 confkey
= g_strstr_len(uri
, -1, "?");
315 /* TODO: Investigate how conf-key field should be used,
316 * ignoring for now */
317 uri_len
= confkey
- uri
;
320 return g_strndup(uri
, uri_len
);
324 extract_uri_from_html(const gchar
*body
,
326 guint prefix_skip_chars
)
329 const gchar
*start
= g_strstr_len(body
, -1, prefix
);
334 start
+= prefix_skip_chars
;
335 end
= strchr(start
, '"');
338 gchar
*html
= g_strndup(start
, end
- start
);
340 /* decode HTML entities */
341 gchar
*html_unescaped
= sipe_backend_markup_strip_html(html
);
344 if (!is_empty(html_unescaped
)) {
345 uri
= sipe_utils_uri_unescape(html_unescaped
);
348 g_free(html_unescaped
);
355 static void sipe_conf_lync_url_cb(struct sipe_core_private
*sipe_private
,
357 SIPE_UNUSED_PARAMETER GSList
*headers
,
359 gpointer callback_data
)
361 gchar
*uri
= callback_data
;
363 if (status
!= (guint
) SIPE_HTTP_STATUS_ABORTED
) {
364 gchar
*focus_uri
= NULL
;
368 * Extract focus URI from HTML, e.g.
370 * <a ... href="conf:sip:...ABCDEF%3Frequired..." ... >
372 gchar
*uri
= extract_uri_from_html(body
, "href=\"conf", 6);
373 focus_uri
= parse_ocs_focus_uri(uri
);
378 SIPE_DEBUG_INFO("sipe_conf_lync_url_cb: found focus URI"
381 sipe_conf_create(sipe_private
, NULL
, focus_uri
);
385 * If present, domainOwnerJoinLauncherUrl redirects to
386 * a page from where we still may extract the focus URI.
389 static const gchar launcher_url_prefix
[] =
390 "var domainOwnerJoinLauncherUrl = \"";
392 SIPE_DEBUG_INFO("sipe_conf_lync_url_cb: no focus URI "
393 "found from URL '%s'", uri
);
395 launcher_url
= extract_uri_from_html(body
,
397 sizeof (launcher_url_prefix
) - 1);
400 sipe_conf_check_for_lync_url(sipe_private
, launcher_url
)) {
401 SIPE_DEBUG_INFO("sipe_conf_lync_url_cb: retrying with URL '%s'",
403 /* Ownership taken by sipe_conf_check_for_lync_url() */
408 error
= g_strdup_printf(_("Can't find a conference URI on this page:\n\n%s"),
411 sipe_backend_notify_error(SIPE_CORE_PUBLIC
,
412 _("Failed to join the conference"),
417 g_free(launcher_url
);
424 static gboolean
sipe_conf_check_for_lync_url(struct sipe_core_private
*sipe_private
,
427 if (!(g_str_has_prefix(uri
, "https://") ||
428 g_str_has_prefix(uri
, "http://")))
431 /* URL points to a HTML page with the conference focus URI */
432 return(sipe_http_request_get(sipe_private
,
435 sipe_conf_lync_url_cb
,
440 static void sipe_conf_uri_error(struct sipe_core_private
*sipe_private
,
443 gchar
*error
= g_strdup_printf(_("\"%s\" is not a valid conference URI"),
445 sipe_backend_notify_error(SIPE_CORE_PUBLIC
,
446 _("Failed to join the conference"),
451 void sipe_core_conf_create(struct sipe_core_public
*sipe_public
,
453 const gchar
*organizer
,
454 const gchar
*meeting_id
)
456 struct sipe_core_private
*sipe_private
= SIPE_CORE_PRIVATE
;
458 /* SIP URI or HTTP URL */
460 gchar
*uri_ue
= sipe_utils_uri_unescape(uri
);
462 SIPE_DEBUG_INFO("sipe_core_conf_create: URI '%s' unescaped '%s'",
464 uri_ue
? uri_ue
: "<UNDEFINED>");
466 /* takes ownership of "uri_ue" if successful */
467 if (!sipe_conf_check_for_lync_url(sipe_private
, uri_ue
)) {
468 gchar
*focus_uri
= parse_ocs_focus_uri(uri_ue
);
471 sipe_conf_create(sipe_private
, NULL
, focus_uri
);
474 sipe_conf_uri_error(sipe_private
, uri
);
479 /* Organizer email and meeting ID */
480 } else if (organizer
&& meeting_id
) {
481 gchar
*tmp
= g_strdup_printf("sip:%s;gruu;opaque=app:conf:focus:id:%s",
482 organizer
, meeting_id
);
483 gchar
*focus_uri
= parse_ocs_focus_uri(tmp
);
485 SIPE_DEBUG_INFO("sipe_core_conf_create: organizer '%s' meeting ID '%s'",
490 sipe_conf_create(sipe_private
, NULL
, focus_uri
);
493 sipe_conf_uri_error(sipe_private
, tmp
);
497 sipe_backend_notify_error(SIPE_CORE_PUBLIC
,
498 _("Failed to join the conference"),
499 _("Incomplete conference information provided"));
503 /** Create new session with Focus URI */
505 sipe_conf_create(struct sipe_core_private
*sipe_private
,
506 struct sipe_chat_session
*chat_session
,
507 const gchar
*focus_uri
)
509 /* addUser request to the focus.
511 * focus_URI, from, endpoint_GUID
513 static const gchar CCCP_ADD_USER
[] =
515 "<conferenceKeys confEntity=\"%s\"/>"
516 "<ci:user xmlns:ci=\"urn:ietf:params:xml:ns:conference-info\" entity=\"%s\">"
518 "<ci:entry>attendee</ci:entry>"
520 "<ci:endpoint entity=\"{%s}\" "
521 "xmlns:msci=\"http://schemas.microsoft.com/rtc/2005/08/confinfoextensions\"/>"
526 struct sip_session
*session
= sipe_session_add_chat(sipe_private
,
531 session
->focus_dialog
= g_new0(struct sip_dialog
, 1);
532 session
->focus_dialog
->callid
= gencallid();
533 session
->focus_dialog
->with
= g_strdup(session
->chat_session
->id
);
534 session
->focus_dialog
->endpoint_GUID
= rand_guid();
535 session
->focus_dialog
->ourtag
= gentag();
537 self
= sip_uri_self(sipe_private
);
538 session
->focus_dialog
->outgoing_invite
=
539 cccp_request(sipe_private
, "INVITE",
540 session
->focus_dialog
->with
, session
->focus_dialog
,
541 process_invite_conf_focus_response
,
543 session
->focus_dialog
->with
, self
,
544 session
->focus_dialog
->endpoint_GUID
);
546 /* Rejoin existing session? */
548 SIPE_DEBUG_INFO("sipe_conf_create: rejoin '%s' (%s)",
551 sipe_backend_chat_rejoin(SIPE_CORE_PUBLIC
,
552 chat_session
->backend
,
554 chat_session
->title
);
561 /** Modify User Role */
563 sipe_conf_modify_user_role(struct sipe_core_private
*sipe_private
,
564 struct sip_session
*session
,
567 /* modifyUserRoles request to the focus. Makes user a leader.
572 static const gchar CCCP_MODIFY_USER_ROLES
[] =
574 "<userKeys confEntity=\"%s\" userEntity=\"%s\"/>"
575 "<user-roles xmlns=\"urn:ietf:params:xml:ns:conference-info\">"
576 "<entry>presenter</entry>"
578 "</modifyUserRoles>";
580 if (!session
->focus_dialog
|| !session
->focus_dialog
->is_established
) {
581 SIPE_DEBUG_INFO_NOFORMAT("sipe_conf_modify_user_role: no dialog with focus, exiting.");
585 cccp_request(sipe_private
, "INFO", session
->focus_dialog
->with
,
586 session
->focus_dialog
, NULL
,
587 CCCP_MODIFY_USER_ROLES
,
588 session
->focus_dialog
->with
, who
);
592 * Check conference lock status
594 sipe_chat_lock_status
sipe_core_chat_lock_status(struct sipe_core_public
*sipe_public
,
595 struct sipe_chat_session
*chat_session
)
597 struct sipe_core_private
*sipe_private
= SIPE_CORE_PRIVATE
;
598 sipe_chat_lock_status status
= SIPE_CHAT_LOCK_STATUS_NOT_ALLOWED
;
601 (chat_session
->type
== SIPE_CHAT_TYPE_CONFERENCE
)) {
602 struct sip_session
*session
= sipe_session_find_chat(sipe_private
,
605 gchar
*self
= sip_uri_self(sipe_private
);
607 /* Only operators are allowed to change the lock status */
608 if (sipe_backend_chat_is_operator(chat_session
->backend
, self
)) {
609 status
= session
->locked
?
610 SIPE_CHAT_LOCK_STATUS_LOCKED
:
611 SIPE_CHAT_LOCK_STATUS_UNLOCKED
;
622 * Modify Conference Lock
623 * Sends request to Focus.
624 * INFO method is a carrier of application/cccp+xml
627 sipe_core_chat_modify_lock(struct sipe_core_public
*sipe_public
,
628 struct sipe_chat_session
*chat_session
,
629 const gboolean locked
)
631 /* modifyConferenceLock request to the focus. Locks/unlocks conference.
634 * locked (%s) "true" or "false" values applicable
636 static const gchar CCCP_MODIFY_CONFERENCE_LOCK
[] =
637 "<modifyConferenceLock>"
638 "<conferenceKeys confEntity=\"%s\"/>"
639 "<locked>%s</locked>"
640 "</modifyConferenceLock>";
642 struct sipe_core_private
*sipe_private
= SIPE_CORE_PRIVATE
;
644 struct sip_session
*session
= sipe_session_find_chat(sipe_private
,
647 if (!session
) return;
648 if (!session
->focus_dialog
|| !session
->focus_dialog
->is_established
) {
649 SIPE_DEBUG_INFO_NOFORMAT("sipe_conf_modify_conference_lock: no dialog with focus, exiting.");
653 cccp_request(sipe_private
, "INFO", session
->focus_dialog
->with
,
654 session
->focus_dialog
, NULL
,
655 CCCP_MODIFY_CONFERENCE_LOCK
,
656 session
->focus_dialog
->with
,
657 locked
? "true" : "false");
660 /** Modify Delete User */
662 sipe_conf_delete_user(struct sipe_core_private
*sipe_private
,
663 struct sip_session
*session
,
666 /* deleteUser request to the focus. Removes a user from the conference.
671 static const gchar CCCP_DELETE_USER
[] =
673 "<userKeys confEntity=\"%s\" userEntity=\"%s\"/>"
676 if (!session
->focus_dialog
|| !session
->focus_dialog
->is_established
) {
677 SIPE_DEBUG_INFO_NOFORMAT("sipe_conf_delete_user: no dialog with focus, exiting.");
681 cccp_request(sipe_private
, "INFO", session
->focus_dialog
->with
,
682 session
->focus_dialog
, NULL
,
684 session
->focus_dialog
->with
, who
);
688 sipe_conf_announce_audio_mute_state(struct sipe_core_private
*sipe_private
,
689 struct sip_session
*session
,
692 // See [MS-CONFAV] 3.2.5.4 and 4.3
693 static const gchar CCCP_MODIFY_ENDPOINT_MEDIA
[] =
694 "<modifyEndpointMedia mscp:mcuUri=\"%s\""
695 " xmlns:mscp=\"http://schemas.microsoft.com/rtc/2005/08/cccpextensions\">"
696 "<mediaKeys confEntity=\"%s\" userEntity=\"%s\""
697 " endpointEntity=\"%s\" mediaId=\"%d\"/>"
699 " xmlns:ci=\"urn:ietf:params:xml:ns:conference-info\" id=\"%d\">"
700 "<ci:type>audio</ci:type>"
701 "<ci:status>%s</ci:status>"
702 "<media-ingress-filter"
703 " xmlns=\"http://schemas.microsoft.com/rtc/2005/08/confinfoextensions\">"
705 "</media-ingress-filter>"
707 "</modifyEndpointMedia>";
709 gchar
*mcu_uri
= sipe_conf_build_uri(session
->focus_dialog
->with
,
711 gchar
*self
= sip_uri_self(sipe_private
);
713 cccp_request(sipe_private
, "INFO", session
->focus_dialog
->with
,
714 session
->focus_dialog
, NULL
,
715 CCCP_MODIFY_ENDPOINT_MEDIA
,
716 mcu_uri
, session
->focus_dialog
->with
, self
,
717 session
->audio_video_entity
,
718 session
->audio_media_id
, session
->audio_media_id
,
719 is_muted
? "recvonly" : "sendrecv",
720 is_muted
? "block" : "unblock");
726 /** Invite counterparty to join conference callback */
728 process_invite_conf_response(struct sipe_core_private
*sipe_private
,
730 SIPE_UNUSED_PARAMETER
struct transaction
*trans
)
732 struct sip_dialog
*dialog
= g_new0(struct sip_dialog
, 1);
734 dialog
->callid
= g_strdup(sipmsg_find_header(msg
, "Call-ID"));
735 dialog
->cseq
= sipmsg_parse_cseq(msg
);
736 dialog
->with
= parse_from(sipmsg_find_header(msg
, "To"));
737 sipe_dialog_parse(dialog
, msg
, TRUE
);
739 if (msg
->response
>= 200) {
740 /* send ACK to counterparty */
742 sip_transport_ack(sipe_private
, dialog
);
743 dialog
->outgoing_invite
= NULL
;
744 dialog
->is_established
= TRUE
;
747 if (msg
->response
>= 400) {
748 SIPE_DEBUG_INFO("process_invite_conf_response: INVITE response is not 200. Failed to invite %s.", dialog
->with
);
749 /* @TODO notify user of failure to invite counterparty */
750 sipe_dialog_free(dialog
);
754 if (msg
->response
>= 200) {
755 struct sip_session
*session
= sipe_session_find_im(sipe_private
, dialog
->with
);
756 struct sip_dialog
*im_dialog
= sipe_dialog_find(session
, dialog
->with
);
758 /* close IM session to counterparty */
760 sip_transport_bye(sipe_private
, im_dialog
);
761 sipe_dialog_remove(session
, dialog
->with
);
765 sipe_dialog_free(dialog
);
770 * Invites counterparty to join conference.
773 sipe_invite_conf(struct sipe_core_private
*sipe_private
,
774 struct sip_session
*session
,
780 struct sip_dialog
*dialog
= NULL
;
782 /* It will be short lived special dialog.
783 * Will not be stored in session.
785 dialog
= g_new0(struct sip_dialog
, 1);
786 dialog
->callid
= gencallid();
787 dialog
->with
= g_strdup(who
);
788 dialog
->ourtag
= gentag();
790 contact
= get_contact(sipe_private
);
791 hdr
= g_strdup_printf(
792 "Supported: ms-sender\r\n"
794 "Content-Type: application/ms-conf-invite+xml\r\n",
798 body
= g_strdup_printf(
799 SIPE_SEND_CONF_INVITE
,
800 session
->chat_session
->id
,
801 session
->subject
? session
->subject
: ""
804 sip_transport_invite(sipe_private
,
808 process_invite_conf_response
);
810 sipe_dialog_free(dialog
);
815 /** Create conference callback */
817 process_conf_add_response(struct sipe_core_private
*sipe_private
,
819 struct transaction
*trans
)
821 if (msg
->response
>= 400) {
822 SIPE_DEBUG_INFO_NOFORMAT("process_conf_add_response: SERVICE response is not 200. Failed to create conference.");
823 /* @TODO notify user of failure to create conference */
826 if (msg
->response
== 200) {
827 sipe_xml
*xn_response
= sipe_xml_parse(msg
->body
, msg
->bodylen
);
828 if (sipe_strequal("success", sipe_xml_attribute(xn_response
, "code")))
830 gchar
*who
= trans
->payload
->data
;
831 const sipe_xml
*xn_conference_info
= sipe_xml_child(xn_response
, "addConference/conference-info");
832 struct sip_session
*session
= sipe_conf_create(sipe_private
,
834 sipe_xml_attribute(xn_conference_info
,
837 SIPE_DEBUG_INFO("process_conf_add_response: session->focus_uri=%s",
838 session
->chat_session
->id
);
840 session
->pending_invite_queue
= sipe_utils_slist_insert_unique_sorted(session
->pending_invite_queue
,
842 (GCompareFunc
)strcmp
,
845 sipe_xml_free(xn_response
);
852 * Creates conference.
855 sipe_conf_add(struct sipe_core_private
*sipe_private
,
858 gchar
*conference_id
;
859 struct transaction
*trans
;
860 time_t expiry
= time(NULL
) + 7*60*60; /* 7 hours */
863 /* addConference request to the focus factory.
865 * conference_id (%s) Ex.: 8386E6AEAAA41E4AA6627BA76D43B6D1
866 * expiry_time (%s) Ex.: 2009-07-13T17:57:09Z
867 * conference_view (%s) Ex.: <msci:entity-view entity="chat"/>
869 static const gchar CCCP_ADD_CONFERENCE
[] =
871 "<ci:conference-info xmlns:ci=\"urn:ietf:params:xml:ns:conference-info\" "
873 "xmlns:msci=\"http://schemas.microsoft.com/rtc/2005/08/confinfoextensions\">"
874 "<ci:conference-description>"
876 "<msci:conference-id>%s</msci:conference-id>"
877 "<msci:expiry-time>%s</msci:expiry-time>"
878 "<msci:admission-policy>openAuthenticated</msci:admission-policy>"
879 "</ci:conference-description>"
880 "<msci:conference-view>%s</msci:conference-view>"
881 "</ci:conference-info>"
884 static const gchar
*DESIRED_MCU_TYPES
[] = {
890 "applicationsharing",
895 GString
*conference_view
= g_string_new("");
898 for (type
= DESIRED_MCU_TYPES
; *type
; ++type
) {
899 if (sipe_conf_supports_mcu_type(sipe_private
, *type
)) {
900 g_string_append(conference_view
, "<msci:entity-view entity=\"");
901 g_string_append(conference_view
, *type
);
902 g_string_append(conference_view
, "\"/>");
906 expiry_time
= sipe_utils_time_to_str(expiry
);
907 conference_id
= genconfid();
908 trans
= cccp_request(sipe_private
, "SERVICE", sipe_private
->focus_factory_uri
,
909 NULL
, process_conf_add_response
,
911 conference_id
, expiry_time
, conference_view
->str
);
912 g_free(conference_id
);
914 g_string_free(conference_view
, TRUE
);
917 struct transaction_payload
*payload
= g_new0(struct transaction_payload
, 1);
919 payload
->destroy
= g_free
;
920 payload
->data
= g_strdup(who
);
921 trans
->payload
= payload
;
926 accept_incoming_invite_conf(struct sipe_core_private
*sipe_private
,
931 struct sip_session
*session
;
932 gchar
*newTag
= gentag();
933 const gchar
*oldHeader
= sipmsg_find_header(msg
, "To");
936 newHeader
= g_strdup_printf("%s;tag=%s", oldHeader
, newTag
);
938 sipmsg_remove_header_now(msg
, "To");
939 sipmsg_add_header_now(msg
, "To", newHeader
);
942 /* acknowledge invite */
943 sip_transport_response(sipe_private
, msg
, 200, "OK", NULL
);
945 /* add self to conf */
946 session
= sipe_conf_create(sipe_private
, NULL
, focus_uri
);
947 session
->is_call
= audio
;
950 struct conf_accept_ctx
{
953 struct sipe_user_ask_ctx
*ask_ctx
;
955 SipeUserAskCb accept_cb
;
956 SipeUserAskCb decline_cb
;
962 conf_accept_ctx_free(struct conf_accept_ctx
*ctx
)
964 g_return_if_fail(ctx
!= NULL
);
966 sipmsg_free(ctx
->msg
);
967 g_free(ctx
->focus_uri
);
972 conf_accept_cb(struct sipe_core_private
*sipe_private
, struct conf_accept_ctx
*ctx
)
974 accept_incoming_invite_conf(sipe_private
, ctx
->focus_uri
, TRUE
, ctx
->msg
);
978 conf_decline_cb(struct sipe_core_private
*sipe_private
, struct conf_accept_ctx
*ctx
)
980 sip_transport_response(sipe_private
,
982 603, "Decline", NULL
);
986 sipe_conf_cancel_unaccepted(struct sipe_core_private
*sipe_private
,
989 const gchar
*callid1
= msg
? sipmsg_find_header(msg
, "Call-ID") : NULL
;
990 GSList
*it
= sipe_private
->sessions_to_accept
;
992 struct conf_accept_ctx
*ctx
= it
->data
;
993 const gchar
*callid2
= NULL
;
996 callid2
= sipmsg_find_header(ctx
->msg
, "Call-ID");
998 if (sipe_strequal(callid1
, callid2
)) {
1002 sip_transport_response(sipe_private
, ctx
->msg
,
1003 487, "Request Terminated", NULL
);
1006 sip_transport_response(sipe_private
, msg
, 200, "OK", NULL
);
1008 sipe_user_close_ask(ctx
->ask_ctx
);
1009 conf_accept_ctx_free(ctx
);
1014 sipe_private
->sessions_to_accept
=
1015 g_slist_delete_link(sipe_private
->sessions_to_accept
, tmp
);
1025 accept_invitation_cb(struct sipe_core_private
*sipe_private
, gpointer data
)
1027 struct conf_accept_ctx
*ctx
= data
;
1029 sipe_private
->sessions_to_accept
=
1030 g_slist_remove(sipe_private
->sessions_to_accept
, ctx
);
1032 if (ctx
->accept_cb
) {
1033 ctx
->accept_cb(sipe_private
, ctx
);
1036 conf_accept_ctx_free(ctx
);
1040 decline_invitation_cb(struct sipe_core_private
*sipe_private
, gpointer data
)
1042 struct conf_accept_ctx
*ctx
= data
;
1044 sipe_private
->sessions_to_accept
=
1045 g_slist_remove(sipe_private
->sessions_to_accept
, ctx
);
1047 if (ctx
->decline_cb
) {
1048 ctx
->decline_cb(sipe_private
, ctx
);
1051 conf_accept_ctx_free(ctx
);
1055 ask_accept_invitation(struct sipe_core_private
*sipe_private
,
1056 const gchar
*focus_uri
,
1057 const gchar
*question
,
1059 SipeUserAskCb accept_cb
,
1060 SipeUserAskCb decline_cb
,
1065 gchar
*question_str
;
1066 struct conf_accept_ctx
*ctx
;
1068 parts
= g_strsplit(focus_uri
, ";", 2);
1069 alias
= sipe_buddy_get_alias(sipe_private
, parts
[0]);
1071 question_str
= g_strdup_printf("%s %s", alias
? alias
: parts
[0], question
);
1076 ctx
= g_new0(struct conf_accept_ctx
, 1);
1077 sipe_private
->sessions_to_accept
=
1078 g_slist_append(sipe_private
->sessions_to_accept
, ctx
);
1080 ctx
->focus_uri
= g_strdup(focus_uri
);
1081 ctx
->msg
= msg
? sipmsg_copy(msg
) : NULL
;
1082 ctx
->accept_cb
= accept_cb
;
1083 ctx
->decline_cb
= decline_cb
;
1084 ctx
->user_data
= user_data
;
1085 ctx
->ask_ctx
= sipe_user_ask(sipe_private
, question_str
,
1086 _("Accept"), accept_invitation_cb
,
1087 _("Decline"), decline_invitation_cb
,
1090 g_free(question_str
);
1094 ask_accept_voice_conference(struct sipe_core_private
*sipe_private
,
1095 const gchar
*focus_uri
,
1097 SipeUserAskCb accept_cb
,
1098 SipeUserAskCb decline_cb
)
1101 const gchar
*novv_note
;
1106 novv_note
= _("\n\nAs this client was not compiled with voice call "
1107 "support, if you accept, you will be able to contact "
1108 "the other participants only via IM session.");
1111 question
= g_strdup_printf(_("wants to invite you "
1112 "to a conference call%s"), novv_note
);
1114 ask_accept_invitation(sipe_private
, focus_uri
, question
, msg
,
1115 accept_cb
, decline_cb
, NULL
);
1121 process_incoming_invite_conf(struct sipe_core_private
*sipe_private
,
1124 sipe_xml
*xn_conferencing
= sipe_xml_parse(msg
->body
, msg
->bodylen
);
1125 const sipe_xml
*xn_focus_uri
= sipe_xml_child(xn_conferencing
, "focus-uri");
1126 const sipe_xml
*xn_audio
= sipe_xml_child(xn_conferencing
, "audio");
1127 gchar
*focus_uri
= sipe_xml_data(xn_focus_uri
);
1128 gboolean audio
= sipe_strequal(sipe_xml_attribute(xn_audio
, "available"), "true");
1130 sipe_xml_free(xn_conferencing
);
1132 SIPE_DEBUG_INFO("We have received invitation to Conference. Focus URI=%s", focus_uri
);
1135 sip_transport_response(sipe_private
, msg
, 180, "Ringing", NULL
);
1136 ask_accept_voice_conference(sipe_private
, focus_uri
, msg
,
1137 (SipeUserAskCb
) conf_accept_cb
,
1138 (SipeUserAskCb
) conf_decline_cb
);
1141 accept_incoming_invite_conf(sipe_private
, focus_uri
, FALSE
, msg
);
1150 process_conference_av_endpoint(const sipe_xml
*endpoint
,
1151 const gchar
*user_uri
,
1152 const gchar
*self_uri
,
1153 struct sip_session
*session
)
1155 const sipe_xml
*media
;
1156 const gchar
*new_entity
;
1158 if (!sipe_strequal(user_uri
, self_uri
)) {
1159 /* We are interested only in our own endpoint data. */
1163 new_entity
= sipe_xml_attribute(endpoint
, "entity");
1164 if (!sipe_strequal(session
->audio_video_entity
, new_entity
)) {
1165 g_free(session
->audio_video_entity
);
1166 session
->audio_video_entity
= g_strdup(new_entity
);
1169 session
->audio_media_id
= 0;
1171 media
= sipe_xml_child(endpoint
, "media");
1172 for (; media
; media
= sipe_xml_twin(media
)) {
1173 gchar
*type
= sipe_xml_data(sipe_xml_child(media
, "type"));
1175 if (sipe_strequal(type
, "audio")) {
1176 session
->audio_media_id
=
1177 sipe_xml_int_attribute(media
, "id", 0);
1182 if (session
->audio_media_id
!= 0) {
1189 call_accept_cb(struct sipe_core_private
*sipe_private
, struct conf_accept_ctx
*ctx
)
1191 struct sip_session
*session
;
1192 session
= sipe_session_find_conference(sipe_private
, ctx
->focus_uri
);
1195 sipe_core_media_connect_conference(SIPE_CORE_PUBLIC
,
1196 session
->chat_session
);
1200 #ifdef HAVE_APPSHARE
1202 sipe_core_conf_is_viewing_appshare(struct sipe_core_public
*sipe_public
,
1203 struct sipe_chat_session
*chat_session
)
1209 mcu_uri
= sipe_conf_build_uri(chat_session
->id
, "applicationsharing");
1210 calls
= g_hash_table_get_values(SIPE_CORE_PRIVATE
->media_calls
);
1212 for (; calls
; calls
= g_list_delete_link(calls
, calls
)) {
1213 struct sipe_media_call
*call
= calls
->data
;
1214 if (sipe_strequal(call
->with
, mcu_uri
)) {
1221 if (calls
!= NULL
) {
1231 process_conference_appshare_endpoint(const sipe_xml
*endpoint
)
1233 gboolean presentation_added
= FALSE
;
1234 const sipe_xml
*media
;
1236 for (media
= sipe_xml_child(endpoint
, "media");
1237 media
&& !presentation_added
;
1238 media
= sipe_xml_twin(media
)) {
1243 type
= sipe_xml_data(sipe_xml_child(media
, "type"));
1244 media_state
= sipe_xml_data(sipe_xml_child(media
, "media-state"));
1245 status
= sipe_xml_data(sipe_xml_child(media
, "status"));
1247 if (sipe_strequal(type
, "applicationsharing") &&
1248 sipe_strequal(media_state
, "connected") &&
1249 sipe_strequal(status
, "sendonly")) {
1250 presentation_added
= TRUE
;
1254 g_free(media_state
);
1258 return(presentation_added
);
1260 #endif // HAVE_APPSHARE
1264 sipe_process_conference(struct sipe_core_private
*sipe_private
,
1267 sipe_xml
*xn_conference_info
;
1268 const sipe_xml
*node
;
1269 const sipe_xml
*xn_subject
;
1270 const gchar
*focus_uri
;
1271 struct sip_session
*session
;
1272 gboolean just_joined
= FALSE
;
1274 gboolean audio_was_added
= FALSE
;
1275 #ifdef HAVE_APPSHARE
1276 gboolean presentation_was_added
= FALSE
;
1280 if (msg
->response
!= 0 && msg
->response
!= 200) return;
1282 if (msg
->bodylen
== 0 || msg
->body
== NULL
|| !sipe_strequal(sipmsg_find_header(msg
, "Event"), "conference")) return;
1284 xn_conference_info
= sipe_xml_parse(msg
->body
, msg
->bodylen
);
1285 if (!xn_conference_info
) return;
1287 focus_uri
= sipe_xml_attribute(xn_conference_info
, "entity");
1288 session
= sipe_session_find_conference(sipe_private
, focus_uri
);
1291 SIPE_DEBUG_INFO("sipe_process_conference: unable to find conf session with focus=%s", focus_uri
);
1295 if (!session
->chat_session
->backend
) {
1296 gchar
*self
= sip_uri_self(sipe_private
);
1299 session
->chat_session
->backend
= sipe_backend_chat_create(SIPE_CORE_PUBLIC
,
1300 session
->chat_session
,
1301 session
->chat_session
->title
,
1304 /* @TODO ask for full state (re-subscribe) if it was a partial one -
1305 * this is to obtain full list of conference participants.
1311 if ((xn_subject
= sipe_xml_child(xn_conference_info
, "conference-description/subject"))) {
1312 g_free(session
->subject
);
1313 session
->subject
= sipe_xml_data(xn_subject
);
1314 sipe_backend_chat_topic(session
->chat_session
->backend
, session
->subject
);
1315 SIPE_DEBUG_INFO("sipe_process_conference: subject=%s", session
->subject
? session
->subject
: "");
1319 if (!session
->im_mcu_uri
) {
1320 for (node
= sipe_xml_child(xn_conference_info
, "conference-description/conf-uris/entry");
1322 node
= sipe_xml_twin(node
))
1324 gchar
*purpose
= sipe_xml_data(sipe_xml_child(node
, "purpose"));
1326 if (sipe_strequal("chat", purpose
)) {
1328 session
->im_mcu_uri
= sipe_xml_data(sipe_xml_child(node
, "uri"));
1329 SIPE_DEBUG_INFO("sipe_process_conference: im_mcu_uri=%s", session
->im_mcu_uri
);
1337 if (!session
->chat_session
->organizer
) {
1338 node
= sipe_xml_child(xn_conference_info
, "conference-description/organizer/display-name");
1340 session
->chat_session
->organizer
= sipe_xml_data(node
);
1345 if (!session
->chat_session
->join_url
) {
1346 node
= sipe_xml_child(xn_conference_info
, "conference-description/join-url");
1348 session
->chat_session
->join_url
= sipe_xml_data(node
);
1352 /* dial-in conference id */
1353 if (!session
->chat_session
->dial_in_conf_id
) {
1354 node
= sipe_xml_child(xn_conference_info
, "conference-description/pstn-access/id");
1356 session
->chat_session
->dial_in_conf_id
= sipe_xml_data(node
);
1361 for (node
= sipe_xml_child(xn_conference_info
, "users/user"); node
; node
= sipe_xml_twin(node
)) {
1362 const gchar
*user_uri
= sipe_xml_attribute(node
, "entity");
1363 const gchar
*state
= sipe_xml_attribute(node
, "state");
1364 gchar
*role
= sipe_xml_data(sipe_xml_child(node
, "roles/entry"));
1365 gboolean is_operator
= sipe_strequal(role
, "presenter");
1366 gboolean is_in_im_mcu
= FALSE
;
1367 gchar
*self
= sip_uri_self(sipe_private
);
1369 if (sipe_strequal("deleted", state
)) {
1370 if (sipe_backend_chat_find(session
->chat_session
->backend
, user_uri
)) {
1371 sipe_backend_chat_remove(session
->chat_session
->backend
,
1376 const sipe_xml
*endpoint
;
1377 for (endpoint
= sipe_xml_child(node
, "endpoint"); endpoint
; endpoint
= sipe_xml_twin(endpoint
)) {
1378 const gchar
*session_type
;
1379 gchar
*status
= sipe_xml_data(sipe_xml_child(endpoint
, "status"));
1380 gboolean connected
= sipe_strequal("connected", status
);
1386 session_type
= sipe_xml_attribute(endpoint
, "session-type");
1388 if (sipe_strequal("chat", session_type
)) {
1389 is_in_im_mcu
= TRUE
;
1390 if (!sipe_backend_chat_find(session
->chat_session
->backend
, user_uri
)) {
1391 sipe_backend_chat_add(session
->chat_session
->backend
,
1393 !just_joined
&& g_ascii_strcasecmp(user_uri
, self
));
1396 sipe_backend_chat_operator(session
->chat_session
->backend
,
1399 } else if (sipe_strequal("audio-video", session_type
)) {
1401 if (!session
->is_call
)
1402 audio_was_added
= TRUE
;
1403 process_conference_av_endpoint(endpoint
,
1408 } else if (sipe_strequal("applicationsharing", session_type
)) {
1409 #ifdef HAVE_APPSHARE
1410 if (!sipe_core_conf_is_viewing_appshare(SIPE_CORE_PUBLIC
,
1411 session
->chat_session
)) {
1412 presentation_was_added
= process_conference_appshare_endpoint(endpoint
);
1417 if (!is_in_im_mcu
) {
1418 if (sipe_backend_chat_find(session
->chat_session
->backend
, user_uri
)) {
1419 sipe_backend_chat_remove(session
->chat_session
->backend
,
1429 if (audio_was_added
) {
1430 session
->is_call
= TRUE
;
1431 ask_accept_voice_conference(sipe_private
, focus_uri
, NULL
,
1432 (SipeUserAskCb
) call_accept_cb
,
1435 #ifdef HAVE_APPSHARE
1436 if (presentation_was_added
) {
1437 sipe_core_appshare_connect_conference(SIPE_CORE_PUBLIC
,
1438 session
->chat_session
,
1444 /* entity-view, locked */
1445 for (node
= sipe_xml_child(xn_conference_info
, "conference-view/entity-view");
1447 node
= sipe_xml_twin(node
)) {
1449 const sipe_xml
*xn_type
= sipe_xml_child(node
, "entity-state/media/entry/type");
1451 if (xn_type
&& sipe_strequal("chat", (tmp
= sipe_xml_data(xn_type
)))) {
1452 const sipe_xml
*xn_locked
= sipe_xml_child(node
, "entity-state/locked");
1454 gchar
*locked
= sipe_xml_data(xn_locked
);
1455 gboolean prev_locked
= session
->locked
;
1456 session
->locked
= sipe_strequal(locked
, "true");
1457 if (prev_locked
&& !session
->locked
) {
1458 sipe_user_present_info(sipe_private
, session
,
1459 _("This conference is no longer locked. Additional participants can now join."));
1461 if (!prev_locked
&& session
->locked
) {
1462 sipe_user_present_info(sipe_private
, session
,
1463 _("This conference is locked. Nobody else can join the conference while it is locked."));
1466 SIPE_DEBUG_INFO("sipe_process_conference: session->locked=%s",
1467 session
->locked
? "TRUE" : "FALSE");
1473 sipe_xml_free(xn_conference_info
);
1475 if (session
->im_mcu_uri
) {
1476 struct sip_dialog
*dialog
= sipe_dialog_find(session
, session
->im_mcu_uri
);
1478 dialog
= sipe_dialog_add(session
);
1480 dialog
->callid
= g_strdup(session
->callid
);
1481 dialog
->with
= g_strdup(session
->im_mcu_uri
);
1483 /* send INVITE to IM MCU */
1484 sipe_im_invite(sipe_private
, session
, dialog
->with
, NULL
, NULL
, NULL
, FALSE
);
1488 sipe_process_pending_invite_queue(sipe_private
, session
);
1492 sipe_conf_immcu_closed(struct sipe_core_private
*sipe_private
,
1493 struct sip_session
*session
)
1495 sipe_user_present_info(sipe_private
, session
,
1496 _("You have been disconnected from this conference."));
1497 sipe_backend_chat_close(session
->chat_session
->backend
);
1501 conf_session_close(struct sipe_core_private
*sipe_private
,
1502 struct sip_session
*session
)
1505 /* unsubscribe from focus */
1506 sipe_subscribe_conference(sipe_private
,
1507 session
->chat_session
->id
, TRUE
);
1509 if (session
->focus_dialog
) {
1510 /* send BYE to focus */
1511 sip_transport_bye(sipe_private
, session
->focus_dialog
);
1517 sipe_process_imdn(struct sipe_core_private
*sipe_private
,
1520 gchar
*with
= parse_from(sipmsg_find_header(msg
, "From"));
1521 const gchar
*callid
= sipmsg_find_header(msg
, "Call-ID");
1522 static struct sip_session
*session
;
1524 const sipe_xml
*node
;
1528 session
= sipe_session_find_chat_or_im(sipe_private
, callid
, with
);
1530 SIPE_DEBUG_INFO("sipe_process_imdn: unable to find conf session with callid=%s", callid
);
1535 xn_imdn
= sipe_xml_parse(msg
->body
, msg
->bodylen
);
1536 message_id
= sipe_xml_data(sipe_xml_child(xn_imdn
, "message-id"));
1538 message
= g_hash_table_lookup(session
->conf_unconfirmed_messages
, message_id
);
1541 for (node
= sipe_xml_child(xn_imdn
, "recipient"); node
; node
= sipe_xml_twin(node
)) {
1542 gchar
*tmp
= parse_from(sipe_xml_attribute(node
, "uri"));
1543 gchar
*uri
= parse_from(tmp
);
1544 gchar
*status
= sipe_xml_data(sipe_xml_child(node
, "status"));
1545 guint error
= status
? g_ascii_strtoull(status
, NULL
, 10) : 0;
1546 /* default to error if missing or conversion failed */
1547 if ((error
== 0) || (error
>= 300))
1548 sipe_user_present_message_undelivered(sipe_private
,
1559 sipe_xml_free(xn_imdn
);
1561 g_hash_table_remove(session
->conf_unconfirmed_messages
, message_id
);
1562 SIPE_DEBUG_INFO("sipe_process_imdn: removed message %s from conf_unconfirmed_messages(count=%d)",
1563 message_id
, g_hash_table_size(session
->conf_unconfirmed_messages
));
1568 void sipe_core_conf_make_leader(struct sipe_core_public
*sipe_public
,
1570 const gchar
*buddy_name
)
1572 struct sipe_core_private
*sipe_private
= SIPE_CORE_PRIVATE
;
1573 struct sipe_chat_session
*chat_session
= parameter
;
1574 struct sip_session
*session
;
1576 SIPE_DEBUG_INFO("sipe_core_conf_make_leader: chat_title=%s",
1577 chat_session
->title
);
1579 session
= sipe_session_find_chat(sipe_private
, chat_session
);
1580 sipe_conf_modify_user_role(sipe_private
, session
, buddy_name
);
1583 void sipe_core_conf_remove_from(struct sipe_core_public
*sipe_public
,
1585 const gchar
*buddy_name
)
1587 struct sipe_core_private
*sipe_private
= SIPE_CORE_PRIVATE
;
1588 struct sipe_chat_session
*chat_session
= parameter
;
1589 struct sip_session
*session
;
1591 SIPE_DEBUG_INFO("sipe_core_conf_remove_from: chat_title=%s",
1592 chat_session
->title
);
1594 session
= sipe_session_find_chat(sipe_private
, chat_session
);
1595 sipe_conf_delete_user(sipe_private
, session
, buddy_name
);
1599 sipe_conf_build_uri(const gchar
*focus_uri
, const gchar
*session_type
)
1601 gchar
**parts
= g_strsplit(focus_uri
, ":focus:", 2);
1602 gchar
*result
= NULL
;
1604 if (g_strv_length(parts
) == 2) {
1605 result
= g_strconcat(parts
[0], ":", session_type
, ":", parts
[1],
1614 access_numbers_info(struct sipe_core_public
*sipe_public
)
1616 GString
*result
= g_string_new("");
1618 #if GLIB_CHECK_VERSION(2,16,0)
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 (void)sipe_public
; /* keep compiler happy */
1636 return g_string_free(result
, FALSE
);
1640 sipe_core_conf_entry_info(struct sipe_core_public
*sipe_public
,
1641 struct sipe_chat_session
*chat_session
)
1643 gchar
*access_info
= access_numbers_info(sipe_public
);
1644 gchar
*result
= g_strdup_printf(
1645 "<b><font size=\"+1\">%s</font></b><br/>"
1646 "<b>%s:</b> %s<br/>"
1647 "<b>%s:</b> %s<br/>"
1652 "<b>%s:</b> %s<br/>"
1654 "<b><font size=\"+1\">%s</font></b><br/>"
1658 SIPE_CORE_PRIVATE
->default_access_number
? SIPE_CORE_PRIVATE
->default_access_number
: "",
1660 chat_session
->dial_in_conf_id
? chat_session
->dial_in_conf_id
: "",
1662 chat_session
->join_url
? chat_session
->join_url
: "",
1664 chat_session
->organizer
? chat_session
->organizer
: "",
1665 _("Alternative dial-in numbers"),
1668 g_free(access_info
);