From cd7bc53db3c4951f0ffc2492828134b426372e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Thu, 8 Feb 2018 13:45:56 +0100 Subject: [PATCH 001/121] =?UTF-8?q?C++=20wrapper=20generator:=C2=A0reworki?= =?UTF-8?q?ng=20of=20ClassHeader=20class?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wrappers/cpp/genwrapper.py | 53 +++++++++++++++----------------------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/wrappers/cpp/genwrapper.py b/wrappers/cpp/genwrapper.py index 5d34caf13..6ac3908f6 100755 --- a/wrappers/cpp/genwrapper.py +++ b/wrappers/cpp/genwrapper.py @@ -361,25 +361,16 @@ class ClassHeader(object): self.filename = '{0}.hh'.format(_class.name.to_snake_case()) self.priorDeclarations = [] self.private_type = _class.name.to_camel_case(fullName=True) - self.includes = {'internal': [], 'external': []} - includes = self.needed_includes(_class) - - for include in includes['external']: - self.includes['external'].append({'name': include}) - - for include in includes['internal']: - self.includes['internal'].append({'name': include}) + self._populate_needed_includes(_class) - def needed_includes(self, _class): - includes = {'internal': [], 'external': []} - + def _populate_needed_includes(self, _class): if type(_class) is AbsApi.Class: for _property in _class.properties: if _property.setter is not None: - self._needed_includes_from_method(_property.setter, includes) + self._populate_needed_includes_from_method(_property.setter) if _property.getter is not None: - self._needed_includes_from_method(_property.getter, includes) + self._populate_needed_includes_from_method(_property.getter) if type(_class) is AbsApi.Class: methods = _class.classMethods + _class.instanceMethods @@ -387,26 +378,24 @@ class ClassHeader(object): methods = _class.methods for method in methods: - self._needed_includes_from_type(method.returnType, includes) + self._populate_needed_includes_from_type(method.returnType) for arg in method.args: - self._needed_includes_from_type(arg.type, includes) + self._populate_needed_includes_from_type(arg.type) if isinstance(_class, AbsApi.Class) and _class.listenerInterface is not None: decl = 'class ' + _class.listenerInterface.name.translate(metaname.Translator.get('Cpp')) self._add_prior_declaration(decl) currentClassInclude = _class.name.to_snake_case() - if currentClassInclude in includes['internal']: - includes['internal'].remove(currentClassInclude) - - return includes + if currentClassInclude in self.includes['internal']: + self.includes['internal'].remove(currentClassInclude) - def _needed_includes_from_method(self, method, includes): - self._needed_includes_from_type(method.returnType, includes) + def _populate_needed_includes_from_method(self, method): + self._populate_needed_includes_from_type(method.returnType) for arg in method.args: - self._needed_includes_from_type(arg.type, includes) + self._populate_needed_includes_from_type(arg.type) - def _needed_includes_from_type(self, type_, includes): + def _populate_needed_includes_from_type(self, type_): translator = metaname.Translator.get('Cpp') if isinstance(type_, AbsApi.ClassType): class_ = type_.desc @@ -415,7 +404,7 @@ class ClassHeader(object): self._add_prior_declaration(decl) else: rootClass = class_.find_first_ancestor_by_type(AbsApi.Namespace, priorAncestor=True) - self._add_include(includes, 'internal', rootClass.name.to_snake_case()) + self._add_include('internal', rootClass.name.to_snake_case()) elif isinstance(type_, AbsApi.EnumType): enum = type_.desc if enum.parent == self.rootNs: @@ -423,19 +412,19 @@ class ClassHeader(object): else: rootClass = enum.find_first_ancestor_by_type(AbsApi.Namespace, priorAncestor=True) headerFile = rootClass.name.to_snake_case() - self._add_include(includes, 'internal', headerFile) + self._add_include('internal', headerFile) elif isinstance(type_, AbsApi.BaseType): if type_.name == 'integer' and isinstance(type_.size, int): - self._add_include(includes, 'external', 'cstdint') + self._add_include('external', 'cstdint') elif type_.name == 'string': - self._add_include(includes, 'external', 'string') + self._add_include('external', 'string') elif isinstance(type_, AbsApi.ListType): - self._add_include(includes, 'external', 'list') - self._needed_includes_from_type(type_.containedTypeDesc, includes) + self._add_include('external', 'list') + self._populate_needed_includes_from_type(type_.containedTypeDesc) - def _add_include(self, includes, location, name): - if not name in includes[location]: - includes[location].append(name) + def _add_include(self, location, name): + if next((x for x in self.includes[location] if x['name']==name), None) is None: + self.includes[location].append({'name': name}) def _add_prior_declaration(self, decl): if next((x for x in self.priorDeclarations if x['declaration']==decl), None) is None: From 6d74bab83ebacf441613ecbf2ddd7d26d95b996f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Thu, 8 Feb 2018 15:29:11 +0100 Subject: [PATCH 002/121] Reworks gendoc.py in order to use the new API of abstractapi.py --- coreapi/help/doc/sphinx/gendoc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coreapi/help/doc/sphinx/gendoc.py b/coreapi/help/doc/sphinx/gendoc.py index 256ab1fe4..1ca6e499c 100755 --- a/coreapi/help/doc/sphinx/gendoc.py +++ b/coreapi/help/doc/sphinx/gendoc.py @@ -348,11 +348,11 @@ class DocGenerator: if not os.path.exists(directory): os.mkdir(directory) - enumsPage = EnumsPage(lang, self.languages, absApiParser.enums) + enumsPage = EnumsPage(lang, self.languages, self.api.namespace.enums) enumsPage.write(directory) indexPage = IndexPage(lang, self.languages) - for _class in absApiParser.classes: + for _class in self.api.namespace.classes: page = ClassPage(_class, lang, self.languages) page.write(directory) indexPage.add_class_entry(_class) From 2f6f839f638f9c0235d14aaacd18fb440140d586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Mon, 26 Feb 2018 14:44:42 +0100 Subject: [PATCH 003/121] Enable generation of Java documentation --- coreapi/help/doc/sphinx/class_page.mustache | 7 +++++ coreapi/help/doc/sphinx/conf.py.in | 2 +- coreapi/help/doc/sphinx/gendoc.py | 34 +++++++++++++-------- coreapi/help/doc/sphinx/source/index.rst | 1 + tools/abstractapi.py | 7 +++++ tools/metadoc.py | 8 +++++ 6 files changed, 46 insertions(+), 13 deletions(-) diff --git a/coreapi/help/doc/sphinx/class_page.mustache b/coreapi/help/doc/sphinx/class_page.mustache index f835c5c3e..af6647fc3 100644 --- a/coreapi/help/doc/sphinx/class_page.mustache +++ b/coreapi/help/doc/sphinx/class_page.mustache @@ -1,6 +1,13 @@ {{#make_chapter}}{{{className}}} class{{/make_chapter}} +{{#isNotJava}} .. {{#write_declarator}}class{{/write_declarator}}:: {{{fullClassName}}} +{{/isNotJava}} +{{#isJava}} +.. java:package:: {{{namespace}}} + +.. java:type:: public interface {{{className}}}; +{{/isJava}} {{#briefDoc}} {{#lines}} diff --git a/coreapi/help/doc/sphinx/conf.py.in b/coreapi/help/doc/sphinx/conf.py.in index 378b84244..ad43af725 100644 --- a/coreapi/help/doc/sphinx/conf.py.in +++ b/coreapi/help/doc/sphinx/conf.py.in @@ -31,7 +31,7 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = ['sphinx_csharp.csharp'] +extensions = ['sphinx_csharp.csharp', 'javasphinx'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/coreapi/help/doc/sphinx/gendoc.py b/coreapi/help/doc/sphinx/gendoc.py index 1ca6e499c..46e73fbdc 100755 --- a/coreapi/help/doc/sphinx/gendoc.py +++ b/coreapi/help/doc/sphinx/gendoc.py @@ -125,22 +125,23 @@ class RstTools: class LangInfo: def __init__(self, langCode): + if langCode not in LangInfo._displayNames: + raise ValueError("Invalid language code '{0}'".format(langCode)) self.langCode = langCode - self.displayName = LangInfo._lang_code_to_display_name(langCode) self.nameTranslator = metaname.Translator.get(langCode) self.langTranslator = abstractapi.Translator.get(langCode) self.docTranslator = metadoc.SphinxTranslator(langCode) - - @staticmethod - def _lang_code_to_display_name(langCode): - if langCode == 'C': - return 'C' - elif langCode == 'Cpp': - return 'C++' - elif langCode == 'CSharp': - return 'C#' - else: - raise ValueError("Invalid language code: '{0}'".format(langCode)) + + @property + def displayName(self): + return LangInfo._displayNames[self.langCode] + + _displayNames = { + 'C' : 'C', + 'Cpp' : 'C++', + 'Java' : 'Java', + 'CSharp': 'C#' + } class SphinxPage(object): @@ -331,6 +332,14 @@ class ClassPage(SphinxPage): table.addrow([method['link'], briefDoc]) return table + @property + def isJava(self): + return self.lang.langCode == 'Java' + + @property + def isNotJava(self): + return not self.isJava + class DocGenerator: def __init__(self, api): @@ -338,6 +347,7 @@ class DocGenerator: self.languages = [ LangInfo('C'), LangInfo('Cpp'), + LangInfo('Java'), LangInfo('CSharp') ] diff --git a/coreapi/help/doc/sphinx/source/index.rst b/coreapi/help/doc/sphinx/source/index.rst index 530adfcc3..93d7d0a30 100644 --- a/coreapi/help/doc/sphinx/source/index.rst +++ b/coreapi/help/doc/sphinx/source/index.rst @@ -12,6 +12,7 @@ Welcome to Linphone API's documentation! c/index.rst cpp/index.rst + java/index.rst csharp/index.rst diff --git a/tools/abstractapi.py b/tools/abstractapi.py index 2ea931971..de9a78e3a 100644 --- a/tools/abstractapi.py +++ b/tools/abstractapi.py @@ -1262,6 +1262,13 @@ class JavaLangTranslator(CLikeLangTranslator): def translate_argument(self, arg, native=False, jni=False): return '{0} {1}'.format(arg.type.translate(self, native=native, jni=jni), arg.name.translate(self.nameTranslator)) + def translate_method_as_prototype(self, method, namespace=None): + return 'public interface {returnType} {methodName}({arguments})'.format( + returnType=method.returnType.translate(self), + methodName=method.name.translate(self.nameTranslator), + arguments=', '.join([arg.translate(self) for arg in method.args]) + ) + class CSharpLangTranslator(CLikeLangTranslator): def __init__(self): diff --git a/tools/metadoc.py b/tools/metadoc.py index 22655adf7..828c9dd6f 100644 --- a/tools/metadoc.py +++ b/tools/metadoc.py @@ -559,6 +559,14 @@ class SphinxTranslator(Translator): self.enumReferencer = 'type' self.enumeratorReferencer = 'enum' self.methodReferencer = 'meth' + elif langCode == 'Java': + self.domain = 'java' + self.classDeclarator = 'type' + self.methodDeclarator = 'method' + self.enumDeclarator = 'type' + self.enumeratorDeclarator = 'field' + self.namespaceDeclarator = 'package' + self.methodReferencer = 'meth' else: raise ValueError('invalid language code: {0}'.format(langCode)) From cfc15904ce2df459ae528b0010a257547b88c19b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Mon, 26 Feb 2018 14:57:47 +0100 Subject: [PATCH 004/121] Add label on each property --- coreapi/help/doc/sphinx/class_page.mustache | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coreapi/help/doc/sphinx/class_page.mustache b/coreapi/help/doc/sphinx/class_page.mustache index af6647fc3..4714039a3 100644 --- a/coreapi/help/doc/sphinx/class_page.mustache +++ b/coreapi/help/doc/sphinx/class_page.mustache @@ -56,6 +56,9 @@ Properties ---------- {{#properties}} + +.. _{{{ref_label}}}: + {{{title}}} {{#hasNamespaceDeclarator}} From 8c28e1a12fbe96a500bd19e9d43f087b2a95cbfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Mon, 26 Feb 2018 15:06:49 +0100 Subject: [PATCH 005/121] Fix methods declarations --- tools/abstractapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/abstractapi.py b/tools/abstractapi.py index de9a78e3a..99b2b8ddc 100644 --- a/tools/abstractapi.py +++ b/tools/abstractapi.py @@ -1263,7 +1263,7 @@ class JavaLangTranslator(CLikeLangTranslator): return '{0} {1}'.format(arg.type.translate(self, native=native, jni=jni), arg.name.translate(self.nameTranslator)) def translate_method_as_prototype(self, method, namespace=None): - return 'public interface {returnType} {methodName}({arguments})'.format( + return 'public {returnType} {methodName}({arguments})'.format( returnType=method.returnType.translate(self), methodName=method.name.translate(self.nameTranslator), arguments=', '.join([arg.translate(self) for arg in method.args]) From 08837c74fabab7fd3c6a00a6fd83f21475f06563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 27 Feb 2018 10:40:55 +0100 Subject: [PATCH 006/121] Fix methods summary links --- coreapi/help/doc/sphinx/gendoc.py | 3 +- tools/metadoc.py | 69 +++++++++++++++++++++---------- 2 files changed, 49 insertions(+), 23 deletions(-) diff --git a/coreapi/help/doc/sphinx/gendoc.py b/coreapi/help/doc/sphinx/gendoc.py index 46e73fbdc..569e816e3 100755 --- a/coreapi/help/doc/sphinx/gendoc.py +++ b/coreapi/help/doc/sphinx/gendoc.py @@ -187,8 +187,7 @@ class SphinxPage(object): def _make_selector(self, obj): links = [] - ref = metadoc.Reference(None) - ref.relatedObject = obj + ref = metadoc.Reference.make_ref_from_object(None, obj) for lang in self.langs: if lang is self.lang: link = lang.displayName diff --git a/tools/metadoc.py b/tools/metadoc.py index 828c9dd6f..2d4a214aa 100644 --- a/tools/metadoc.py +++ b/tools/metadoc.py @@ -138,12 +138,25 @@ class Reference(ParagraphPart): ParagraphPart.__init__(self) self.cname = cname self.relatedObject = None - - def translate(self, docTranslator, **kargs): - return docTranslator.translate_reference(self, **kargs) + + @staticmethod + def make_ref_from_object(cname, obj): + if isinstance(obj, (abstractapi.Enum, abstractapi.Enumerator, abstractapi.Class, abstractapi.Interface)): + ref = ClassReference(cname) + elif isinstance(obj, abstractapi.Method): + ref = FunctionReference(cname) + else: + raise TypeError('cannot create documentation reference from {0}'.format(str(obj))) + ref.relatedObject = obj + return ref class ClassReference(Reference): + def translate(self, docTranslator, **kargs): + if self.relatedObject is None: + raise ReferenceTranslationError(self.cname) + return docTranslator.translate_class_reference(self, **kargs) + def resolve(self, api): try: self.relatedObject = api.classesIndex[self.cname] @@ -152,6 +165,11 @@ class ClassReference(Reference): class FunctionReference(Reference): + def translate(self, docTranslator, **kargs): + if self.relatedObject is None: + raise ReferenceTranslationError(self.cname) + return docTranslator.translate_function_reference(self, **kargs) + def resolve(self, api): try: self.relatedObject = api.methodsIndex[self.cname] @@ -495,13 +513,16 @@ class DoxygenTranslator(Translator): def _tag_as_brief(self, lines): if len(lines) > 0: lines[0] = '@brief ' + lines[0] - - def translate_reference(self, ref): - refStr = Translator.translate_reference(self, ref) + + def translate_class_reference(self, ref, **kargs): if isinstance(ref.relatedObject, (abstractapi.Class, abstractapi.Enum)): - return '#' + refStr - elif isinstance(ref.relatedObject, abstractapi.Method): - return refStr + '()' + return '#' + Translator.translate_reference(self, ref) + else: + raise ReferenceTranslationError(ref.cname) + + def translate_function_reference(self, ref, **kargs): + if isinstance(ref.relatedObject, abstractapi.Method): + return Translator.translate_reference(self, ref) + '()' else: raise ReferenceTranslationError(ref.cname) @@ -588,18 +609,24 @@ class SphinxTranslator(Translator): return self.get_declarator(typeName) except AttributeError: raise ValueError("'{0}' referencer type not supported".format(typeName)) - - def translate_reference(self, ref, label=None, namespace=None): - strRef = Translator.translate_reference(self, ref, absName=True) - kargs = { - 'tag' : self._sphinx_ref_tag(ref), - 'ref' : strRef, - } - kargs['label'] = label if label is not None else Translator.translate_reference(self, ref, namespace=namespace) - if isinstance(ref, FunctionReference): - kargs['label'] += '()' - - return ':{tag}:`{label} <{ref}>`'.format(**kargs) + + def translate_class_reference(self, ref, label=None, namespace=None): + return ':{tag}:`{label} <{ref}>`'.format( + tag=self._sphinx_ref_tag(ref), + label=label if label is not None else Translator.translate_reference(self, ref, namespace=namespace), + ref=Translator.translate_reference(self, ref, absName=True) + ) + + def translate_function_reference(self, ref, label=None, namespace=None): + paramTypes = [] + if self.domain != 'c': + for arg in ref.relatedObject.args: + paramTypes.append(arg._type.translate(self.langTranslator)) + return ':{tag}:`{label} <{ref}>`'.format( + tag=self._sphinx_ref_tag(ref), + label=label if label is not None else '{0}()'.format(Translator.translate_reference(self, ref, namespace=namespace)), + ref='{0}({1})'.format(Translator.translate_reference(self, ref, absName=True), ', '.join(paramTypes)) + ) def translate_keyword(self, keyword): translatedKeyword = Translator.translate_keyword(self, keyword) From 7f9636f9535091cdd219daadfc1408099262fde1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Thu, 1 Mar 2018 17:07:47 +0100 Subject: [PATCH 007/121] Fix references --- coreapi/help/doc/sphinx/class_page.mustache | 33 +++- coreapi/help/doc/sphinx/enums_page.mustache | 20 +- coreapi/help/doc/sphinx/gendoc.py | 44 ++--- tools/abstractapi.py | 192 ++++++++------------ tools/metadoc.py | 27 +-- 5 files changed, 157 insertions(+), 159 deletions(-) diff --git a/coreapi/help/doc/sphinx/class_page.mustache b/coreapi/help/doc/sphinx/class_page.mustache index 4714039a3..fe747bf4e 100644 --- a/coreapi/help/doc/sphinx/class_page.mustache +++ b/coreapi/help/doc/sphinx/class_page.mustache @@ -1,13 +1,13 @@ +{{#hasNamespaceDeclarator}} +.. {{#write_declarator}}namespace{{/write_declarator}}:: {{{namespace}}} + {{#isJava}} + :noindex: + {{/isJava}} +{{/hasNamespaceDeclarator}} + {{#make_chapter}}{{{className}}} class{{/make_chapter}} -{{#isNotJava}} -.. {{#write_declarator}}class{{/write_declarator}}:: {{{fullClassName}}} -{{/isNotJava}} -{{#isJava}} -.. java:package:: {{{namespace}}} - -.. java:type:: public interface {{{className}}}; -{{/isJava}} +.. {{#write_declarator}}class{{/write_declarator}}:: {{{classDeclaration}}} {{#briefDoc}} {{#lines}} @@ -24,6 +24,14 @@ {{{selector}}} +{{#hasNamespaceDeclarator}} +.. {{#write_declarator}}namespace{{/write_declarator}}:: {{{fullClassName}}} + {{#isJava}} + :noindex: + {{/isJava}} +{{/hasNamespaceDeclarator}} + + Summary ======= @@ -63,6 +71,9 @@ Properties {{#hasNamespaceDeclarator}} .. {{#write_declarator}}namespace{{/write_declarator}}:: {{{fullClassName}}} + {{#isJava}} + :noindex: + {{/isJava}} {{/hasNamespaceDeclarator}} {{#getter}} @@ -110,6 +121,9 @@ Public methods {{#hasNamespaceDeclarator}} .. {{#write_declarator}}namespace{{/write_declarator}}:: {{{fullClassName}}} + {{#isJava}} + :noindex: + {{/isJava}} {{/hasNamespaceDeclarator}} {{#methods}} @@ -138,6 +152,9 @@ Class methods {{#hasNamespaceDeclarator}} .. {{#write_declarator}}namespace{{/write_declarator}}:: {{{fullClassName}}} + {{#isJava}} + :noindex: + {{/isJava}} {{/hasNamespaceDeclarator}} {{#classMethods}} diff --git a/coreapi/help/doc/sphinx/enums_page.mustache b/coreapi/help/doc/sphinx/enums_page.mustache index fd013094a..59a171992 100644 --- a/coreapi/help/doc/sphinx/enums_page.mustache +++ b/coreapi/help/doc/sphinx/enums_page.mustache @@ -1,7 +1,19 @@ +{{#namespace}} +.. {{#write_declarator}}namespace{{/write_declarator}}:: {{{namespace}}} + {{#isJava}} + :noindex: + {{/isJava}} +{{/namespace}} + {{#enums}} {{{sectionName}}} -.. {{#write_declarator}}enum{{/write_declarator}}:: {{{fullName}}} +{{#isNotJava}} + .. {{#write_declarator}}enum{{/write_declarator}}:: {{{fullName}}} +{{/isNotJava}} +{{#isJava}} +.. java:type:: public enum {{{name}}}; +{{/isJava}} {{#briefDesc}} {{#lines}} @@ -11,10 +23,7 @@ {{{selector}}} - {{#hasNamespaceDeclarator}} - .. {{#write_declarator}}namespace{{/write_declarator}}:: {{{namespace}}} - {{/hasNamespaceDeclarator}} - + {{#isNotJava}} {{#enumerators}} .. {{#write_declarator}}enumerator{{/write_declarator}}:: {{{name}}}{{#value}} = {{{value}}}{{/value}} @@ -27,4 +36,5 @@ {{{selector}}} {{/enumerators}} + {{/isNotJava}} {{/enums}} diff --git a/coreapi/help/doc/sphinx/gendoc.py b/coreapi/help/doc/sphinx/gendoc.py index 569e816e3..a575bcb3d 100755 --- a/coreapi/help/doc/sphinx/gendoc.py +++ b/coreapi/help/doc/sphinx/gendoc.py @@ -162,6 +162,14 @@ class SphinxPage(object): @property def docTranslator(self): return self.lang.docTranslator + + @property + def isJava(self): + return self.lang.langCode == 'Java' + + @property + def isNotJava(self): + return not self.isJava def make_chapter(self): return lambda text: RstTools.make_chapter(pystache.render(text, self)) @@ -193,9 +201,7 @@ class SphinxPage(object): link = lang.displayName else: link = ref.translate(lang.docTranslator, label=lang.displayName) - links.append(link) - return ' '.join(links) @staticmethod @@ -213,9 +219,10 @@ class IndexPage(SphinxPage): class EnumsPage(SphinxPage): - def __init__(self, lang, langs, enums): + def __init__(self, lang, langs, api): SphinxPage.__init__(self, lang, langs, 'enums.rst') - self._translate_enums(enums) + self.namespace = api.namespace.name.translate(lang.nameTranslator) if lang.langCode != 'C' else None + self._translate_enums(api.namespace.enums) def _translate_enums(self, enums): self.enums = [] @@ -227,7 +234,6 @@ class EnumsPage(SphinxPage): 'enumerators' : self._translate_enum_values(enum), 'selector' : self._make_selector(enum) } - translatedEnum['namespace'] = self._get_translated_namespace(enum) if self.lang.langCode == 'Cpp' else translatedEnum['fullName'] translatedEnum['sectionName'] = RstTools.make_section(translatedEnum['name']) self.enums.append(translatedEnum) @@ -249,7 +255,8 @@ class ClassPage(SphinxPage): def __init__(self, _class, lang, langs): filename = SphinxPage._classname_to_filename(_class.name) SphinxPage.__init__(self, lang, langs, filename) - self.namespace = self._get_translated_namespace(_class) + namespace = _class.find_first_ancestor_by_type(abstractapi.Namespace) + self.namespace = namespace.name.translate(self.lang.nameTranslator, recursive=True) self.className = _class.name.translate(self.lang.nameTranslator) self.fullClassName = _class.name.translate(self.lang.nameTranslator, recursive=True) self.briefDoc = _class.briefDescription.translate(self.docTranslator) @@ -258,6 +265,10 @@ class ClassPage(SphinxPage): self.methods = self._translate_methods(_class.instanceMethods) self.classMethods = self._translate_methods(_class.classMethods) self.selector = self._make_selector(_class) + + @property + def classDeclaration(self): + return 'public interface {0}'.format(self.className) if self.lang.langCode == 'Java' else self.className @property def hasMethods(self): @@ -276,11 +287,12 @@ class ClassPage(SphinxPage): for property_ in properties: propertyAttr = { 'name' : property_.name.translate(self.lang.nameTranslator), - 'ref_label' : '{0}_{1}'.format(self.lang.langCode, property_.name.to_snake_case(fullName=True)), 'getter' : self._translate_method(property_.getter) if property_.getter is not None else None, 'setter' : self._translate_method(property_.setter) if property_.setter is not None else None } propertyAttr['title'] = RstTools.make_subsubsection(propertyAttr['name']) + propertyAttr['ref_label'] = (self.lang.langCode + '_') + propertyAttr['ref_label'] += (property_.getter.name.to_snake_case(fullName=True) if property_.getter is not None else property_.setter.name.to_snake_case(fullName=True)) translatedProperties.append(propertyAttr) return translatedProperties @@ -291,18 +303,16 @@ class ClassPage(SphinxPage): return translatedMethods def _translate_method(self, method): - prototypeParams = {} - if self.lang.langCode == 'Cpp': - prototypeParams['showStdNs'] = True + namespace = method.find_first_ancestor_by_type(abstractapi.Class) methAttr = { - 'prototype' : method.translate_as_prototype(self.lang.langTranslator, **prototypeParams), + 'prototype' : method.translate_as_prototype(self.lang.langTranslator, namespace=namespace), 'briefDoc' : method.briefDescription.translate(self.docTranslator), 'detailedDoc' : method.detailedDescription.translate(self.docTranslator), 'selector' : self._make_selector(method) } reference = metadoc.FunctionReference(None) reference.relatedObject = method - methAttr['link'] = reference.translate(self.lang.docTranslator) + methAttr['link'] = reference.translate(self.lang.docTranslator, namespace=method.find_first_ancestor_by_type(abstractapi.Class, abstractapi.Interface)) return methAttr @property @@ -331,14 +341,6 @@ class ClassPage(SphinxPage): table.addrow([method['link'], briefDoc]) return table - @property - def isJava(self): - return self.lang.langCode == 'Java' - - @property - def isNotJava(self): - return not self.isJava - class DocGenerator: def __init__(self, api): @@ -357,7 +359,7 @@ class DocGenerator: if not os.path.exists(directory): os.mkdir(directory) - enumsPage = EnumsPage(lang, self.languages, self.api.namespace.enums) + enumsPage = EnumsPage(lang, self.languages, self.api) enumsPage.write(directory) indexPage = IndexPage(lang, self.languages) diff --git a/tools/abstractapi.py b/tools/abstractapi.py index 99b2b8ddc..be6c1559b 100644 --- a/tools/abstractapi.py +++ b/tools/abstractapi.py @@ -949,15 +949,12 @@ class Translator: except KeyError: raise ValueError("Invalid language code: '{0}'".format(langCode)) - def _get_object_name(self, obj): - return obj.desc.name if isinstance(obj, (EnumType, ClassType)) else obj.name - - def _compute_namespace_name(self, namespace, obj): - if namespace is not None: - return namespace.name if namespace is not GlobalNs else None - else: - namespace = obj.find_first_ancestor_by_type(Enum, Class, Namespace, Interface) - return metaname.Name.find_common_parent(self._get_object_name(obj), namespace.name) + @staticmethod + def _namespace_to_name_translator_params(namespace): + return { + 'recursive': True, + 'topAncestor': namespace.name if namespace is not None else None + } class CLikeLangTranslator(Translator): @@ -971,8 +968,11 @@ class CLikeLangTranslator(Translator): else: raise TypeError('invalid enumerator value type: {0}'.format(value)) - def translate_argument(self, argument, **kargs): - return '{0} {1}'.format(argument.type.translate(self, **kargs), argument.name.translate(self.nameTranslator)) + def translate_argument(self, argument, hideArgName=False, namespace=None): + ret = argument.type.translate(self, namespace=namespace) + if not hideArgName: + ret += (' ' + argument.name.translate(self.nameTranslator)) + return ret class CLangTranslator(CLikeLangTranslator): @@ -982,19 +982,19 @@ class CLangTranslator(CLikeLangTranslator): self.falseConstantToken = 'FALSE' self.trueConstantToken = 'TRUE' - def translate_base_type(self, _type): + def translate_base_type(self, _type, **kargs): return _type.cDecl - def translate_enum_type(self, _type): + def translate_enum_type(self, _type, **kargs): return _type.cDecl - def translate_class_type(self, _type): + def translate_class_type(self, _type, **kargs): return _type.cDecl - def translate_list_type(self, _type): + def translate_list_type(self, _type, **kargs): return _type.cDecl - def translate_enumerator_value(self, value): + def translate_enumerator_value(self, value, **kargs): if value is None: return None elif isinstance(value, int): @@ -1004,19 +1004,20 @@ class CLangTranslator(CLikeLangTranslator): else: raise TypeError('invalid enumerator value type: {0}'.format(value)) - def translate_method_as_prototype(self, method, **params): + def translate_method_as_prototype(self, method, hideArguments=False, hideArgNames=False, hideReturnType=False, stripDeclarators=False, namespace=None): _class = method.find_first_ancestor_by_type(Class) - params = '{const}{className} *obj'.format( - className=_class.name.to_c(), - const='const ' if method.isconst else '' - ) - for arg in method.args: - params += (', ' + arg.translate(self)) - - return '{returnType} {name}({params})'.format( - returnType=method.returnType.translate(self), + params = [] + if not hideArguments: + params.append('{const}{className} *obj'.format( + className=_class.name.to_c(), + const='const ' if method.isconst and not stripDeclarators else '' + )) + for arg in method.args: + params.append(arg.translate(self, hideArgName=hideArgNames)) + return '{returnType}{name}({params})'.format( + returnType=(method.returnType.translate(self) + ' ') if not hideReturnType else '', name=method.name.translate(self.nameTranslator), - params=params + params=', '.join(params) ) @@ -1028,7 +1029,7 @@ class CppLangTranslator(CLikeLangTranslator): self.trueConstantToken = 'true' self.ambigousTypes = [] - def translate_base_type(self, _type, showStdNs=True, namespace=None): + def translate_base_type(self, _type, namespace=None): if _type.name == 'void': if _type.isref: return 'void *' @@ -1058,14 +1059,11 @@ class CppLangTranslator(CLikeLangTranslator): elif _type.name == 'status': res = 'linphone::Status' elif _type.name == 'string': - res = CppLangTranslator.prepend_std('string', showStdNs) + res = 'std::string' if type(_type.parent) is Argument: res += ' &' elif _type.name == 'string_array': - res = '{0}<{1}>'.format( - CppLangTranslator.prepend_std('list', showStdNs), - CppLangTranslator.prepend_std('string', showStdNs) - ) + res = 'std::list' if type(_type.parent) is Argument: res += ' &' else: @@ -1085,81 +1083,50 @@ class CppLangTranslator(CLikeLangTranslator): res += ' *' return res - def translate_enum_type(self, type_, showStdNs=True, namespace=None): + def translate_enum_type(self, type_, namespace=None): if type_.desc is None: raise TranslationError('{0} has not been fixed'.format(type_.name)) - nsName = self._compute_namespace_name(namespace, type_) - return type_.desc.name.translate(self.nameTranslator, recursive=True, topAncestor=nsName) + return type_.desc.name.translate(self.nameTranslator, **Translator._namespace_to_name_translator_params(namespace)) - def translate_class_type(self, type_, showStdNs=True, namespace=None): + def translate_class_type(self, type_, namespace=None): if type_.desc is None: raise TranslationError('{0} has not been fixed'.format(type_.name)) - nsName = self._compute_namespace_name(namespace, type_) - res = type_.desc.name.translate(self.nameTranslator, recursive=True, topAncestor=nsName) + res = type_.desc.name.translate(self.nameTranslator, **Translator._namespace_to_name_translator_params(namespace)) if type_.desc.refcountable: if type_.isconst: res = 'const ' + res if type(type_.parent) is Argument: - return 'const {0}<{1}> &'.format( - CppLangTranslator.prepend_std('shared_ptr', showStdNs), - res - ) + return 'const std::shared_ptr<{0}> &'.format(res) else: - return '{0}<{1}>'.format( - CppLangTranslator.prepend_std('shared_ptr', showStdNs), - res - ) + return 'std::shared_ptr<{0}>'.format(res) else: if type(type_.parent) is Argument: return 'const {0} &'.format(res) else: return '{0}'.format(res) - def translate_list_type(self, _type, showStdNs=True, namespace=None): + def translate_list_type(self, _type, namespace=None): if _type.containedTypeDesc is None: raise TranslationError('{0} has not been fixed'.format(_type.containedTypeName)) elif isinstance(_type.containedTypeDesc, BaseType): res = _type.containedTypeDesc.translate(self) else: - res = _type.containedTypeDesc.translate(self, showStdNs=showStdNs, namespace=namespace) + res = _type.containedTypeDesc.translate(self, namespace=namespace) if type(_type.parent) is Argument: - return 'const {0}<{1} > &'.format( - CppLangTranslator.prepend_std('list', showStdNs), - res - ) + return 'const std::list<{0}> &'.format(res) else: - return '{0}<{1} >'.format( - CppLangTranslator.prepend_std('list', showStdNs), - res - ) + return 'std::list<{0}>'.format(res) - def translate_method_as_prototype(self, method, showStdNs=True, namespace=None): - nsName = self._compute_namespace_name(namespace, method) - - argsString = '' - argStrings = [] - for arg in method.args: - argStrings.append(arg.translate(self, showStdNs=showStdNs, namespace=namespace)) - argsString = ', '.join(argStrings) - - return '{_return} {name}({args}){const}'.format( - _return=method.returnType.translate(self, ), - name=method.name.translate(self.nameTranslator, recursive=True, topAncestor=nsName), - args=argsString, - const=' const' if method.isconst else '' + def translate_method_as_prototype(self, method, hideArguments=False, hideArgNames=False, hideReturnType=False, stripDeclarators=False, namespace=None): + argsAsString = ', '.join([arg.translate(self, hideArgName=hideArgNames, namespace=namespace) for arg in method.args]) if not hideArguments else '' + return '{return_}{name}({args}){const}'.format( + return_=(method.returnType.translate(self, namespace=namespace) + ' ') if not hideReturnType else '', + name=method.name.translate(self.nameTranslator, **Translator._namespace_to_name_translator_params(namespace)), + args=argsAsString, + const=' const' if method.isconst and not stripDeclarators else '' ) - - @staticmethod - def prepend_std(string, prepend): - return 'std::' + string if prepend else string - - def _compute_namespace_name(self, namespace, obj): - nsName = Translator._compute_namespace_name(self, namespace, obj) - if self._get_object_name(obj).to_c() in self.ambigousTypes: - nsName = None - return nsName class JavaLangTranslator(CLikeLangTranslator): @@ -1226,14 +1193,12 @@ class JavaLangTranslator(CLikeLangTranslator): elif jni: return 'jint' else: - nsName = self._compute_namespace_name(namespace, _type) - return _type.desc.name.translate(self.nameTranslator, recursive=True, topAncestor=nsName) + return _type.desc.name.translate(self.nameTranslator, **Translator._namespace_to_name_translator_params(namespace)) def translate_class_type(self, _type, native=False, jni=False, isReturn=False, namespace=None): if jni: return 'jobject' - nsName = self._compute_namespace_name(namespace, _type) - return _type.desc.name.translate(self.nameTranslator, recursive=True, topAncestor=nsName) + return _type.desc.name.translate(self.nameTranslator, **Translator._namespace_to_name_translator_params(namespace)) def translate_list_type(self, _type, native=False, jni=False, isReturn=False, namespace=None): if jni: @@ -1259,14 +1224,18 @@ class JavaLangTranslator(CLikeLangTranslator): raise Error('translation of bctbx_list_t of unknow type !') return ptrtype + '[]' - def translate_argument(self, arg, native=False, jni=False): - return '{0} {1}'.format(arg.type.translate(self, native=native, jni=jni), arg.name.translate(self.nameTranslator)) + def translate_argument(self, arg, native=False, jni=False, hideArgName=False, namespace=None): + res = arg.type.translate(self, native=native, jni=jni, namespace=None) + if not hideArgName: + res += (' ' + arg.name.translate(self.nameTranslator)) + return res - def translate_method_as_prototype(self, method, namespace=None): - return 'public {returnType} {methodName}({arguments})'.format( - returnType=method.returnType.translate(self), - methodName=method.name.translate(self.nameTranslator), - arguments=', '.join([arg.translate(self) for arg in method.args]) + def translate_method_as_prototype(self, method, hideArguments=False, hideArgNames=False, hideReturnType=False, stripDeclarators=False, namespace=None): + return '{public}{returnType}{methodName}({arguments})'.format( + public='public ' if not stripDeclarators else '', + returnType=(method.returnType.translate(self, isReturn=True, namespace=namespace) + ' ') if not hideReturnType else '', + methodName=method.name.translate(self.nameTranslator, **Translator._namespace_to_name_translator_params(namespace)), + arguments=', '.join([arg.translate(self, hideArgName=hideArgNames, namespace=namespace) for arg in method.args]) if not hideArguments else '' ) @@ -1277,7 +1246,7 @@ class CSharpLangTranslator(CLikeLangTranslator): self.falseConstantToken = 'false' self.trueConstantToken = 'true' - def translate_base_type(self, _type, dllImport=True): + def translate_base_type(self, _type, dllImport=True, namespace=None): if _type.name == 'void': if _type.isref: return 'IntPtr' @@ -1326,16 +1295,16 @@ class CSharpLangTranslator(CLikeLangTranslator): return res - def translate_enum_type(self, _type, dllImport=True): + def translate_enum_type(self, _type, dllImport=True, namespace=None): if dllImport and type(_type.parent) is Argument: return 'int' else: - return _type.desc.name.translate(self.nameTranslator) + return _type.desc.name.translate(self.nameTranslator, **Translator._namespace_to_name_translator_params(namespace)) - def translate_class_type(self, _type, dllImport=True): - return "IntPtr" if dllImport else _type.desc.name.translate(self.nameTranslator) + def translate_class_type(self, _type, dllImport=True, namespace=None): + return "IntPtr" if dllImport else _type.desc.name.translate(self.nameTranslator, **Translator._namespace_to_name_translator_params(namespace)) - def translate_list_type(self, _type, dllImport=True): + def translate_list_type(self, _type, dllImport=True, namespace=None): if dllImport: return 'IntPtr' else: @@ -1345,7 +1314,7 @@ class CSharpLangTranslator(CLikeLangTranslator): else: raise TranslationError('translation of bctbx_list_t of basic C types is not supported') elif type(_type.containedTypeDesc) is ClassType: - ptrType = _type.containedTypeDesc.desc.name.translate(self.nameTranslator) + ptrType = _type.containedTypeDesc.desc.name.translate(self.nameTranslator, **Translator._namespace_to_name_translator_params(namespace)) return 'IEnumerable<' + ptrType + '>' else: if _type.containedTypeDesc: @@ -1353,22 +1322,17 @@ class CSharpLangTranslator(CLikeLangTranslator): else: raise TranslationError('translation of bctbx_list_t of unknow type !') - def translate_argument(self, arg, dllImport=True): + def translate_argument(self, arg, dllImport=True, namespace=None): return '{0} {1}'.format( - arg.type.translate(self, dllImport=dllImport), + arg.type.translate(self, dllImport=dllImport, namespace=None), arg.name.translate(self.nameTranslator) ) - def translate_method_as_prototype(self, method): - kargs = { - 'static' : 'static ' if method.type == Method.Type.Class else '', - 'override' : 'override ' if method.name.translate(self.nameTranslator) == 'ToString' else '', - 'returnType' : method.returnType.translate(self, dllImport=False), - 'name' : method.name.translate(self.nameTranslator), - 'args' : '' - } - for arg in method.args: - if kargs['args'] != '': - kargs['args'] += ', ' - kargs['args'] += arg.translate(self, dllImport=False) - return '{static}{override}{returnType} {name}({args})'.format(**kargs) + def translate_method_as_prototype(self, method, hideArguments=False, hideArgNames=False, hideReturnType=False, stripDeclarators=False, namespace=None): + return '{static}{override}{returnType}{name}({args})'.format( + static = 'static ' if method.type == Method.Type.Class and not stripDeclarators else '', + override = 'override ' if method.name.translate(self.nameTranslator) == 'ToString' and not stripDeclarators else '', + returnType = (method.returnType.translate(self, dllImport=False, namespace=namespace) + ' ') if not hideReturnType else '', + name = method.name.translate(self.nameTranslator, **Translator._namespace_to_name_translator_params(namespace)), + args = ', '.join([arg.translate(self, dllImport=False, namespace=namespace) for arg in method.args]) if not hideArguments else '' + ) diff --git a/tools/metadoc.py b/tools/metadoc.py index 2d4a214aa..e739b318b 100644 --- a/tools/metadoc.py +++ b/tools/metadoc.py @@ -435,12 +435,11 @@ class Translator: else: if namespace is None: description = ref.find_root() - namespaceObj = description.relatedObject.find_first_ancestor_by_type(abstractapi.Namespace, abstractapi.Class) - namespace = namespaceObj.name - if namespace.is_prefix_of(ref.relatedObject.name): - commonName = namespace + namespace = description.relatedObject.find_first_ancestor_by_type(abstractapi.Namespace, abstractapi.Class) + if namespace.name.is_prefix_of(ref.relatedObject.name): + commonName = namespace.name else: - commonName = metaname.Name.find_common_parent(ref.relatedObject.name, namespace) + commonName = metaname.Name.find_common_parent(ref.relatedObject.name, namespace.name) return ref.relatedObject.name.translate(self.nameTranslator, recursive=True, topAncestor=commonName) def translate_keyword(self, keyword): @@ -617,15 +616,21 @@ class SphinxTranslator(Translator): ref=Translator.translate_reference(self, ref, absName=True) ) - def translate_function_reference(self, ref, label=None, namespace=None): - paramTypes = [] - if self.domain != 'c': - for arg in ref.relatedObject.args: - paramTypes.append(arg._type.translate(self.langTranslator)) + def translate_function_reference(self, ref, label=None, useNamespace=True, namespace=None): + if self.domain == 'csharp': + refStr = ref.relatedObject.name.translate(self.nameTranslator, **abstractapi.Translator._namespace_to_name_translator_params(namespace)) + else: + refStr = ref.relatedObject.translate_as_prototype(self.langTranslator, + hideArguments=self.domain != 'java', + hideArgNames=self.domain == 'java', + hideReturnType=True, + stripDeclarators=True, + namespace=namespace + ) return ':{tag}:`{label} <{ref}>`'.format( tag=self._sphinx_ref_tag(ref), label=label if label is not None else '{0}()'.format(Translator.translate_reference(self, ref, namespace=namespace)), - ref='{0}({1})'.format(Translator.translate_reference(self, ref, absName=True), ', '.join(paramTypes)) + ref=refStr ) def translate_keyword(self, keyword): From 5c6bf5db1312f32644091f9122cb0670abd4f236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 6 Mar 2018 13:51:33 +0100 Subject: [PATCH 008/121] Fixes selector's links on between enums --- coreapi/help/doc/sphinx/enums_page.mustache | 9 ++------- coreapi/help/doc/sphinx/gendoc.py | 1 + tools/metadoc.py | 8 ++++---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/coreapi/help/doc/sphinx/enums_page.mustache b/coreapi/help/doc/sphinx/enums_page.mustache index 59a171992..16b45bddb 100644 --- a/coreapi/help/doc/sphinx/enums_page.mustache +++ b/coreapi/help/doc/sphinx/enums_page.mustache @@ -8,12 +8,7 @@ {{#enums}} {{{sectionName}}} -{{#isNotJava}} - .. {{#write_declarator}}enum{{/write_declarator}}:: {{{fullName}}} -{{/isNotJava}} -{{#isJava}} -.. java:type:: public enum {{{name}}}; -{{/isJava}} +.. {{#write_declarator}}enum{{/write_declarator}}:: {{{declaration}}} {{#briefDesc}} {{#lines}} @@ -25,7 +20,7 @@ {{#isNotJava}} {{#enumerators}} - .. {{#write_declarator}}enumerator{{/write_declarator}}:: {{{name}}}{{#value}} = {{{value}}}{{/value}} + .. {{#write_declarator}}enumerator{{/write_declarator}}:: {{{name}}} {{#briefDesc}} {{#lines}} diff --git a/coreapi/help/doc/sphinx/gendoc.py b/coreapi/help/doc/sphinx/gendoc.py index a575bcb3d..11d3b68d0 100755 --- a/coreapi/help/doc/sphinx/gendoc.py +++ b/coreapi/help/doc/sphinx/gendoc.py @@ -235,6 +235,7 @@ class EnumsPage(SphinxPage): 'selector' : self._make_selector(enum) } translatedEnum['sectionName'] = RstTools.make_section(translatedEnum['name']) + translatedEnum['declaration'] = 'public enum {0}'.format(translatedEnum['name']) if self.lang.langCode == 'Java' else translatedEnum['name'] self.enums.append(translatedEnum) def _translate_enum_values(self, enum): diff --git a/tools/metadoc.py b/tools/metadoc.py index e739b318b..3db05655f 100644 --- a/tools/metadoc.py +++ b/tools/metadoc.py @@ -403,6 +403,7 @@ class ReferenceTranslationError(TranslationError): class Translator: def __init__(self, langCode): + self.langCode = langCode self.textWidth = 80 self.nameTranslator = metaname.Translator.get(langCode) self.langTranslator = abstractapi.Translator.get(langCode) @@ -553,12 +554,11 @@ class SphinxTranslator(Translator): def __init__(self, langCode): Translator.__init__(self, langCode) if langCode == 'C': - self.domain = 'c' + self.domain = 'cpp' self.classDeclarator = 'type' self.methodDeclarator = 'function' - self.enumDeclarator = 'type' - self.enumeratorDeclarator = 'var' - self.enumeratorReferencer = 'data' + self.enumDeclarator = 'enum' + self.enumeratorDeclarator = 'enumerator' self.methodReferencer = 'func' elif langCode == 'Cpp': self.domain = 'cpp' From ed9bc0f6db3cad33ad238ff3dd02dfda54ec738d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 6 Mar 2018 15:41:28 +0100 Subject: [PATCH 009/121] Java enums support --- coreapi/help/doc/sphinx/enums_page.mustache | 7 +++++-- coreapi/help/doc/sphinx/gendoc.py | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/coreapi/help/doc/sphinx/enums_page.mustache b/coreapi/help/doc/sphinx/enums_page.mustache index 16b45bddb..cd74bd73c 100644 --- a/coreapi/help/doc/sphinx/enums_page.mustache +++ b/coreapi/help/doc/sphinx/enums_page.mustache @@ -18,10 +18,14 @@ {{{selector}}} - {{#isNotJava}} {{#enumerators}} + {{#isNotJava}} .. {{#write_declarator}}enumerator{{/write_declarator}}:: {{{name}}} + {{/isNotJava}} + {{#isJava}} + **{{{name}}}** + {{/isJava}} {{#briefDesc}} {{#lines}} {{{line}}} @@ -31,5 +35,4 @@ {{{selector}}} {{/enumerators}} - {{/isNotJava}} {{/enums}} diff --git a/coreapi/help/doc/sphinx/gendoc.py b/coreapi/help/doc/sphinx/gendoc.py index 11d3b68d0..6a5556fa6 100755 --- a/coreapi/help/doc/sphinx/gendoc.py +++ b/coreapi/help/doc/sphinx/gendoc.py @@ -195,11 +195,14 @@ class SphinxPage(object): def _make_selector(self, obj): links = [] - ref = metadoc.Reference.make_ref_from_object(None, obj) for lang in self.langs: if lang is self.lang: link = lang.displayName else: + if lang.langCode == 'Java' and type(obj) is abstractapi.Enumerator: + ref = metadoc.Reference.make_ref_from_object(None, obj.parent) + else: + ref = metadoc.Reference.make_ref_from_object(None, obj) link = ref.translate(lang.docTranslator, label=lang.displayName) links.append(link) return ' '.join(links) From a3c41aae31636a0ea812efc0baa41de15f2d42e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Wed, 7 Mar 2018 16:08:47 +0100 Subject: [PATCH 010/121] Fixes references in Doxygen docstrings --- include/linphone/account_creator.h | 252 +++---- include/linphone/account_creator_service.h | 100 +-- include/linphone/api/c-address.h | 42 +- include/linphone/api/c-call-cbs.h | 50 +- include/linphone/api/c-call-stats.h | 40 +- include/linphone/api/c-call.h | 122 ++-- include/linphone/api/c-callbacks.h | 26 +- include/linphone/api/c-chat-message-cbs.h | 2 +- include/linphone/api/c-chat-message.h | 54 +- include/linphone/api/c-chat-room-cbs.h | 60 +- include/linphone/api/c-chat-room.h | 72 +- include/linphone/api/c-participant.h | 12 +- include/linphone/api/c-types.h | 30 +- include/linphone/auth_info.h | 4 +- include/linphone/buffer.h | 40 +- include/linphone/call_log.h | 42 +- include/linphone/call_params.h | 76 +- include/linphone/callbacks.h | 108 +-- include/linphone/conference.h | 2 +- include/linphone/content.h | 56 +- include/linphone/core.h | 810 ++++++++++----------- include/linphone/error_info.h | 36 +- include/linphone/event.h | 20 +- include/linphone/factory.h | 150 ++-- include/linphone/friend.h | 22 +- include/linphone/friendlist.h | 144 ++-- include/linphone/headers.h | 6 +- include/linphone/im_encryption_engine.h | 66 +- include/linphone/im_notif_policy.h | 50 +- include/linphone/info_message.h | 2 +- include/linphone/lpconfig.h | 56 +- include/linphone/misc.h | 44 +- include/linphone/nat_policy.h | 64 +- include/linphone/payload_type.h | 2 +- include/linphone/player.h | 62 +- include/linphone/presence.h | 8 +- include/linphone/proxy_config.h | 12 +- include/linphone/ringtoneplayer.h | 2 +- include/linphone/tunnel.h | 78 +- include/linphone/types.h | 74 +- include/linphone/vcard.h | 66 +- include/linphone/video_definition.h | 48 +- include/linphone/wrapper_utils.h | 2 +- include/linphone/xmlrpc.h | 86 +-- 44 files changed, 1550 insertions(+), 1550 deletions(-) diff --git a/include/linphone/account_creator.h b/include/linphone/account_creator.h index d5ef4dc12..3d1a7644b 100644 --- a/include/linphone/account_creator.h +++ b/include/linphone/account_creator.h @@ -33,302 +33,302 @@ extern "C" { /** * Callback to notify a response of server. - * @param[in] creator LinphoneAccountCreator object - * @param[in] status The status of the LinphoneAccountCreator test existence operation that has just finished + * @param[in] creator #LinphoneAccountCreator object + * @param[in] status The status of the #LinphoneAccountCreator test existence operation that has just finished **/ typedef void (*LinphoneAccountCreatorCbsStatusCb)(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status, const char* resp); /************************** Start Account Creator data **************************/ /** - * Create a LinphoneAccountCreator and set Linphone Request callbacks. - * @param[in] core The LinphoneCore used for the XML-RPC communication + * Create a #LinphoneAccountCreator and set Linphone Request callbacks. + * @param[in] core The #LinphoneCore used for the XML-RPC communication * @param[in] xmlrpc_url The URL to the XML-RPC server. Must be NON NULL. - * @return The new LinphoneAccountCreator object. + * @return The new #LinphoneAccountCreator object. **/ LINPHONE_PUBLIC LinphoneAccountCreator * linphone_account_creator_new(LinphoneCore *core, const char *xmlrpc_url); /** * Reset the account creator entries like username, password, phone number... - * @param[in] creator LinphoneAccountCreator object + * @param[in] creator #LinphoneAccountCreator object **/ LINPHONE_PUBLIC void linphone_account_creator_reset(LinphoneAccountCreator *creator); /** * Send a request to know the existence of account on server. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise + * @param[in] creator #LinphoneAccountCreator object + * @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise **/ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account_exist(LinphoneAccountCreator *creator); /** * Send a request to create an account on server. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise + * @param[in] creator #LinphoneAccountCreator object + * @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise **/ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_create_account(LinphoneAccountCreator *creator); /** * Send a request to know if an account is activated on server. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise + * @param[in] creator #LinphoneAccountCreator object + * @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise **/ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account_activated(LinphoneAccountCreator *creator); /** * Send a request to activate an account on server. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise + * @param[in] creator #LinphoneAccountCreator object + * @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise **/ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_activate_account(LinphoneAccountCreator *creator); /** * Send a request to link an account to an alias. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise + * @param[in] creator #LinphoneAccountCreator object + * @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise **/ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_link_account(LinphoneAccountCreator *creator); /** * Send a request to activate an alias. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise + * @param[in] creator #LinphoneAccountCreator object + * @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise **/ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_activate_alias(LinphoneAccountCreator *creator); /** * Send a request to know if an alias is used. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise + * @param[in] creator #LinphoneAccountCreator object + * @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise **/ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_alias_used(LinphoneAccountCreator *creator); /** * Send a request to know if an account is linked. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise + * @param[in] creator #LinphoneAccountCreator object + * @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise **/ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_is_account_linked(LinphoneAccountCreator *creator); /** * Send a request to recover an account. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise + * @param[in] creator #LinphoneAccountCreator object + * @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise **/ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_recover_account(LinphoneAccountCreator *creator); /** * Send a request to update an account. - * @param[in] creator LinphoneAccountCreator object - * @return LinphoneAccountCreatorStatusRequestOk if the request has been sent, LinphoneAccountCreatorStatusRequestFailed otherwise + * @param[in] creator #LinphoneAccountCreator object + * @return #LinphoneAccountCreatorStatusRequestOk if the request has been sent, #LinphoneAccountCreatorStatusRequestFailed otherwise **/ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_update_account(LinphoneAccountCreator *creator); /** * Acquire a reference to the LinphoneAccountCreator. - * @param[in] creator LinphoneAccountCreator object. - * @return The same LinphoneAccountCreator object. + * @param[in] creator #LinphoneAccountCreator object. + * @return The same #LinphoneAccountCreator object. **/ LINPHONE_PUBLIC LinphoneAccountCreator * linphone_account_creator_ref(LinphoneAccountCreator *creator); /** * Release reference to the LinphoneAccountCreator. - * @param[in] creator LinphoneAccountCreator object. + * @param[in] creator #LinphoneAccountCreator object. **/ LINPHONE_PUBLIC void linphone_account_creator_unref(LinphoneAccountCreator *creator); /** * Retrieve the user pointer associated with the LinphoneAccountCreator. - * @param[in] creator LinphoneAccountCreator object. + * @param[in] creator #LinphoneAccountCreator object. * @return The user pointer associated with the LinphoneAccountCreator. **/ LINPHONE_PUBLIC void *linphone_account_creator_get_user_data(const LinphoneAccountCreator *creator); /** * Assign a user pointer to the LinphoneAccountCreator. - * @param[in] creator LinphoneAccountCreator object. + * @param[in] creator #LinphoneAccountCreator object. * @param[in] ud The user pointer to associate with the LinphoneAccountCreator. **/ LINPHONE_PUBLIC void linphone_account_creator_set_user_data(LinphoneAccountCreator *creator, void *ud); /** * Set the username. - * @param[in] creator LinphoneAccountCreator object + * @param[in] creator #LinphoneAccountCreator object * @param[in] username The username to set - * @return LinphoneAccountCreatorUsernameStatusOk if everything is OK, or a specific error otherwise. + * @return #LinphoneAccountCreatorUsernameStatusOk if everything is OK, or a specific error otherwise. **/ LINPHONE_PUBLIC LinphoneAccountCreatorUsernameStatus linphone_account_creator_set_username(LinphoneAccountCreator *creator, const char *username); /** * Get the username. - * @param[in] creator LinphoneAccountCreator object - * @return The username of the LinphoneAccountCreator + * @param[in] creator #LinphoneAccountCreator object + * @return The username of the #LinphoneAccountCreator **/ LINPHONE_PUBLIC const char * linphone_account_creator_get_username(const LinphoneAccountCreator *creator); /** * Set the phone number normalized. - * @param[in] creator LinphoneAccountCreator object + * @param[in] creator #LinphoneAccountCreator object * @param[in] phone_number The phone number to set * @param[in] country_code Country code to associate phone number with - * @return LinphoneAccountCreatorPhoneNumberStatusOk if everything is OK, or specific(s) error(s) otherwise. + * @return #LinphoneAccountCreatorPhoneNumberStatusOk if everything is OK, or specific(s) error(s) otherwise. **/ LINPHONE_PUBLIC LinphoneAccountCreatorPhoneNumberStatusMask linphone_account_creator_set_phone_number(LinphoneAccountCreator *creator, const char *phone_number, const char *country_code); /** * Get the RFC 3966 normalized phone number. - * @param[in] creator LinphoneAccountCreator object - * @return The phone number of the LinphoneAccountCreator + * @param[in] creator #LinphoneAccountCreator object + * @return The phone number of the #LinphoneAccountCreator **/ LINPHONE_PUBLIC const char * linphone_account_creator_get_phone_number(const LinphoneAccountCreator *creator); /** * Set the password. - * @param[in] creator LinphoneAccountCreator object + * @param[in] creator #LinphoneAccountCreator object * @param[in] password The password to set - * @return LinphoneAccountCreatorPasswordStatusOk if everything is OK, or specific(s) error(s) otherwise. + * @return #LinphoneAccountCreatorPasswordStatusOk if everything is OK, or specific(s) error(s) otherwise. **/ LINPHONE_PUBLIC LinphoneAccountCreatorPasswordStatus linphone_account_creator_set_password(LinphoneAccountCreator *creator, const char *password); /** * Get the password. - * @param[in] creator LinphoneAccountCreator object - * @return The password of the LinphoneAccountCreator + * @param[in] creator #LinphoneAccountCreator object + * @return The password of the #LinphoneAccountCreator **/ LINPHONE_PUBLIC const char * linphone_account_creator_get_password(const LinphoneAccountCreator *creator); /** * Set the ha1. - * @param[in] creator LinphoneAccountCreator object + * @param[in] creator #LinphoneAccountCreator object * @param[in] ha1 The ha1 to set - * @return LinphoneAccountCreatorPasswordStatusOk if everything is OK, or a specific error otherwise. + * @return #LinphoneAccountCreatorPasswordStatusOk if everything is OK, or a specific error otherwise. **/ LINPHONE_PUBLIC LinphoneAccountCreatorPasswordStatus linphone_account_creator_set_ha1(LinphoneAccountCreator *creator, const char *ha1); /** * Get the ha1. - * @param[in] creator LinphoneAccountCreator object - * @return The ha1 of the LinphoneAccountCreator + * @param[in] creator #LinphoneAccountCreator object + * @return The ha1 of the #LinphoneAccountCreator **/ LINPHONE_PUBLIC const char * linphone_account_creator_get_ha1(const LinphoneAccountCreator *creator); /** * Set the activation code. - * @param[in] creator LinphoneAccountCreator object + * @param[in] creator #LinphoneAccountCreator object * @param[in] activation_code The activation code to set - * @return LinphoneAccountCreatorActivationCodeStatusOk if everything is OK, or a specific error otherwise. + * @return #LinphoneAccountCreatorActivationCodeStatusOk if everything is OK, or a specific error otherwise. **/ LINPHONE_PUBLIC LinphoneAccountCreatorActivationCodeStatus linphone_account_creator_set_activation_code(LinphoneAccountCreator *creator, const char *activation_code); /** * Get the activation code. - * @param[in] creator LinphoneAccountCreator object - * @return The activation code of the LinphoneAccountCreator + * @param[in] creator #LinphoneAccountCreator object + * @return The activation code of the #LinphoneAccountCreator **/ LINPHONE_PUBLIC const char * linphone_account_creator_get_activation_code(const LinphoneAccountCreator *creator); /** * Set the language to use in email or SMS if supported. - * @param[in] creator LinphoneAccountCreator object + * @param[in] creator #LinphoneAccountCreator object * @param[in] lang The language to use - * @return LinphoneAccountCreatorLanguageStatusOk if everything is OK, or a specific error otherwise. + * @return #LinphoneAccountCreatorLanguageStatusOk if everything is OK, or a specific error otherwise. **/ LINPHONE_PUBLIC LinphoneAccountCreatorLanguageStatus linphone_account_creator_set_language(LinphoneAccountCreator *creator, const char *lang); /** * Get the language use in email of SMS. - * @param[in] creator LinphoneAccountCreator object - * @return The language of the LinphoneAccountCreator + * @param[in] creator #LinphoneAccountCreator object + * @return The language of the #LinphoneAccountCreator **/ LINPHONE_PUBLIC const char * linphone_account_creator_get_language(const LinphoneAccountCreator *creator); /** * Set the display name. - * @param[in] creator LinphoneAccountCreator object + * @param[in] creator #LinphoneAccountCreator object * @param[in] display_name The display name to set - * @return LinphoneAccountCreatorUsernameStatusOk if everything is OK, or a specific error otherwise. + * @return #LinphoneAccountCreatorUsernameStatusOk if everything is OK, or a specific error otherwise. **/ LINPHONE_PUBLIC LinphoneAccountCreatorUsernameStatus linphone_account_creator_set_display_name(LinphoneAccountCreator *creator, const char *display_name); /** * Get the display name. - * @param[in] creator LinphoneAccountCreator object - * @return The display name of the LinphoneAccountCreator + * @param[in] creator #LinphoneAccountCreator object + * @return The display name of the #LinphoneAccountCreator **/ LINPHONE_PUBLIC const char * linphone_account_creator_get_display_name(const LinphoneAccountCreator *creator); /** * Set the email. - * @param[in] creator LinphoneAccountCreator object + * @param[in] creator #LinphoneAccountCreator object * @param[in] email The email to set - * @return LinphoneAccountCreatorEmailStatusOk if everything is OK, or a specific error otherwise. + * @return #LinphoneAccountCreatorEmailStatusOk if everything is OK, or a specific error otherwise. **/ LINPHONE_PUBLIC LinphoneAccountCreatorEmailStatus linphone_account_creator_set_email(LinphoneAccountCreator *creator, const char *email); /** * Get the email. - * @param[in] creator LinphoneAccountCreator object - * @return The email of the LinphoneAccountCreator + * @param[in] creator #LinphoneAccountCreator object + * @return The email of the #LinphoneAccountCreator **/ LINPHONE_PUBLIC const char * linphone_account_creator_get_email(const LinphoneAccountCreator *creator); /** * Set the domain. - * @param[in] creator LinphoneAccountCreator object + * @param[in] creator #LinphoneAccountCreator object * @param[in] domain The domain to set - * @return LinphoneAccountCreatorDomainOk if everything is OK, or a specific error otherwise. + * @return #LinphoneAccountCreatorDomainOk if everything is OK, or a specific error otherwise. **/ LINPHONE_PUBLIC LinphoneAccountCreatorDomainStatus linphone_account_creator_set_domain(LinphoneAccountCreator *creator, const char *domain); /** * Get the domain. - * @param[in] creator LinphoneAccountCreator object - * @return The domain of the LinphoneAccountCreator + * @param[in] creator #LinphoneAccountCreator object + * @return The domain of the #LinphoneAccountCreator **/ LINPHONE_PUBLIC const char * linphone_account_creator_get_domain(const LinphoneAccountCreator *creator); /** * Set Transport - * @param[in] creator LinphoneAccountCreator object + * @param[in] creator #LinphoneAccountCreator object * @param[in] transport The transport to set - * @return LinphoneAccountCreatorTransportOk if everything is OK, or a specific error otherwise. + * @return #LinphoneAccountCreatorTransportOk if everything is OK, or a specific error otherwise. **/ LINPHONE_PUBLIC LinphoneAccountCreatorTransportStatus linphone_account_creator_set_transport(LinphoneAccountCreator *creator, LinphoneTransportType transport); /** * get Transport - * @param[in] creator LinphoneAccountCreator object - * @return The transport of LinphoneAccountCreator + * @param[in] creator #LinphoneAccountCreator object + * @return The transport of #LinphoneAccountCreator **/ LINPHONE_PUBLIC LinphoneTransportType linphone_account_creator_get_transport(const LinphoneAccountCreator *creator); /** * Set the route. - * @param[in] creator LinphoneAccountCreator object + * @param[in] creator #LinphoneAccountCreator object * @param[in] route The route to set - * @return LinphoneAccountCreatorStatusRequestOk if everything is OK, or a specific error otherwise. + * @return #LinphoneAccountCreatorStatusRequestOk if everything is OK, or a specific error otherwise. **/ LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_set_route(LinphoneAccountCreator *creator, const char *route); /** * Get the route. - * @param[in] creator LinphoneAccountCreator object - * @return The route of the LinphoneAccountCreator + * @param[in] creator #LinphoneAccountCreator object + * @return The route of the #LinphoneAccountCreator **/ LINPHONE_DEPRECATED LINPHONE_PUBLIC const char * linphone_account_creator_get_route(const LinphoneAccountCreator *creator); /** - * Get the LinphoneAccountCreatorCbs object associated with a LinphoneAccountCreator. - * @param[in] creator LinphoneAccountCreator object - * @return The LinphoneAccountCreatorCbs object associated with the LinphoneAccountCreator. + * Get the #LinphoneAccountCreatorCbs object associated with a LinphoneAccountCreator. + * @param[in] creator #LinphoneAccountCreator object + * @return The #LinphoneAccountCreatorCbs object associated with the LinphoneAccountCreator. **/ LINPHONE_PUBLIC LinphoneAccountCreatorCbs * linphone_account_creator_get_callbacks(const LinphoneAccountCreator *creator); /** - * Get the LinphoneAccountCreatorService object associated with a LinphoneAccountCreator. - * @param[in] creator LinphoneAccountCreator object - * @return The LinphoneAccountCreatorService object associated with the LinphoneAccountCreator. + * Get the #LinphoneAccountCreatorService object associated with a LinphoneAccountCreator. + * @param[in] creator #LinphoneAccountCreator object + * @return The #LinphoneAccountCreatorService object associated with the LinphoneAccountCreator. * @donotwrap **/ LINPHONE_PUBLIC LinphoneAccountCreatorService * linphone_account_creator_get_service(const LinphoneAccountCreator *creator); @@ -338,168 +338,168 @@ LINPHONE_PUBLIC LinphoneAccountCreatorService * linphone_account_creator_get_ser /************************** Start Account Creator Cbs **************************/ /** - * Acquire a reference to a LinphoneAccountCreatorCbs object. - * @param[in] cbs LinphoneAccountCreatorCbs object. - * @return The same LinphoneAccountCreatorCbs object. + * Acquire a reference to a #LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. + * @return The same #LinphoneAccountCreatorCbs object. **/ LINPHONE_PUBLIC LinphoneAccountCreatorCbs * linphone_account_creator_cbs_ref(LinphoneAccountCreatorCbs *cbs); /** - * Release a reference to a LinphoneAccountCreatorCbs object. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * Release a reference to a #LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. **/ LINPHONE_PUBLIC void linphone_account_creator_cbs_unref(LinphoneAccountCreatorCbs *cbs); /** - * Retrieve the user pointer associated with a LinphoneAccountCreatorCbs object. - * @param[in] cbs LinphoneAccountCreatorCbs object. - * @return The user pointer associated with the LinphoneAccountCreatorCbs object. + * Retrieve the user pointer associated with a #LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. + * @return The user pointer associated with the #LinphoneAccountCreatorCbs object. **/ LINPHONE_PUBLIC void *linphone_account_creator_cbs_get_user_data(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorCbs object. - * @param[in] cbs LinphoneAccountCreatorCbs object. - * @param[in] ud The user pointer to associate with the LinphoneAccountCreatorCbs object. + * Assign a user pointer to a #LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. + * @param[in] ud The user pointer to associate with the #LinphoneAccountCreatorCbs object. **/ LINPHONE_PUBLIC void linphone_account_creator_cbs_set_user_data(LinphoneAccountCreatorCbs *cbs, void *ud); /** * Get the create account request. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @return The current create account request. **/ LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_create_account(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorCbs object. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * Assign a user pointer to a #LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @param[in] cb The create account request to be used. **/ LINPHONE_PUBLIC void linphone_account_creator_cbs_set_create_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the is account exist request. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @return The current is account exist request. **/ LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_account_exist(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorCbs object. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * Assign a user pointer to a #LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @param[in] cb The is account exist request to be used. **/ LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_account_exist(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the activate account request. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @return The current activate account request. **/ LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_activate_account(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorCbs object. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * Assign a user pointer to a #LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @param[in] cb The activate account request to be used. **/ LINPHONE_PUBLIC void linphone_account_creator_cbs_set_activate_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the is account activated request. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @return The current is account activated request. **/ LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_account_activated(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorCbs object. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * Assign a user pointer to a #LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @param[in] cb The is account activated request to be used. **/ LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_account_activated(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the link account request. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @return The current link account request. **/ LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_link_account(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorCbs object. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * Assign a user pointer to a #LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @param[in] cb The link account request to be used. **/ LINPHONE_PUBLIC void linphone_account_creator_cbs_set_link_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the activate alias request. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @return The current link account request. **/ LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_activate_alias(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorCbs object. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * Assign a user pointer to a #LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @param[in] cb The activate alias request to be used. **/ LINPHONE_PUBLIC void linphone_account_creator_cbs_set_activate_alias(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the is alias used request. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @return The current is alias used request. **/ LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_alias_used(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorCbs object. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * Assign a user pointer to a #LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @param[in] cb The is alias used request to be used. **/ LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_alias_used(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the is account linked request. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @return The current is account linked request. **/ LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_is_account_linked(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorCbs object. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * Assign a user pointer to a #LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @param[in] cb The is account linked request to be used. **/ LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_account_linked(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the recover account request. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @return The current recover account request. **/ LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_recover_account(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorCbs object. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * Assign a user pointer to a #LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @param[in] cb The recover account request to be used. **/ LINPHONE_PUBLIC void linphone_account_creator_cbs_set_recover_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); /** * Get the update account request. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @return The current update account request. **/ LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_update_account(const LinphoneAccountCreatorCbs *cbs); /** - * Assign a user pointer to a LinphoneAccountCreatorCbs object. - * @param[in] cbs LinphoneAccountCreatorCbs object. + * Assign a user pointer to a #LinphoneAccountCreatorCbs object. + * @param[in] cbs #LinphoneAccountCreatorCbs object. * @param[in] cb The update account request to be used. **/ LINPHONE_PUBLIC void linphone_account_creator_cbs_set_update_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); @@ -508,15 +508,15 @@ LINPHONE_PUBLIC void linphone_account_creator_cbs_set_update_account(LinphoneAcc /** * Create and configure a proxy config and a authentication info for an account creator - * @param[in] creator LinphoneAccountCreator object - * @return A LinphoneProxyConfig object if successful, NULL otherwise + * @param[in] creator #LinphoneAccountCreator object + * @return A #LinphoneProxyConfig object if successful, NULL otherwise **/ LINPHONE_PUBLIC LinphoneProxyConfig * linphone_account_creator_create_proxy_config(const LinphoneAccountCreator *creator); /** * Configure an account (create a proxy config and authentication info for it). - * @param[in] creator LinphoneAccountCreator object - * @return A LinphoneProxyConfig object if successful, NULL otherwise + * @param[in] creator #LinphoneAccountCreator object + * @return A #LinphoneProxyConfig object if successful, NULL otherwise **/ LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCreator *creator); diff --git a/include/linphone/account_creator_service.h b/include/linphone/account_creator_service.h index 1896dee92..f21650088 100644 --- a/include/linphone/account_creator_service.h +++ b/include/linphone/account_creator_service.h @@ -28,7 +28,7 @@ extern "C" { /** * Function to set custom server request. - * @param[in] creator LinphoneAccountCreator object + * @param[in] creator #LinphoneAccountCreator object */ typedef LinphoneAccountCreatorStatus (*LinphoneAccountCreatorRequestFunc)(LinphoneAccountCreator *creator); @@ -40,46 +40,46 @@ typedef LinphoneAccountCreatorStatus (*LinphoneAccountCreatorRequestFunc)(Linpho /************************** Start Account Creator Requests **************************/ /** - * Create a new LinphoneAccountCreatorService object. - * @return a new LinphoneAccountCreatorService object. + * Create a new #LinphoneAccountCreatorService object. + * @return a new #LinphoneAccountCreatorService object. * @donotwrap **/ LINPHONE_PUBLIC LinphoneAccountCreatorService * linphone_account_creator_service_new(void); /** - * Acquire a reference to a LinphoneAccountCreatorService object. - * @param[in] service LinphoneAccountCreatorService object. - * @return The same LinphoneAccountCreatorService object. + * Acquire a reference to a #LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. + * @return The same #LinphoneAccountCreatorService object. * @donotwrap **/ LinphoneAccountCreatorService * linphone_account_creator_service_ref(LinphoneAccountCreatorService *service); /** - * Release a reference to a LinphoneAccountCreatorService object. - * @param[in] service LinphoneAccountCreatorService object. + * Release a reference to a #LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @donotwrap **/ void linphone_account_creator_service_unref(LinphoneAccountCreatorService *service); /** - * Retrieve the user pointer associated with a LinphoneAccountCreatorService object. - * @param[in] service LinphoneAccountCreatorService object. - * @return The user pointer associated with the LinphoneAccountCreatorService object. + * Retrieve the user pointer associated with a #LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. + * @return The user pointer associated with the #LinphoneAccountCreatorService object. * @donotwrap **/ LINPHONE_PUBLIC void *linphone_account_creator_service_get_user_data(const LinphoneAccountCreatorService *service); /** - * Assign a user pointer to a LinphoneAccountCreatorService object. - * @param[in] service LinphoneAccountCreatorService object. - * @param[in] ud The user pointer to associate with the LinphoneAccountCreatorService object. + * Assign a user pointer to a #LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. + * @param[in] ud The user pointer to associate with the #LinphoneAccountCreatorService object. * @donotwrap **/ LINPHONE_PUBLIC void linphone_account_creator_service_set_user_data(LinphoneAccountCreatorService *service, void *ud); /** - * Assign a user pointer to a LinphoneAccountCreatorService object. - * @param[in] service LinphoneAccountCreatorService object. + * Assign a user pointer to a #LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @param[in] cb The constructor of account creator requests. * @donotwrap **/ @@ -87,15 +87,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_constructor_cb(Linphon /** * Get the constructor of account creator requests. - * @param[in] service LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @return The current constructor of create account request. * @donotwrap **/ LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_constructor_cb(const LinphoneAccountCreatorService *service); /** - * Assign a user pointer to a LinphoneAccountCreatorService object. - * @param[in] service LinphoneAccountCreatorService object. + * Assign a user pointer to a #LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @param[in] cb The destructor. * @donotwrap **/ @@ -103,7 +103,7 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_destructor_cb(Linphone /** * Get the destructor of create account request. - * @param[in] service LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @return The current destructor of create account request. * @donotwrap **/ @@ -111,15 +111,15 @@ LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_servi /** * Get the create account request. - * @param[in] service LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @return The current create account request. * @donotwrap **/ LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_create_account_cb(const LinphoneAccountCreatorService *service); /** - * Assign a user pointer to a LinphoneAccountCreatorService object. - * @param[in] service LinphoneAccountCreatorService object. + * Assign a user pointer to a #LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @param[in] cb The create account request to be used. * @donotwrap **/ @@ -127,15 +127,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_create_account_cb(Linp /** * Get the is account exist request. - * @param[in] service LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @return The current is account exist request. * @donotwrap **/ LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_account_exist_cb(const LinphoneAccountCreatorService *service); /** - * Assign a user pointer to a LinphoneAccountCreatorService object. - * @param[in] service LinphoneAccountCreatorService object. + * Assign a user pointer to a #LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @param[in] cb The is account exist request to be used. * @donotwrap **/ @@ -143,15 +143,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_is_account_exist_cb(Li /** * Get the activate account request. - * @param[in] service LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @return The current activate account request. * @donotwrap **/ LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_activate_account_cb(const LinphoneAccountCreatorService *service); /** - * Assign a user pointer to a LinphoneAccountCreatorService object. - * @param[in] service LinphoneAccountCreatorService object. + * Assign a user pointer to a #LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @param[in] cb The activate account request to be used. * @donotwrap **/ @@ -159,15 +159,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_activate_account_cb(Li /** * Get the is account activated request. - * @param[in] service LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @return The current is account activated request. * @donotwrap **/ LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_account_activated_cb(const LinphoneAccountCreatorService *service); /** - * Assign a user pointer to a LinphoneAccountCreatorService object. - * @param[in] service LinphoneAccountCreatorService object. + * Assign a user pointer to a #LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @param[in] cb The is account activated request to be used. * @donotwrap **/ @@ -175,15 +175,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_is_account_activated_c /** * Get the link account request. - * @param[in] service LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @return The current link account request. * @donotwrap **/ LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_link_account_cb(const LinphoneAccountCreatorService *service); /** - * Assign a user pointer to a LinphoneAccountCreatorService object. - * @param[in] service LinphoneAccountCreatorService object. + * Assign a user pointer to a #LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @param[in] cb The link account request to be used. * @donotwrap **/ @@ -191,15 +191,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_link_account_cb(Linpho /** * Get the activate alias request. - * @param[in] service LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @return The current link account request. * @donotwrap **/ LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_activate_alias_cb(const LinphoneAccountCreatorService *service); /** - * Assign a user pointer to a LinphoneAccountCreatorService object. - * @param[in] service LinphoneAccountCreatorService object. + * Assign a user pointer to a #LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @param[in] cb The activate alias request to be used. * @donotwrap **/ @@ -207,15 +207,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_activate_alias_cb(Linp /** * Get the is alias used request. - * @param[in] service LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @return The current is alias used request. * @donotwrap **/ LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_alias_used_cb(const LinphoneAccountCreatorService *service); /** - * Assign a user pointer to a LinphoneAccountCreatorService object. - * @param[in] service LinphoneAccountCreatorService object. + * Assign a user pointer to a #LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @param[in] cb The is alias used request to be used. * @donotwrap **/ @@ -223,15 +223,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_is_alias_used_cb(Linph /** * Get the is account linked request. - * @param[in] service LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @return The current is account linked request. * @donotwrap **/ LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_is_account_linked_cb(const LinphoneAccountCreatorService *service); /** - * Assign a user pointer to a LinphoneAccountCreatorService object. - * @param[in] service LinphoneAccountCreatorService object. + * Assign a user pointer to a #LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @param[in] cb The is account linked request to be used. * @donotwrap **/ @@ -239,15 +239,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_is_account_linked_cb(L /** * Get the recover account request. - * @param[in] service LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @return The current recover account request. * @donotwrap **/ LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_recover_account_cb(const LinphoneAccountCreatorService *service); /** - * Assign a user pointer to a LinphoneAccountCreatorService object. - * @param[in] service LinphoneAccountCreatorService object. + * Assign a user pointer to a #LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @param[in] cb The recover account request to be used. * @donotwrap **/ @@ -255,15 +255,15 @@ LINPHONE_PUBLIC void linphone_account_creator_service_set_recover_account_cb(Lin /** * Get the update account request. - * @param[in] service LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @return The current update account request. * @donotwrap **/ LINPHONE_PUBLIC LinphoneAccountCreatorRequestFunc linphone_account_creator_service_get_update_account_cb(const LinphoneAccountCreatorService *service); /** - * Assign a user pointer to a LinphoneAccountCreatorService object. - * @param[in] service LinphoneAccountCreatorService object. + * Assign a user pointer to a #LinphoneAccountCreatorService object. + * @param[in] service #LinphoneAccountCreatorService object. * @param[in] cb The update account request to be used. * @donotwrap **/ diff --git a/include/linphone/api/c-address.h b/include/linphone/api/c-address.h index a07554b1b..daf59a825 100644 --- a/include/linphone/api/c-address.h +++ b/include/linphone/api/c-address.h @@ -34,23 +34,23 @@ */ /** - * Constructs a LinphoneAddress object by parsing the user supplied address, + * Constructs a #LinphoneAddress object by parsing the user supplied address, * given as a string. **/ LINPHONE_PUBLIC LinphoneAddress *linphone_address_new (const char *address); /** - * Clones a LinphoneAddress object. + * Clones a #LinphoneAddress object. **/ LINPHONE_PUBLIC LinphoneAddress *linphone_address_clone (const LinphoneAddress *address); /** - * Increment reference count of LinphoneAddress object. + * Increment reference count of #LinphoneAddress object. **/ LINPHONE_PUBLIC LinphoneAddress *linphone_address_ref (LinphoneAddress *address); /** - * Decrement reference count of LinphoneAddress object. When dropped to zero, memory is freed. + * Decrement reference count of #LinphoneAddress object. When dropped to zero, memory is freed. **/ LINPHONE_PUBLIC void linphone_address_unref (LinphoneAddress *address); @@ -147,7 +147,7 @@ LINPHONE_PUBLIC const char *linphone_address_get_password (const LinphoneAddress /** * Set the password encoded in the address. * It is used for basic authentication (not recommended). - * @param address the LinphoneAddress + * @param address the #LinphoneAddress * @param password the password to set. **/ LINPHONE_PUBLIC void linphone_address_set_password (LinphoneAddress *address, const char *password); @@ -170,19 +170,19 @@ LINPHONE_PUBLIC char *linphone_address_as_string (const LinphoneAddress *address LINPHONE_PUBLIC char *linphone_address_as_string_uri_only (const LinphoneAddress *address); /** - * Compare two LinphoneAddress ignoring tags and headers, basically just domain, username, and port. - * @param[in] address1 LinphoneAddress object - * @param[in] address2 LinphoneAddress object - * @return Boolean value telling if the LinphoneAddress objects are equal. + * Compare two #LinphoneAddress ignoring tags and headers, basically just domain, username, and port. + * @param[in] address1 #LinphoneAddress object + * @param[in] address2 #LinphoneAddress object + * @return Boolean value telling if the #LinphoneAddress objects are equal. * @see linphone_address_equal() **/ LINPHONE_PUBLIC bool_t linphone_address_weak_equal (const LinphoneAddress *address1, const LinphoneAddress *address2); /** - * Compare two LinphoneAddress taking the tags and headers into account. - * @param[in] address1 LinphoneAddress object - * @param[in] address2 LinphoneAddress object - * @return Boolean value telling if the LinphoneAddress objects are equal. + * Compare two #LinphoneAddress taking the tags and headers into account. + * @param[in] address1 #LinphoneAddress object + * @param[in] address2 #LinphoneAddress object + * @return Boolean value telling if the #LinphoneAddress objects are equal. * @see linphone_address_weak_equal() */ LINPHONE_PUBLIC bool_t linphone_address_equal (const LinphoneAddress *address1, const LinphoneAddress *address2); @@ -204,7 +204,7 @@ LINPHONE_PUBLIC void linphone_address_set_header (LinphoneAddress *address, cons /** * Tell whether a parameter is present in the address - * @param[in] address LinphoneAddress object + * @param[in] address #LinphoneAddress object * @param[in] param_name The name of the parameter * @return A boolean value telling whether the parameter is present in the address */ @@ -212,7 +212,7 @@ LINPHONE_PUBLIC bool_t linphone_address_has_param (const LinphoneAddress *addres /** * Get the value of a parameter of the address - * @param[in] address LinphoneAddress object + * @param[in] address #LinphoneAddress object * @param[in] param_name The name of the parameter * @return The value of the parameter */ @@ -220,7 +220,7 @@ LINPHONE_PUBLIC const char *linphone_address_get_param (const LinphoneAddress *a /** * Set the value of a parameter of the address - * @param[in] address LinphoneAddress object + * @param[in] address #LinphoneAddress object * @param[in] param_name The name of the parameter * @param[in] param_value The new value of the parameter */ @@ -230,7 +230,7 @@ LINPHONE_PUBLIC void linphone_address_set_params (LinphoneAddress *address, cons /** * Tell whether a parameter is present in the URI of the address - * @param[in] address LinphoneAddress object + * @param[in] address #LinphoneAddress object * @param[in] uri_param_name The name of the parameter * @return A boolean value telling whether the parameter is present in the URI of the address */ @@ -238,7 +238,7 @@ LINPHONE_PUBLIC bool_t linphone_address_has_uri_param (const LinphoneAddress *ad /** * Get the value of a parameter of the URI of the address - * @param[in] address LinphoneAddress object + * @param[in] address #LinphoneAddress object * @param[in] uri_param_name The name of the parameter * @return The value of the parameter */ @@ -246,7 +246,7 @@ LINPHONE_PUBLIC const char *linphone_address_get_uri_param (const LinphoneAddres /** * Set the value of a parameter of the URI of the address - * @param[in] address LinphoneAddress object + * @param[in] address #LinphoneAddress object * @param[in] uri_param_name The name of the parameter * @param[in] uri_param_value The new value of the parameter */ @@ -256,13 +256,13 @@ LINPHONE_PUBLIC void linphone_address_set_uri_params (LinphoneAddress *address, /** * Removes the value of a parameter of the URI of the address - * @param[in] address LinphoneAddress object + * @param[in] address #LinphoneAddress object * @param[in] uri_param_name The name of the parameter */ LINPHONE_PUBLIC void linphone_address_remove_uri_param (LinphoneAddress *address, const char *uri_param_name); /** - * Destroys a LinphoneAddress object (actually calls linphone_address_unref()). + * Destroys a #LinphoneAddress object (actually calls linphone_address_unref()). * @deprecated Use linphone_address_unref() instead * @donotwrap **/ diff --git a/include/linphone/api/c-call-cbs.h b/include/linphone/api/c-call-cbs.h index ed5c3718c..5bd6f7c52 100644 --- a/include/linphone/api/c-call-cbs.h +++ b/include/linphone/api/c-call-cbs.h @@ -35,126 +35,126 @@ */ /** - * Acquire a reference to the LinphoneCallCbs object. - * @param[in] cbs LinphoneCallCbs object. - * @return The same LinphoneCallCbs object. + * Acquire a reference to the #LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. + * @return The same #LinphoneCallCbs object. */ LINPHONE_PUBLIC LinphoneCallCbs *linphone_call_cbs_ref (LinphoneCallCbs *cbs); /** - * Release reference to the LinphoneCallCbs object. - * @param[in] cbs LinphoneCallCbs object. + * Release reference to the #LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. */ LINPHONE_PUBLIC void linphone_call_cbs_unref (LinphoneCallCbs *cbs); /** - * Retrieve the user pointer associated with the LinphoneCallCbs object. - * @param[in] cbs LinphoneCallCbs object. - * @return The user pointer associated with the LinphoneCallCbs object. + * Retrieve the user pointer associated with the #LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. + * @return The user pointer associated with the #LinphoneCallCbs object. */ LINPHONE_PUBLIC void *linphone_call_cbs_get_user_data (const LinphoneCallCbs *cbs); /** - * Assign a user pointer to the LinphoneCallCbs object. - * @param[in] cbs LinphoneCallCbs object. - * @param[in] ud The user pointer to associate with the LinphoneCallCbs object. + * Assign a user pointer to the #LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. + * @param[in] ud The user pointer to associate with the #LinphoneCallCbs object. */ LINPHONE_PUBLIC void linphone_call_cbs_set_user_data (LinphoneCallCbs *cbs, void *ud); /** * Get the dtmf received callback. - * @param[in] cbs LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. * @return The current dtmf received callback. */ LINPHONE_PUBLIC LinphoneCallCbsDtmfReceivedCb linphone_call_cbs_get_dtmf_received (LinphoneCallCbs *cbs); /** * Set the dtmf received callback. - * @param[in] cbs LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. * @param[in] cb The dtmf received callback to be used. */ LINPHONE_PUBLIC void linphone_call_cbs_set_dtmf_received (LinphoneCallCbs *cbs, LinphoneCallCbsDtmfReceivedCb cb); /** * Get the encryption changed callback. - * @param[in] cbs LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. * @return The current encryption changed callback. */ LINPHONE_PUBLIC LinphoneCallCbsEncryptionChangedCb linphone_call_cbs_get_encryption_changed (LinphoneCallCbs *cbs); /** * Set the encryption changed callback. - * @param[in] cbs LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. * @param[in] cb The encryption changed callback to be used. */ LINPHONE_PUBLIC void linphone_call_cbs_set_encryption_changed (LinphoneCallCbs *cbs, LinphoneCallCbsEncryptionChangedCb cb); /** * Get the info message received callback. - * @param[in] cbs LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. * @return The current info message received callback. */ LINPHONE_PUBLIC LinphoneCallCbsInfoMessageReceivedCb linphone_call_cbs_get_info_message_received (LinphoneCallCbs *cbs); /** * Set the info message received callback. - * @param[in] cbs LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. * @param[in] cb The info message received callback to be used. */ LINPHONE_PUBLIC void linphone_call_cbs_set_info_message_received (LinphoneCallCbs *cbs, LinphoneCallCbsInfoMessageReceivedCb cb); /** * Get the state changed callback. - * @param[in] cbs LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. * @return The current state changed callback. */ LINPHONE_PUBLIC LinphoneCallCbsStateChangedCb linphone_call_cbs_get_state_changed (LinphoneCallCbs *cbs); /** * Set the state changed callback. - * @param[in] cbs LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. * @param[in] cb The state changed callback to be used. */ LINPHONE_PUBLIC void linphone_call_cbs_set_state_changed (LinphoneCallCbs *cbs, LinphoneCallCbsStateChangedCb cb); /** * Get the stats updated callback. - * @param[in] cbs LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. * @return The current stats updated callback. */ LINPHONE_PUBLIC LinphoneCallCbsStatsUpdatedCb linphone_call_cbs_get_stats_updated (LinphoneCallCbs *cbs); /** * Set the stats updated callback. - * @param[in] cbs LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. * @param[in] cb The stats updated callback to be used. */ LINPHONE_PUBLIC void linphone_call_cbs_set_stats_updated (LinphoneCallCbs *cbs, LinphoneCallCbsStatsUpdatedCb cb); /** * Get the transfer state changed callback. - * @param[in] cbs LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. * @return The current transfer state changed callback. */ LINPHONE_PUBLIC LinphoneCallCbsTransferStateChangedCb linphone_call_cbs_get_transfer_state_changed (LinphoneCallCbs *cbs); /** * Set the transfer state changed callback. - * @param[in] cbs LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. * @param[in] cb The transfer state changed callback to be used. */ LINPHONE_PUBLIC void linphone_call_cbs_set_transfer_state_changed (LinphoneCallCbs *cbs, LinphoneCallCbsTransferStateChangedCb cb); /** * Get the ACK processing callback. - * @param[in] cbs LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. * @return The current ack processing callback. */ LINPHONE_PUBLIC LinphoneCallCbsAckProcessingCb linphone_call_cbs_get_ack_processing (LinphoneCallCbs *cbs); /** * Set ACK processing callback. - * @param[in] cbs LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. * @param[in] cb The ack processing callback to be used. */ LINPHONE_PUBLIC void linphone_call_cbs_set_ack_processing (LinphoneCallCbs *cbs, LinphoneCallCbsAckProcessingCb cb); diff --git a/include/linphone/api/c-call-stats.h b/include/linphone/api/c-call-stats.h index 60eb2e498..c2d18e815 100644 --- a/include/linphone/api/c-call-stats.h +++ b/include/linphone/api/c-call-stats.h @@ -46,29 +46,29 @@ /** * Increment refcount. - * @param[in] stats LinphoneCallStats object + * @param[in] stats #LinphoneCallStats object * @ingroup misc **/ LINPHONE_PUBLIC LinphoneCallStats *linphone_call_stats_ref (LinphoneCallStats *stats); /** * Decrement refcount and possibly free the object. - * @param[in] stats LinphoneCallStats object + * @param[in] stats #LinphoneCallStats object * @ingroup misc **/ LINPHONE_PUBLIC void linphone_call_stats_unref (LinphoneCallStats *stats); /** - * Gets the user data in the LinphoneCallStats object - * @param[in] stats the LinphoneCallStats + * Gets the user data in the #LinphoneCallStats object + * @param[in] stats the #LinphoneCallStats * @return the user data * @ingroup misc */ LINPHONE_PUBLIC void *linphone_call_stats_get_user_data (const LinphoneCallStats *stats); /** - * Sets the user data in the LinphoneCallStats object - * @param[in] stats the LinphoneCallStats object + * Sets the user data in the #LinphoneCallStats object + * @param[in] stats the #LinphoneCallStats object * @param[in] data the user data * @ingroup misc */ @@ -76,7 +76,7 @@ LINPHONE_PUBLIC void linphone_call_stats_set_user_data (LinphoneCallStats *stats /** * Get the type of the stream the stats refer to. - * @param[in] stats LinphoneCallStats object + * @param[in] stats #LinphoneCallStats object * @return The type of the stream the stats refer to */ LINPHONE_PUBLIC LinphoneStreamType linphone_call_stats_get_type (const LinphoneCallStats *stats); @@ -107,14 +107,14 @@ LINPHONE_PUBLIC float linphone_call_stats_get_local_late_rate (const LinphoneCal /** * Gets the local interarrival jitter - * @param[in] stats LinphoneCallStats object + * @param[in] stats #LinphoneCallStats object * @return The interarrival jitter at last emitted sender report **/ LINPHONE_PUBLIC float linphone_call_stats_get_sender_interarrival_jitter (const LinphoneCallStats *stats); /** * Gets the remote reported interarrival jitter - * @param[in] stats LinphoneCallStats object + * @param[in] stats #LinphoneCallStats object * @return The interarrival jitter at last received receiver report **/ LINPHONE_PUBLIC float linphone_call_stats_get_receiver_interarrival_jitter (const LinphoneCallStats *stats); @@ -123,77 +123,77 @@ LINPHONE_PUBLIC const rtp_stats_t *linphone_call_stats_get_rtp_stats (const Linp /** * Gets the cumulative number of late packets - * @param[in] stats LinphoneCallStats object + * @param[in] stats #LinphoneCallStats object * @return The cumulative number of late packets **/ LINPHONE_PUBLIC uint64_t linphone_call_stats_get_late_packets_cumulative_number (const LinphoneCallStats *stats); /** * Get the bandwidth measurement of the received stream, expressed in kbit/s, including IP/UDP/RTP headers. - * @param[in] stats LinphoneCallStats object + * @param[in] stats #LinphoneCallStats object * @return The bandwidth measurement of the received stream in kbit/s. */ LINPHONE_PUBLIC float linphone_call_stats_get_download_bandwidth (const LinphoneCallStats *stats); /** * Get the bandwidth measurement of the sent stream, expressed in kbit/s, including IP/UDP/RTP headers. - * @param[in] stats LinphoneCallStats object + * @param[in] stats #LinphoneCallStats object * @return The bandwidth measurement of the sent stream in kbit/s. */ LINPHONE_PUBLIC float linphone_call_stats_get_upload_bandwidth (const LinphoneCallStats *stats); /** * Get the bandwidth measurement of the received RTCP, expressed in kbit/s, including IP/UDP/RTP headers. - * @param[in] stats LinphoneCallStats object + * @param[in] stats #LinphoneCallStats object * @return The bandwidth measurement of the received RTCP in kbit/s. */ LINPHONE_PUBLIC float linphone_call_stats_get_rtcp_download_bandwidth (const LinphoneCallStats *stats); /** * Get the bandwidth measurement of the sent RTCP, expressed in kbit/s, including IP/UDP/RTP headers. - * @param[in] stats LinphoneCallStats object + * @param[in] stats #LinphoneCallStats object * @return The bandwidth measurement of the sent RTCP in kbit/s. */ LINPHONE_PUBLIC float linphone_call_stats_get_rtcp_upload_bandwidth( const LinphoneCallStats *stats); /** * Get the state of ICE processing. - * @param[in] stats LinphoneCallStats object + * @param[in] stats #LinphoneCallStats object * @return The state of ICE processing. */ LINPHONE_PUBLIC LinphoneIceState linphone_call_stats_get_ice_state (const LinphoneCallStats *stats); /** * Get the state of uPnP processing. - * @param[in] stats LinphoneCallStats object + * @param[in] stats #LinphoneCallStats object * @return The state of uPnP processing. */ LINPHONE_PUBLIC LinphoneUpnpState linphone_call_stats_get_upnp_state (const LinphoneCallStats *stats); /** * Get the IP address family of the remote peer. - * @param[in] stats LinphoneCallStats object + * @param[in] stats #LinphoneCallStats object * @return The IP address family of the remote peer. */ LINPHONE_PUBLIC LinphoneAddressFamily linphone_call_stats_get_ip_family_of_remote (const LinphoneCallStats *stats); /** * Get the jitter buffer size in ms. - * @param[in] stats LinphoneCallStats object + * @param[in] stats #LinphoneCallStats object * @return The jitter buffer size in ms. */ LINPHONE_PUBLIC float linphone_call_stats_get_jitter_buffer_size_ms (const LinphoneCallStats *stats); /** * Get the round trip delay in s. - * @param[in] stats LinphoneCallStats object + * @param[in] stats #LinphoneCallStats object * @return The round trip delay in s. */ LINPHONE_PUBLIC float linphone_call_stats_get_round_trip_delay (const LinphoneCallStats *stats); /** * Get the estimated bandwidth measurement of the received stream, expressed in kbit/s, including IP/UDP/RTP headers. - * @param[in] stats LinphoneCallStats object + * @param[in] stats #LinphoneCallStats object * @return The estimated bandwidth measurement of the received stream in kbit/s. */ LINPHONE_PUBLIC float linphone_call_stats_get_estimated_download_bandwidth(const LinphoneCallStats *stats); diff --git a/include/linphone/api/c-call.h b/include/linphone/api/c-call.h index 272e67b1d..47cc3bce3 100644 --- a/include/linphone/api/c-call.h +++ b/include/linphone/api/c-call.h @@ -68,8 +68,8 @@ LINPHONE_PUBLIC void linphone_call_set_user_data (LinphoneCall *call, void *ud); /** * Get the core that has created the specified call. - * @param[in] call LinphoneCall object - * @return The LinphoneCore object that has created the specified call. + * @param[in] call #LinphoneCall object + * @return The #LinphoneCore object that has created the specified call. */ LINPHONE_PUBLIC LinphoneCore * linphone_call_get_core (const LinphoneCall *call); @@ -80,7 +80,7 @@ LINPHONE_PUBLIC LinphoneCallState linphone_call_get_state (const LinphoneCall *c /** * Tell whether a call has been asked to autoanswer - * @param[in] call LinphoneCall object + * @param[in] call #LinphoneCall object * @return A boolean value telling whether the call has been asked to autoanswer **/ LINPHONE_PUBLIC bool_t linphone_call_asked_to_autoanswer (LinphoneCall *call); @@ -118,14 +118,14 @@ LINPHONE_PUBLIC LinphoneCallDir linphone_call_get_dir (const LinphoneCall *call) /** * Gets the call log associated to this call. - * @param[in] call LinphoneCall object - * @return The LinphoneCallLog associated with the specified LinphoneCall + * @param[in] call #LinphoneCall object + * @return The #LinphoneCallLog associated with the specified #LinphoneCall **/ LINPHONE_PUBLIC LinphoneCallLog *linphone_call_get_call_log (const LinphoneCall *call); /** * Gets the refer-to uri (if the call was transfered). - * @param[in] call LinphoneCall object + * @param[in] call #LinphoneCall object * @return The refer-to uri of the call (if it was transfered) **/ LINPHONE_PUBLIC const char *linphone_call_get_refer_to (const LinphoneCall *call); @@ -143,7 +143,7 @@ LINPHONE_PUBLIC bool_t linphone_call_has_transfer_pending (const LinphoneCall *c /** * Gets the transferer if this call was started automatically as a result of an incoming transfer request. * The call in which the transfer request was received is returned in this case. - * @param[in] call LinphoneCall object + * @param[in] call #LinphoneCall object * @return The transferer call if the specified call was started automatically as a result of an incoming transfer request, NULL otherwise **/ LINPHONE_PUBLIC LinphoneCall *linphone_call_get_transferer_call (const LinphoneCall *call); @@ -192,7 +192,7 @@ LINPHONE_PUBLIC bool_t linphone_call_camera_enabled (const LinphoneCall *lc); /** * Take a photo of currently received video and write it into a jpeg file. * Note that the snapshot is asynchronous, an application shall not assume that the file is created when the function returns. - * @param call a LinphoneCall + * @param call a #LinphoneCall * @param file a path where to write the jpeg content. * @return 0 if successfull, -1 otherwise (typically if jpeg format is not supported). **/ @@ -201,7 +201,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_take_video_snapshot (LinphoneCall * /** * Take a photo of currently captured video and write it into a jpeg file. * Note that the snapshot is asynchronous, an application shall not assume that the file is created when the function returns. - * @param call a LinphoneCall + * @param call a #LinphoneCall * @param file a path where to write the jpeg content. * @return 0 if successfull, -1 otherwise (typically if jpeg format is not supported). **/ @@ -214,8 +214,8 @@ LINPHONE_PUBLIC LinphoneReason linphone_call_get_reason (const LinphoneCall *cal /** * Returns full details about call errors or termination reasons. - * @param call LinphoneCall object on which we want the information error - * @return LinphoneErrorInfo object holding the reason error. + * @param call #LinphoneCall object on which we want the information error + * @return #LinphoneErrorInfo object holding the reason error. */ LINPHONE_PUBLIC const LinphoneErrorInfo *linphone_call_get_error_info (const LinphoneCall *call); @@ -231,7 +231,7 @@ LINPHONE_PUBLIC const char *linphone_call_get_remote_contact (LinphoneCall *call /** * Returns the ZRTP authentication token to verify. - * @param call the LinphoneCall + * @param call the #LinphoneCall * @return the authentication token to verify. **/ LINPHONE_PUBLIC const char *linphone_call_get_authentication_token (LinphoneCall *call); @@ -240,7 +240,7 @@ LINPHONE_PUBLIC const char *linphone_call_get_authentication_token (LinphoneCall * Returns whether ZRTP authentication token is verified. * If not, it must be verified by users as described in ZRTP procedure. * Once done, the application must inform of the results with linphone_call_set_authentication_token_verified(). - * @param call the LinphoneCall + * @param call the #LinphoneCall * @return TRUE if authentication token is verifed, false otherwise. **/ LINPHONE_PUBLIC bool_t linphone_call_get_authentication_token_verified (const LinphoneCall *call); @@ -248,7 +248,7 @@ LINPHONE_PUBLIC bool_t linphone_call_get_authentication_token_verified (const Li /** * Set the result of ZRTP short code verification by user. * If remote party also does the same, it will update the ZRTP cache so that user's verification will not be required for the two users. - * @param call the LinphoneCall + * @param call the #LinphoneCall * @param verified whether the ZRTP SAS is verified. **/ LINPHONE_PUBLIC void linphone_call_set_authentication_token_verified (LinphoneCall *call, bool_t verified); @@ -291,7 +291,7 @@ LINPHONE_PUBLIC void linphone_call_zoom (LinphoneCall *call, float zoom_factor, * Send the specified dtmf. * * The dtmf is automatically played to the user. - * @param call The LinphoneCall object + * @param call The #LinphoneCall object * @param dtmf The dtmf name specified as a char, such as '0', '#' etc... * @return 0 if successful, -1 on error. **/ @@ -302,7 +302,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_send_dtmf (LinphoneCall *call, char * * The dtmfs are automatically sent to remote, separated by some needed customizable delay. * Sending is canceled if the call state changes to something not LinphoneCallStreamsRunning. - * @param call The LinphoneCall object + * @param call The #LinphoneCall object * @param dtmfs A dtmf sequence such as '123#123123' * @return -2 if there is already a DTMF sequence, -1 if call is not ready, 0 otherwise. **/ @@ -314,7 +314,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_send_dtmfs (LinphoneCall *call, con * Please note that some DTMF could be already sent, * depending on when this function call is delayed from #linphone_call_send_dtmfs. This * function will be automatically called if call state change to anything but LinphoneCallStreamsRunning. - * @param call The LinphoneCall object + * @param call The #LinphoneCall object **/ LINPHONE_PUBLIC void linphone_call_cancel_dtmfs (LinphoneCall *call); @@ -374,7 +374,7 @@ LINPHONE_PUBLIC RtpTransport *linphone_call_get_meta_rtcp_transport (const Linph * Pauses the call. If a music file has been setup using linphone_core_set_play_file(), * this file will be played to the remote user. * The only way to resume a paused call is to call linphone_call_resume(). - * @param[in] call LinphoneCall object + * @param[in] call #LinphoneCall object * @return 0 on success, -1 on failure * @see linphone_call_resume() **/ @@ -383,7 +383,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_pause (LinphoneCall *call); /** * Resumes a call. * The call needs to have been paused previously with linphone_call_pause(). - * @param[in] call LinphoneCall object + * @param[in] call #LinphoneCall object * @return 0 on success, -1 on failure * @see linphone_call_pause() **/ @@ -391,21 +391,21 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_resume (LinphoneCall *call); /** * Terminates a call. - * @param[in] call LinphoneCall object + * @param[in] call #LinphoneCall object * @return 0 on success, -1 on failure **/LINPHONE_PUBLIC LinphoneStatus linphone_call_terminate (LinphoneCall *call); /** * Terminates a call. - * @param[in] call LinphoneCall object - * @param[in] ei LinphoneErrorInfo + * @param[in] call #LinphoneCall object + * @param[in] ei #LinphoneErrorInfo * @return 0 on success, -1 on failure **/ LINPHONE_PUBLIC LinphoneStatus linphone_call_terminate_with_error_info (LinphoneCall *call, const LinphoneErrorInfo *ei); /** * Redirect the specified call to the given redirect URI. - * @param[in] call A LinphoneCall object + * @param[in] call A #LinphoneCall object * @param[in] redirect_uri The URI to redirect the call to * @return 0 if successful, -1 on error. */ @@ -413,16 +413,16 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_redirect (LinphoneCall *call, const /** * Decline a pending incoming call, with a reason. - * @param[in] call A LinphoneCall object that must be in the IncomingReceived state - * @param[in] reason The reason for rejecting the call: LinphoneReasonDeclined or LinphoneReasonBusy + * @param[in] call A #LinphoneCall object that must be in the IncomingReceived state + * @param[in] reason The reason for rejecting the call: #LinphoneReasonDeclined or #LinphoneReasonBusy * @return 0 on success, -1 on failure **/ LINPHONE_PUBLIC LinphoneStatus linphone_call_decline (LinphoneCall *call, LinphoneReason reason); /** - * Decline a pending incoming call, with a LinphoneErrorInfo object. - * @param[in] call A LinphoneCall object that must be in the IncomingReceived state - * @param[in] ei LinphoneErrorInfo containing more information on the call rejection. + * Decline a pending incoming call, with a #LinphoneErrorInfo object. + * @param[in] call A #LinphoneCall object that must be in the IncomingReceived state + * @param[in] ei #LinphoneErrorInfo containing more information on the call rejection. * @return 0 on success, -1 on failure */ LINPHONE_PUBLIC int linphone_call_decline_with_error_info (LinphoneCall *call, const LinphoneErrorInfo *ei); @@ -432,9 +432,9 @@ LINPHONE_PUBLIC int linphone_call_decline_with_error_info (LinphoneCall *call, c * * Basically the application is notified of incoming calls within the * call_state_changed callback of the #LinphoneCoreVTable structure, where it will receive - * a LinphoneCallIncoming event with the associated LinphoneCall object. + * a #LinphoneCallIncoming event with the associated #LinphoneCall object. * The application can later accept the call using this method. - * @param[in] call A LinphoneCall object + * @param[in] call A #LinphoneCall object * @return 0 on success, -1 on failure **/ LINPHONE_PUBLIC LinphoneStatus linphone_call_accept (LinphoneCall *call); @@ -444,9 +444,9 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_accept (LinphoneCall *call); * * Basically the application is notified of incoming calls within the * call_state_changed callback of the #LinphoneCoreVTable structure, where it will receive - * a LinphoneCallIncoming event with the associated LinphoneCall object. + * a #LinphoneCallIncoming event with the associated #LinphoneCall object. * The application can later accept the call using this method. - * @param[in] call A LinphoneCall object + * @param[in] call A #LinphoneCall object * @param[in] params The specific parameters for this call, for example whether video is accepted or not. Use NULL to use default parameters * @return 0 on success, -1 on failure **/ @@ -455,7 +455,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_accept_with_params (LinphoneCall *c /** * Accept an early media session for an incoming call. * This is identical as calling linphone_call_accept_early_media_with_params() with NULL parameters. - * @param[in] call A LinphoneCall object + * @param[in] call A #LinphoneCall object * @return 0 if successful, -1 otherwise * @see linphone_call_accept_early_media_with_params() **/ @@ -466,7 +466,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_accept_early_media (LinphoneCall *c * This means the call is not accepted but audio & video streams can be established if the remote party supports early media. * However, unlike after call acceptance, mic and camera input are not sent during early-media, though received audio & video are played normally. * The call can then later be fully accepted using linphone_call_accept() or linphone_call_accept_with_params(). - * @param[in] call A LinphoneCall object + * @param[in] call A #LinphoneCall object * @param[in] params The call parameters to use (can be NULL) * @return 0 if successful, -1 otherwise **/ @@ -475,35 +475,35 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_accept_early_media_with_params (Lin /** * Updates a running call according to supplied call parameters or parameters changed in the LinphoneCore. * In this version this is limited to the following use cases: - * - setting up/down the video stream according to the video parameter of the LinphoneCallParams (see linphone_call_params_enable_video() ). + * - setting up/down the video stream according to the video parameter of the #LinphoneCallParams (see linphone_call_params_enable_video() ). * - changing the size of the transmitted video after calling linphone_core_set_preferred_video_size() - * In case no changes are requested through the LinphoneCallParams argument, then this argument can be omitted and set to NULL. - * WARNING: Updating a call in the LinphoneCallPaused state will still result in a paused call even if the media directions set in the + * In case no changes are requested through the #LinphoneCallParams argument, then this argument can be omitted and set to NULL. + * WARNING: Updating a call in the #LinphoneCallPaused state will still result in a paused call even if the media directions set in the * params are sendrecv. To resume a paused call, you need to call linphone_call_resume(). * - * @param[in] call A LinphoneCall object + * @param[in] call A #LinphoneCall object * @param[in] params The new call parameters to use (may be NULL) * @return 0 if successful, -1 otherwise. **/ LINPHONE_PUBLIC LinphoneStatus linphone_call_update (LinphoneCall *call, const LinphoneCallParams *params); /** - * When receiving a #LinphoneCallUpdatedByRemote state notification, prevent LinphoneCore from performing an automatic answer. + * When receiving a #LinphoneCallUpdatedByRemote state notification, prevent #LinphoneCore from performing an automatic answer. * * When receiving a #LinphoneCallUpdatedByRemote state notification (ie an incoming reINVITE), the default behaviour of - * LinphoneCore is defined by the "defer_update_default" option of the "sip" section of the config. If this option is 0 (the default) - * then the LinphoneCore automatically answers the reINIVTE with call parameters unchanged. + * #LinphoneCore is defined by the "defer_update_default" option of the "sip" section of the config. If this option is 0 (the default) + * then the #LinphoneCore automatically answers the reINIVTE with call parameters unchanged. * However when for example when the remote party updated the call to propose a video stream, it can be useful * to prompt the user before answering. This can be achieved by calling linphone_core_defer_call_update() during * the call state notification, to deactivate the automatic answer that would just confirm the audio but reject the video. * Then, when the user responds to dialog prompt, it becomes possible to call linphone_call_accept_update() to answer - * the reINVITE, with eventually video enabled in the LinphoneCallParams argument. + * the reINVITE, with eventually video enabled in the #LinphoneCallParams argument. * * The #LinphoneCallUpdatedByRemote notification can also arrive when receiving an INVITE without SDP. In such case, an unchanged offer is made * in the 200Ok, and when the ACK containing the SDP answer is received, #LinphoneCallUpdatedByRemote is triggered to notify the application of possible * changes in the media session. However in such case defering the update has no meaning since we just generating an offer. * - * @param[in] call A LinphoneCall object + * @param[in] call A #LinphoneCall object * @return 0 if successful, -1 if the linphone_call_defer_update() was done outside a valid #LinphoneCallUpdatedByRemote notification **/ LINPHONE_PUBLIC LinphoneStatus linphone_call_defer_update (LinphoneCall *call); @@ -521,8 +521,8 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_defer_update (LinphoneCall *call); * If params is not NULL, then the update will be accepted according to the parameters passed. * Typical example is when a user accepts to start video, then params should indicate that video stream should be used * (see linphone_call_params_enable_video()). - * @param[in] call A LinphoneCall object - * @param[in] params A LinphoneCallParams object describing the call parameters to accept + * @param[in] call A #LinphoneCall object + * @param[in] params A #LinphoneCallParams object describing the call parameters to accept * @return 0 if successful, -1 otherwise (actually when this function call is performed outside ot #LinphoneCallUpdatedByRemote state) **/ LINPHONE_PUBLIC LinphoneStatus linphone_call_accept_update (LinphoneCall *call, const LinphoneCallParams *params); @@ -706,8 +706,8 @@ LINPHONE_PUBLIC void linphone_call_stop_recording(LinphoneCall *call); /** * Get a player associated with the call to play a local file and stream it to the remote peer. - * @param[in] call LinphoneCall object - * @return A LinphonePlayer object + * @param[in] call #LinphoneCall object + * @return A #LinphonePlayer object */ LINPHONE_PUBLIC LinphonePlayer * linphone_call_get_player(LinphoneCall *call); @@ -729,7 +729,7 @@ LINPHONE_PUBLIC bool_t linphone_call_media_in_progress(const LinphoneCall *call) LINPHONE_PUBLIC void linphone_call_ogl_render(const LinphoneCall *call); /** - * Send a LinphoneInfoMessage through an established call + * Send a #LinphoneInfoMessage through an established call * @param call the call * @param info the info message **/ @@ -749,25 +749,25 @@ LINPHONE_PUBLIC LinphoneCallStats *linphone_call_get_video_stats(LinphoneCall *c LINPHONE_PUBLIC LinphoneCallStats *linphone_call_get_text_stats(LinphoneCall *call); /** - * Add a listener in order to be notified of LinphoneCall events. Once an event is received, registred LinphoneCallCbs are + * Add a listener in order to be notified of #LinphoneCall events. Once an event is received, registred #LinphoneCallCbs are * invoked sequencially. - * @param[in] call LinphoneCall object to monitor. - * @param[in] cbs A LinphoneCallCbs object holding the callbacks you need. A reference is taken by the LinphoneCall until you invoke linphone_call_remove_callbacks(). + * @param[in] call #LinphoneCall object to monitor. + * @param[in] cbs A #LinphoneCallCbs object holding the callbacks you need. A reference is taken by the #LinphoneCall until you invoke linphone_call_remove_callbacks(). */ LINPHONE_PUBLIC void linphone_call_add_callbacks(LinphoneCall *call, LinphoneCallCbs *cbs); /** - * Remove a listener from a LinphoneCall - * @param[in] call LinphoneCall object - * @param[in] cbs LinphoneCallCbs object to remove. + * Remove a listener from a #LinphoneCall + * @param[in] call #LinphoneCall object + * @param[in] cbs #LinphoneCallCbs object to remove. */ LINPHONE_PUBLIC void linphone_call_remove_callbacks(LinphoneCall *call, LinphoneCallCbs *cbs); /** * Gets the current LinphoneCallCbs. - * This is meant only to be called from a callback to be able to get the user_data associated with the LinphoneCallCbs that is calling the callback. - * @param[in] call LinphoneCall object - * @return The LinphoneCallCbs that has called the last callback + * This is meant only to be called from a callback to be able to get the user_data associated with the #LinphoneCallCbs that is calling the callback. + * @param[in] call #LinphoneCall object + * @return The #LinphoneCallCbs that has called the last callback */ LINPHONE_PUBLIC LinphoneCallCbs *linphone_call_get_current_callbacks(const LinphoneCall *call); @@ -777,16 +777,16 @@ LINPHONE_PUBLIC LinphoneCallCbs *linphone_call_get_current_callbacks(const Linph * linphone_call_accept_with_params(). * However, in some cases it might be desirable from a software design standpoint to modify local parameters outside of the application layer, typically * in the purpose of implementing a custom logic including special headers in INVITE or 200Ok requests, driven by a call_state_changed listener method. - * This function accepts to assign a new LinphoneCallParams only in LinphoneCallOutgoingInit and LinphoneCallIncomingReceived states. - * @param call the LinphoneCall object + * This function accepts to assign a new #LinphoneCallParams only in #LinphoneCallOutgoingInit and #LinphoneCallIncomingReceived states. + * @param call the #LinphoneCall object **/ LINPHONE_PUBLIC void linphone_call_set_params(LinphoneCall *call, const LinphoneCallParams *params); /** * Returns local parameters associated with the call. * This is typically the parameters passed at call initiation to linphone_core_invite_address_with_params() or linphone_call_accept_with_params(), or some default - * parameters if no LinphoneCallParams was explicitely passed during call initiation. - * @param call the LinphoneCall object + * parameters if no #LinphoneCallParams was explicitely passed during call initiation. + * @param call the #LinphoneCall object * @return the call's local parameters. **/ LINPHONE_PUBLIC const LinphoneCallParams * linphone_call_get_params(LinphoneCall *call); diff --git a/include/linphone/api/c-callbacks.h b/include/linphone/api/c-callbacks.h index a053e78a8..dc36e2b48 100644 --- a/include/linphone/api/c-callbacks.h +++ b/include/linphone/api/c-callbacks.h @@ -37,14 +37,14 @@ /** * Callback for being notified of received DTMFs. - * @param call LinphoneCall object that received the dtmf + * @param call #LinphoneCall object that received the dtmf * @param dtmf The ascii code of the dtmf */ typedef void (*LinphoneCallCbsDtmfReceivedCb)(LinphoneCall *call, int dtmf); /** * Call encryption changed callback. - * @param call LinphoneCall object whose encryption is changed. + * @param call #LinphoneCall object whose encryption is changed. * @param on Whether encryption is activated. * @param authentication_token An authentication_token, currently set for ZRTP kind of encryption only. */ @@ -52,14 +52,14 @@ typedef void (*LinphoneCallCbsEncryptionChangedCb)(LinphoneCall *call, bool_t on /** * Callback for receiving info messages. - * @param call LinphoneCall whose info message belongs to. - * @param msg LinphoneInfoMessage object. + * @param call #LinphoneCall whose info message belongs to. + * @param msg #LinphoneInfoMessage object. */ typedef void (*LinphoneCallCbsInfoMessageReceivedCb)(LinphoneCall *call, const LinphoneInfoMessage *msg); /** * Call state notification callback. - * @param call LinphoneCall whose state is changed. + * @param call #LinphoneCall whose state is changed. * @param cstate The new state of the call * @param message An informational message about the state. */ @@ -67,21 +67,21 @@ typedef void (*LinphoneCallCbsStateChangedCb)(LinphoneCall *call, LinphoneCallSt /** * Callback for receiving quality statistics for calls. - * @param call LinphoneCall object whose statistics are notified - * @param stats LinphoneCallStats object + * @param call #LinphoneCall object whose statistics are notified + * @param stats #LinphoneCallStats object */ typedef void (*LinphoneCallCbsStatsUpdatedCb)(LinphoneCall *call, const LinphoneCallStats *stats); /** * Callback for notifying progresses of transfers. - * @param call LinphoneCall that was transfered + * @param call #LinphoneCall that was transfered * @param cstate The state of the call to transfer target at the far end. */ typedef void (*LinphoneCallCbsTransferStateChangedCb)(LinphoneCall *call, LinphoneCallState cstate); /** * Callback for notifying the processing SIP ACK messages. - * @param call LinphoneCall for which an ACK is being received or sent + * @param call #LinphoneCall for which an ACK is being received or sent * @param ack the ACK message * @param is_received if TRUE this ACK is an incoming one, otherwise it is an ACK about to be sent. */ @@ -100,9 +100,9 @@ typedef void (*LinphoneCallCbsAckProcessingCb)(LinphoneCall *call, LinphoneHeade /** * Call back used to notify message delivery status * @param msg #LinphoneChatMessage object - * @param status LinphoneChatMessageState + * @param status #LinphoneChatMessageState * @param ud application user data - * @deprecated Use LinphoneChatMessageCbsMsgStateChangedCb instead. + * @deprecated Use #LinphoneChatMessageCbsMsgStateChangedCb instead. * @donotwrap */ typedef void (*LinphoneChatMessageStateChangedCb)(LinphoneChatMessage* msg,LinphoneChatMessageState state,void* ud); @@ -110,7 +110,7 @@ typedef void (*LinphoneChatMessageStateChangedCb)(LinphoneChatMessage* msg,Linph /** * Call back used to notify message delivery status * @param msg #LinphoneChatMessage object - * @param status LinphoneChatMessageState + * @param status #LinphoneChatMessageState */ typedef void (*LinphoneChatMessageCbsMsgStateChangedCb)(LinphoneChatMessage* msg, LinphoneChatMessageState state); @@ -128,7 +128,7 @@ typedef void (*LinphoneChatMessageCbsFileTransferRecvCb)(LinphoneChatMessage *me * @param content #LinphoneContent outgoing content * @param offset the offset in the file from where to get the data to be sent * @param size the number of bytes expected by the framework - * @return A LinphoneBuffer object holding the data written by the application. An empty buffer means end of file. + * @return A #LinphoneBuffer object holding the data written by the application. An empty buffer means end of file. */ typedef LinphoneBuffer * (*LinphoneChatMessageCbsFileTransferSendCb)(LinphoneChatMessage *message, const LinphoneContent* content, size_t offset, size_t size); diff --git a/include/linphone/api/c-chat-message-cbs.h b/include/linphone/api/c-chat-message-cbs.h index 440b7a4a0..632353f87 100644 --- a/include/linphone/api/c-chat-message-cbs.h +++ b/include/linphone/api/c-chat-message-cbs.h @@ -65,7 +65,7 @@ LINPHONE_PUBLIC void linphone_chat_message_cbs_set_user_data (LinphoneChatMessag /** * Get the message state changed callback. - * @param[in] cbs LinphoneChatMessageCbs object. + * @param[in] cbs #LinphoneChatMessageCbs object. * @return The current message state changed callback. */ LINPHONE_PUBLIC LinphoneChatMessageCbsMsgStateChangedCb linphone_chat_message_cbs_get_msg_state_changed(const LinphoneChatMessageCbs *cbs); diff --git a/include/linphone/api/c-chat-message.h b/include/linphone/api/c-chat-message.h index 1b66980bf..71e98a0ba 100644 --- a/include/linphone/api/c-chat-message.h +++ b/include/linphone/api/c-chat-message.h @@ -105,7 +105,7 @@ LINPHONE_PUBLIC const LinphoneAddress* linphone_chat_message_get_to_address(Linp /** * Get the content type of a chat message. - * @param[in] message LinphoneChatMessage object + * @param[in] message #LinphoneChatMessage object * @return The content type of the chat message */ LINPHONE_PUBLIC const char * linphone_chat_message_get_content_type(LinphoneChatMessage *msg); @@ -113,7 +113,7 @@ LINPHONE_PUBLIC const char * linphone_chat_message_get_content_type(LinphoneChat /** * Set the content type of a chat message. * This content type must match a content that is text representable, such as text/plain, text/html or image/svg+xml. - * @param[in] message LinphoneChatMessage object + * @param[in] message #LinphoneChatMessage object * @param[in] content_type The new content type of the chat message */ LINPHONE_PUBLIC void linphone_chat_message_set_content_type(LinphoneChatMessage *msg, const char *content_type); @@ -128,7 +128,7 @@ LINPHONE_PUBLIC const char* linphone_chat_message_get_text(LinphoneChatMessage* /** * Get the message identifier. * It is used to identify a message so that it can be notified as delivered and/or displayed. - * @param[in] cm LinphoneChatMessage object + * @param[in] cm #LinphoneChatMessage object * @return The message identifier. */ LINPHONE_PUBLIC const char* linphone_chat_message_get_message_id(const LinphoneChatMessage *msg); @@ -160,7 +160,7 @@ LINPHONE_PUBLIC LinphoneChatRoom* linphone_chat_message_get_chat_room(const Linp /** * Get the path to the file to read from or write to during the file transfer. - * @param[in] msg LinphoneChatMessage object + * @param[in] msg #LinphoneChatMessage object * @return The path to the file to use for the file transfer. */ LINPHONE_PUBLIC const char * linphone_chat_message_get_file_transfer_filepath(LinphoneChatMessage *msg); @@ -169,7 +169,7 @@ LINPHONE_PUBLIC const char * linphone_chat_message_get_file_transfer_filepath(Li /** * Get if a chat message is to be stored. - * @param[in] message LinphoneChatMessage object + * @param[in] message #LinphoneChatMessage object * @return Whether or not the message is to be stored */ LINPHONE_PUBLIC bool_t linphone_chat_message_get_to_be_stored(const LinphoneChatMessage *message); @@ -177,7 +177,7 @@ LINPHONE_PUBLIC bool_t linphone_chat_message_get_to_be_stored(const LinphoneChat /** * Set if a chat message is to be stored. * This content type must match a content that is text representable, such as text/plain, text/html or image/svg+xml. - * @param[in] message LinphoneChatMessage object + * @param[in] message #LinphoneChatMessage object * @param[in] to_be_stored Whether or not the chat message is to be stored */ LINPHONE_PUBLIC void linphone_chat_message_set_to_be_stored(LinphoneChatMessage *message, bool_t to_be_stored); @@ -208,7 +208,7 @@ LINPHONE_PUBLIC const char* linphone_chat_message_get_external_body_url(const Li /** * Linphone message can carry external body as defined by rfc2017 * - * @param message a LinphoneChatMessage + * @param message a #LinphoneChatMessage * @param url ex: access-type=URL; URL="http://www.foo.com/file" */ LINPHONE_PUBLIC void linphone_chat_message_set_external_body_url(LinphoneChatMessage* message,const char* url); @@ -217,20 +217,20 @@ LINPHONE_PUBLIC void linphone_chat_message_set_external_body_url(LinphoneChatMes * Get the file_transfer_information (used by call backs to recover informations during a rcs file transfer) * * @param message #LinphoneChatMessage - * @return a pointer to the LinphoneContent structure or NULL if not present. + * @return a pointer to the #LinphoneContent structure or NULL if not present. */ LINPHONE_PUBLIC LinphoneContent* linphone_chat_message_get_file_transfer_information(LinphoneChatMessage* message); /** * Return whether or not a chat message is a file tranfer. - * @param[in] message LinphoneChatMessage object + * @param[in] message #LinphoneChatMessage object * @return Whether or not the message is a file tranfer */ LINPHONE_PUBLIC bool_t linphone_chat_message_is_file_transfer(LinphoneChatMessage *message); /** * Return whether or not a chat message is a text. - * @param[in] message LinphoneChatMessage object + * @param[in] message #LinphoneChatMessage object * @return Whether or not the message is a text */ LINPHONE_PUBLIC bool_t linphone_chat_message_is_text(LinphoneChatMessage *message); @@ -239,7 +239,7 @@ LINPHONE_PUBLIC bool_t linphone_chat_message_is_text(LinphoneChatMessage *messag * Start the download of the file from remote server * * @param message #LinphoneChatMessage - * @param status_cb LinphoneChatMessageStateChangeCb status callback invoked when file is downloaded or could not be downloaded + * @param status_cb #LinphoneChatMessageStateChangeCb status callback invoked when file is downloaded or could not be downloaded * @param ud user data * @deprecated Use linphone_chat_message_download_file() instead. * @donotwrap @@ -247,8 +247,8 @@ LINPHONE_PUBLIC bool_t linphone_chat_message_is_text(LinphoneChatMessage *messag LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_chat_message_start_file_download(LinphoneChatMessage* message, LinphoneChatMessageStateChangedCb status_cb, void* ud); /** - * Start the download of the file referenced in a LinphoneChatMessage from remote server. - * @param[in] message LinphoneChatMessage object. + * Start the download of the file referenced in a #LinphoneChatMessage from remote server. + * @param[in] message #LinphoneChatMessage object. */ LINPHONE_PUBLIC LinphoneStatus linphone_chat_message_download_file(LinphoneChatMessage *message); @@ -260,13 +260,13 @@ LINPHONE_PUBLIC void linphone_chat_message_cancel_file_transfer(LinphoneChatMess /** * Send a chat message. - * @param[in] msg LinphoneChatMessage object + * @param[in] msg #LinphoneChatMessage object */ LINPHONE_PUBLIC void linphone_chat_message_send (LinphoneChatMessage *msg); /** * Resend a chat message if it is in the 'not delivered' state for whatever reason. - * @param[in] msg LinphoneChatMessage object + * @param[in] msg #LinphoneChatMessage object * @deprecated Use linphone_chat_message_send instead. * @donotwrap */ @@ -313,14 +313,14 @@ LINPHONE_PUBLIC LinphoneReason linphone_chat_message_get_reason(LinphoneChatMess /** * Get full details about delivery error of a chat message. - * @param msg a LinphoneChatMessage - * @return a LinphoneErrorInfo describing the details. + * @param msg a #LinphoneChatMessage + * @return a #LinphoneErrorInfo describing the details. **/ LINPHONE_PUBLIC const LinphoneErrorInfo *linphone_chat_message_get_error_info(const LinphoneChatMessage *msg); /** * Set the path to the file to read from or write to during the file transfer. - * @param[in] msg LinphoneChatMessage object + * @param[in] msg #LinphoneChatMessage object * @param[in] filepath The path to the file to use for the file transfer. */ LINPHONE_PUBLIC void linphone_chat_message_set_file_transfer_filepath(LinphoneChatMessage *msg, const char *filepath); @@ -328,37 +328,37 @@ LINPHONE_PUBLIC void linphone_chat_message_set_file_transfer_filepath(LinphoneCh /** * Fulfill a chat message char by char. Message linked to a Real Time Text Call send char in realtime following RFC 4103/T.140 * To commit a message, use #linphone_chat_room_send_message - * @param[in] msg LinphoneChatMessage + * @param[in] msg #LinphoneChatMessage * @param[in] character T.140 char * @returns 0 if succeed. */ LINPHONE_PUBLIC LinphoneStatus linphone_chat_message_put_char(LinphoneChatMessage *msg,uint32_t character); /** - * Get the LinphoneChatMessageCbs object associated with the LinphoneChatMessage. - * @param[in] msg LinphoneChatMessage object - * @return The LinphoneChatMessageCbs object associated with the LinphoneChatMessage. + * Get the #LinphoneChatMessageCbs object associated with the LinphoneChatMessage. + * @param[in] msg #LinphoneChatMessage object + * @return The #LinphoneChatMessageCbs object associated with the LinphoneChatMessage. */ LINPHONE_PUBLIC LinphoneChatMessageCbs * linphone_chat_message_get_callbacks(const LinphoneChatMessage *msg); /** * Adds a content to the ChatMessage - * @param[in] msg LinphoneChatMessage object - * @param[in] c_content LinphoneContent object + * @param[in] msg #LinphoneChatMessage object + * @param[in] c_content #LinphoneContent object */ LINPHONE_PUBLIC void linphone_chat_message_add_text_content(LinphoneChatMessage *msg, const char *c_content); /** * Returns true if the chat message has a text content - * @param[in] msg LinphoneChatMessage object + * @param[in] msg #LinphoneChatMessage object * @return true if it has one, false otherwise */ LINPHONE_PUBLIC bool_t linphone_chat_message_has_text_content(const LinphoneChatMessage *msg); /** * Gets the text content if available as a string - * @param[in] msg LinphoneChatMessage object - * @return the LinphoneContent buffer if available, null otherwise + * @param[in] msg #LinphoneChatMessage object + * @return the #LinphoneContent buffer if available, null otherwise */ LINPHONE_PUBLIC const char* linphone_chat_message_get_text_content(const LinphoneChatMessage *msg); diff --git a/include/linphone/api/c-chat-room-cbs.h b/include/linphone/api/c-chat-room-cbs.h index 9dc396fac..1be433b15 100644 --- a/include/linphone/api/c-chat-room-cbs.h +++ b/include/linphone/api/c-chat-room-cbs.h @@ -63,210 +63,210 @@ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_user_data (LinphoneChatRoomCbs * /** * Get the is-composing received callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @return The current is-composing received callback. */ LINPHONE_PUBLIC LinphoneChatRoomCbsIsComposingReceivedCb linphone_chat_room_cbs_get_is_composing_received (const LinphoneChatRoomCbs *cbs); /** * Set the is-composing received callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @param[in] cb The is-composing received callback to be used. */ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_is_composing_received (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsIsComposingReceivedCb cb); /** * Get the message received callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @return The current message received callback. */ LINPHONE_PUBLIC LinphoneChatRoomCbsMessageReceivedCb linphone_chat_room_cbs_get_message_received (const LinphoneChatRoomCbs *cbs); /** * Set the message received callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @param[in] cb The message received callback to be used. */ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_message_received (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsMessageReceivedCb cb); /** * Get the chat message received callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @return The current chat message received callback. */ LINPHONE_PUBLIC LinphoneChatRoomCbsChatMessageReceivedCb linphone_chat_room_cbs_get_chat_message_received (const LinphoneChatRoomCbs *cbs); /** * Set the chat message received callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @param[in] cb The chat message received callback to be used. */ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_chat_message_received (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsChatMessageReceivedCb cb); /** * Get the chat message sent callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @return The current chat message sent callback. */ LINPHONE_PUBLIC LinphoneChatRoomCbsChatMessageSentCb linphone_chat_room_cbs_get_chat_message_sent (const LinphoneChatRoomCbs *cbs); /** * Set the chat message sent callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @param[in] cb The chat message sent callback to be used. */ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_chat_message_sent (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsChatMessageSentCb cb); /** * Get the participant added callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @return The current participant added callback. */ LINPHONE_PUBLIC LinphoneChatRoomCbsParticipantAddedCb linphone_chat_room_cbs_get_participant_added (const LinphoneChatRoomCbs *cbs); /** * Set the participant added callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @param[in] cb The participant added callback to be used. */ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_participant_added (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsParticipantAddedCb cb); /** * Get the participant removed callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @return The current participant removed callback. */ LINPHONE_PUBLIC LinphoneChatRoomCbsParticipantRemovedCb linphone_chat_room_cbs_get_participant_removed (const LinphoneChatRoomCbs *cbs); /** * Set the participant removed callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @param[in] cb The participant removed callback to be used. */ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_participant_removed (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsParticipantRemovedCb cb); /** * Get the participant admin status changed callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @return The current participant admin status changed callback. */ LINPHONE_PUBLIC LinphoneChatRoomCbsParticipantAdminStatusChangedCb linphone_chat_room_cbs_get_participant_admin_status_changed (const LinphoneChatRoomCbs *cbs); /** * Set the participant admin status changed callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @param[in] cb The participant admin status changed callback to be used. */ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_participant_admin_status_changed (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsParticipantAdminStatusChangedCb cb); /** * Get the state changed callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @return The current state changed callback. */ LINPHONE_PUBLIC LinphoneChatRoomCbsStateChangedCb linphone_chat_room_cbs_get_state_changed (const LinphoneChatRoomCbs *cbs); /** * Set the state changed callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @param[in] cb The state changed callback to be used. */ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_state_changed (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsStateChangedCb cb); /** * Get the subject changed callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @return The current subject changed callback. */ LINPHONE_PUBLIC LinphoneChatRoomCbsSubjectChangedCb linphone_chat_room_cbs_get_subject_changed (const LinphoneChatRoomCbs *cbs); /** * Set the subject changed callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @param[in] cb The subject changed callback to be used. */ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_subject_changed (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsSubjectChangedCb cb); /** * Get the undecryptable message received callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @return The current undecryptable message received callback. */ LINPHONE_PUBLIC LinphoneChatRoomCbsUndecryptableMessageReceivedCb linphone_chat_room_cbs_get_undecryptable_message_received (const LinphoneChatRoomCbs *cbs); /** * Set the undecryptable message received callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @param[in] cb The undecryptable message received callback to be used. */ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_undecryptable_message_received (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsUndecryptableMessageReceivedCb cb); /** * Get the participant device added callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @return The current participant device added callback. */ LINPHONE_PUBLIC LinphoneChatRoomCbsParticipantDeviceAddedCb linphone_chat_room_cbs_get_participant_device_added (const LinphoneChatRoomCbs *cbs); /** * Set the participant device added callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @param[in] cb The participant device added callback to be used. */ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_participant_device_added (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsParticipantDeviceAddedCb cb); /** * Get the participant device removed callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @return The current participant device removed callback. */ LINPHONE_PUBLIC LinphoneChatRoomCbsParticipantDeviceRemovedCb linphone_chat_room_cbs_get_participant_device_removed (const LinphoneChatRoomCbs *cbs); /** * Set the participant device removed callback. - * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cbs #LinphoneChatRoomCbs object. * @param[in] cb The participant device removed callback to be used. */ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_participant_device_removed (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsParticipantDeviceRemovedCb cb); /** * Get the conference address generation callback. - * @param[in] cbs LinphoneChatRoomCbs object + * @param[in] cbs #LinphoneChatRoomCbs object * @return The current conference address generation callback */ LINPHONE_PUBLIC LinphoneChatRoomCbsConferenceAddressGenerationCb linphone_chat_room_cbs_get_conference_address_generation (const LinphoneChatRoomCbs *cbs); /** * Set the conference address generation callback. - * @param[in] cbs LinphoneChatRoomCbs object + * @param[in] cbs #LinphoneChatRoomCbs object * @param[in] cb The conference address generation callback to be used */ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_conference_address_generation (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsConferenceAddressGenerationCb cb); /** * Get the participant device getting callback. - * @param[in] cbs LinphoneChatRoomCbs object + * @param[in] cbs #LinphoneChatRoomCbs object * @return The participant device getting callback */ LINPHONE_PUBLIC LinphoneChatRoomCbsParticipantDeviceFetchedCb linphone_chat_room_cbs_get_participant_device_fetched (const LinphoneChatRoomCbs *cbs); /** * Set the participant device getting callback. - * @param[in] cbs LinphoneChatRoomCbs object + * @param[in] cbs #LinphoneChatRoomCbs object * @param[in] cb The participant device getting callback to be used */ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_participant_device_fetched (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsParticipantDeviceFetchedCb cb); /** * Get the participants capabilities callback. - * @param[in] cbs LinphoneChatRoomCbs object + * @param[in] cbs #LinphoneChatRoomCbs object * @return The participants capabilities getting callback */ LINPHONE_PUBLIC LinphoneChatRoomCbsParticipantsCapabilitiesCheckedCb linphone_chat_room_cbs_get_participants_capabilities_checked (const LinphoneChatRoomCbs *cbs); /** * Set the participants capabilities callback. - * @param[in] cbs LinphoneChatRoomCbs object + * @param[in] cbs #LinphoneChatRoomCbs object * @param[in] cb The participants capabilities callback to be used */ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_participants_capabilities_checked (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsParticipantsCapabilitiesCheckedCb cb); diff --git a/include/linphone/api/c-chat-room.h b/include/linphone/api/c-chat-room.h index 392bce10f..c83ec6328 100644 --- a/include/linphone/api/c-chat-room.h +++ b/include/linphone/api/c-chat-room.h @@ -118,11 +118,11 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_chat_room_send_message(Linphon /** * Send a message to peer member of this chat room. - * @param[in] cr LinphoneChatRoom object - * @param[in] msg LinphoneChatMessage object - * The state of the message sending will be notified via the callbacks defined in the LinphoneChatMessageCbs object that can be obtained + * @param[in] cr #LinphoneChatRoom object + * @param[in] msg #LinphoneChatMessage object + * The state of the message sending will be notified via the callbacks defined in the #LinphoneChatMessageCbs object that can be obtained * by calling linphone_chat_message_get_callbacks(). - * The LinphoneChatMessage reference is transfered to the function and thus doesn't need to be unref'd by the application. + * The #LinphoneChatMessage reference is transfered to the function and thus doesn't need to be unref'd by the application. * @deprecated Use linphone_chat_message_send() instead. * @donotwrap */ @@ -130,8 +130,8 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_chat_room_send_chat_message(Li /** * Used to receive a chat message when using async mechanism with IM encryption engine - * @param[in] cr LinphoneChatRoom object - * @param[in] msg LinphoneChatMessage object + * @param[in] cr #LinphoneChatRoom object + * @param[in] msg #LinphoneChatMessage object */ LINPHONE_PUBLIC void linphone_chat_room_receive_chat_message (LinphoneChatRoom *cr, LinphoneChatMessage *msg); @@ -255,28 +255,28 @@ LINPHONE_PUBLIC bool_t linphone_chat_room_lime_available(LinphoneChatRoom *cr); /** * get Curent Call associated to this chatroom if any * To commit a message, use #linphone_chat_room_send_message - * @param[in] room LinphoneChatRomm - * @returns LinphoneCall or NULL. + * @param[in] room #LinphoneChatRomm + * @returns #LinphoneCall or NULL. */ LINPHONE_PUBLIC LinphoneCall *linphone_chat_room_get_call(const LinphoneChatRoom *room); /** - * Get the LinphoneChatRoomCbs object associated with the LinphoneChatRoom. - * @param[in] cr LinphoneChatRoom object - * @return The LinphoneChatRoomCbs object associated with the LinphoneChatRoom + * Get the #LinphoneChatRoomCbs object associated with the LinphoneChatRoom. + * @param[in] cr #LinphoneChatRoom object + * @return The #LinphoneChatRoomCbs object associated with the #LinphoneChatRoom */ LINPHONE_PUBLIC LinphoneChatRoomCbs * linphone_chat_room_get_callbacks (const LinphoneChatRoom *cr); /** * Get the state of the chat room. - * @param[in] cr LinphoneChatRoom object + * @param[in] cr #LinphoneChatRoom object * @return The state of the chat room */ LINPHONE_PUBLIC LinphoneChatRoomState linphone_chat_room_get_state (const LinphoneChatRoom *cr); /** * Return whether or not the chat room has been left. - * @param[in] cr LinphoneChatRoom object + * @param[in] cr #LinphoneChatRoom object * @return whether or not the chat room has been left */ LINPHONE_PUBLIC bool_t linphone_chat_room_has_been_left (const LinphoneChatRoom *cr); @@ -284,7 +284,7 @@ LINPHONE_PUBLIC bool_t linphone_chat_room_has_been_left (const LinphoneChatRoom /** * Add a participant to a chat room. This may fail if this type of chat room does not handle participants. * Use linphone_chat_room_can_handle_participants() to know if this chat room handles participants. - * @param[in] cr A LinphoneChatRoom object + * @param[in] cr A #LinphoneChatRoom object * @param[in] addr The address of the participant to add to the chat room */ LINPHONE_PUBLIC void linphone_chat_room_add_participant (LinphoneChatRoom *cr, const LinphoneAddress *addr); @@ -292,21 +292,21 @@ LINPHONE_PUBLIC void linphone_chat_room_add_participant (LinphoneChatRoom *cr, c /** * Add several participants to a chat room at once. This may fail if this type of chat room does not handle participants. * Use linphone_chat_room_can_handle_participants() to know if this chat room handles participants. - * @param[in] cr A LinphoneChatRoom object + * @param[in] cr A #LinphoneChatRoom object * @param[in] addresses \bctbx_list{LinphoneAddress} */ LINPHONE_PUBLIC void linphone_chat_room_add_participants (LinphoneChatRoom *cr, const bctbx_list_t *addresses); /** * Tells whether a chat room is able to handle participants. - * @param[in] cr A LinphoneChatRoom object + * @param[in] cr A #LinphoneChatRoom object * @return A boolean value telling whether the chat room can handle participants or not */ LINPHONE_PUBLIC bool_t linphone_chat_room_can_handle_participants (const LinphoneChatRoom *cr); /** * Find a participant of a chat room from its address. - * @param[in] cr A LinphoneChatRoom object + * @param[in] cr A #LinphoneChatRoom object * @param[in] addr The address to search in the list of participants of the chat room * @return The participant if found, NULL otherwise. */ @@ -314,14 +314,14 @@ LINPHONE_PUBLIC LinphoneParticipant *linphone_chat_room_find_participant (const /** * Get the capabilities of a chat room. - * @param[in] cr A LinphoneChatRoom object + * @param[in] cr A #LinphoneChatRoom object * @return The capabilities of the chat room */ LINPHONE_PUBLIC LinphoneChatRoomCapabilitiesMask linphone_chat_room_get_capabilities (const LinphoneChatRoom *cr); /** * Check if a chat room has given capabilities. - * @param[in] cr A LinphoneChatRoom object + * @param[in] cr A #LinphoneChatRoom object * @param[in] mask A Capabilities mask * @return True if the mask matches, false otherwise */ @@ -329,62 +329,62 @@ LINPHONE_PUBLIC bool_t linphone_chat_room_has_capability(const LinphoneChatRoom /** * Get the conference address of the chat room. - * @param[in] cr A LinphoneChatRoom object + * @param[in] cr A #LinphoneChatRoom object * @return The conference address of the chat room or NULL if this type of chat room is not conference based */ LINPHONE_PUBLIC const LinphoneAddress *linphone_chat_room_get_conference_address (const LinphoneChatRoom *cr); /** * Get the participant representing myself in the chat room. - * @param[in] cr A LinphoneChatRoom object + * @param[in] cr A #LinphoneChatRoom object * @return The participant representing myself in the conference. */ LINPHONE_PUBLIC LinphoneParticipant *linphone_chat_room_get_me (const LinphoneChatRoom *cr); /** * Get the number of participants in the chat room (that is without ourselves). - * @param[in] cr A LinphoneChatRoom object + * @param[in] cr A #LinphoneChatRoom object * @return The number of participants in the chat room */ LINPHONE_PUBLIC int linphone_chat_room_get_nb_participants (const LinphoneChatRoom *cr); /** * Get the list of participants of a chat room. - * @param[in] cr A LinphoneChatRoom object + * @param[in] cr A #LinphoneChatRoom object * @return \bctbx_list{LinphoneParticipant} */ LINPHONE_PUBLIC bctbx_list_t * linphone_chat_room_get_participants (const LinphoneChatRoom *cr); /** * Get the subject of a chat room. - * @param[in] cr A LinphoneChatRoom object + * @param[in] cr A #LinphoneChatRoom object * @return The subject of the chat room */ LINPHONE_PUBLIC const char * linphone_chat_room_get_subject (const LinphoneChatRoom *cr); /** * Leave a chat room. - * @param[in] cr A LinphoneChatRoom object + * @param[in] cr A #LinphoneChatRoom object */ LINPHONE_PUBLIC void linphone_chat_room_leave (LinphoneChatRoom *cr); /** * Remove a participant of a chat room. - * @param[in] cr A LinphoneChatRoom object + * @param[in] cr A #LinphoneChatRoom object * @param[in] participant The participant to remove from the chat room */ LINPHONE_PUBLIC void linphone_chat_room_remove_participant (LinphoneChatRoom *cr, LinphoneParticipant *participant); /** * Remove several participants of a chat room at once. - * @param[in] cr A LinphoneChatRoom object + * @param[in] cr A #LinphoneChatRoom object * @param[in] participants \bctbx_list{LinphoneParticipant} */ LINPHONE_PUBLIC void linphone_chat_room_remove_participants (LinphoneChatRoom *cr, const bctbx_list_t *participants); /** * Change the admin status of a participant of a chat room (you need to be an admin yourself to do this). - * @param[in] cr A LinphoneChatRoom object + * @param[in] cr A #LinphoneChatRoom object * @param[in] participant The Participant for which to change the admin status * @param[in] isAdmin A boolean value telling whether the participant should now be an admin or not */ @@ -392,30 +392,30 @@ LINPHONE_PUBLIC void linphone_chat_room_set_participant_admin_status (LinphoneCh /** * Set the subject of a chat room. - * @param[in] cr A LinphoneChatRoom object + * @param[in] cr A #LinphoneChatRoom object * @param[in] subject The new subject to set for the chat room */ LINPHONE_PUBLIC void linphone_chat_room_set_subject (LinphoneChatRoom *cr, const char *subject); /** * Gets the list of participants that are currently composing - * @param[in] cr A LinphoneChatRoom object + * @param[in] cr A #LinphoneChatRoom object * @return \bctbx_list{LinphoneAddress} list of addresses that are in the is_composing state */ LINPHONE_PUBLIC const bctbx_list_t * linphone_chat_room_get_composing_addresses(LinphoneChatRoom *cr); /** * Set the conference address of a group chat room. This function needs to be called from the - * LinphoneChatRoomCbsConferenceAddressGenerationCb callback and only there. - * @param[in] cr A LinphoneChatRoom object + * #LinphoneChatRoomCbsConferenceAddressGenerationCb callback and only there. + * @param[in] cr A #LinphoneChatRoom object * @param[in] confAddr The conference address to be used by the group chat room */ LINPHONE_PUBLIC void linphone_chat_room_set_conference_address (LinphoneChatRoom *cr, const LinphoneAddress *confAddr); /** * Set the participant device. This function needs to be called from the - * LinphoneChatRoomCbsParticipantDeviceFetchedCb callback and only there. - * @param[in] cr A LinphoneChatRoom object + * #LinphoneChatRoomCbsParticipantDeviceFetchedCb callback and only there. + * @param[in] cr A #LinphoneChatRoom object * @param[in] partAddr The participant address * @param[in] partDevices \bctbx_list{LinphoneAddress} list of the participant devices to be used by the group chat room */ @@ -423,8 +423,8 @@ LINPHONE_PUBLIC void linphone_chat_room_set_participant_devices (LinphoneChatRoo /** * Set the participant device. This function needs to be called from the - * LinphoneChatRoomCbsParticipantsCapabilitiesCheckedCb callback and only there. - * @param[in] cr A LinphoneChatRoom object + * #LinphoneChatRoomCbsParticipantsCapabilitiesCheckedCb callback and only there. + * @param[in] cr A #LinphoneChatRoom object * @param[in] deviceAddr The device address * @param[in] participantsCompatible \bctbx_list{LinphoneAddress} */ diff --git a/include/linphone/api/c-participant.h b/include/linphone/api/c-participant.h index e0c187ba5..93e20d2c8 100644 --- a/include/linphone/api/c-participant.h +++ b/include/linphone/api/c-participant.h @@ -34,39 +34,39 @@ */ /** - * Increment reference count of LinphoneParticipant object. + * Increment reference count of #LinphoneParticipant object. **/ LINPHONE_PUBLIC LinphoneParticipant *linphone_participant_ref (LinphoneParticipant *participant); /** - * Decrement reference count of LinphoneParticipant object. + * Decrement reference count of #LinphoneParticipant object. **/ LINPHONE_PUBLIC void linphone_participant_unref (LinphoneParticipant *participant); /** * Retrieve the user pointer associated with the conference participant. - * @param[in] participant A LinphoneParticipant object + * @param[in] participant A #LinphoneParticipant object * @return The user pointer associated with the participant. **/ LINPHONE_PUBLIC void * linphone_participant_get_user_data(const LinphoneParticipant *participant); /** * Assign a user pointer to the conference participant. - * @param[in] participant A LinphoneParticipant object + * @param[in] participant A #LinphoneParticipant object * @param[in] ud The user pointer to associate with the participant **/ LINPHONE_PUBLIC void linphone_participant_set_user_data(LinphoneParticipant *participant, void *ud); /** * Get the address of a conference participant. - * @param[in] participant A LinphoneParticipant object + * @param[in] participant A #LinphoneParticipant object * @return The address of the participant */ LINPHONE_PUBLIC const LinphoneAddress * linphone_participant_get_address (const LinphoneParticipant *participant); /** * Tells whether a conference participant is an administrator of the conference. - * @param[in] participant A LinphoneParticipant object + * @param[in] participant A #LinphoneParticipant object * @return A boolean value telling whether the participant is an administrator */ LINPHONE_PUBLIC bool_t linphone_participant_is_admin (const LinphoneParticipant *participant); diff --git a/include/linphone/api/c-types.h b/include/linphone/api/c-types.h index 6c109375f..f3024abc7 100644 --- a/include/linphone/api/c-types.h +++ b/include/linphone/api/c-types.h @@ -61,11 +61,11 @@ /** * Object that represents a SIP address. * - * The LinphoneAddress is an opaque object to represents SIP addresses, ie + * The #LinphoneAddress is an opaque object to represents SIP addresses, ie * the content of SIP's 'from' and 'to' headers. * A SIP address is made of display name, username, domain name, port, and various * uri headers (such as tags). It looks like 'Alice '. - * The LinphoneAddress has methods to extract and manipulate all parts of the address. + * The #LinphoneAddress has methods to extract and manipulate all parts of the address. * When some part of the address (for example the username) is empty, the accessor methods * return NULL. * @ingroup linphone_address @@ -77,7 +77,7 @@ typedef struct _LinphoneAddress LinphoneAddress; // ----------------------------------------------------------------------------- /** - * The LinphoneCall object represents a call issued or received by the LinphoneCore + * The #LinphoneCall object represents a call issued or received by the #LinphoneCore * @ingroup call_control **/ typedef struct _LinphoneCall LinphoneCall; @@ -86,11 +86,11 @@ typedef struct _LinphoneCall LinphoneCall; typedef void (*LinphoneCallCbFunc) (LinphoneCall *call, void *ud); /** - * That class holds all the callbacks which are called by LinphoneCall objects. + * That class holds all the callbacks which are called by #LinphoneCall objects. * * Use linphone_factory_create_call_cbs() to create an instance. Then, call the * callback setters on the events you need to monitor and pass the object to - * a LinphoneCall instance through linphone_call_add_callbacks(). + * a #LinphoneCall instance through linphone_call_add_callbacks(). * @ingroup call_control */ typedef struct _LinphoneCallCbs LinphoneCallCbs; @@ -106,7 +106,7 @@ typedef struct _LinphoneCallCbs LinphoneCallCbs; typedef struct _LinphoneChatMessage LinphoneChatMessage; /** - * An object to handle the callbacks for the handling a LinphoneChatMessage objects. + * An object to handle the callbacks for the handling a #LinphoneChatMessage objects. * @ingroup chatroom */ typedef struct _LinphoneChatMessageCbs LinphoneChatMessageCbs; @@ -119,13 +119,13 @@ typedef struct _LinphoneChatMessageCbs LinphoneChatMessageCbs; typedef struct _LinphoneChatRoom LinphoneChatRoom; /** - * A mask of LinphoneChatRoomCapabilities + * A mask of #LinphoneChatRoomCapabilities * @ingroup chatroom */ typedef int LinphoneChatRoomCapabilitiesMask; /** - * An object to handle the callbacks for the handling a LinphoneChatRoom objects. + * An object to handle the callbacks for the handling a #LinphoneChatRoom objects. * @ingroup chatroom */ typedef struct _LinphoneChatRoomCbs LinphoneChatRoomCbs; @@ -151,7 +151,7 @@ typedef struct _LinphoneEventLog LinphoneEventLog; typedef struct _LinphoneDialPlan LinphoneDialPlan; /** - * The LinphoneParticipant object represents a participant of a conference. + * The #LinphoneParticipant object represents a participant of a conference. * @ingroup misc **/ typedef struct _LinphoneParticipant LinphoneParticipant; @@ -165,7 +165,7 @@ typedef struct _LinphoneParticipant LinphoneParticipant; // ----------------------------------------------------------------------------- /** - * LinphoneCallState enum represents the different state a call can reach into. + * #LinphoneCallState enum represents the different state a call can reach into. * The application is notified of state changes through the LinphoneCoreVTable::call_state_changed callback. * @ingroup call_control **/ @@ -176,25 +176,25 @@ L_DECLARE_C_ENUM(CallState, L_ENUM_VALUES_CALL_SESSION_STATE); // ----------------------------------------------------------------------------- /** - * LinphoneChatMessageDirection is used to indicate if a message is outgoing or incoming. + * #LinphoneChatMessageDirection is used to indicate if a message is outgoing or incoming. * @ingroup chatroom */ L_DECLARE_C_ENUM(ChatMessageDirection, L_ENUM_VALUES_CHAT_MESSAGE_DIRECTION); /** - * LinphoneChatMessageState is used to notify if messages have been succesfully delivered or not. + * #LinphoneChatMessageState is used to notify if messages have been succesfully delivered or not. * @ingroup chatroom */ L_DECLARE_C_ENUM(ChatMessageState, L_ENUM_VALUES_CHAT_MESSAGE_STATE); /** - * LinphoneChatRoomCapabilities is used to indicated the capabilities of a chat room. + * #LinphoneChatRoomCapabilities is used to indicated the capabilities of a chat room. * @ingroup chatroom */ L_DECLARE_C_ENUM_FIXED_VALUES(ChatRoomCapabilities, L_ENUM_VALUES_CHAT_ROOM_CAPABILITIES); /** - * LinphoneChatRoomState is used to indicate the current state of a chat room. + * #LinphoneChatRoomState is used to indicate the current state of a chat room. * @ingroup chatroom */ L_DECLARE_C_ENUM(ChatRoomState, L_ENUM_VALUES_CHAT_ROOM_STATE); @@ -204,7 +204,7 @@ L_DECLARE_C_ENUM(ChatRoomState, L_ENUM_VALUES_CHAT_ROOM_STATE); // ----------------------------------------------------------------------------- /** - * LinphoneEventLogType is used to indicate the type of an event. Useful for cast. + * #LinphoneEventLogType is used to indicate the type of an event. Useful for cast. * @ingroup events */ L_DECLARE_C_ENUM(EventLogType, L_ENUM_VALUES_EVENT_LOG_TYPE); diff --git a/include/linphone/auth_info.h b/include/linphone/auth_info.h index 5b9e3a6b1..72ef24d93 100644 --- a/include/linphone/auth_info.h +++ b/include/linphone/auth_info.h @@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** - * Safely cast a belle_sip_object_t into LinphoneAuthInfo + * Safely cast a belle_sip_object_t into #LinphoneAuthInfo */ #define LINPHONE_AUTH_INFO(obj) BELLE_SIP_CAST(obj, LinphoneAuthInfo) @@ -48,7 +48,7 @@ extern "C" { * @param ha1 The ha1-encrypted password if password is not given in clear text. * @param realm The authentication domain (which can be larger than the sip domain. Unfortunately many SIP servers don't use this parameter. * @param domain The SIP domain for which this authentication information is valid, if it has to be restricted for a single SIP domain. - * @return A #LinphoneAuthInfo object. linphone_auth_info_destroy() must be used to destroy it when no longer needed. The LinphoneCore makes a copy of LinphoneAuthInfo + * @return A #LinphoneAuthInfo object. linphone_auth_info_destroy() must be used to destroy it when no longer needed. The #LinphoneCore makes a copy of #LinphoneAuthInfo * passed through linphone_core_add_auth_info(). **/ LINPHONE_PUBLIC LinphoneAuthInfo *linphone_auth_info_new( diff --git a/include/linphone/buffer.h b/include/linphone/buffer.h index bb7450666..9377546c6 100644 --- a/include/linphone/buffer.h +++ b/include/linphone/buffer.h @@ -35,63 +35,63 @@ extern "C" { */ /** - * Create a new empty LinphoneBuffer object. - * @return A new LinphoneBuffer object. + * Create a new empty #LinphoneBuffer object. + * @return A new #LinphoneBuffer object. */ LINPHONE_PUBLIC LinphoneBuffer * linphone_buffer_new(void); /** - * Create a new LinphoneBuffer object from existing data. + * Create a new #LinphoneBuffer object from existing data. * @param[in] data The initial data to store in the LinphoneBuffer. * @param[in] size The size of the initial data to stroe in the LinphoneBuffer. - * @return A new LinphoneBuffer object. + * @return A new #LinphoneBuffer object. */ LINPHONE_PUBLIC LinphoneBuffer * linphone_buffer_new_from_data(const uint8_t *data, size_t size); /** - * Create a new LinphoneBuffer object from a string. + * Create a new #LinphoneBuffer object from a string. * @param[in] data The initial string content of the LinphoneBuffer. - * @return A new LinphoneBuffer object. + * @return A new #LinphoneBuffer object. */ LINPHONE_PUBLIC LinphoneBuffer * linphone_buffer_new_from_string(const char *data); /** * Acquire a reference to the buffer. - * @param[in] buffer LinphoneBuffer object. - * @return The same LinphoneBuffer object. + * @param[in] buffer #LinphoneBuffer object. + * @return The same #LinphoneBuffer object. **/ LINPHONE_PUBLIC LinphoneBuffer * linphone_buffer_ref(LinphoneBuffer *buffer); /** * Release reference to the buffer. - * @param[in] buffer LinphoneBuffer object. + * @param[in] buffer #LinphoneBuffer object. **/ LINPHONE_PUBLIC void linphone_buffer_unref(LinphoneBuffer *buffer); /** * Retrieve the user pointer associated with the buffer. - * @param[in] buffer LinphoneBuffer object. + * @param[in] buffer #LinphoneBuffer object. * @return The user pointer associated with the buffer. **/ LINPHONE_PUBLIC void *linphone_buffer_get_user_data(const LinphoneBuffer *buffer); /** * Assign a user pointer to the buffer. - * @param[in] buffer LinphoneBuffer object. + * @param[in] buffer #LinphoneBuffer object. * @param[in] ud The user pointer to associate with the buffer. **/ LINPHONE_PUBLIC void linphone_buffer_set_user_data(LinphoneBuffer *buffer, void *ud); /** * Get the content of the data buffer. - * @param[in] buffer LinphoneBuffer object. + * @param[in] buffer #LinphoneBuffer object. * @return The content of the data buffer. */ LINPHONE_PUBLIC const uint8_t * linphone_buffer_get_content(const LinphoneBuffer *buffer); /** * Set the content of the data buffer. - * @param[in] buffer LinphoneBuffer object. + * @param[in] buffer #LinphoneBuffer object. * @param[in] content The content of the data buffer. * @param[in] size The size of the content of the data buffer. */ @@ -99,36 +99,36 @@ LINPHONE_PUBLIC void linphone_buffer_set_content(LinphoneBuffer *buffer, const u /** * Get the string content of the data buffer. - * @param[in] buffer LinphoneBuffer object + * @param[in] buffer #LinphoneBuffer object * @return The string content of the data buffer. */ LINPHONE_PUBLIC const char * linphone_buffer_get_string_content(const LinphoneBuffer *buffer); /** * Set the string content of the data buffer. - * @param[in] buffer LinphoneBuffer object. + * @param[in] buffer #LinphoneBuffer object. * @param[in] content The string content of the data buffer. */ LINPHONE_PUBLIC void linphone_buffer_set_string_content(LinphoneBuffer *buffer, const char *content); /** * Get the size of the content of the data buffer. - * @param[in] buffer LinphoneBuffer object. + * @param[in] buffer #LinphoneBuffer object. * @return The size of the content of the data buffer. */ LINPHONE_PUBLIC size_t linphone_buffer_get_size(const LinphoneBuffer *buffer); /** * Set the size of the content of the data buffer. - * @param[in] buffer LinphoneBuffer object + * @param[in] buffer #LinphoneBuffer object * @param[in] size The size of the content of the data buffer. */ LINPHONE_PUBLIC void linphone_buffer_set_size(LinphoneBuffer *buffer, size_t size); /** - * Tell whether the LinphoneBuffer is empty. - * @param[in] buffer LinphoneBuffer object - * @return A boolean value telling whether the LinphoneBuffer is empty or not. + * Tell whether the #LinphoneBuffer is empty. + * @param[in] buffer #LinphoneBuffer object + * @return A boolean value telling whether the #LinphoneBuffer is empty or not. */ LINPHONE_PUBLIC bool_t linphone_buffer_is_empty(const LinphoneBuffer *buffer); diff --git a/include/linphone/call_log.h b/include/linphone/call_log.h index 205865fad..43a2a3e7c 100644 --- a/include/linphone/call_log.h +++ b/include/linphone/call_log.h @@ -38,35 +38,35 @@ extern "C" { /** * Get the call ID used by the call. - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object * @return The call ID used by the call as a string. **/ LINPHONE_PUBLIC const char * linphone_call_log_get_call_id(const LinphoneCallLog *cl); /** * Get the direction of the call. - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object * @return The direction of the call. **/ LINPHONE_PUBLIC LinphoneCallDir linphone_call_log_get_dir(const LinphoneCallLog *cl); /** * Get the duration of the call since connected. - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object * @return The duration of the call in seconds. **/ LINPHONE_PUBLIC int linphone_call_log_get_duration(const LinphoneCallLog *cl); /** * Get the origin address (ie from) of the call. - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object * @return The origin address (ie from) of the call. **/ LINPHONE_PUBLIC const LinphoneAddress * linphone_call_log_get_from_address(const LinphoneCallLog *cl); /** * Get the RTP statistics computed locally regarding the call. - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object * @return The RTP statistics that have been computed locally for the call. * @donotwrap **/ @@ -74,7 +74,7 @@ LINPHONE_PUBLIC const rtp_stats_t * linphone_call_log_get_local_stats(const Linp /** * Get the overall quality indication of the call. - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object * @return The overall quality indication of the call. **/ LINPHONE_PUBLIC float linphone_call_log_get_quality(const LinphoneCallLog *cl); @@ -85,14 +85,14 @@ LINPHONE_PUBLIC float linphone_call_log_get_quality(const LinphoneCallLog *cl); * The reference key can be for example an id to an external database. * It is stored in the config file, thus can survive to process exits/restarts. * - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object * @return The reference key string that has been associated to the call log, or NULL if none has been associated. **/ LINPHONE_PUBLIC const char * linphone_call_log_get_ref_key(const LinphoneCallLog *cl); /** * Get the remote address (that is from or to depending on call direction). - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object * @return The remote address of the call. **/ LINPHONE_PUBLIC LinphoneAddress * linphone_call_log_get_remote_address(const LinphoneCallLog *cl); @@ -100,7 +100,7 @@ LINPHONE_PUBLIC LinphoneAddress * linphone_call_log_get_remote_address(const Lin /** * Get the RTP statistics computed by the remote end and sent back via RTCP. * @note Not implemented yet. - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object * @return The RTP statistics that have been computed by the remote end for the call. * @donotwrap **/ @@ -108,21 +108,21 @@ LINPHONE_PUBLIC const rtp_stats_t * linphone_call_log_get_remote_stats(const Lin /** * Get the start date of the call. - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object * @return The date of the beginning of the call. **/ LINPHONE_PUBLIC time_t linphone_call_log_get_start_date(const LinphoneCallLog *cl); /** * Get the status of the call. - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object * @return The status of the call. **/ LINPHONE_PUBLIC LinphoneCallStatus linphone_call_log_get_status(const LinphoneCallLog *cl); /** * Get the destination address (ie to) of the call. - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object * @return The destination address (ie to) of the call. **/ LINPHONE_PUBLIC const LinphoneAddress * linphone_call_log_get_to_address(const LinphoneCallLog *cl); @@ -133,14 +133,14 @@ LINPHONE_PUBLIC const LinphoneAddress * linphone_call_log_get_to_address(const L * The reference key can be for example an id to an external database. * It is stored in the config file, thus can survive to process exits/restarts. * - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object * @param[in] refkey The reference key string to associate to the call log. **/ LINPHONE_PUBLIC void linphone_call_log_set_ref_key(LinphoneCallLog *cl, const char *refkey); /** * Tell whether video was enabled at the end of the call or not. - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object * @return A boolean value telling whether video was enabled at the end of the call. **/ LINPHONE_PUBLIC bool_t linphone_call_log_video_enabled(const LinphoneCallLog *cl); @@ -148,7 +148,7 @@ LINPHONE_PUBLIC bool_t linphone_call_log_video_enabled(const LinphoneCallLog *cl /** * Get a human readable string describing the call. * @note: the returned string must be freed by the application (use ms_free()). - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object * @return A human readable string describing the call. **/ LINPHONE_PUBLIC char * linphone_call_log_to_str(const LinphoneCallLog *cl); @@ -174,28 +174,28 @@ LINPHONE_PUBLIC const LinphoneErrorInfo *linphone_call_log_get_error_info(const /** * Get the user data associated with the call log. - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object * @return The user data associated with the call log. **/ LINPHONE_PUBLIC void *linphone_call_log_get_user_data(const LinphoneCallLog *cl); /** * Assign a user data to the call log. - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object * @param[in] ud The user data to associate with the call log. **/ LINPHONE_PUBLIC void linphone_call_log_set_user_data(LinphoneCallLog *cl, void *ud); /** * Acquire a reference to the call log. - * @param[in] cl LinphoneCallLog object - * @return The same LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object + * @return The same #LinphoneCallLog object **/ LINPHONE_PUBLIC LinphoneCallLog * linphone_call_log_ref(LinphoneCallLog *cl); /** * Release a reference to the call log. - * @param[in] cl LinphoneCallLog object + * @param[in] cl #LinphoneCallLog object **/ LINPHONE_PUBLIC void linphone_call_log_unref(LinphoneCallLog *cl); @@ -218,7 +218,7 @@ LINPHONE_PUBLIC void linphone_call_log_unref(LinphoneCallLog *cl); /** * Destroy a LinphoneCallLog. - * @param cl LinphoneCallLog object + * @param cl #LinphoneCallLog object * @deprecated Use linphone_call_log_unref() instead. * @donotwrap */ diff --git a/include/linphone/call_params.h b/include/linphone/call_params.h index 9d3a88211..2da8b369e 100644 --- a/include/linphone/call_params.h +++ b/include/linphone/call_params.h @@ -48,22 +48,22 @@ extern "C" { LINPHONE_PUBLIC void linphone_call_params_add_custom_header(LinphoneCallParams *cp, const char *header_name, const char *header_value); /** - * Copy an existing LinphoneCallParams object to a new LinphoneCallParams object. - * @param[in] cp The LinphoneCallParams object to copy. - * @return A copy of the LinphoneCallParams object. + * Copy an existing #LinphoneCallParams object to a new #LinphoneCallParams object. + * @param[in] cp The #LinphoneCallParams object to copy. + * @return A copy of the #LinphoneCallParams object. **/ LINPHONE_PUBLIC LinphoneCallParams * linphone_call_params_copy(const LinphoneCallParams *cp); /** * Indicate whether sending of early media was enabled. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @return A boolean value telling whether sending of early media was enabled. **/ LINPHONE_PUBLIC bool_t linphone_call_params_early_media_sending_enabled(const LinphoneCallParams *cp); /** * Enable sending of real early media (during outgoing calls). - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @param[in] enabled A boolean value telling whether to enable early media sending or not. **/ LINPHONE_PUBLIC void linphone_call_params_enable_early_media_sending(LinphoneCallParams *cp, bool_t enabled); @@ -73,21 +73,21 @@ LINPHONE_PUBLIC void linphone_call_params_enable_early_media_sending(LinphoneCal * Configuring a call to low bandwidth mode will result in the core to activate several settings for the call in order to ensure that bitrate usage * is lowered to the minimum possible. Typically, ptime (packetization time) will be increased, audio codec's output bitrate will be targetted to 20kbit/s provided * that it is achievable by the codec selected after SDP handshake. Video is automatically disabled. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @param[in] enabled A boolean value telling whether to activate the low bandwidth mode or not. **/ LINPHONE_PUBLIC void linphone_call_params_enable_low_bandwidth(LinphoneCallParams *cp, bool_t enabled); /** * Enable audio stream. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @param[in] enabled A boolean value telling whether to enable audio or not. **/ LINPHONE_PUBLIC void linphone_call_params_enable_audio(LinphoneCallParams *cp, bool_t enabled); /** * Enable video stream. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @param[in] enabled A boolean value telling whether to enable video or not. **/ LINPHONE_PUBLIC void linphone_call_params_enable_video(LinphoneCallParams *cp, bool_t enabled); @@ -106,36 +106,36 @@ LINPHONE_PUBLIC const char *linphone_call_params_get_custom_header(const Linphon * that function does not return TRUE even if the conference is running.
* If you want to test whether the conference is running, you should test * whether linphone_core_get_conference() return a non-null pointer. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @return A boolean value telling whether the call is part of the locally managed conference. **/ LINPHONE_PUBLIC bool_t linphone_call_params_get_local_conference_mode(const LinphoneCallParams *cp); /** * Get the kind of media encryption selected for the call. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @return The kind of media encryption selected for the call. **/ LINPHONE_PUBLIC LinphoneMediaEncryption linphone_call_params_get_media_encryption(const LinphoneCallParams *cp); /** * Get requested level of privacy for the call. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @return The privacy mode used for the call. **/ LINPHONE_PUBLIC LinphonePrivacyMask linphone_call_params_get_privacy(const LinphoneCallParams *cp); /** * Get the framerate of the video that is received. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @return The actual received framerate in frames per seconds, 0 if not available. */ LINPHONE_PUBLIC float linphone_call_params_get_received_framerate(const LinphoneCallParams *cp); /** * Get the definition of the received video. - * @param[in] cp LinphoneCallParams object - * @return The received LinphoneVideoDefinition + * @param[in] cp #LinphoneCallParams object + * @return The received #LinphoneVideoDefinition */ LINPHONE_PUBLIC const LinphoneVideoDefinition * linphone_call_params_get_received_video_definition(const LinphoneCallParams *cp); @@ -150,7 +150,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED MSVideoSize linphone_call_params_get_receive /** * Get the path for the audio recording of the call. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @return The path to the audio recording of the call. **/ LINPHONE_PUBLIC const char *linphone_call_params_get_record_file(const LinphoneCallParams *cp); @@ -164,15 +164,15 @@ LINPHONE_PUBLIC const char * linphone_call_params_get_rtp_profile(const Linphone /** * Get the framerate of the video that is sent. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @return The actual sent framerate in frames per seconds, 0 if not available. */ LINPHONE_PUBLIC float linphone_call_params_get_sent_framerate(const LinphoneCallParams *cp); /** * Get the definition of the sent video. - * @param[in] cp LinphoneCallParams object - * @return The sent LinphoneVideoDefinition + * @param[in] cp #LinphoneCallParams object + * @return The sent #LinphoneVideoDefinition */ LINPHONE_PUBLIC const LinphoneVideoDefinition * linphone_call_params_get_sent_video_definition(const LinphoneCallParams *cp); @@ -188,7 +188,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED MSVideoSize linphone_call_params_get_sent_vi /** * Get the session name of the media session (ie in SDP). * Subject from the SIP message can be retrieved using linphone_call_params_get_custom_header() and is different. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @return The session name of the media session. **/ LINPHONE_PUBLIC const char *linphone_call_params_get_session_name(const LinphoneCallParams *cp); @@ -250,7 +250,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED const OrtpPayloadType *linphone_call_params_ * An application that would have reliable way to know network capacity may not use activate_edge_workarounds=1 but instead manually configure * low bandwidth mode with linphone_call_params_enable_low_bandwidth(). * When enabled, this param may transform a call request with video in audio only mode. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @return A boolean value telling whether the low bandwidth mode has been configured/detected. */ LINPHONE_PUBLIC bool_t linphone_call_params_low_bandwidth_enabled(const LinphoneCallParams *cp); @@ -258,14 +258,14 @@ LINPHONE_PUBLIC bool_t linphone_call_params_low_bandwidth_enabled(const Linphone /** * Refine bandwidth settings for this call by setting a bandwidth limit for audio streams. * As a consequence, codecs whose bitrates are not compatible with this limit won't be used. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @param[in] bw The audio bandwidth limit to set in kbit/s. **/ LINPHONE_PUBLIC void linphone_call_params_set_audio_bandwidth_limit(LinphoneCallParams *cp, int bw); /** * Set requested media encryption for a call. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @param[in] enc The media encryption to use for the call. **/ LINPHONE_PUBLIC void linphone_call_params_set_media_encryption(LinphoneCallParams *cp, LinphoneMediaEncryption enc); @@ -273,7 +273,7 @@ LINPHONE_PUBLIC void linphone_call_params_set_media_encryption(LinphoneCallParam /** * Set requested level of privacy for the call. * \xmlonly javascript \endxmlonly - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @param[in] privacy The privacy mode to used for the call. **/ LINPHONE_PUBLIC void linphone_call_params_set_privacy(LinphoneCallParams *cp, LinphonePrivacyMask privacy); @@ -283,7 +283,7 @@ LINPHONE_PUBLIC void linphone_call_params_set_privacy(LinphoneCallParams *cp, Li * This function must be used before the call parameters are assigned to the call. * The call recording can be started and paused after the call is established with * linphone_call_start_recording() and linphone_call_pause_recording(). - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @param[in] path A string containing the path and filename of the file where audio/video streams are to be written. * The filename must have either .mkv or .wav extention. The video stream will be written only if a MKV file is given. **/ @@ -292,49 +292,49 @@ LINPHONE_PUBLIC void linphone_call_params_set_record_file(LinphoneCallParams *cp /** * Set the session name of the media session (ie in SDP). * Subject from the SIP message (which is different) can be set using linphone_call_params_set_custom_header(). - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @param[in] name The session name to be used. **/ LINPHONE_PUBLIC void linphone_call_params_set_session_name(LinphoneCallParams *cp, const char *name); /** * Tell whether audio is enabled or not. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @return A boolean value telling whether audio is enabled or not. **/ LINPHONE_PUBLIC bool_t linphone_call_params_audio_enabled(const LinphoneCallParams *cp); /** * Tell whether video is enabled or not. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @return A boolean value telling whether video is enabled or not. **/ LINPHONE_PUBLIC bool_t linphone_call_params_video_enabled(const LinphoneCallParams *cp); /** * Get the audio stream direction. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @return The audio stream direction associated with the call params. **/ LINPHONE_PUBLIC LinphoneMediaDirection linphone_call_params_get_audio_direction(const LinphoneCallParams *cp); /** * Get the video stream direction. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @return The video stream direction associated with the call params. **/ LINPHONE_PUBLIC LinphoneMediaDirection linphone_call_params_get_video_direction(const LinphoneCallParams *cp); /** * Set the audio stream direction. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @param[in] dir The audio stream direction associated with this call params. **/ LINPHONE_PUBLIC void linphone_call_params_set_audio_direction(LinphoneCallParams *cp, LinphoneMediaDirection dir); /** * Set the video stream direction. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @param[in] dir The video stream direction associated with this call params. **/ LINPHONE_PUBLIC void linphone_call_params_set_video_direction(LinphoneCallParams *cp, LinphoneMediaDirection dir); @@ -356,28 +356,28 @@ void linphone_call_params_set_avpf_rr_interval(LinphoneCallParams *params, uint1 /** * Get the user data associated with the call params. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @return The user data associated with the call params. **/ LINPHONE_PUBLIC void *linphone_call_params_get_user_data(const LinphoneCallParams *cp); /** * Assign a user data to the call params. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object * @param[in] ud The user data to associate with the call params. **/ LINPHONE_PUBLIC void linphone_call_params_set_user_data(LinphoneCallParams *cp, void *ud); /** * Acquire a reference to the call params. - * @param[in] cp LinphoneCallParams object - * @return The same LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object + * @return The same #LinphoneCallParams object **/ LINPHONE_PUBLIC LinphoneCallParams * linphone_call_params_ref(LinphoneCallParams *cp); /** * Release a reference to the call params. - * @param[in] cp LinphoneCallParams object + * @param[in] cp #LinphoneCallParams object **/ LINPHONE_PUBLIC void linphone_call_params_unref(LinphoneCallParams *cp); @@ -497,8 +497,8 @@ LINPHONE_PUBLIC void linphone_call_params_clear_custom_sdp_media_attributes(Linp #define linphone_call_params_local_conference_mode linphone_call_params_get_local_conference_mode /** - * Destroy a LinphoneCallParams object. - * @param[in] cp LinphoneCallParams object + * Destroy a #LinphoneCallParams object. + * @param[in] cp #LinphoneCallParams object * @deprecated Use linphone_call_params_unref() instead. * @donotwrap **/ diff --git a/include/linphone/callbacks.h b/include/linphone/callbacks.h index 714dac323..f6833baa1 100644 --- a/include/linphone/callbacks.h +++ b/include/linphone/callbacks.h @@ -40,9 +40,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ /** - * Callback notifying that a new LinphoneCall (either incoming or outgoing) has been created. - * @param[in] lc LinphoneCore object that has created the call - * @param[in] call The newly created LinphoneCall object + * Callback notifying that a new #LinphoneCall (either incoming or outgoing) has been created. + * @param[in] lc #LinphoneCore object that has created the call + * @param[in] call The newly created #LinphoneCall object */ typedef void (*LinphoneCoreCbsCallCreatedCb)(LinphoneCore *lc, LinphoneCall *call); @@ -61,7 +61,7 @@ typedef LinphoneCoreCbsGlobalStateChangedCb LinphoneCoreGlobalStateChangedCb; /** * Call state notification callback. - * @param lc the LinphoneCore + * @param lc the #LinphoneCore * @param call the call object whose state is changed. * @param cstate the new state of the call * @param message a non NULL informational message about the state. @@ -75,7 +75,7 @@ typedef LinphoneCoreCbsCallStateChangedCb LinphoneCoreCallStateChangedCb; /** * Call encryption changed callback. - * @param lc the LinphoneCore + * @param lc the #LinphoneCore * @param call the call on which encryption is changed. * @param on whether encryption is activated. * @param authentication_token an authentication_token, currently set for ZRTP kind of encryption only. @@ -140,7 +140,7 @@ typedef LinphoneCoreCbsNewSubscriptionRequestedCb LinphoneCoreNewSubscriptionReq /** * Callback for requesting authentication information to application or user. - * @param lc the LinphoneCore + * @param lc the #LinphoneCore * @param realm the realm (domain) on which authentication is required. * @param username the username that needs to be authenticated. * @param domain the domain on which authentication is required. @@ -150,8 +150,8 @@ typedef void (*LinphoneCoreAuthInfoRequestedCb)(LinphoneCore *lc, const char *re /** * Callback for requesting authentication information to application or user. - * @param lc the LinphoneCore - * @param auth_info a LinphoneAuthInfo pre-filled with username, realm and domain values as much as possible + * @param lc the #LinphoneCore + * @param auth_info a #LinphoneAuthInfo pre-filled with username, realm and domain values as much as possible * @param method the type of authentication requested * Application shall reply to this callback using linphone_core_add_auth_info(). */ @@ -165,7 +165,7 @@ typedef LinphoneCoreCbsAuthenticationRequestedCb LinphoneCoreAuthenticationReque /** * Callback to notify a new call-log entry has been added. * This is done typically when a call terminates. - * @param lc the LinphoneCore + * @param lc the #LinphoneCore * @param newcl the new call log entry added. */ typedef void (*LinphoneCoreCbsCallLogUpdatedCb)(LinphoneCore *lc, LinphoneCallLog *newcl); @@ -190,7 +190,7 @@ typedef void (*LinphoneCoreTextMessageReceivedCb)(LinphoneCore *lc, LinphoneChat * Chat message callback prototype * @param lc #LinphoneCore object * @param room #LinphoneChatRoom involved in this conversation. Can be be created by the framework in case \link #LinphoneAddress the from \endlink is not present in any chat room. - * @param LinphoneChatMessage incoming message + * @param #LinphoneChatMessage incoming message */ typedef void (*LinphoneCoreCbsMessageReceivedCb)(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage *message); @@ -203,7 +203,7 @@ typedef LinphoneCoreCbsMessageReceivedCb LinphoneCoreMessageReceivedCb; * Chat message not decrypted callback prototype * @param lc #LinphoneCore object * @param room #LinphoneChatRoom involved in this conversation. Can be be created by the framework in case \link #LinphoneAddress the from \endlink is not present in any chat room. - * @param LinphoneChatMessage incoming message + * @param #LinphoneChatMessage incoming message */ typedef void (*LinphoneCoreCbsMessageReceivedUnableDecryptCb)(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage *message); @@ -281,7 +281,7 @@ typedef LinphoneCoreCbsBuddyInfoUpdatedCb LinphoneCoreBuddyInfoUpdatedCb; /** * Callback for notifying progresses of transfers. - * @param lc the LinphoneCore + * @param lc the #LinphoneCore * @param transfered the call that was transfered * @param new_call_state the state of the call to transfer target at the far end. */ @@ -294,7 +294,7 @@ typedef LinphoneCoreCbsTransferStateChangedCb LinphoneCoreTransferStateChangedCb /** * Callback for receiving quality statistics for calls. - * @param lc the LinphoneCore + * @param lc the #LinphoneCore * @param call the call * @param stats the call statistics. */ @@ -307,7 +307,7 @@ typedef LinphoneCoreCbsCallStatsUpdatedCb LinphoneCoreCallStatsUpdatedCb; /** * Callback prototype for receiving info messages. - * @param lc the LinphoneCore + * @param lc the #LinphoneCore * @param call the call whose info message belongs to. * @param msg the info message. */ @@ -320,7 +320,7 @@ typedef LinphoneCoreCbsInfoReceivedCb LinphoneCoreInfoReceivedCb; /** * Callback prototype for configuring status changes notification - * @param lc the LinphoneCore + * @param lc the #LinphoneCore * @param message informational message. */ typedef void (*LinphoneCoreCbsConfiguringStatusCb)(LinphoneCore *lc, LinphoneConfiguringState status, const char *message); @@ -332,7 +332,7 @@ typedef LinphoneCoreCbsConfiguringStatusCb LinphoneCoreConfiguringStatusCb; /** * Callback prototype for reporting network change either automatically detected or notified by #linphone_core_set_network_reachable. - * @param lc the LinphoneCore + * @param lc the #LinphoneCore * @param reachable true if network is reachable. */ typedef void (*LinphoneCoreCbsNetworkReachableCb)(LinphoneCore *lc, bool_t reachable); @@ -344,7 +344,7 @@ typedef LinphoneCoreCbsNetworkReachableCb LinphoneCoreNetworkReachableCb; /** * Callback prototype for reporting log collection upload state change. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] state The state of the log collection upload * @param[in] info Additional information: error message in case of error state, URL of uploaded file in case of success. */ @@ -357,7 +357,7 @@ typedef LinphoneCoreCbsLogCollectionUploadStateChangedCb LinphoneCoreLogCollecti /** * Callback prototype for reporting log collection upload progress indication. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object */ typedef void (*LinphoneCoreCbsLogCollectionUploadProgressIndicationCb)(LinphoneCore *lc, size_t offset, size_t total); @@ -368,8 +368,8 @@ typedef LinphoneCoreCbsLogCollectionUploadProgressIndicationCb LinphoneCoreLogCo /** * Callback prototype for reporting when a friend list has been added to the core friends list. - * @param[in] lc LinphoneCore object - * @param[in] list LinphoneFriendList object + * @param[in] lc #LinphoneCore object + * @param[in] list #LinphoneFriendList object */ typedef void (*LinphoneCoreCbsFriendListCreatedCb) (LinphoneCore *lc, LinphoneFriendList *list); @@ -380,8 +380,8 @@ typedef LinphoneCoreCbsFriendListCreatedCb LinphoneCoreFriendListCreatedCb; /** * Callback prototype for reporting when a friend list has been removed from the core friends list. - * @param[in] lc LinphoneCore object - * @param[in] list LinphoneFriendList object + * @param[in] lc #LinphoneCore object + * @param[in] list #LinphoneFriendList object */ typedef void (*LinphoneCoreCbsFriendListRemovedCb) (LinphoneCore *lc, LinphoneFriendList *list); @@ -392,16 +392,16 @@ typedef LinphoneCoreCbsFriendListRemovedCb LinphoneCoreFriendListRemovedCb; /** * Callback prototype for reporting the result of a version update check. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] result The result of the version update check - * @param[in] url The url where to download the new version if the result is LinphoneVersionUpdateCheckNewVersionAvailable + * @param[in] url The url where to download the new version if the result is #LinphoneVersionUpdateCheckNewVersionAvailable */ typedef void (*LinphoneCoreCbsVersionUpdateCheckResultReceivedCb) (LinphoneCore *lc, LinphoneVersionUpdateCheckResult result, const char *version, const char *url); /** - * Callback prototype telling that a LinphoneChatRoom state has changed. - * @param[in] lc LinphoneCore object - * @param[in] cr The LinphoneChatRoom object for which the state has changed + * Callback prototype telling that a #LinphoneChatRoom state has changed. + * @param[in] lc #LinphoneCore object + * @param[in] cr The #LinphoneChatRoom object for which the state has changed */ typedef void (*LinphoneCoreCbsChatRoomStateChangedCb) (LinphoneCore *lc, LinphoneChatRoom *cr, LinphoneChatRoomState state); @@ -455,29 +455,29 @@ typedef LinphoneCoreCbsPublishStateChangedCb LinphoneCorePublishStateChangedCb; /** * Callback used to notify a new contact has been created on the CardDAV server and downloaded locally - * @param list The LinphoneFriendList object the new contact is added to - * @param lf The LinphoneFriend object that has been created + * @param list The #LinphoneFriendList object the new contact is added to + * @param lf The #LinphoneFriend object that has been created **/ typedef void (*LinphoneFriendListCbsContactCreatedCb)(LinphoneFriendList *list, LinphoneFriend *lf); /** * Callback used to notify a contact has been deleted on the CardDAV server - * @param list The LinphoneFriendList object a contact has been removed from - * @param lf The LinphoneFriend object that has been deleted + * @param list The #LinphoneFriendList object a contact has been removed from + * @param lf The #LinphoneFriend object that has been deleted **/ typedef void (*LinphoneFriendListCbsContactDeletedCb)(LinphoneFriendList *list, LinphoneFriend *lf); /** * Callback used to notify a contact has been updated on the CardDAV server - * @param list The LinphoneFriendList object in which a contact has been updated - * @param new_friend The new LinphoneFriend object corresponding to the updated contact - * @param old_friend The old LinphoneFriend object before update + * @param list The #LinphoneFriendList object in which a contact has been updated + * @param new_friend The new #LinphoneFriend object corresponding to the updated contact + * @param old_friend The old #LinphoneFriend object before update **/ typedef void (*LinphoneFriendListCbsContactUpdatedCb)(LinphoneFriendList *list, LinphoneFriend *new_friend, LinphoneFriend *old_friend); /** * Callback used to notify the status of the synchronization has changed - * @param list The LinphoneFriendList object for which the status has changed + * @param list The #LinphoneFriendList object for which the status has changed * @param status The new synchronisation status * @param msg An additional information on the status update **/ @@ -513,44 +513,44 @@ typedef void (*LinphoneCoreCbsEcCalibrationAudioInitCb)(LinphoneCore *lc); typedef void (*LinphoneCoreCbsEcCalibrationAudioUninitCb)(LinphoneCore *lc); /** - * Callback to decrypt incoming LinphoneChatMessage + * Callback to decrypt incoming #LinphoneChatMessage * @param engine ImEncryptionEngine object - * @param room LinphoneChatRoom object - * @param msg LinphoneChatMessage object + * @param room #LinphoneChatRoom object + * @param msg #LinphoneChatMessage object * @return -1 if nothing to be done, 0 on success or an integer > 0 for error */ typedef int (*LinphoneImEncryptionEngineCbsIncomingMessageCb)(LinphoneImEncryptionEngine *engine, LinphoneChatRoom *room, LinphoneChatMessage *msg); /** - * Callback to encrypt outgoing LinphoneChatMessage - * @param engine LinphoneImEncryptionEngine object - * @param room LinphoneChatRoom object - * @param msg LinphoneChatMessage object + * Callback to encrypt outgoing #LinphoneChatMessage + * @param engine #LinphoneImEncryptionEngine object + * @param room #LinphoneChatRoom object + * @param msg #LinphoneChatMessage object * @return -1 if nothing to be done, 0 on success or an integer > 0 for error */ typedef int (*LinphoneImEncryptionEngineCbsOutgoingMessageCb)(LinphoneImEncryptionEngine *engine, LinphoneChatRoom *room, LinphoneChatMessage *msg); /** * Callback to know whether or not the engine will encrypt files before uploading them - * @param engine LinphoneImEncryptionEngine object - * @param room LinphoneChatRoom object + * @param engine #LinphoneImEncryptionEngine object + * @param room #LinphoneChatRoom object * @return TRUE if files will be encrypted, FALSE otherwise */ typedef bool_t (*LinphoneImEncryptionEngineCbsIsEncryptionEnabledForFileTransferCb)(LinphoneImEncryptionEngine *engine, LinphoneChatRoom *room); /** * Callback to generate the key used to encrypt the files before uploading them - * Key can be stored in the LinphoneContent object inside the LinphoneChatMessage using linphone_content_set_key - * @param engine LinphoneImEncryptionEngine object - * @param room LinphoneChatRoom object - * @param msg LinphoneChatMessage object + * Key can be stored in the #LinphoneContent object inside the #LinphoneChatMessage using linphone_content_set_key + * @param engine #LinphoneImEncryptionEngine object + * @param room #LinphoneChatRoom object + * @param msg #LinphoneChatMessage object */ typedef void (*LinphoneImEncryptionEngineCbsGenerateFileTransferKeyCb)(LinphoneImEncryptionEngine *engine, LinphoneChatRoom *room, LinphoneChatMessage *msg); /** * Callback to decrypt downloading file - * @param engine LinphoneImEncryptionEngine object - * @param msg LinphoneChatMessage object + * @param engine #LinphoneImEncryptionEngine object + * @param msg #LinphoneChatMessage object * @param offset The current offset of the upload * @param[in] buffer Encrypted data buffer * @param[in] size Size of the encrypted data buffer and maximum size of the decrypted data buffer @@ -561,8 +561,8 @@ typedef int (*LinphoneImEncryptionEngineCbsDownloadingFileCb)(LinphoneImEncrypti /** * Callback to encrypt uploading file - * @param engine LinphoneImEncryptionEngine object - * @param msg LinphoneChatMessage object + * @param engine #LinphoneImEncryptionEngine object + * @param msg #LinphoneChatMessage object * @param offset The current offset of the upload * @param[in] buffer Encrypted data buffer * @param[in,out] size Size of the plain data buffer and the size of the encrypted data buffer once encryption is done @@ -573,7 +573,7 @@ typedef int (*LinphoneImEncryptionEngineCbsUploadingFileCb)(LinphoneImEncryption /** * Callback used to notify the response to an XML-RPC request. - * @param[in] request LinphoneXmlRpcRequest object + * @param[in] request #LinphoneXmlRpcRequest object **/ typedef void (*LinphoneXmlRpcRequestCbsResponseCb)(LinphoneXmlRpcRequest *request); @@ -588,7 +588,7 @@ typedef void (*LinphoneXmlRpcRequestCbsResponseCb)(LinphoneXmlRpcRequest *reques /** * Callback for notifying end of play (file). - * @param[in] player The LinphonePlayer object + * @param[in] player The #LinphonePlayer object **/ typedef void (*LinphonePlayerCbsEofReachedCb)(LinphonePlayer *obj); diff --git a/include/linphone/conference.h b/include/linphone/conference.h index ea12eac85..d61425437 100644 --- a/include/linphone/conference.h +++ b/include/linphone/conference.h @@ -118,7 +118,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_conference_remove_participant(LinphoneCo LINPHONE_PUBLIC bctbx_list_t *linphone_conference_get_participants(const LinphoneConference *obj); /** - * Invite participants to the conference, by supplying a list of LinphoneAddress + * Invite participants to the conference, by supplying a list of #LinphoneAddress * @param obj The conference. * @param addresses \bctbx_list{LinphoneAddress} * @param params #LinphoneCallParams to use for inviting the participants. diff --git a/include/linphone/content.h b/include/linphone/content.h index 78ebc3114..969d6b9b5 100644 --- a/include/linphone/content.h +++ b/include/linphone/content.h @@ -36,69 +36,69 @@ extern "C" { /** * Acquire a reference to the content. - * @param[in] content LinphoneContent object. - * @return The same LinphoneContent object. + * @param[in] content #LinphoneContent object. + * @return The same #LinphoneContent object. **/ LINPHONE_PUBLIC LinphoneContent * linphone_content_ref(LinphoneContent *content); /** * Release reference to the content. - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. **/ LINPHONE_PUBLIC void linphone_content_unref(LinphoneContent *content); /** * Retrieve the user pointer associated with the content. - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @return The user pointer associated with the content. **/ LINPHONE_PUBLIC void *linphone_content_get_user_data(const LinphoneContent *content); /** * Assign a user pointer to the content. - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @param[in] ud The user pointer to associate with the content. **/ LINPHONE_PUBLIC void linphone_content_set_user_data(LinphoneContent *content, void *ud); /** * Get the mime type of the content data. - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @return The mime type of the content data, for example "application". */ LINPHONE_PUBLIC const char * linphone_content_get_type(const LinphoneContent *content); /** * Set the mime type of the content data. - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @param[in] type The mime type of the content data, for example "application". */ LINPHONE_PUBLIC void linphone_content_set_type(LinphoneContent *content, const char *type); /** * Get the mime subtype of the content data. - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @return The mime subtype of the content data, for example "html". */ LINPHONE_PUBLIC const char * linphone_content_get_subtype(const LinphoneContent *content); /** * Set the mime subtype of the content data. - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @param[in] subtype The mime subtype of the content data, for example "html". */ LINPHONE_PUBLIC void linphone_content_set_subtype(LinphoneContent *content, const char *subtype); /** * Get the content data buffer, usually a string. - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @return The content data buffer. */ LINPHONE_PUBLIC uint8_t * linphone_content_get_buffer(const LinphoneContent *content); /** * Set the content data buffer, usually a string. - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @param[in] buffer The content data buffer. * @param[in] size The size of the content data buffer. */ @@ -106,87 +106,87 @@ LINPHONE_PUBLIC void linphone_content_set_buffer(LinphoneContent *content, const /** * Get the string content data buffer. - * @param[in] content LinphoneContent object + * @param[in] content #LinphoneContent object * @return The string content data buffer. */ LINPHONE_PUBLIC const char * linphone_content_get_string_buffer(const LinphoneContent *content); /** * Set the string content data buffer. - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @param[in] buffer The string content data buffer. */ LINPHONE_PUBLIC void linphone_content_set_string_buffer(LinphoneContent *content, const char *buffer); /** * Get the content data buffer size, excluding null character despite null character is always set for convenience. - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @return The content data buffer size. */ LINPHONE_PUBLIC size_t linphone_content_get_size(const LinphoneContent *content); /** * Set the content data size, excluding null character despite null character is always set for convenience. - * @param[in] content LinphoneContent object + * @param[in] content #LinphoneContent object * @param[in] size The content data buffer size. */ LINPHONE_PUBLIC void linphone_content_set_size(LinphoneContent *content, size_t size); /** * Get the encoding of the data buffer, for example "gzip". - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @return The encoding of the data buffer. */ LINPHONE_PUBLIC const char * linphone_content_get_encoding(const LinphoneContent *content); /** * Set the encoding of the data buffer, for example "gzip". - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @param[in] encoding The encoding of the data buffer. */ LINPHONE_PUBLIC void linphone_content_set_encoding(LinphoneContent *content, const char *encoding); /** * Get the name associated with a RCS file transfer message. It is used to store the original filename of the file to be downloaded from server. - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @return The name of the content. */ LINPHONE_PUBLIC const char * linphone_content_get_name(const LinphoneContent *content); /** * Set the name associated with a RCS file transfer message. It is used to store the original filename of the file to be downloaded from server. - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @param[in] name The name of the content. */ LINPHONE_PUBLIC void linphone_content_set_name(LinphoneContent *content, const char *name); /** * Tell whether a content is a multipart content. - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @return A boolean value telling whether the content is multipart or not. */ LINPHONE_PUBLIC bool_t linphone_content_is_multipart(const LinphoneContent *content); /** * Get a part from a multipart content according to its index. - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @param[in] idx The index of the part to get. - * @return A LinphoneContent object holding the part if found, NULL otherwise. + * @return A #LinphoneContent object holding the part if found, NULL otherwise. */ LINPHONE_PUBLIC LinphoneContent * linphone_content_get_part(const LinphoneContent *content, int idx); /** * Find a part from a multipart content looking for a part header with a specified value. - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @param[in] header_name The name of the header to look for. * @param[in] header_value The value of the header to look for. - * @return A LinphoneContent object object the part if found, NULL otherwise. + * @return A #LinphoneContent object object the part if found, NULL otherwise. */ LINPHONE_PUBLIC LinphoneContent * linphone_content_find_part_by_header(const LinphoneContent *content, const char *header_name, const char *header_value); /** * Get a custom header value of a content. - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @param[in] header_name The name of the header to get the value from. * @return The value of the header if found, NULL otherwise. */ @@ -194,21 +194,21 @@ LINPHONE_PUBLIC const char * linphone_content_get_custom_header(const LinphoneCo /** * Get the key associated with a RCS file transfer message if encrypted - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @return The key to encrypt/decrypt the file associated to this content. */ LINPHONE_PUBLIC const char *linphone_content_get_key(const LinphoneContent *content); /** * Get the size of key associated with a RCS file transfer message if encrypted - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @return The key size in bytes */ LINPHONE_PUBLIC size_t linphone_content_get_key_size(const LinphoneContent *content); /** * Set the key associated with a RCS file transfer message if encrypted - * @param[in] content LinphoneContent object. + * @param[in] content #LinphoneContent object. * @param[in] key The key to be used to encrypt/decrypt file associated to this content. * @param[in] keyLength The lengh of the key. */ diff --git a/include/linphone/core.h b/include/linphone/core.h index d2efdce47..82ed102e3 100644 --- a/include/linphone/core.h +++ b/include/linphone/core.h @@ -73,7 +73,7 @@ extern "C" { #endif /** - * Safely down-cast a belle_sip_object_t into LinphoneCore + * Safely down-cast a belle_sip_object_t into #LinphoneCore * @ingroup initializing */ #define LINPHONE_CORE(object) BELLE_SIP_CAST(object, LinphoneCore) @@ -97,9 +97,9 @@ LINPHONE_PUBLIC LinphoneAddress * linphone_core_create_address(LinphoneCore *lc, /** * Create an independent media file player. * This player support WAVE and MATROSKA formats. - * @param lc A LinphoneCore object - * @param sound_card_name Playback sound card. If NULL, the ringer sound card set in LinphoneCore will be used - * @param video_display_name Video display. If NULL, the video display set in LinphoneCore will be used + * @param lc A #LinphoneCore object + * @param sound_card_name Playback sound card. If NULL, the ringer sound card set in #LinphoneCore will be used + * @param video_display_name Video display. If NULL, the video display set in #LinphoneCore will be used * @param window_id Id of the drawing window. Depend of video out * @return A pointer on the new instance. NULL if faild. */ @@ -107,7 +107,7 @@ LINPHONE_PUBLIC LinphonePlayer *linphone_core_create_local_player(LinphoneCore * /** * Creates an empty info message. - * @param lc the LinphoneCore + * @param lc the #LinphoneCore * @return a new LinphoneInfoMessage. * * The info message can later be filled with information using linphone_info_message_add_header() or linphone_info_message_set_content(), @@ -117,7 +117,7 @@ LINPHONE_PUBLIC LinphoneInfoMessage *linphone_core_create_info_message(LinphoneC /** * Checks if a new version of the application is available. - * @param lc LinphoneCore object + * @param lc #LinphoneCore object * @param current_version The current version of the application */ LINPHONE_PUBLIC void linphone_core_check_for_update(LinphoneCore *lc, const char *current_version); @@ -128,7 +128,7 @@ LINPHONE_PUBLIC void linphone_core_check_for_update(LinphoneCore *lc, const char /** * Get the remote address of the current call. - * @param[in] lc LinphoneCore object. + * @param[in] lc #LinphoneCore object. * @return The remote address of the current call or NULL if there is no current call. * @ingroup call_control */ @@ -639,42 +639,42 @@ LINPHONE_PUBLIC LinphoneCoreCbsFriendListRemovedCb linphone_core_cbs_get_friend_ /** * Set the call created callback. - * @param[in] cbs LinphoneCallCbs object. + * @param[in] cbs #LinphoneCallCbs object. * @param[in] cb The call created callback to be used. */ LINPHONE_PUBLIC void linphone_core_cbs_set_call_created(LinphoneCoreCbs *cbs, LinphoneCoreCbsCallCreatedCb cb); /** * Get the call created callback. - * @param[in] cbs LinphoneCoreCbs object. + * @param[in] cbs #LinphoneCoreCbs object. * @return The current call created callback. */ LINPHONE_PUBLIC LinphoneCoreCbsCallCreatedCb linphone_core_cbs_get_call_created(LinphoneCoreCbs *cbs); /** * Set the version update check result callback. - * @param[in] cbs LinphoneCoreCbs object + * @param[in] cbs #LinphoneCoreCbs object * @param[in] cb The callback to use */ LINPHONE_PUBLIC void linphone_core_cbs_set_version_update_check_result_received(LinphoneCoreCbs *cbs, LinphoneCoreCbsVersionUpdateCheckResultReceivedCb cb); /** * Get the version update check result callback. - * @param[in] cbs LinphoneCoreCbs object + * @param[in] cbs #LinphoneCoreCbs object * @return The current callback */ LINPHONE_PUBLIC LinphoneCoreCbsVersionUpdateCheckResultReceivedCb linphone_core_cbs_get_version_update_check_result_received(LinphoneCoreCbs *cbs); /** * Get the chat room state changed callback. - * @param[in] cbs LinphoneCoreCbs object + * @param[in] cbs #LinphoneCoreCbs object * @return The current callback */ LINPHONE_PUBLIC LinphoneCoreCbsChatRoomStateChangedCb linphone_core_cbs_get_chat_room_state_changed (LinphoneCoreCbs *cbs); /** * Set the chat room state changed callback. - * @param[in] cbs LinphoneCoreCbs object + * @param[in] cbs #LinphoneCoreCbs object * @param[in] cb The callback to use */ LINPHONE_PUBLIC void linphone_core_cbs_set_chat_room_state_changed (LinphoneCoreCbs *cbs, LinphoneCoreCbsChatRoomStateChangedCb cb); @@ -714,7 +714,7 @@ LINPHONE_PUBLIC LinphoneLogCollectionState linphone_core_log_collection_enabled( /** * Enable the linphone core log collection to upload logs on a server. - * @param[in] state LinphoneLogCollectionState value telling whether to enable log collection or not. + * @param[in] state #LinphoneLogCollectionState value telling whether to enable log collection or not. */ LINPHONE_PUBLIC void linphone_core_enable_log_collection(LinphoneLogCollectionState state); @@ -760,21 +760,21 @@ LINPHONE_PUBLIC void linphone_core_set_log_collection_max_file_size(size_t size) /** * Set the url of the server where to upload the collected log files. - * @param[in] core LinphoneCore object + * @param[in] core #LinphoneCore object * @param[in] server_url The url of the server where to upload the collected log files. */ LINPHONE_PUBLIC void linphone_core_set_log_collection_upload_server_url(LinphoneCore *core, const char *server_url); /** * Gets the url of the server where to upload the collected log files. - * @param[in] core LinphoneCore object + * @param[in] core #LinphoneCore object * @return The url of the server where to upload the collected log files. */ LINPHONE_PUBLIC const char * linphone_core_get_log_collection_upload_server_url(LinphoneCore *core); /** * Upload the log collection to the configured server url. - * @param[in] core LinphoneCore object + * @param[in] core #LinphoneCore object */ LINPHONE_PUBLIC void linphone_core_upload_log_collection(LinphoneCore *core); @@ -887,12 +887,12 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED const char *linphone_core_get_user_agent_ver **/ /** - * Instanciates a LinphoneCore object. + * Instanciates a #LinphoneCore object. * @ingroup initializing * - * The LinphoneCore object is the primary handle for doing all phone actions. + * The #LinphoneCore object is the primary handle for doing all phone actions. * It should be unique within your application. - * @param vtable a LinphoneCoreVTable structure holding your application callbacks + * @param vtable a #LinphoneCoreVTable structure holding your application callbacks * @param config_path a path to a config file. If it does not exists it will be created. * The config file is used to store all settings, call logs, friends, proxies... so that all these settings * become persistent over the life of the LinphoneCore object. @@ -911,13 +911,13 @@ LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneCore *linphone_core_new(const Linpho const char *config_path, const char *factory_config_path, void* userdata); /** - * Instantiates a LinphoneCore object with a given LpConfig. + * Instantiates a #LinphoneCore object with a given LpConfig. * @ingroup initializing * - * The LinphoneCore object is the primary handle for doing all phone actions. + * The #LinphoneCore object is the primary handle for doing all phone actions. * It should be unique within your application. - * @param vtable a LinphoneCoreVTable structure holding your application callbacks - * @param config a pointer to an LpConfig object holding the configuration of the LinphoneCore to be instantiated. + * @param vtable a #LinphoneCoreVTable structure holding your application callbacks + * @param config a pointer to an LpConfig object holding the configuration of the #LinphoneCore to be instantiated. * @param userdata an opaque user pointer that can be retrieved at any time (for example in * callbacks) using linphone_core_get_user_data(). * @see linphone_core_new @@ -927,7 +927,7 @@ LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneCore *linphone_core_new(const Linpho LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneCore *linphone_core_new_with_config(const LinphoneCoreVTable *vtable, LpConfig *config, void *userdata); /** - * Start a LinphoneCore object after it has been instantiated. + * Start a #LinphoneCore object after it has been instantiated. * @ingroup initializing * @param[in] core The #LinphoneCore object to be started */ @@ -962,7 +962,7 @@ LINPHONE_PUBLIC void linphone_core_unref(LinphoneCore *lc); * other liblinphone methods. If it is not the case make sure all liblinphone calls are * serialized with a mutex. * For ICE to work properly it should be called every 20ms. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @ingroup initializing **/ LINPHONE_PUBLIC void linphone_core_iterate(LinphoneCore *lc); @@ -970,7 +970,7 @@ LINPHONE_PUBLIC void linphone_core_iterate(LinphoneCore *lc); /** * @ingroup initializing * add a listener to be notified of linphone core events. Once events are received, registered vtable are invoked in order. - * @param vtable a LinphoneCoreVTable structure holding your application callbacks. Object is owned by linphone core until linphone_core_remove_listener. + * @param vtable a #LinphoneCoreVTable structure holding your application callbacks. Object is owned by linphone core until linphone_core_remove_listener. * @param lc object * @deprecated Use linphone_core_add_callbacks() instead. * @donotwrap @@ -990,7 +990,7 @@ LINPHONE_PUBLIC void linphone_core_add_callbacks(LinphoneCore *lc, LinphoneCoreC * @ingroup initializing * remove a listener registred by linphone_core_add_listener. * @param lc object - * @param vtable a LinphoneCoreVTable structure holding your application callbacks. + * @param vtable a #LinphoneCoreVTable structure holding your application callbacks. * @deprecated Use linphone_core_remove_callbacks() instead. * @donotwrap */ @@ -1006,7 +1006,7 @@ LINPHONE_PUBLIC void linphone_core_remove_callbacks(LinphoneCore *lc, const Linp /** * Sets the user agent string used in SIP messages, ideally called just after linphone_core_new() or linphone_core_init(). - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] ua_name The user agent name * @param[in] version The user agent version * @ingroup misc @@ -1022,50 +1022,50 @@ LINPHONE_PUBLIC LinphoneAddress * linphone_core_interpret_url(LinphoneCore *lc, /** * Initiates an outgoing call - * The application doesn't own a reference to the returned LinphoneCall object. - * Use linphone_call_ref() to safely keep the LinphoneCall pointer valid within your application. - * @param[in] lc LinphoneCore object + * The application doesn't own a reference to the returned #LinphoneCall object. + * Use linphone_call_ref() to safely keep the #LinphoneCall pointer valid within your application. + * @param[in] lc #LinphoneCore object * @param[in] url The destination of the call (sip address, or phone number). - * @return A LinphoneCall object or NULL in case of failure + * @return A #LinphoneCall object or NULL in case of failure * @ingroup call_control **/ LINPHONE_PUBLIC LinphoneCall * linphone_core_invite(LinphoneCore *lc, const char *url); /** - * Initiates an outgoing call given a destination LinphoneAddress - * The LinphoneAddress can be constructed directly using linphone_address_new(), or + * Initiates an outgoing call given a destination #LinphoneAddress + * The #LinphoneAddress can be constructed directly using linphone_address_new(), or * created by linphone_core_interpret_url(). - * The application doesn't own a reference to the returned LinphoneCall object. - * Use linphone_call_ref() to safely keep the LinphoneCall pointer valid within your application. - * @param[in] lc LinphoneCore object + * The application doesn't own a reference to the returned #LinphoneCall object. + * Use linphone_call_ref() to safely keep the #LinphoneCall pointer valid within your application. + * @param[in] lc #LinphoneCore object * @param[in] addr The destination of the call (sip address). - * @return A LinphoneCall object or NULL in case of failure + * @return A #LinphoneCall object or NULL in case of failure * @ingroup call_control **/ LINPHONE_PUBLIC LinphoneCall * linphone_core_invite_address(LinphoneCore *lc, const LinphoneAddress *addr); /** * Initiates an outgoing call according to supplied call parameters - * The application doesn't own a reference to the returned LinphoneCall object. - * Use linphone_call_ref() to safely keep the LinphoneCall pointer valid within your application. - * @param[in] lc LinphoneCore object + * The application doesn't own a reference to the returned #LinphoneCall object. + * Use linphone_call_ref() to safely keep the #LinphoneCall pointer valid within your application. + * @param[in] lc #LinphoneCore object * @param[in] url The destination of the call (sip address, or phone number). * @param[in] params Call parameters - * @return A LinphoneCall object or NULL in case of failure + * @return A #LinphoneCall object or NULL in case of failure * @ingroup call_control **/ LINPHONE_PUBLIC LinphoneCall * linphone_core_invite_with_params(LinphoneCore *lc, const char *url, const LinphoneCallParams *params); /** - * Initiates an outgoing call given a destination LinphoneAddress - * The LinphoneAddress can be constructed directly using linphone_address_new(), or + * Initiates an outgoing call given a destination #LinphoneAddress + * The #LinphoneAddress can be constructed directly using linphone_address_new(), or * created by linphone_core_interpret_url(). - * The application doesn't own a reference to the returned LinphoneCall object. - * Use linphone_call_ref() to safely keep the LinphoneCall pointer valid within your application. - * @param[in] lc LinphoneCore object + * The application doesn't own a reference to the returned #LinphoneCall object. + * Use linphone_call_ref() to safely keep the #LinphoneCall pointer valid within your application. + * @param[in] lc #LinphoneCore object * @param[in] addr The destination of the call (sip address). * @param[in] params Call parameters - * @return A LinphoneCall object or NULL in case of failure + * @return A #LinphoneCall object or NULL in case of failure * @ingroup call_control **/ LINPHONE_PUBLIC LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const LinphoneAddress *addr, const LinphoneCallParams *params); @@ -1077,7 +1077,7 @@ LINPHONE_PUBLIC LinphoneCall * linphone_core_invite_address_with_params(Linphone * It is possible to follow the progress of the transfer provided that transferee sends notification about it. * In this case, the transfer_state_changed callback of the #LinphoneCoreVTable is invoked to notify of the state of the new call at the other party. * The notified states are #LinphoneCallOutgoingInit , #LinphoneCallOutgoingProgress, #LinphoneCallOutgoingRinging and #LinphoneCallConnected. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] call The call to be transfered * @param[in] refer_to The destination the call is to be refered to * @return 0 on success, -1 on failure @@ -1096,7 +1096,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_transfer_call(L * It is possible to follow the progress of the transfer provided that transferee sends notification about it. * In this case, the transfer_state_changed callback of the #LinphoneCoreVTable is invoked to notify of the state of the new call at the other party. * The notified states are #LinphoneCallOutgoingInit , #LinphoneCallOutgoingProgress, #LinphoneCallOutgoingRinging and #LinphoneCallConnected. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] call A running call you want to transfer * @param[in] dest A running call whose remote person will receive the transfer * @return 0 on success, -1 on failure @@ -1108,12 +1108,12 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_transfer_call_t /** * Start a new call as a consequence of a transfer request received from a call. * This function is for advanced usage: the execution of transfers is automatically managed by the LinphoneCore. However if an application - * wants to have control over the call parameters for the new call, it should call this function immediately during the LinphoneCallRefered notification. + * wants to have control over the call parameters for the new call, it should call this function immediately during the #LinphoneCallRefered notification. * @see LinphoneCoreVTable::call_state_changed - * @param[in] lc LinphoneCore object - * @param[in] call A call that has just been notified about LinphoneCallRefered state event. + * @param[in] lc #LinphoneCore object + * @param[in] call A call that has just been notified about #LinphoneCallRefered state event. * @param[in] params The call parameters to be applied to the new call. - * @return A LinphoneCall corresponding to the new call that is attempted to the transfer destination. + * @return A #LinphoneCall corresponding to the new call that is attempted to the transfer destination. **/ LINPHONE_PUBLIC LinphoneCall * linphone_core_start_refered_call(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params); @@ -1123,14 +1123,14 @@ LINPHONE_PUBLIC LinphoneCall * linphone_core_start_refered_call(LinphoneCore *lc /** * Tells whether there is an incoming invite pending. * @ingroup call_control - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return A boolean telling whether an incoming invite is pending or not. */ LINPHONE_PUBLIC bool_t linphone_core_is_incoming_invite_pending(LinphoneCore*lc); /** * Tells whether there is a call running. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return A boolean value telling whether a call is currently running or not * @ingroup call_control **/ @@ -1138,7 +1138,7 @@ LINPHONE_PUBLIC bool_t linphone_core_in_call(const LinphoneCore *lc); /** * Gets the current call. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The current call or NULL if no call is running * @ingroup call_control **/ @@ -1149,10 +1149,10 @@ LINPHONE_PUBLIC LinphoneCall *linphone_core_get_current_call(const LinphoneCore * * Basically the application is notified of incoming calls within the * call_state_changed callback of the #LinphoneCoreVTable structure, where it will receive - * a LinphoneCallIncoming event with the associated LinphoneCall object. + * a #LinphoneCallIncoming event with the associated #LinphoneCall object. * The application can later accept the call using this method. - * @param[in] lc LinphoneCore object - * @param[in] call The LinphoneCall object representing the call to be answered + * @param[in] lc #LinphoneCore object + * @param[in] call The #LinphoneCall object representing the call to be answered * @return 0 on success, -1 on failure * @ingroup call_control * @deprecated Use linphone_call_accept() instead @@ -1164,11 +1164,11 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_accept_call(Lin * * Basically the application is notified of incoming calls within the * call_state_changed callback of the #LinphoneCoreVTable structure, where it will receive - * a LinphoneCallIncoming event with the associated LinphoneCall object. + * a #LinphoneCallIncoming event with the associated #LinphoneCall object. * The application can later accept the call using * this method. - * @param[in] lc LinphoneCore object - * @param[in] call The LinphoneCall object representing the call to be answered + * @param[in] lc #LinphoneCore object + * @param[in] call The #LinphoneCall object representing the call to be answered * @param[in] params The specific parameters for this call, for example whether video is accepted or not. Use NULL to use default parameters * @return 0 on success, -1 on failure * @ingroup call_control @@ -1181,7 +1181,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_accept_call_wit * This means the call is not accepted but audio & video streams can be established if the remote party supports early media. * However, unlike after call acceptance, mic and camera input are not sent during early-media, though received audio & video are played normally. * The call can then later be fully accepted using linphone_core_accept_call() or linphone_core_accept_call_with_params(). - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] call The call to accept * @param[in] params The call parameters to use (can be NULL) * @return 0 if successful, -1 otherwise @@ -1193,7 +1193,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_accept_early_me /** * Accept an early media session for an incoming call. * This is identical as calling linphone_core_accept_early_media_with_params() with NULL call parameters. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] call The incoming call to accept * @return 0 if successful, -1 otherwise * @ingroup call_control @@ -1204,8 +1204,8 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_accept_early_me /** * Terminates a call. - * @param[in] lc LinphoneCore object - * @param[in] call The LinphoneCall object representing the call to be terminated + * @param[in] lc #LinphoneCore object + * @param[in] call The #LinphoneCall object representing the call to be terminated * @return 0 on success, -1 on failure * @ingroup call_control * @deprecated Use linphone_call_terminate() instead @@ -1225,9 +1225,9 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_redirect_call(L /** * Decline a pending incoming call, with a reason. - * @param[in] lc LinphoneCore object - * @param[in] call The LinphoneCall to decline, must be in the IncomingReceived state - * @param[in] reason The reason for rejecting the call: LinphoneReasonDeclined or LinphoneReasonBusy + * @param[in] lc #LinphoneCore object + * @param[in] call The #LinphoneCall to decline, must be in the IncomingReceived state + * @param[in] reason The reason for rejecting the call: #LinphoneReasonDeclined or #LinphoneReasonBusy * @return 0 on success, -1 on failure * @ingroup call_control * @deprecated Use linphone_call_decline() instead @@ -1236,7 +1236,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_decline_call(Li /** * Terminates all the calls. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return 0 * @ingroup call_control **/ @@ -1246,7 +1246,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_core_terminate_all_calls(LinphoneCore *l * Pauses the call. If a music file has been setup using linphone_core_set_play_file(), * this file will be played to the remote user. * The only way to resume a paused call is to call linphone_core_resume_call(). - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] call The call to pause * @return 0 on success, -1 on failure * @ingroup call_control @@ -1257,7 +1257,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_pause_call(Linp /** * Pause all currently running calls. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return 0 * @ingroup call_control **/ @@ -1266,7 +1266,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_core_pause_all_calls(LinphoneCore *lc); /** * Resumes a call. * The call needs to have been paused previously with linphone_core_pause_call(). - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] call The call to resume * @return 0 on success, -1 on failure * @ingroup call_control @@ -1278,13 +1278,13 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_resume_call(Lin /** * Updates a running call according to supplied call parameters or parameters changed in the LinphoneCore. * In this version this is limited to the following use cases: - * - setting up/down the video stream according to the video parameter of the LinphoneCallParams (see linphone_call_params_enable_video() ). + * - setting up/down the video stream according to the video parameter of the #LinphoneCallParams (see linphone_call_params_enable_video() ). * - changing the size of the transmitted video after calling linphone_core_set_preferred_video_size() - * In case no changes are requested through the LinphoneCallParams argument, then this argument can be omitted and set to NULL. - * WARNING: Updating a call in the LinphoneCallPaused state will still result in a paused call even if the media directions set in the + * In case no changes are requested through the #LinphoneCallParams argument, then this argument can be omitted and set to NULL. + * WARNING: Updating a call in the #LinphoneCallPaused state will still result in a paused call even if the media directions set in the * params are sendrecv. To resume a paused call, you need to call linphone_core_resume_call(). * - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] call The call to be updated * @param[in] params The new call parameters to use (may be NULL) * @return 0 if successful, -1 otherwise. @@ -1294,22 +1294,22 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_resume_call(Lin LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params); /** - * When receiving a #LinphoneCallUpdatedByRemote state notification, prevent LinphoneCore from performing an automatic answer. + * When receiving a #LinphoneCallUpdatedByRemote state notification, prevent #LinphoneCore from performing an automatic answer. * * When receiving a #LinphoneCallUpdatedByRemote state notification (ie an incoming reINVITE), the default behaviour of - * LinphoneCore is defined by the "defer_update_default" option of the "sip" section of the config. If this option is 0 (the default) - * then the LinphoneCore automatically answers the reINIVTE with call parameters unchanged. + * #LinphoneCore is defined by the "defer_update_default" option of the "sip" section of the config. If this option is 0 (the default) + * then the #LinphoneCore automatically answers the reINIVTE with call parameters unchanged. * However when for example when the remote party updated the call to propose a video stream, it can be useful * to prompt the user before answering. This can be achieved by calling linphone_core_defer_call_update() during * the call state notification, to deactivate the automatic answer that would just confirm the audio but reject the video. * Then, when the user responds to dialog prompt, it becomes possible to call linphone_core_accept_call_update() to answer - * the reINVITE, with eventually video enabled in the LinphoneCallParams argument. + * the reINVITE, with eventually video enabled in the #LinphoneCallParams argument. * * The #LinphoneCallUpdatedByRemote notification can also arrive when receiving an INVITE without SDP. In such case, an unchanged offer is made * in the 200Ok, and when the ACK containing the SDP answer is received, #LinphoneCallUpdatedByRemote is triggered to notify the application of possible * changes in the media session. However in such case defering the update has no meaning since we just generating an offer. * - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] call The call for which to defer the update * @return 0 if successful, -1 if the linphone_core_defer_call_update() was done outside a valid #LinphoneCallUpdatedByRemote notification * @ingroup call_control @@ -1330,9 +1330,9 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_defer_call_upda * If params is not NULL, then the update will be accepted according to the parameters passed. * Typical example is when a user accepts to start video, then params should indicate that video stream should be used * (see linphone_call_params_enable_video()). - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] call The call for which to accept an update - * @param[in] params A LinphoneCallParams object describing the call parameters to accept + * @param[in] params A #LinphoneCallParams object describing the call parameters to accept * @return 0 if successful, -1 otherwise (actually when this function call is performed outside ot #LinphoneCallUpdatedByRemote state) * @ingroup call_control * @deprecated Use linphone_call_accept_update() instead @@ -1340,19 +1340,19 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_defer_call_upda LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_accept_call_update(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params); /** - * Create a LinphoneCallParams suitable for linphone_core_invite_with_params(), linphone_core_accept_call_with_params(), linphone_core_accept_early_media_with_params(), + * Create a #LinphoneCallParams suitable for linphone_core_invite_with_params(), linphone_core_accept_call_with_params(), linphone_core_accept_early_media_with_params(), * linphone_core_accept_call_update(). - * The parameters are initialized according to the current LinphoneCore configuration and the current state of the LinphoneCall. - * @param[in] lc LinphoneCore object - * @param[in] call LinphoneCall for which the parameters are to be build, or NULL in the case where the parameters are to be used for a new outgoing call. - * @return A new LinphoneCallParams object + * The parameters are initialized according to the current #LinphoneCore configuration and the current state of the LinphoneCall. + * @param[in] lc #LinphoneCore object + * @param[in] call #LinphoneCall for which the parameters are to be build, or NULL in the case where the parameters are to be used for a new outgoing call. + * @return A new #LinphoneCallParams object * @ingroup call_control */ LINPHONE_PUBLIC LinphoneCallParams *linphone_core_create_call_params(LinphoneCore *lc, LinphoneCall *call); /** * Get the call with the remote_address specified - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] remote_address The remote address of the call that we want to get * @return The call if it has been found, NULL otherwise * @ingroup call_control @@ -1363,7 +1363,7 @@ LINPHONE_PUBLIC LinphoneCall *linphone_core_get_call_by_remote_address(const Lin * Get the call with the remote_address specified * @param lc * @param remote_address - * @return the LinphoneCall of the call if found + * @return the #LinphoneCall of the call if found * * @ingroup call_control */ @@ -1376,7 +1376,7 @@ LINPHONE_PUBLIC LinphoneCall *linphone_core_get_call_by_remote_address2(const Li * @ingroup media_parameters * @deprecated Use #linphone_call_send_dtmf instead. * This function only works during calls. The dtmf is automatically played to the user. - * @param lc The LinphoneCore object + * @param lc The #LinphoneCore object * @param dtmf The dtmf name specified as a char, such as '0', '#' etc... * @donotwrap **/ @@ -1387,7 +1387,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_send_dtmf(LinphoneCore *l * * @ingroup proxies * This data is used in absence of any proxy configuration or when no - * default proxy configuration is set. See LinphoneProxyConfig + * default proxy configuration is set. See #LinphoneProxyConfig **/ LINPHONE_PUBLIC LinphoneStatus linphone_core_set_primary_contact(LinphoneCore *lc, const char *contact); @@ -1404,7 +1404,7 @@ LINPHONE_PUBLIC const char *linphone_core_get_primary_contact(LinphoneCore *lc); * If no default proxy is set, this will return the primary contact ( * see linphone_core_get_primary_contact() ). If a default proxy is set * it returns the registered identity on the proxy. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The default identity SIP address * @ingroup proxies **/ @@ -1413,7 +1413,7 @@ LINPHONE_PUBLIC const char * linphone_core_get_identity(LinphoneCore *lc); LINPHONE_PUBLIC char * linphone_core_get_device_identity(LinphoneCore *lc); /** - * Tells LinphoneCore to guess local hostname automatically in primary contact. + * Tells #LinphoneCore to guess local hostname automatically in primary contact. * @ingroup proxies **/ LINPHONE_PUBLIC void linphone_core_set_guess_hostname(LinphoneCore *lc, bool_t val); @@ -1425,8 +1425,8 @@ LINPHONE_PUBLIC void linphone_core_set_guess_hostname(LinphoneCore *lc, bool_t v LINPHONE_PUBLIC bool_t linphone_core_get_guess_hostname(LinphoneCore *lc); /** - * Tells to LinphoneCore to use Linphone Instant Messaging encryption - * @param[in] lc LinphoneCore object + * Tells to #LinphoneCore to use Linphone Instant Messaging encryption + * @param[in] lc #LinphoneCore object * @param[in] val The new lime state * @ingroup network_parameters */ @@ -1435,7 +1435,7 @@ LINPHONE_PUBLIC void linphone_core_enable_lime(LinphoneCore *lc, LinphoneLimeSta /** * Returns the lime state - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The current lime state * @ingroup network_parameters **/ @@ -1444,14 +1444,14 @@ LINPHONE_PUBLIC LinphoneLimeState linphone_core_lime_enabled(const LinphoneCore /** * Tells if lime is available - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @ingroup network_parameters **/ LINPHONE_PUBLIC bool_t linphone_core_lime_available(const LinphoneCore *lc); /** * Tells whether IPv6 is enabled or not. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return A boolean value telling whether IPv6 is enabled or not * @ingroup network_parameters * @see linphone_core_enable_ipv6() for more details on how IPv6 is supported in liblinphone. @@ -1460,14 +1460,14 @@ LINPHONE_PUBLIC bool_t linphone_core_ipv6_enabled(LinphoneCore *lc); /** * Turns IPv6 support on or off. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] val A boolean value telling whether to enable IPv6 support * @ingroup network_parameters **/ LINPHONE_PUBLIC void linphone_core_enable_ipv6(LinphoneCore *lc, bool_t val); /** - * Same as linphone_core_get_primary_contact() but the result is a LinphoneAddress object + * Same as linphone_core_get_primary_contact() but the result is a #LinphoneAddress object * instead of const char* * * @ingroup proxies @@ -1486,7 +1486,7 @@ LINPHONE_PUBLIC const char * linphone_core_get_identity(LinphoneCore *lc); * * @ingroup media_parameters * - * @param lc the LinphoneCore object + * @param lc the #LinphoneCore object * @param bw the bandwidth in kbits/s, 0 for infinite */ LINPHONE_PUBLIC void linphone_core_set_download_bandwidth(LinphoneCore *lc, int bw); @@ -1498,7 +1498,7 @@ LINPHONE_PUBLIC void linphone_core_set_download_bandwidth(LinphoneCore *lc, int * side available bandwidth signaled in SDP messages to properly * configure audio & video codec's output bitrate. * - * @param lc the LinphoneCore object + * @param lc the #LinphoneCore object * @param bw the bandwidth in kbits/s, 0 for infinite * @ingroup media_parameters */ @@ -1511,7 +1511,7 @@ LINPHONE_PUBLIC void linphone_core_set_upload_bandwidth(LinphoneCore *lc, int bw * side available bandwidth signaled in SDP messages to properly * configure audio & video codec's output bitrate. * - * @param lc the LinphoneCore object + * @param lc the #LinphoneCore object * @param bw the bandwidth in kbits/s, 0 for infinite * @ingroup media_parameters */ @@ -1671,7 +1671,7 @@ LINPHONE_PUBLIC void linphone_core_set_audio_payload_types(LinphoneCore *lc, con /** * Returns the list of available audio codecs. - * @param[in] lc The LinphoneCore object + * @param[in] lc The #LinphoneCore object * @return \bctbx_list{OrtpPayloadType} * * This list is unmodifiable. The ->data field of the bctbx_list_t points a PayloadType @@ -1686,10 +1686,10 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED const bctbx_list_t *linphone_core_get_audio_ /** * Sets the list of audio codecs. - * @param[in] lc The LinphoneCore object + * @param[in] lc The #LinphoneCore object * @param[in] codecs \bctbx_list{OrtpPayloadType} * @return 0 - * The list is taken by the LinphoneCore thus the application should not free it. + * The list is taken by the #LinphoneCore thus the application should not free it. * This list is made of struct PayloadType describing the codec parameters. * @ingroup media_parameters * @deprecated Use linphone_core_set_audio_payload_types() instead. @@ -1717,7 +1717,7 @@ LINPHONE_PUBLIC void linphone_core_set_video_payload_types(LinphoneCore *lc, con /** * Returns the list of available video codecs. - * @param[in] lc The LinphoneCore object + * @param[in] lc The #LinphoneCore object * @return \bctbx_list{OrtpPayloadType} * * This list is unmodifiable. The ->data field of the bctbx_list_t points a PayloadType @@ -1732,11 +1732,11 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED const bctbx_list_t *linphone_core_get_video_ /** * Sets the list of video codecs. - * @param[in] lc The LinphoneCore object + * @param[in] lc The #LinphoneCore object * @param[in] codecs \bctbx_list{OrtpPayloadType} * @return 0 * - * The list is taken by the LinphoneCore thus the application should not free it. + * The list is taken by the #LinphoneCore thus the application should not free it. * This list is made of struct PayloadType describing the codec parameters. * @ingroup media_parameters * @deprecated Use linphone_core_set_video_payload_types() instead. @@ -1764,7 +1764,7 @@ LINPHONE_PUBLIC void linphone_core_set_text_payload_types(LinphoneCore *lc, cons /** * Returns the list of available text codecs. - * @param[in] lc The LinphoneCore object + * @param[in] lc The #LinphoneCore object * @return \bctbx_list{OrtpPayloadType} * * This list is unmodifiable. The ->data field of the bctbx_list_t points a PayloadType @@ -1779,11 +1779,11 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED const bctbx_list_t *linphone_core_get_text_c /** * Sets the list of text codecs. - * @param[in] lc The LinphoneCore object + * @param[in] lc The #LinphoneCore object * @param[in] codecs \bctbx_list{LinphonePayloadType} * @return 0 * - * The list is taken by the LinphoneCore thus the application should not free it. + * The list is taken by the #LinphoneCore thus the application should not free it. * This list is made of struct PayloadType describing the codec parameters. * @ingroup media_parameters * @deprecated Use linphone_core_set_text_payload_types() instead. @@ -1794,7 +1794,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_set_text_codecs /** * Enable RFC3389 generic comfort noise algorithm (CN payload type). * It is disabled by default, because this algorithm is only relevant for legacy codecs (PCMU, PCMA, G722). - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] enabled TRUE if enabled, FALSE otherwise. * @deprecated Use linphone_core_enable_generic_comfort_noise() instead */ @@ -1802,7 +1802,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_set_text_codecs /** * Returns enablement of RFC3389 generic comfort noise algorithm. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return TRUE or FALSE. * @deprecated Use linphone_core_generic_comfort_noise_enabled() instead */ @@ -1811,14 +1811,14 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_set_text_codecs /** * Enable RFC3389 generic comfort noise algorithm (CN payload type). * It is disabled by default, because this algorithm is only relevant for legacy codecs (PCMU, PCMA, G722). - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] enabled TRUE if enabled, FALSE otherwise. **/ LINPHONE_PUBLIC void linphone_core_enable_generic_comfort_noise(LinphoneCore *lc, bool_t enabled); /** * Returns enablement of RFC3389 generic comfort noise algorithm. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return TRUE or FALSE. **/ LINPHONE_PUBLIC bool_t linphone_core_generic_comfort_noise_enabled(const LinphoneCore *lc); @@ -1928,7 +1928,7 @@ LINPHONE_PUBLIC LinphonePayloadType *linphone_core_get_payload_type(LinphoneCore LINPHONE_PUBLIC LINPHONE_DEPRECATED int linphone_core_get_payload_type_number(LinphoneCore *lc, const OrtpPayloadType *pt); /** - * Force a number for a payload type. The LinphoneCore does payload type number assignment automatically. THis function is to be used mainly for tests, in order + * Force a number for a payload type. The #LinphoneCore does payload type number assignment automatically. THis function is to be used mainly for tests, in order * to override the automatic assignment mechanism. * @ingroup media_parameters * @deprecated Use linphone_payload_type_set_number() instead @@ -1980,14 +1980,14 @@ LINPHONE_PUBLIC void linphone_core_clear_proxy_config(LinphoneCore *lc); /** * Removes a proxy configuration. * - * LinphoneCore will then automatically unregister and place the proxy configuration + * #LinphoneCore will then automatically unregister and place the proxy configuration * on a deleted list. For that reason, a removed proxy does NOT need to be freed. **/ LINPHONE_PUBLIC void linphone_core_remove_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *config); /** * Returns an unmodifiable list of entered proxy configurations. - * @param[in] lc The LinphoneCore object + * @param[in] lc The #LinphoneCore object * @return \bctbx_list{LinphoneProxyConfig} **/ LINPHONE_PUBLIC const bctbx_list_t *linphone_core_get_proxy_config_list(const LinphoneCore *lc); @@ -2006,7 +2006,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED int linphone_core_get_default_proxy(Linphone /** * @return the default proxy configuration, that is the one used to determine the current identity. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The default proxy configuration. **/ LINPHONE_PUBLIC LinphoneProxyConfig * linphone_core_get_default_proxy_config(LinphoneCore *lc); @@ -2015,9 +2015,9 @@ LINPHONE_PUBLIC LinphoneProxyConfig * linphone_core_get_default_proxy_config(Lin * Sets the default proxy. * * This default proxy must be part of the list of already entered LinphoneProxyConfig. - * Toggling it as default will make LinphoneCore use the identity associated with + * Toggling it as default will make #LinphoneCore use the identity associated with * the proxy configuration in all incoming and outgoing calls. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] config The proxy configuration to use as the default one. **/ LINPHONE_PUBLIC void linphone_core_set_default_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *config); @@ -2059,7 +2059,7 @@ LINPHONE_PUBLIC void linphone_core_remove_auth_info(LinphoneCore *lc, const Linp /** * Returns an unmodifiable list of currently entered #LinphoneAuthInfo. - * @param[in] lc The LinphoneCore object. + * @param[in] lc The #LinphoneCore object. * @return \bctbx_list{LinphoneAuthInfo} * @ingroup authentication */ @@ -2068,7 +2068,7 @@ LINPHONE_PUBLIC const bctbx_list_t *linphone_core_get_auth_info_list(const Linph /** * Find authentication info matching realm, username, domain criteria. * First of all, (realm,username) pair are searched. If multiple results (which should not happen because realm are supposed to be unique), then domain is added to the search. - * @param lc the LinphoneCore + * @param lc the #LinphoneCore * @param realm the authentication 'realm' (optional) * @param username the SIP username to be authenticated (mandatory) * @param sip_domain the SIP domain name (optional) @@ -2078,7 +2078,7 @@ LINPHONE_PUBLIC const bctbx_list_t *linphone_core_get_auth_info_list(const Linph LINPHONE_PUBLIC const LinphoneAuthInfo *linphone_core_find_auth_info(LinphoneCore *lc, const char *realm, const char *username, const char *sip_domain); /** - * This method is used to abort a user authentication request initiated by LinphoneCore + * This method is used to abort a user authentication request initiated by #LinphoneCore * from the auth_info_requested callback of LinphoneCoreVTable. * @note That function does nothing for now. **/ @@ -2092,15 +2092,15 @@ LINPHONE_PUBLIC void linphone_core_clear_all_auth_info(LinphoneCore *lc); /** * Sets an default account creator service in the core - * @param lc LinphoneCore object - * @param cbs LinphoneAccountCreatorService object + * @param lc #LinphoneCore object + * @param cbs #LinphoneAccountCreatorService object **/ LINPHONE_PUBLIC void linphone_core_set_account_creator_service(LinphoneCore *lc, LinphoneAccountCreatorService *service); /** * Get default account creator service from the core - * @param lc LinphoneCore object - * @return LinphoneAccountCreatorService object + * @param lc #LinphoneCore object + * @return #LinphoneAccountCreatorService object **/ LINPHONE_PUBLIC LinphoneAccountCreatorService * linphone_core_get_account_creator_service(LinphoneCore *lc); @@ -2122,7 +2122,7 @@ LINPHONE_PUBLIC bool_t linphone_core_audio_adaptive_jittcomp_enabled(LinphoneCor /** * Returns the nominal audio jitter buffer size in milliseconds. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The nominal audio jitter buffer size in milliseconds * @ingroup media_parameters **/ @@ -2154,7 +2154,7 @@ LINPHONE_PUBLIC bool_t linphone_core_video_adaptive_jittcomp_enabled(LinphoneCor /** * Returns the nominal video jitter buffer size in milliseconds. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The nominal video jitter buffer size in milliseconds * @ingroup media_parameters **/ @@ -2170,7 +2170,7 @@ LINPHONE_PUBLIC void linphone_core_set_video_jittcomp(LinphoneCore *lc, int mill /** * Gets the UDP port used for audio streaming. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The UDP port used for audio streaming * @ingroup network_parameters **/ @@ -2178,7 +2178,7 @@ LINPHONE_PUBLIC int linphone_core_get_audio_port(const LinphoneCore *lc); /** * Get the audio port range from which is randomly chosen the UDP port used for audio streaming. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[out] min_port The lower bound of the audio port range being used * @param[out] max_port The upper bound of the audio port range being used * @ingroup network_parameters @@ -2188,15 +2188,15 @@ LINPHONE_PUBLIC void linphone_core_get_audio_port_range(const LinphoneCore *lc, /** * Get the audio port range from which is randomly chosen the UDP port used for audio streaming. - * @param[in] lc LinphoneCore object - * @return a LinphoneRange object + * @param[in] lc #LinphoneCore object + * @return a #LinphoneRange object * @ingroup network_parameters */ LINPHONE_PUBLIC LinphoneRange *linphone_core_get_audio_ports_range(const LinphoneCore *lc); /** * Gets the UDP port used for video streaming. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The UDP port used for video streaming * @ingroup network_parameters **/ @@ -2204,7 +2204,7 @@ LINPHONE_PUBLIC int linphone_core_get_video_port(const LinphoneCore *lc); /** * Get the video port range from which is randomly chosen the UDP port used for video streaming. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[out] min_port The lower bound of the video port range being used * @param[out] max_port The upper bound of the video port range being used * @ingroup network_parameters @@ -2214,15 +2214,15 @@ LINPHONE_PUBLIC void linphone_core_get_video_port_range(const LinphoneCore *lc, /** * Get the video port range from which is randomly chosen the UDP port used for video streaming. - * @param[in] lc LinphoneCore object - * @return a LinphoneRange object + * @param[in] lc #LinphoneCore object + * @return a #LinphoneRange object * @ingroup network_parameters */ LINPHONE_PUBLIC LinphoneRange *linphone_core_get_video_ports_range(const LinphoneCore *lc); /** * Gets the UDP port used for text streaming. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The UDP port used for text streaming * @ingroup network_parameters **/ @@ -2230,7 +2230,7 @@ LINPHONE_PUBLIC int linphone_core_get_text_port(const LinphoneCore *lc); /** * Get the video port range from which is randomly chosen the UDP port used for text streaming. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[out] min_port The lower bound of the text port range being used * @param[out] max_port The upper bound of the text port range being used * @ingroup network_parameters @@ -2240,8 +2240,8 @@ LINPHONE_PUBLIC void linphone_core_get_text_port_range(const LinphoneCore *lc, i /** * Get the text port range from which is randomly chosen the UDP port used for text streaming. - * @param[in] lc LinphoneCore object - * @return a LinphoneRange object + * @param[in] lc #LinphoneCore object + * @return a #LinphoneRange object * @ingroup network_parameters */ LINPHONE_PUBLIC LinphoneRange *linphone_core_get_text_ports_range(const LinphoneCore *lc); @@ -2250,10 +2250,10 @@ LINPHONE_PUBLIC LinphoneRange *linphone_core_get_text_ports_range(const Linphone * Gets the value of the no-rtp timeout. * * When no RTP or RTCP packets have been received for a while - * LinphoneCore will consider the call is broken (remote end crashed or + * #LinphoneCore will consider the call is broken (remote end crashed or * disconnected from the network), and thus will terminate the call. * The no-rtp timeout is the duration above which the call is considered broken. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The value of the no-rtp timeout in seconds * @ingroup media_parameters **/ @@ -2263,7 +2263,7 @@ LINPHONE_PUBLIC int linphone_core_get_nortp_timeout(const LinphoneCore *lc); * Sets the UDP port used for audio streaming. * A value of -1 will request the system to allocate the local port randomly. * This is recommended in order to avoid firewall warnings. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] port The UDP port to use for audio streaming * @ingroup network_parameters **/ @@ -2271,7 +2271,7 @@ LINPHONE_PUBLIC void linphone_core_set_audio_port(LinphoneCore *lc, int port); /** * Sets the UDP port range from which to randomly select the port used for audio streaming. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] min_port The lower bound of the audio port range to use * @param[in] max_port The upper bound of the audio port range to use * @ingroup media_parameters @@ -2282,7 +2282,7 @@ LINPHONE_PUBLIC void linphone_core_set_audio_port_range(LinphoneCore *lc, int mi * Sets the UDP port used for video streaming. * A value of -1 will request the system to allocate the local port randomly. * This is recommended in order to avoid firewall warnings. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] port The UDP port to use for video streaming * @ingroup network_parameters **/ @@ -2290,7 +2290,7 @@ LINPHONE_PUBLIC void linphone_core_set_video_port(LinphoneCore *lc, int port); /** * Sets the UDP port range from which to randomly select the port used for video streaming. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] min_port The lower bound of the video port range to use * @param[in] max_port The upper bound of the video port range to use * @ingroup media_parameters @@ -2301,7 +2301,7 @@ LINPHONE_PUBLIC void linphone_core_set_video_port_range(LinphoneCore *lc, int mi * Sets the UDP port used for text streaming. * A value if -1 will request the system to allocate the local port randomly. * This is recommended in order to avoid firewall warnings. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] port The UDP port to use for text streaming * @ingroup network_parameters **/ @@ -2309,7 +2309,7 @@ LINPHONE_PUBLIC void linphone_core_set_text_port(LinphoneCore *lc, int port); /** * Sets the UDP port range from which to randomly select the port used for text streaming. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] min_port The lower bound of the text port range to use * @param[in] max_port The upper bound of the text port range to use * @ingroup media_parameters @@ -2318,7 +2318,7 @@ LINPHONE_PUBLIC void linphone_core_set_text_port_range(LinphoneCore *lc, int min /** * Sets the no-rtp timeout value in seconds. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] seconds The no-rtp timeout value to use in seconds * @ingroup media_parameters * @see linphone_core_get_nortp_timeout() for details. @@ -2327,7 +2327,7 @@ LINPHONE_PUBLIC void linphone_core_set_nortp_timeout(LinphoneCore *lc, int secon /** * Sets whether SIP INFO is to be used to send digits. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] use_info A boolean value telling whether to use SIP INFO to send digits * @ingroup media_parameters **/ @@ -2335,7 +2335,7 @@ LINPHONE_PUBLIC void linphone_core_set_use_info_for_dtmf(LinphoneCore *lc, bool_ /** * Indicates whether SIP INFO is used to send digits. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return A boolean value telling whether SIP INFO is used to send digits * @ingroup media_parameters **/ @@ -2343,7 +2343,7 @@ LINPHONE_PUBLIC bool_t linphone_core_get_use_info_for_dtmf(LinphoneCore *lc); /** * Sets whether RFC2833 is to be used to send digits. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] use_rfc2833 A boolean value telling whether to use RFC2833 to send digits * @ingroup media_parameters **/ @@ -2351,7 +2351,7 @@ LINPHONE_PUBLIC void linphone_core_set_use_rfc2833_for_dtmf(LinphoneCore *lc,boo /** * Indicates whether RFC2833 is used to send digits. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return A boolean value telling whether RFC2833 is used to send digits * @ingroup media_parameters **/ @@ -2359,7 +2359,7 @@ LINPHONE_PUBLIC bool_t linphone_core_get_use_rfc2833_for_dtmf(LinphoneCore *lc); /** * Sets the UDP port to be used by SIP. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] port The UDP port to be used by SIP * @ingroup network_parameters * @deprecated use linphone_core_set_sip_transports() instead. @@ -2369,7 +2369,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_set_sip_port(LinphoneCore /** * Gets the UDP port used by SIP. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The UDP port used by SIP * @ingroup network_parameters * @deprecated use linphone_core_get_sip_transports() instead. @@ -2381,8 +2381,8 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED int linphone_core_get_sip_port(LinphoneCore * Sets the ports to be used for each of transport (UDP or TCP) * A zero value port for a given transport means the transport * is not used. A value of LC_SIP_TRANSPORT_RANDOM (-1) means the port is to be choosen randomly by the system. - * @param[in] lc LinphoneCore object - * @param[in] transports A LinphoneSipTransports structure giving the ports to use + * @param[in] lc #LinphoneCore object + * @param[in] transports A #LinphoneSipTransports structure giving the ports to use * @return 0 * @ingroup network_parameters * @deprecated Use linphone_core_set_transports instead @@ -2394,7 +2394,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_core_set_sip_transports(LinphoneCore *lc * Retrieves the port configuration used for each transport (udp, tcp, tls). * A zero value port for a given transport means the transport * is not used. A value of LC_SIP_TRANSPORT_RANDOM (-1) means the port is to be chosen randomly by the system. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[out] transports A #LinphoneSipTransports structure that will receive the configured ports * @return 0 * @ingroup network_parameters @@ -2407,7 +2407,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_core_get_sip_transports(LinphoneCore *lc * Retrieves the real port number assigned for each sip transport (udp, tcp, tls). * A zero value means that the transport is not activated. * If LC_SIP_TRANSPORT_RANDOM was passed to linphone_core_set_sip_transports(), the random port choosed by the system is returned. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[out] tr A #LinphoneSipTransports structure that will receive the ports being used * @ingroup network_parameters * @deprecated Use linphone_core_get_transports_used instead @@ -2419,8 +2419,8 @@ LINPHONE_PUBLIC void linphone_core_get_sip_transports_used(LinphoneCore *lc, Lin * Sets the ports to be used for each of transport (UDP or TCP) * A zero value port for a given transport means the transport * is not used. A value of LC_SIP_TRANSPORT_RANDOM (-1) means the port is to be choosen randomly by the system. - * @param[in] lc LinphoneCore object - * @param[in] transports A LinphoneSipTransports structure giving the ports to use + * @param[in] lc #LinphoneCore object + * @param[in] transports A #LinphoneSipTransports structure giving the ports to use * @return 0 * @ingroup network_parameters **/ @@ -2430,7 +2430,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_core_set_transports(LinphoneCore *lc, co * Retrieves the port configuration used for each transport (udp, tcp, tls). * A zero value port for a given transport means the transport * is not used. A value of LC_SIP_TRANSPORT_RANDOM (-1) means the port is to be chosen randomly by the system. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return A #LinphoneTransports structure with the configured ports * @ingroup network_parameters **/ @@ -2440,7 +2440,7 @@ LINPHONE_PUBLIC LinphoneTransports *linphone_core_get_transports(LinphoneCore *l * Retrieves the real port number assigned for each sip transport (udp, tcp, tls). * A zero value means that the transport is not activated. * If LC_SIP_TRANSPORT_RANDOM was passed to linphone_core_set_sip_transports(), the random port choosed by the system is returned. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return A #LinphoneTransports structure with the ports being used * @ingroup network_parameters **/ @@ -2448,93 +2448,93 @@ LINPHONE_PUBLIC LinphoneTransports *linphone_core_get_transports_used(LinphoneCo /** * Increment refcount. - * @param[in] transports LinphoneTransports object + * @param[in] transports #LinphoneTransports object * @ingroup network_parameters **/ LINPHONE_PUBLIC LinphoneTransports *linphone_transports_ref(LinphoneTransports *transports); /** * Decrement refcount and possibly free the object. - * @param[in] transports LinphoneTransports object + * @param[in] transports #LinphoneTransports object * @ingroup network_parameters **/ LINPHONE_PUBLIC void linphone_transports_unref(LinphoneTransports *transports); /** - * Gets the user data in the LinphoneTransports object - * @param[in] transports the LinphoneTransports + * Gets the user data in the #LinphoneTransports object + * @param[in] transports the #LinphoneTransports * @return the user data * @ingroup network_parameters */ LINPHONE_PUBLIC void *linphone_transports_get_user_data(const LinphoneTransports *transports); /** - * Sets the user data in the LinphoneTransports object - * @param[in] transports the LinphoneTransports object + * Sets the user data in the #LinphoneTransports object + * @param[in] transports the #LinphoneTransports object * @param[in] data the user data * @ingroup network_parameters */ LINPHONE_PUBLIC void linphone_transports_set_user_data(LinphoneTransports *transports, void *data); /** - * Gets the UDP port in the LinphoneTransports object - * @param[in] transports the LinphoneTransports object + * Gets the UDP port in the #LinphoneTransports object + * @param[in] transports the #LinphoneTransports object * @return the UDP port * @ingroup network_parameters */ LINPHONE_PUBLIC int linphone_transports_get_udp_port(const LinphoneTransports* transports); /** - * Gets the TCP port in the LinphoneTransports object - * @param[in] transports the LinphoneTransports object + * Gets the TCP port in the #LinphoneTransports object + * @param[in] transports the #LinphoneTransports object * @return the TCP port * @ingroup network_parameters */ LINPHONE_PUBLIC int linphone_transports_get_tcp_port(const LinphoneTransports* transports); /** - * Gets the TLS port in the LinphoneTransports object - * @param[in] transports the LinphoneTransports object + * Gets the TLS port in the #LinphoneTransports object + * @param[in] transports the #LinphoneTransports object * @return the TLS port * @ingroup network_parameters */ LINPHONE_PUBLIC int linphone_transports_get_tls_port(const LinphoneTransports* transports); /** - * Gets the DTLS port in the LinphoneTransports object - * @param[in] transports the LinphoneTransports object + * Gets the DTLS port in the #LinphoneTransports object + * @param[in] transports the #LinphoneTransports object * @return the DTLS port * @ingroup network_parameters */ LINPHONE_PUBLIC int linphone_transports_get_dtls_port(const LinphoneTransports* transports); /** - * Sets the UDP port in the LinphoneTransports object - * @param[in] transports the LinphoneTransports object + * Sets the UDP port in the #LinphoneTransports object + * @param[in] transports the #LinphoneTransports object * @param[in] port the UDP port * @ingroup network_parameters */ LINPHONE_PUBLIC void linphone_transports_set_udp_port(LinphoneTransports *transports, int port); /** - * Sets the TCP port in the LinphoneTransports object - * @param[in] transports the LinphoneTransports object + * Sets the TCP port in the #LinphoneTransports object + * @param[in] transports the #LinphoneTransports object * @param[in] port the TCP port * @ingroup network_parameters */ LINPHONE_PUBLIC void linphone_transports_set_tcp_port(LinphoneTransports *transports, int port); /** - * Sets the TLS port in the LinphoneTransports object - * @param[in] transports the LinphoneTransports object + * Sets the TLS port in the #LinphoneTransports object + * @param[in] transports the #LinphoneTransports object * @param[in] port the TLS port * @ingroup network_parameters */ LINPHONE_PUBLIC void linphone_transports_set_tls_port(LinphoneTransports *transports, int port); /** - * Sets the DTLS port in the LinphoneTransports object - * @param[in] transports the LinphoneTransports object + * Sets the DTLS port in the #LinphoneTransports object + * @param[in] transports the #LinphoneTransports object * @param[in] port the DTLS port * @ingroup network_parameters */ @@ -2542,8 +2542,8 @@ LINPHONE_PUBLIC void linphone_transports_set_dtls_port(LinphoneTransports *trans /** * Tells whether the given transport type is supported by the library. - * @param[in] lc LinphoneCore object - * @param[in] tp LinphoneTranportType to check for support + * @param[in] lc #LinphoneCore object + * @param[in] tp #LinphoneTranportType to check for support * @return A boolean value telling whether the given transport type is supported by the library **/ LINPHONE_PUBLIC bool_t linphone_core_sip_transport_supported(const LinphoneCore *lc, LinphoneTransportType tp); @@ -2562,7 +2562,7 @@ ortp_socket_t linphone_core_get_sip_socket(LinphoneCore *lc); * Set the incoming call timeout in seconds. * If an incoming call isn't answered for this timeout period, it is * automatically declined. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] seconds The new timeout in seconds * @ingroup call_control **/ @@ -2571,7 +2571,7 @@ LINPHONE_PUBLIC void linphone_core_set_inc_timeout(LinphoneCore *lc, int seconds /** * Returns the incoming call timeout * See linphone_core_set_inc_timeout() for details. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The current incoming call timeout in seconds * @ingroup call_control **/ @@ -2580,7 +2580,7 @@ LINPHONE_PUBLIC int linphone_core_get_inc_timeout(LinphoneCore *lc); /** * Set the in call timeout in seconds. * After this timeout period, the call is automatically hangup. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] seconds The new timeout in seconds * @ingroup call_control **/ @@ -2589,7 +2589,7 @@ LINPHONE_PUBLIC void linphone_core_set_in_call_timeout(LinphoneCore *lc, int sec /** * Gets the in call timeout * See linphone_core_set_in_call_timeout() for details. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The current in call timeout in seconds * @ingroup call_control **/ @@ -2598,7 +2598,7 @@ LINPHONE_PUBLIC int linphone_core_get_in_call_timeout(LinphoneCore *lc); /** * Set the in delayed timeout in seconds. * After this timeout period, a delayed call (internal call initialisation or resolution) is resumed. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] seconds The new delayed timeout * @ingroup call_control **/ @@ -2607,7 +2607,7 @@ LINPHONE_PUBLIC void linphone_core_set_delayed_timeout(LinphoneCore *lc, int sec /** * Gets the delayed timeout * See linphone_core_set_delayed_timeout() for details. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The current delayed timeout in seconds * @ingroup call_control **/ @@ -2696,7 +2696,7 @@ LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneFirewallPolicy linphone_core_get_fir * Set the policy to use to pass through NATs/firewalls. * It may be overridden by a NAT policy for a specific proxy config. * @param[in] lc #LinphoneCore object - * @param[in] policy LinphoneNatPolicy object + * @param[in] policy #LinphoneNatPolicy object * @ingroup network_parameters * @see linphone_proxy_config_set_nat_policy() */ @@ -2706,7 +2706,7 @@ LINPHONE_PUBLIC void linphone_core_set_nat_policy(LinphoneCore *lc, LinphoneNatP * Get The policy that is used to pass through NATs/firewalls. * It may be overridden by a NAT policy for a specific proxy config. * @param[in] lc #LinphoneCore object - * @return LinphoneNatPolicy object in use. + * @return #LinphoneNatPolicy object in use. * @ingroup network_parameters * @see linphone_proxy_config_get_nat_policy() */ @@ -2714,7 +2714,7 @@ LINPHONE_PUBLIC LinphoneNatPolicy * linphone_core_get_nat_policy(const LinphoneC /** * Gets the list of the available sound devices. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return An unmodifiable array of strings contanining the names of the available sound devices that is NULL terminated * @ingroup media_parameters * @donotwrap @@ -2724,7 +2724,7 @@ LINPHONE_PUBLIC const char** linphone_core_get_sound_devices(LinphoneCore *lc); /** * Gets the list of the available sound devices. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return \bctbx_list{char *} An unmodifiable array of strings contanining the names of the available sound devices that is NULL terminated * @ingroup media_parameters **/ @@ -2747,7 +2747,7 @@ LINPHONE_PUBLIC void linphone_core_reload_sound_devices(LinphoneCore *lc); /** * Tells whether a specified sound device can capture sound. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] device the device name as returned by linphone_core_get_sound_devices() * @return A boolean value telling whether the specified sound device can capture sound * @ingroup media_parameters @@ -2756,7 +2756,7 @@ LINPHONE_PUBLIC bool_t linphone_core_sound_device_can_capture(LinphoneCore *lc, /** * Tells whether a specified sound device can play sound. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] device the device name as returned by linphone_core_get_sound_devices() * @return A boolean value telling whether the specified sound device can play sound * @ingroup media_parameters @@ -2817,7 +2817,7 @@ LINPHONE_DEPRECATED void linphone_core_set_sound_source(LinphoneCore *lc, char s /** * Allow to control microphone level: gain in db. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] level The new microphone level * @ingroup media_parameters **/ @@ -2825,7 +2825,7 @@ LINPHONE_PUBLIC void linphone_core_set_mic_gain_db(LinphoneCore *lc, float level /** * Get microphone gain in db. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The current microphone gain * @ingroup media_parameters **/ @@ -2833,7 +2833,7 @@ LINPHONE_PUBLIC float linphone_core_get_mic_gain_db(LinphoneCore *lc); /** * Allow to control play level before entering sound card: gain in db - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] level The new play level * @ingroup media_parameters **/ @@ -2841,7 +2841,7 @@ LINPHONE_PUBLIC void linphone_core_set_playback_gain_db(LinphoneCore *lc, float /** * Get playback gain in db before entering sound card. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The current playback gain * @ingroup media_parameters **/ @@ -2849,7 +2849,7 @@ LINPHONE_PUBLIC float linphone_core_get_playback_gain_db(LinphoneCore *lc); /** * Gets the name of the currently assigned sound device for ringing. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The name of the currently assigned sound device for ringing * @ingroup media_parameters **/ @@ -2857,7 +2857,7 @@ LINPHONE_PUBLIC const char * linphone_core_get_ringer_device(LinphoneCore *lc); /** * Gets the name of the currently assigned sound device for playback. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The name of the currently assigned sound device for playback * @ingroup media_parameters **/ @@ -2865,7 +2865,7 @@ LINPHONE_PUBLIC const char * linphone_core_get_playback_device(LinphoneCore *lc) /** * Gets the name of the currently assigned sound device for capture. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The name of the currently assigned sound device for capture * @ingroup media_parameters **/ @@ -2873,7 +2873,7 @@ LINPHONE_PUBLIC const char * linphone_core_get_capture_device(LinphoneCore *lc); /** * Sets the sound device used for ringing. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] devid The device name as returned by linphone_core_get_sound_devices() * @return 0 * @ingroup media_parameters @@ -2882,7 +2882,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_core_set_ringer_device(LinphoneCore *lc, /** * Sets the sound device used for playback. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] devid The device name as returned by linphone_core_get_sound_devices() * @return 0 * @ingroup media_parameters @@ -2891,7 +2891,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_core_set_playback_device(LinphoneCore *l /** * Sets the sound device used for capture. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] devid The device name as returned by linphone_core_get_sound_devices() * @return 0 * @ingroup media_parameters @@ -2901,14 +2901,14 @@ LINPHONE_PUBLIC LinphoneStatus linphone_core_set_capture_device(LinphoneCore *lc /** * Whenever the liblinphone is playing a ring to advertise an incoming call or ringback of an outgoing call, this function stops * the ringing. Typical use is to stop ringing when the user requests to ignore the call. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @ingroup media_parameters **/ LINPHONE_PUBLIC void linphone_core_stop_ringing(LinphoneCore *lc); /** * Sets the path to a wav file used for ringing. The file must be a wav 16bit linear. Local ring is disabled if null. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] path The path to a wav file to be used for ringing * @ingroup media_parameters **/ @@ -2916,7 +2916,7 @@ LINPHONE_PUBLIC void linphone_core_set_ring(LinphoneCore *lc, const char *path); /** * Returns the path to the wav file used for ringing. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The path to the wav file used for ringing * @ingroup media_parameters **/ @@ -2924,7 +2924,7 @@ LINPHONE_PUBLIC const char *linphone_core_get_ring(const LinphoneCore *lc); /** * Specify whether the tls server certificate must be verified when connecting to a SIP/TLS server. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] yesno A boolean value telling whether the tls server certificate must be verified * @ingroup initializing **/ @@ -2932,7 +2932,7 @@ LINPHONE_PUBLIC void linphone_core_verify_server_certificates(LinphoneCore *lc, /** * Specify whether the tls server certificate common name must be verified when connecting to a SIP/TLS server. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] yesno A boolean value telling whether the tls server certificate common name must be verified * @ingroup initializing **/ @@ -2940,7 +2940,7 @@ LINPHONE_PUBLIC void linphone_core_verify_server_cn(LinphoneCore *lc, bool_t yes /** * Gets the path to a file or folder containing the trusted root CAs (PEM format) - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The path to a file or folder containing the trusted root CAs * @ingroup initializing **/ @@ -2948,7 +2948,7 @@ LINPHONE_PUBLIC const char *linphone_core_get_root_ca(LinphoneCore *lc); /** * Sets the path to a file or folder containing trusted root CAs (PEM format) - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] path The path to a file or folder containing trusted root CAs * @ingroup initializing **/ @@ -2956,7 +2956,7 @@ LINPHONE_PUBLIC void linphone_core_set_root_ca(LinphoneCore *lc, const char *pat /** * Sets the trusted root CAs (PEM format) - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] data The trusted root CAs as a string * @ingroup initializing **/ @@ -2977,7 +2977,7 @@ LINPHONE_PUBLIC void linphone_core_set_ssl_config(LinphoneCore *lc, void *ssl_co * Sets the path to a wav file used for ringing back. * Ringback means the ring that is heard when it's ringing at the remote party. * The file must be a wav 16bit linear. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] path The path to a wav file to be used for ringing back * @ingroup media_parameters **/ @@ -2985,7 +2985,7 @@ LINPHONE_PUBLIC void linphone_core_set_ringback(LinphoneCore *lc, const char *pa /** * Returns the path to the wav file used for ringing back. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The path to the wav file used for ringing back * @ingroup media_parameters **/ @@ -3024,7 +3024,7 @@ LINPHONE_PUBLIC bool_t linphone_core_get_ring_during_incoming_early_media(const LINPHONE_PUBLIC LinphoneStatus linphone_core_preview_ring(LinphoneCore *lc, const char *ring,LinphoneCoreCbFunc func,void * userdata); /** - * Returns the MSFactory (mediastreamer2 factory) used by the LinphoneCore to control mediastreamer2 library. + * Returns the MSFactory (mediastreamer2 factory) used by the #LinphoneCore to control mediastreamer2 library. **/ LINPHONE_PUBLIC MSFactory* linphone_core_get_ms_factory(LinphoneCore* lc); @@ -3032,7 +3032,7 @@ LINPHONE_PUBLIC MSFactory* linphone_core_get_ms_factory(LinphoneCore* lc); * Plays an audio file to the local user. * This function works at any time, during calls, or when no calls are running. * It doesn't request the underlying audio system to support multiple playback streams. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] audiofile The path to an audio file in wav PCM 16 bit format * @return 0 on success, -1 on error * @ingroup misc @@ -3044,7 +3044,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_core_play_local(LinphoneCore *lc, const * This actually controls software echo cancellation. If hardware echo cancellation is available, * it will be always used and activated for calls, regardless of the value passed to this function. * When hardware echo cancellation is available, the software one is of course not activated. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] val A boolean value telling whether echo cancellation is to be enabled or disabled. * @ingroup media_parameters **/ @@ -3052,7 +3052,7 @@ LINPHONE_PUBLIC void linphone_core_enable_echo_cancellation(LinphoneCore *lc, bo /** * Returns TRUE if echo cancellation is enabled. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return A boolean value telling whether echo cancellation is enabled or disabled * @ingroup media_parameters **/ @@ -3132,7 +3132,7 @@ LINPHONE_PUBLIC void linphone_core_set_rtp_no_xmit_on_audio_mute(LinphoneCore *l /** * Get the list of call logs (past calls). - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return \bctbx_list{LinphoneCallLog} **/ LINPHONE_PUBLIC const bctbx_list_t * linphone_core_get_call_logs(LinphoneCore *lc); @@ -3140,22 +3140,22 @@ LINPHONE_PUBLIC const bctbx_list_t * linphone_core_get_call_logs(LinphoneCore *l /** * Get the list of call logs (past calls) that matches the given #LinphoneAddress. * At the contrary of linphone_core_get_call_logs, it is your responsibility to unref the logs and free this list once you are done using it. - * @param[in] lc LinphoneCore object - * @param[in] addr LinphoneAddress object + * @param[in] lc #LinphoneCore object + * @param[in] addr #LinphoneAddress object * @return \bctbx_list{LinphoneCallLog} **/ LINPHONE_PUBLIC bctbx_list_t * linphone_core_get_call_history_for_address(LinphoneCore *lc, const LinphoneAddress *addr); /** * Get the latest outgoing call log. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return {LinphoneCallLog} **/ LINPHONE_PUBLIC LinphoneCallLog * linphone_core_get_last_outgoing_call_log(LinphoneCore *lc); /** * Get the call log matching the call id, or NULL if can't be found. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] call_id Call id of the call log to find * @return {LinphoneCallLog} **/ @@ -3163,7 +3163,7 @@ LINPHONE_PUBLIC LinphoneCallLog * linphone_core_find_call_log_from_call_id(Linph /** * Erase the call log. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object **/ LINPHONE_PUBLIC void linphone_core_clear_call_logs(LinphoneCore *lc); @@ -3233,11 +3233,11 @@ LINPHONE_PUBLIC bool_t linphone_core_video_supported(LinphoneCore *lc); /** * Enables video globally. * - * This function does not have any effect during calls. It just indicates LinphoneCore to + * This function does not have any effect during calls. It just indicates #LinphoneCore to * initiate future calls with video or not. The two boolean parameters indicate in which * direction video is enabled. Setting both to false disables video entirely. * - * @param lc The LinphoneCore object + * @param lc The #LinphoneCore object * @param vcap_enabled indicates whether video capture is enabled * @param display_enabled indicates whether video display should be shown * @ingroup media_parameters @@ -3313,7 +3313,7 @@ LINPHONE_PUBLIC bool_t linphone_core_video_display_enabled(LinphoneCore *lc); * - video shall be initiated by default for outgoing calls * - video shall be accepter by default for incoming calls * - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] policy The video policy to use * @ingroup media_parameters * @deprecated Deprecated since 2017-04-19. @@ -3324,7 +3324,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_set_video_policy(Linphone /** * Get the default policy for video. * See linphone_core_set_video_policy() for more details. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The video policy being used * @ingroup media_parameters * @deprecated Deprecated since 2017-04-19. @@ -3334,29 +3334,29 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED const LinphoneVideoPolicy *linphone_core_get /** * Increment refcount. - * @param[in] policy LinphoneVideoActivationPolicy object + * @param[in] policy #LinphoneVideoActivationPolicy object * @ingroup media_parameters **/ LINPHONE_PUBLIC LinphoneVideoActivationPolicy *linphone_video_activation_policy_ref(LinphoneVideoActivationPolicy *policy); /** * Decrement refcount and possibly free the object. - * @param[in] policy LinphoneVideoActivationPolicy object + * @param[in] policy #LinphoneVideoActivationPolicy object * @ingroup media_parameters **/ LINPHONE_PUBLIC void linphone_video_activation_policy_unref(LinphoneVideoActivationPolicy *policy); /** - * Gets the user data in the LinphoneVideoActivationPolicy object - * @param[in] policy the LinphoneVideoActivationPolicy + * Gets the user data in the #LinphoneVideoActivationPolicy object + * @param[in] policy the #LinphoneVideoActivationPolicy * @return the user data * @ingroup media_parameters */ LINPHONE_PUBLIC void *linphone_video_activation_policy_get_user_data(const LinphoneVideoActivationPolicy *policy); /** - * Sets the user data in the LinphoneVideoActivationPolicy object - * @param[in] policy the LinphoneVideoActivationPolicy object + * Sets the user data in the #LinphoneVideoActivationPolicy object + * @param[in] policy the #LinphoneVideoActivationPolicy object * @param[in] data the user data * @ingroup media_parameters */ @@ -3364,7 +3364,7 @@ LINPHONE_PUBLIC void linphone_video_activation_policy_set_user_data(LinphoneVide /** * Gets the value for the automatically accept video policy - * @param[in] policy the LinphoneVideoActivationPolicy object + * @param[in] policy the #LinphoneVideoActivationPolicy object * @return whether or not to automatically accept video requests is enabled * @ingroup media_parameters */ @@ -3372,7 +3372,7 @@ LINPHONE_PUBLIC bool_t linphone_video_activation_policy_get_automatically_accept /** * Gets the value for the automatically initiate video policy - * @param[in] policy the LinphoneVideoActivationPolicy object + * @param[in] policy the #LinphoneVideoActivationPolicy object * @return whether or not to automatically initiate video calls is enabled * @ingroup media_parameters */ @@ -3380,7 +3380,7 @@ LINPHONE_PUBLIC bool_t linphone_video_activation_policy_get_automatically_initia /** * Sets the value for the automatically accept video policy - * @param[in] policy the LinphoneVideoActivationPolicy object + * @param[in] policy the #LinphoneVideoActivationPolicy object * @param[in] enable whether or not to enable automatically accept video requests * @ingroup media_parameters */ @@ -3388,7 +3388,7 @@ LINPHONE_PUBLIC void linphone_video_activation_policy_set_automatically_accept(L /** * Sets the value for the automatically initiate video policy - * @param[in] policy the LinphoneVideoActivationPolicy object + * @param[in] policy the #LinphoneVideoActivationPolicy object * @param[in] enable whether or not to enable automatically initiate video calls * @ingroup media_parameters */ @@ -3399,7 +3399,7 @@ LINPHONE_PUBLIC void linphone_video_activation_policy_set_automatically_initiate * This policy defines whether: * - video shall be initiated by default for outgoing calls * - video shall be accepted by default for incoming calls - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] policy The video policy to use * @ingroup media_parameters **/ @@ -3408,7 +3408,7 @@ LINPHONE_PUBLIC void linphone_core_set_video_activation_policy(LinphoneCore *lc, /** * Get the default policy for video. * See linphone_core_set_video_activation_policy() for more details. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The video policy being used * @ingroup media_parameters **/ @@ -3425,8 +3425,8 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED const MSVideoSizeDef *linphone_core_get_supp /** * Set the preferred video definition for the stream that is captured and sent to the remote party. * All standard video definitions are accepted on the receive path. - * @param[in] lc LinphoneCore object - * @param[in] vdef LinphoneVideoDefinition object + * @param[in] lc #LinphoneCore object + * @param[in] vdef #LinphoneVideoDefinition object * @ingroup media_parameters */ LINPHONE_PUBLIC void linphone_core_set_preferred_video_definition(LinphoneCore *lc, LinphoneVideoDefinition *vdef); @@ -3447,8 +3447,8 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_set_preferred_video_size( * This method is for advanced usage where a video capture must be set independently of the definition of the stream actually sent through the call. * This allows for example to have the preview window in High Definition even if due to bandwidth constraint the sent video definition is small. * Using this feature increases the CPU consumption, since a rescaling will be done internally. - * @param[in] lc LinphoneCore object - * @param[in] vdef LinphoneVideoDefinition object + * @param[in] lc #LinphoneCore object + * @param[in] vdef #LinphoneVideoDefinition object * @ingroup media_parameters */ LINPHONE_PUBLIC void linphone_core_set_preview_video_definition(LinphoneCore *lc, LinphoneVideoDefinition *vdef); @@ -3478,8 +3478,8 @@ LINPHONE_PUBLIC void linphone_core_set_preview_video_size_by_name(LinphoneCore * /** * Get the definition of the captured video. - * @param[in] lc LinphoneCore object - * @return The captured LinphoneVideoDefinition if it was previously set by linphone_core_set_preview_video_definition(), otherwise a 0x0 LinphoneVideoDefinition. + * @param[in] lc #LinphoneCore object + * @return The captured #LinphoneVideoDefinition if it was previously set by linphone_core_set_preview_video_definition(), otherwise a 0x0 LinphoneVideoDefinition. * @see linphone_core_set_preview_video_definition() * @ingroup media_parameters */ @@ -3499,8 +3499,8 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED MSVideoSize linphone_core_get_preview_video_ /** * Get the effective video definition provided by the camera for the captured video. * When preview is disabled or not yet started this function returns a 0x0 video definition. - * @param[in] lc LinphoneCore object - * @return The captured LinphoneVideoDefinition + * @param[in] lc #LinphoneCore object + * @return The captured #LinphoneVideoDefinition * @ingroup media_parameters * @see linphone_core_set_preview_video_definition() */ @@ -3521,8 +3521,8 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED MSVideoSize linphone_core_get_current_previe /** * Get the preferred video definition for the stream that is captured and sent to the remote party. - * @param[in] lc LinphoneCore object - * @return The preferred LinphoneVideoDefinition + * @param[in] lc #LinphoneCore object + * @return The preferred #LinphoneVideoDefinition * @ingroup media_parameters */ LINPHONE_PUBLIC const LinphoneVideoDefinition * linphone_core_get_preferred_video_definition(const LinphoneCore *lc); @@ -3559,7 +3559,7 @@ LINPHONE_PUBLIC void linphone_core_set_preferred_video_size_by_name(LinphoneCore * Based on the available bandwidth constraints and network conditions, the video encoder * remains free to lower the framerate. There is no warranty that the preferred frame rate be the actual framerate. * used during a call. Default value is 0, which means "use encoder's default fps value". - * @param lc the LinphoneCore + * @param lc the #LinphoneCore * @param fps the target frame rate in number of frames per seconds. * @ingroup media_parameters **/ @@ -3582,7 +3582,7 @@ LINPHONE_PUBLIC void linphone_core_preview_ogl_render(const LinphoneCore *lc); /** * Controls video preview enablement. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] val A boolean value telling whether the video preview is to be shown * Video preview refers to the action of displaying the local webcam image * to the user while not in call. @@ -3592,7 +3592,7 @@ LINPHONE_PUBLIC void linphone_core_enable_video_preview(LinphoneCore *lc, bool_t /** * Tells whether video preview is enabled. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return A boolean value telling whether video preview is enabled * @ingroup media_parameters **/ @@ -3610,7 +3610,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_core_take_preview_snapshot(LinphoneCore /** * Enables or disable self view during calls. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] val A boolean value telling whether to enable self view * Self-view refers to having local webcam image inserted in corner * of the video window during calls. @@ -3621,7 +3621,7 @@ LINPHONE_PUBLIC void linphone_core_enable_self_view(LinphoneCore *lc, bool_t val /** * Tells whether video self view during call is enabled or not. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return A boolean value telling whether self view is enabled * @see linphone_core_enable_self_view() for details. * @ingroup media_parameters @@ -3640,7 +3640,7 @@ LINPHONE_PUBLIC void linphone_core_reload_video_devices(LinphoneCore *lc); /** * Gets the list of the available video capture devices. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return An unmodifiable array of strings contanining the names of the available video capture devices that is NULL terminated * @ingroup media_parameters * @deprecated use linphone_core_get_video_devices_list instead @@ -3650,7 +3650,7 @@ LINPHONE_PUBLIC const char** linphone_core_get_video_devices(const LinphoneCore /** * Gets the list of the available video capture devices. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return \bctbx_list{char *} An unmodifiable array of strings contanining the names of the available video capture devices that is NULL terminated * @ingroup media_parameters **/ @@ -3658,7 +3658,7 @@ LINPHONE_PUBLIC bctbx_list_t * linphone_core_get_video_devices_list(const Linpho /** * Sets the active video device. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param id The name of the video device to use as returned by linphone_core_get_video_devices() * @ingroup media_parameters **/ @@ -3666,7 +3666,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_core_set_video_device(LinphoneCore *lc, /** * Returns the name of the currently active video device. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The name of the currently active video device * @ingroup media_parameters **/ @@ -3706,7 +3706,7 @@ LINPHONE_PUBLIC float linphone_core_get_static_picture_fps(LinphoneCore *lc); /** * Get the native window handle of the video window. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The native window handle of the video window * @ingroup media_parameters **/ @@ -3733,7 +3733,7 @@ LINPHONE_PUBLIC void linphone_core_set_native_video_window_id(LinphoneCore *lc, /** * Get the native window handle of the video preview window. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The native window handle of the video preview window * @ingroup media_parameters **/ @@ -3743,7 +3743,7 @@ LINPHONE_PUBLIC void * linphone_core_get_native_preview_window_id(const Linphone * Set the native window id where the preview video (local camera) is to be displayed. * This has to be used in conjonction with linphone_core_use_preview_window(). * MacOS, Linux, Windows: if not set or zero the core will create its own window, unless the special id -1 is given. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] id The native window id where the preview video is to be displayed * @ingroup media_parameters **/ @@ -3760,7 +3760,7 @@ LINPHONE_PUBLIC void linphone_core_use_preview_window(LinphoneCore *lc, bool_t y /** * Gets the current device orientation. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The current device orientation * @ingroup media_parameters * @see linphone_core_set_device_rotation() @@ -3773,7 +3773,7 @@ LINPHONE_PUBLIC int linphone_core_get_device_rotation(LinphoneCore *lc); * oriented images. The exact meaning of the value in rotation if left to each device * specific implementations. * IOS supported values are 0 for UIInterfaceOrientationPortrait and 270 for UIInterfaceOrientationLandscapeRight. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] rotation The orientation to use * @ingroup media_parameters **/ @@ -3801,7 +3801,7 @@ void linphone_core_show_video(LinphoneCore *lc, bool_t show); /** * Ask the core to stream audio from and to files, instead of using the soundcard. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] yesno A boolean value asking to stream audio from and to files or not. * @ingroup media_parameters **/ @@ -3810,7 +3810,7 @@ LINPHONE_PUBLIC void linphone_core_set_use_files(LinphoneCore *lc, bool_t yesno) /** * Gets whether linphone is currently streaming audio from and to files, rather * than using the soundcard. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return A boolean value representing whether linphone is streaming audio from and to files or not. * @ingroup media_parameters **/ @@ -3821,7 +3821,7 @@ LINPHONE_PUBLIC bool_t linphone_core_get_use_files(LinphoneCore *lc); * or when files are used instead of soundcards (see linphone_core_set_use_files()). * * The file is a 16 bit linear wav file. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The path to the file that is played when putting somebody on hold. * @ingroup media_parameters */ @@ -3832,7 +3832,7 @@ LINPHONE_PUBLIC const char * linphone_core_get_play_file(const LinphoneCore *lc) * or when files are used instead of soundcards (see linphone_core_set_use_files()). * * The file must be a 16 bit linear wav file. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] file The path to the file to be played when putting somebody on hold. * @ingroup media_parameters **/ @@ -3844,7 +3844,7 @@ LINPHONE_PUBLIC void linphone_core_set_play_file(LinphoneCore *lc, const char *f * * This feature is different from call recording (linphone_call_params_set_record_file()) * The file is a 16 bit linear wav file. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The path to the file where incoming stream is recorded. * @ingroup media_parameters **/ @@ -3856,7 +3856,7 @@ LINPHONE_PUBLIC const char * linphone_core_get_record_file(const LinphoneCore *l * * This feature is different from call recording (linphone_call_params_set_record_file()) * The file will be a 16 bit linear wav file. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] file The path to the file where incoming stream is to be recorded. * @ingroup media_parameters **/ @@ -3864,7 +3864,7 @@ LINPHONE_PUBLIC void linphone_core_set_record_file(LinphoneCore *lc, const char /** * Plays a dtmf sound to the local user. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] dtmf DTMF to play ['0'..'16'] | '#' | '#' * @param[in] duration_ms Duration in ms, -1 means play until next further call to #linphone_core_stop_dtmf() * @ingroup media_parameters @@ -3873,7 +3873,7 @@ LINPHONE_PUBLIC void linphone_core_play_dtmf(LinphoneCore *lc, char dtmf, int du /** * Stops playing a dtmf started by linphone_core_play_dtmf(). - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @ingroup media_parameters **/ LINPHONE_PUBLIC void linphone_core_stop_dtmf(LinphoneCore *lc); @@ -3890,7 +3890,7 @@ LINPHONE_PUBLIC int linphone_core_get_mtu(const LinphoneCore *lc); * Sets the maximum transmission unit size in bytes. * This information is useful for sending RTP packets. * Default value is 1500. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] mtu The MTU in bytes * @ingroup media_parameters **/ @@ -3928,7 +3928,7 @@ LINPHONE_PUBLIC void linphone_core_set_media_network_reachable(LinphoneCore* lc, /** * Enables signaling keep alive, small udp packet sent periodically to keep udp NAT association. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] enable A boolean value telling whether signaling keep alive is to be enabled * @ingroup network_parameters */ @@ -3936,7 +3936,7 @@ LINPHONE_PUBLIC void linphone_core_enable_keep_alive(LinphoneCore* lc, bool_t en /** * Is signaling keep alive enabled. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return A boolean value telling whether signaling keep alive is enabled * @ingroup network_parameters */ @@ -3944,16 +3944,16 @@ LINPHONE_PUBLIC bool_t linphone_core_keep_alive_enabled(LinphoneCore* lc); /** * Retrieves the user pointer that was given to linphone_core_new() - * @param[in] lc LinphoneCore object - * @return The user data associated with the LinphoneCore object + * @param[in] lc #LinphoneCore object + * @return The user data associated with the #LinphoneCore object * @ingroup initializing **/ LINPHONE_PUBLIC void *linphone_core_get_user_data(const LinphoneCore *lc); /** * Associate a user pointer to the linphone core. - * @param[in] lc LinphoneCore object - * @param[in] userdata The user data to associate with the LinphoneCore object + * @param[in] lc #LinphoneCore object + * @param[in] userdata The user data to associate with the #LinphoneCore object * @ingroup initializing **/ LINPHONE_PUBLIC void linphone_core_set_user_data(LinphoneCore *lc, void *userdata); @@ -3996,8 +3996,8 @@ LINPHONE_PUBLIC void linphone_core_set_waiting_callback(LinphoneCore *lc, Linpho LINPHONE_PUBLIC const bctbx_list_t * linphone_core_get_sip_setups(LinphoneCore *lc); /** - * Destroys a LinphoneCore - * @param[in] lc LinphoneCore object + * Destroys a #LinphoneCore + * @param[in] lc #LinphoneCore object * @ingroup initializing * @deprecated Use linphone_core_unref() instead. * @donotwrap @@ -4022,7 +4022,7 @@ void linphone_core_set_rtp_transport_factories(LinphoneCore* lc, LinphoneRtpTran /** * Retrieve RTP statistics regarding current call. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[out] local RTP statistics computed locally. * @param[out] remote RTP statistics computed by far end (obtained via RTCP feedback). * @return 0 or -1 if no call is running. @@ -4032,7 +4032,7 @@ int linphone_core_get_current_call_stats(LinphoneCore *lc, rtp_stats_t *local, r /** * Get the number of Call - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The current number of calls * @ingroup call_control **/ @@ -4041,9 +4041,9 @@ LINPHONE_PUBLIC int linphone_core_get_calls_nb(const LinphoneCore *lc); /** * Gets the current list of calls. * Note that this list is read-only and might be changed by the core after a function call to linphone_core_iterate(). - * Similarly the LinphoneCall objects inside it might be destroyed without prior notice. - * To hold references to LinphoneCall object into your program, you must use linphone_call_ref(). - * @param[in] lc The LinphoneCore object + * Similarly the #LinphoneCall objects inside it might be destroyed without prior notice. + * To hold references to #LinphoneCall object into your program, you must use linphone_call_ref(). + * @param[in] lc The #LinphoneCore object * @return \bctbx_list{LinphoneCall} * @ingroup call_control **/ @@ -4110,7 +4110,7 @@ LINPHONE_PUBLIC void linphone_core_reload_ms_plugins(LinphoneCore *lc, const cha * @ingroup call_control * @param lc * @param uri which should match call remote uri - * @return LinphoneCall or NULL is no match is found + * @return #LinphoneCall or NULL is no match is found */ LINPHONE_PUBLIC LinphoneCall* linphone_core_find_call_from_uri(const LinphoneCore *lc, const char *uri); @@ -4300,7 +4300,7 @@ LINPHONE_PUBLIC void linphone_core_set_max_calls(LinphoneCore *lc, int max); * In order to prevent this situation, an application can use linphone_core_sound_resources_locked() to know whether * it is possible at a given time to start a new outgoing call. * When the function returns TRUE, an application should not allow the user to start an outgoing call. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return A boolean value telling whether a call will need the sound resources in near future * @ingroup call_control **/ @@ -4309,8 +4309,8 @@ LINPHONE_PUBLIC bool_t linphone_core_sound_resources_locked(LinphoneCore *lc); /** * Check if a media encryption type is supported * @param lc core - * @param menc LinphoneMediaEncryption - * @return whether a media encryption scheme is supported by the LinphoneCore engine + * @param menc #LinphoneMediaEncryption + * @return whether a media encryption scheme is supported by the #LinphoneCore engine * @ingroup initializing **/ LINPHONE_PUBLIC bool_t linphone_core_media_encryption_supported(const LinphoneCore *lc, LinphoneMediaEncryption menc); @@ -4363,14 +4363,14 @@ LINPHONE_PUBLIC bool_t linphone_core_tunnel_available(void); * get tunnel instance if available * @ingroup tunnel * @param lc core object - * @returns LinphoneTunnel or NULL if not available + * @returns #LinphoneTunnel or NULL if not available */ LINPHONE_PUBLIC LinphoneTunnel *linphone_core_get_tunnel(const LinphoneCore *lc); /** * Set the DSCP field for SIP signaling channel. * The DSCP defines the quality of service in IP packets. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] dscp The DSCP value to set * @ingroup network_parameters **/ @@ -4379,7 +4379,7 @@ LINPHONE_PUBLIC void linphone_core_set_sip_dscp(LinphoneCore *lc, int dscp); /** * Get the DSCP field for SIP signaling channel. * The DSCP defines the quality of service in IP packets. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The current DSCP value * @ingroup network_parameters **/ @@ -4388,7 +4388,7 @@ LINPHONE_PUBLIC int linphone_core_get_sip_dscp(const LinphoneCore *lc); /** * Set the DSCP field for outgoing audio streams. * The DSCP defines the quality of service in IP packets. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] dscp The DSCP value to set * @ingroup network_parameters **/ @@ -4397,7 +4397,7 @@ LINPHONE_PUBLIC void linphone_core_set_audio_dscp(LinphoneCore *lc, int dscp); /** * Get the DSCP field for outgoing audio streams. * The DSCP defines the quality of service in IP packets. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The current DSCP value * @ingroup network_parameters **/ @@ -4406,7 +4406,7 @@ LINPHONE_PUBLIC int linphone_core_get_audio_dscp(const LinphoneCore *lc); /** * Set the DSCP field for outgoing video streams. * The DSCP defines the quality of service in IP packets. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] dscp The DSCP value to set * @ingroup network_parameters **/ @@ -4415,7 +4415,7 @@ LINPHONE_PUBLIC void linphone_core_set_video_dscp(LinphoneCore *lc, int dscp); /** * Get the DSCP field for outgoing video streams. * The DSCP defines the quality of service in IP packets. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The current DSCP value * @ingroup network_parameters **/ @@ -4436,7 +4436,7 @@ LINPHONE_PUBLIC void linphone_core_set_video_display_filter(LinphoneCore *lc, co /** * Get the name of the mediastreamer2 filter used for echo cancelling. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The name of the mediastreamer2 filter used for echo cancelling * @ingroup media_parameters */ @@ -4445,7 +4445,7 @@ LINPHONE_PUBLIC const char * linphone_core_get_echo_canceller_filter_name(const /** * Set the name of the mediastreamer2 filter to be used for echo cancelling. * This is for advanced users of the library. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] filtername The name of the mediastreamer2 filter to be used for echo cancelling * @ingroup media_parameters */ @@ -4460,7 +4460,7 @@ typedef void (*ContactSearchCallback)( LinphoneContactSearch* id, bctbx_list_t* * Set URI where to download xml configuration file at startup. * This can also be set from configuration file or factory config file, from [misc] section, item "config-uri". * Calling this function does not load the configuration. It will write the value into configuration so that configuration - * from remote URI will take place at next LinphoneCore start. + * from remote URI will take place at next #LinphoneCore start. * @param lc the linphone core * @param uri the http or https uri to use in order to download the configuration. Passing NULL will disable remote provisioning. * @return -1 if uri could not be parsed, 0 otherwise. Note that this does not check validity of URI endpoint nor scheme and download may still fail. @@ -4575,7 +4575,7 @@ LINPHONE_PUBLIC bool_t linphone_core_file_format_supported(LinphoneCore *lc, con /** * This function controls signaling features supported by the core. * They are typically included in a SIP Supported header. - * @param[in] core LinphoneCore object + * @param[in] core #LinphoneCore object * @param[in] tag The feature tag name * @ingroup initializing **/ @@ -4583,7 +4583,7 @@ LINPHONE_PUBLIC void linphone_core_add_supported_tag(LinphoneCore *core, const c /** * Remove a supported tag. - * @param[in] core LinphoneCore object + * @param[in] core #LinphoneCore object * @param[in] tag The tag to remove * @ingroup initializing * @see linphone_core_add_supported_tag() @@ -4592,10 +4592,10 @@ LINPHONE_PUBLIC void linphone_core_remove_supported_tag(LinphoneCore *core, cons /** * Enable RTCP feedback (also known as RTP/AVPF profile). - * Setting LinphoneAVPFDefault is equivalent to LinphoneAVPFDisabled. - * This setting can be overriden per LinphoneProxyConfig with linphone_proxy_config_set_avpf_mode(). + * Setting #LinphoneAVPFDefault is equivalent to LinphoneAVPFDisabled. + * This setting can be overriden per #LinphoneProxyConfig with linphone_proxy_config_set_avpf_mode(). * The value set here is used for calls placed or received out of any proxy configured, or if the proxy config is configured with LinphoneAVPFDefault. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] mode The AVPF mode to use. * @ingroup media_parameters **/ @@ -4603,7 +4603,7 @@ LINPHONE_PUBLIC void linphone_core_set_avpf_mode(LinphoneCore *lc, LinphoneAVPFM /** * Return AVPF enablement. See linphone_core_set_avpf_mode() . - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The current AVPF mode * @ingroup media_parameters **/ @@ -4612,7 +4612,7 @@ LINPHONE_PUBLIC LinphoneAVPFMode linphone_core_get_avpf_mode(const LinphoneCore /** * Set the avpf report interval in seconds. * This value can be overriden by the proxy config using linphone_proxy_config_set_avpf_rr_interval(). - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] interval The report interval in seconds * @ingroup media_parameters **/ @@ -4620,7 +4620,7 @@ LINPHONE_PUBLIC void linphone_core_set_avpf_rr_interval(LinphoneCore *lc, int in /** * Return the avpf report interval in seconds. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The current AVPF report interval in seconds * @ingroup media_parameters **/ @@ -4757,7 +4757,7 @@ LINPHONE_PUBLIC const OrtpNetworkSimulatorParams *linphone_core_get_network_simu /** * Set the video preset to be used for video calls. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] preset The name of the video preset to be used (can be NULL to use the default video preset). * @ingroup media_parameters */ @@ -4765,7 +4765,7 @@ LINPHONE_PUBLIC void linphone_core_set_video_preset(LinphoneCore *lc, const char /** * Get the video preset used for video calls. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return The name of the video preset used for video calls (can be NULL if the default video preset is used). * @ingroup media_parameters */ @@ -4773,7 +4773,7 @@ LINPHONE_PUBLIC const char * linphone_core_get_video_preset(const LinphoneCore * /** * Gets if realtime text is enabled or not - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return true if realtime text is enabled, false otherwise * @ingroup media_parameters */ @@ -4783,7 +4783,7 @@ LINPHONE_PUBLIC void linphone_core_enable_realtime_text(LinphoneCore *lc, bool_t /** * Set http proxy address to be used for signaling during next channel connection. Use #linphone_core_set_network_reachable FASLE/TRUE to force channel restart. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] host Hostname of IP adress of the http proxy (can be NULL to disable). * @ingroup network_parameters */ @@ -4791,7 +4791,7 @@ LINPHONE_PUBLIC void linphone_core_set_http_proxy_host(LinphoneCore *lc, const c /** * Set http proxy port to be used for signaling. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] port of the http proxy. * @ingroup network_parameters */ @@ -4799,7 +4799,7 @@ LINPHONE_PUBLIC void linphone_core_set_http_proxy_port(LinphoneCore *lc, int por /** * Get http proxy address to be used for signaling. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return hostname of IP adress of the http proxy (can be NULL to disable). * @ingroup network_parameters */ @@ -4807,7 +4807,7 @@ LINPHONE_PUBLIC const char *linphone_core_get_http_proxy_host(const LinphoneCore /** * Get http proxy port to be used for signaling. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return port of the http proxy. * @ingroup network_parameters */ @@ -4817,8 +4817,8 @@ LINPHONE_PUBLIC LinphoneRingtonePlayer *linphone_core_get_ringtoneplayer(Linphon /** * Sets a TLS certificate used for TLS authentication - * The certificate won't be stored, you have to set it after each LinphoneCore startup - * @param lc LinphoneCore object + * The certificate won't be stored, you have to set it after each #LinphoneCore startup + * @param lc #LinphoneCore object * @param tls_cert the TLS certificate * @ingroup network_parameters */ @@ -4826,8 +4826,8 @@ LINPHONE_PUBLIC void linphone_core_set_tls_cert(LinphoneCore *lc, const char *tl /** * Sets a TLS key used for TLS authentication - * The key won't be stored, you have to set it after each LinphoneCore startup - * @param lc LinphoneCore object + * The key won't be stored, you have to set it after each #LinphoneCore startup + * @param lc #LinphoneCore object * @param tls_key the TLS key * @ingroup network_parameters */ @@ -4836,7 +4836,7 @@ LINPHONE_PUBLIC void linphone_core_set_tls_key(LinphoneCore *lc, const char *tls /** * Sets a TLS certificate path used for TLS authentication * The path will be stored in the rc file and automatically restored on startup - * @param lc LinphoneCore object + * @param lc #LinphoneCore object * @param tls_cert_path path to the TLS certificate * @ingroup network_parameters */ @@ -4845,7 +4845,7 @@ LINPHONE_PUBLIC void linphone_core_set_tls_cert_path(LinphoneCore *lc, const cha /** * Sets a TLS key path used for TLS authentication * The path will be stored in the rc file and automatically restored on startup - * @param lc LinphoneCore object + * @param lc #LinphoneCore object * @param tls_key_path path to the TLS key * @ingroup network_parameters */ @@ -4853,7 +4853,7 @@ LINPHONE_PUBLIC void linphone_core_set_tls_key_path(LinphoneCore *lc, const char /** * Gets the TLS certificate - * @param lc LinphoneCore object + * @param lc #LinphoneCore object * @return the TLS certificate or NULL if not set yet * @ingroup network_parameters */ @@ -4861,7 +4861,7 @@ LINPHONE_PUBLIC const char *linphone_core_get_tls_cert(const LinphoneCore *lc); /** * Gets the TLS key - * @param lc LinphoneCore object + * @param lc #LinphoneCore object * @return the TLS key or NULL if not set yet * @ingroup network_parameters */ @@ -4869,7 +4869,7 @@ LINPHONE_PUBLIC const char *linphone_core_get_tls_key(const LinphoneCore *lc); /** * Gets the path to the TLS certificate file - * @param lc LinphoneCore object + * @param lc #LinphoneCore object * @return the TLS certificate path or NULL if not set yet * @ingroup network_parameters */ @@ -4877,7 +4877,7 @@ LINPHONE_PUBLIC const char *linphone_core_get_tls_cert_path(const LinphoneCore * /** * Gets the path to the TLS key file - * @param lc LinphoneCore object + * @param lc #LinphoneCore object * @return the TLS key path or NULL if not set yet * @ingroup network_parameters */ @@ -4885,8 +4885,8 @@ LINPHONE_PUBLIC const char *linphone_core_get_tls_key_path(const LinphoneCore *l /** * Sets an IM Encryption Engine in the core - * @param lc LinphoneCore object - * @param imee LinphoneImEncryptionEngine object + * @param lc #LinphoneCore object + * @param imee #LinphoneImEncryptionEngine object * @ingroup chatroom * @donotwrap */ @@ -4894,7 +4894,7 @@ LINPHONE_PUBLIC void linphone_core_set_im_encryption_engine(LinphoneCore *lc, Li /** * Gets the IM Encryption Engine in the core if possible - * @param lc LinphoneCore object + * @param lc #LinphoneCore object * @return the IM Encryption Engine in the core or NULL * @ingroup chatroom * @donotwrap @@ -4903,7 +4903,7 @@ LINPHONE_PUBLIC LinphoneImEncryptionEngine * linphone_core_get_im_encryption_eng /** * Tells whether a content type is supported. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] content_type The content type to check * @return A boolean value telling whether the specified content type is supported or not. */ @@ -4912,14 +4912,14 @@ LINPHONE_PUBLIC bool_t linphone_core_is_content_type_supported(const LinphoneCor /** * Add support for the specified content type. * It is the application responsibility to handle it correctly afterwards. - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @param[in] content_type The content type to add support for */ LINPHONE_PUBLIC void linphone_core_add_content_type_support(LinphoneCore *lc, const char *content_type); /** * Get the linphone specs value telling what functionalities the linphone client supports. - * @param[in] core LinphoneCore object + * @param[in] core #LinphoneCore object * @return The linphone specs telling what functionalities the linphone client supports * @ingroup initializing */ @@ -4927,7 +4927,7 @@ const char *linphone_core_get_linphone_specs (const LinphoneCore *core); /** * Set the linphone specs value telling what functionalities the linphone client supports. - * @param[in] core LinphoneCore object + * @param[in] core #LinphoneCore object * @param[in] specs The linphone specs to set * @ingroup initializing */ @@ -4966,7 +4966,7 @@ LINPHONE_PUBLIC LinphoneChatRoom * linphone_core_create_client_group_chat_room(L /** * Get a basic chat room whose peer is the supplied address. If it does not exist yet, it will be created. - * No reference is transfered to the application. The LinphoneCore keeps a reference on the chat room. + * No reference is transfered to the application. The #LinphoneCore keeps a reference on the chat room. * @param lc the linphone core * @param addr a linphone address. * @return #LinphoneChatRoom where messaging can take place. @@ -4975,7 +4975,7 @@ LINPHONE_PUBLIC LinphoneChatRoom *linphone_core_get_chat_room(LinphoneCore *lc, /** * Get a basic chat room for messaging from a sip uri like sip:joe@sip.linphone.org. If it does not exist yet, it will be created. - * No reference is transfered to the application. The LinphoneCore keeps a reference on the chat room. + * No reference is transfered to the application. The #LinphoneCore keeps a reference on the chat room. * @param lc A #LinphoneCore object * @param to The destination address for messages. * @return #LinphoneChatRoom where messaging can take place. @@ -4984,7 +4984,7 @@ LINPHONE_PUBLIC LinphoneChatRoom *linphone_core_get_chat_room_from_uri(LinphoneC /** * Find a chat room. - * No reference is transfered to the application. The LinphoneCore keeps a reference on the chat room. + * No reference is transfered to the application. The #LinphoneCore keeps a reference on the chat room. * @param lc the linphone core * @param peer_addr a linphone address. * @param local_addr a linphone address. @@ -4998,7 +4998,7 @@ LINPHONE_PUBLIC LinphoneChatRoom *linphone_core_find_chat_room ( /** * Find a one to one chat room. - * No reference is transfered to the application. The LinphoneCore keeps a reference on the chat room. + * No reference is transfered to the application. The #LinphoneCore keeps a reference on the chat room. * @param lc the linphone core * @param local_addr a linphone address. * @param participant_addr a linphone address. @@ -5038,9 +5038,9 @@ LINPHONE_PUBLIC void linphone_core_enable_chat(LinphoneCore *lc); LINPHONE_PUBLIC bool_t linphone_core_chat_enabled(const LinphoneCore *lc); /** - * Get the LinphoneImNotifPolicy object controlling the instant messaging notifications. - * @param[in] lc LinphoneCore object - * @return A LinphoneImNotifPolicy object. + * Get the #LinphoneImNotifPolicy object controlling the instant messaging notifications. + * @param[in] lc #LinphoneCore object + * @return A #LinphoneImNotifPolicy object. */ LINPHONE_PUBLIC LinphoneImNotifPolicy * linphone_core_get_im_notif_policy(const LinphoneCore *lc); @@ -5050,8 +5050,8 @@ LINPHONE_PUBLIC LinphoneImNotifPolicy * linphone_core_get_im_notif_policy(const /** * Create a content with default values from Linphone core. - * @param[in] lc LinphoneCore object - * @return LinphoneContent object with default values set + * @param[in] lc #LinphoneCore object + * @return #LinphoneContent object with default values set * @ingroup misc */ LINPHONE_PUBLIC LinphoneContent * linphone_core_create_content(LinphoneCore *lc); @@ -5070,7 +5070,7 @@ LINPHONE_PUBLIC LinphoneContent * linphone_core_create_content(LinphoneCore *lc) * @param event the event name * @param expires the whished duration of the subscription * @param body an optional body, may be NULL. - * @return a LinphoneEvent holding the context of the created subcription. + * @return a #LinphoneEvent holding the context of the created subcription. **/ LINPHONE_PUBLIC LinphoneEvent *linphone_core_subscribe(LinphoneCore *lc, const LinphoneAddress *resource, const char *event, int expires, const LinphoneContent *body); @@ -5082,7 +5082,7 @@ LINPHONE_PUBLIC LinphoneEvent *linphone_core_subscribe(LinphoneCore *lc, const L * @param resource the destination resource * @param event the event name * @param expires the whished duration of the subscription - * @return a LinphoneEvent holding the context of the created subcription. + * @return a #LinphoneEvent holding the context of the created subcription. **/ LINPHONE_PUBLIC LinphoneEvent *linphone_core_create_subscribe(LinphoneCore *lc, const LinphoneAddress *resource, const char *event, int expires); @@ -5093,20 +5093,20 @@ LINPHONE_PUBLIC LinphoneEvent *linphone_core_create_subscribe(LinphoneCore *lc, * @param lc the #LinphoneCore * @param resource the destination resource * @param event the event name - * @return a LinphoneEvent holding the context of the notification. + * @return a #LinphoneEvent holding the context of the notification. **/ LINPHONE_PUBLIC LinphoneEvent *linphone_core_create_notify(LinphoneCore *lc, const LinphoneAddress *resource, const char *event); /** * Publish an event state. - * This first create a LinphoneEvent with linphone_core_create_publish() and calls linphone_event_send_publish() to actually send it. + * This first create a #LinphoneEvent with linphone_core_create_publish() and calls linphone_event_send_publish() to actually send it. * After expiry, the publication is refreshed unless it is terminated before. * @param lc the #LinphoneCore * @param resource the resource uri for the event * @param event the event name * @param expires the lifetime of event being published, -1 if no associated duration, in which case it will not be refreshed. * @param body the actual published data - * @return the LinphoneEvent holding the context of the publish. + * @return the #LinphoneEvent holding the context of the publish. **/ LINPHONE_PUBLIC LinphoneEvent *linphone_core_publish(LinphoneCore *lc, const LinphoneAddress *resource, const char *event, int expires, const LinphoneContent *body); @@ -5118,19 +5118,19 @@ LINPHONE_PUBLIC LinphoneEvent *linphone_core_publish(LinphoneCore *lc, const Lin * @param resource the resource uri for the event * @param event the event name * @param expires the lifetime of event being published, -1 if no associated duration, in which case it will not be refreshed. - * @return the LinphoneEvent holding the context of the publish. + * @return the #LinphoneEvent holding the context of the publish. **/ LINPHONE_PUBLIC LinphoneEvent *linphone_core_create_publish(LinphoneCore *lc, const LinphoneAddress *resource, const char *event, int expires); /** * Create a publish context for a one-shot publish. * After being created, the publish must be sent using linphone_event_send_publish(). - * The LinphoneEvent is automatically terminated when the publish transaction is finished, either with success or failure. + * The #LinphoneEvent is automatically terminated when the publish transaction is finished, either with success or failure. * The application must not call linphone_event_terminate() for such one-shot publish. * @param lc the #LinphoneCore * @param resource the resource uri for the event * @param event the event name - * @return the LinphoneEvent holding the context of the publish. + * @return the #LinphoneEvent holding the context of the publish. **/ LINPHONE_PUBLIC LinphoneEvent *linphone_core_create_one_shot_publish(LinphoneCore *lc, const LinphoneAddress *resource, const char *event); @@ -5152,9 +5152,9 @@ LINPHONE_PUBLIC LinphoneEvent *linphone_core_create_one_shot_publish(LinphoneCor LINPHONE_PUBLIC LinphoneFriend * linphone_core_create_friend(LinphoneCore *lc); /** - * Create a LinphoneFriend from the given address. + * Create a #LinphoneFriend from the given address. * @param[in] lc #LinphoneCore object - * @param[in] address A string containing the address to create the LinphoneFriend from + * @param[in] address A string containing the address to create the #LinphoneFriend from * @return The created #LinphoneFriend object */ LINPHONE_PUBLIC LinphoneFriend * linphone_core_create_friend_with_address(LinphoneCore *lc, const char *address); @@ -5195,15 +5195,15 @@ LINPHONE_PUBLIC LinphonePresenceModel * linphone_core_get_presence_model(const L /** * Get my consolidated presence - * @param[in] lc LinphoneCore object + * @param[in] lc #LinphoneCore object * @return My consolidated presence */ LINPHONE_PUBLIC LinphoneConsolidatedPresence linphone_core_get_consolidated_presence(const LinphoneCore *lc); /** * Set my consolidated presence - * @param[in] lc LinphoneCore object - * @param[in] presence LinphoneConsolidatedPresence value + * @param[in] lc #LinphoneCore object + * @param[in] presence #LinphoneConsolidatedPresence value */ LINPHONE_PUBLIC void linphone_core_set_consolidated_presence(LinphoneCore *lc, LinphoneConsolidatedPresence presence); @@ -5238,7 +5238,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_remove_friend(LinphoneCor LINPHONE_PUBLIC void linphone_core_reject_subscriber(LinphoneCore *lc, LinphoneFriend *lf); /** - * Get Buddy list of LinphoneFriend + * Get Buddy list of #LinphoneFriend * @param[in] lc #LinphoneCore object * @return \bctbx_list{LinphoneFriend} * @deprecated use linphone_core_get_friends_lists() or linphone_friend_list_get_friends() instead. @@ -5254,7 +5254,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED const bctbx_list_t * linphone_core_get_frie LINPHONE_PUBLIC void linphone_core_notify_all_friends(LinphoneCore *lc, LinphonePresenceModel *presence); /** - * Search a LinphoneFriend by its address. + * Search a #LinphoneFriend by its address. * @param[in] lc #LinphoneCore object. * @param[in] addr The address to use to search the friend. * @return The #LinphoneFriend object corresponding to the given address. @@ -5264,7 +5264,7 @@ LINPHONE_PUBLIC void linphone_core_notify_all_friends(LinphoneCore *lc, Linphone LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneFriend *linphone_core_get_friend_by_address(const LinphoneCore *lc, const char *addr); /** - * Search a LinphoneFriend by its address. + * Search a #LinphoneFriend by its address. * @param[in] lc #LinphoneCore object. * @param[in] addr The address to use to search the friend. * @return The #LinphoneFriend object corresponding to the given address. @@ -5272,7 +5272,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneFriend *linphone_core_get_friend_by_ LINPHONE_PUBLIC LinphoneFriend *linphone_core_find_friend(const LinphoneCore *lc, const LinphoneAddress *addr); /** - * Search a LinphoneFriend by its reference key. + * Search a #LinphoneFriend by its reference key. * @param[in] lc #LinphoneCore object. * @param[in] key The reference key to use to search the friend. * @return The #LinphoneFriend object corresponding to the given reference key. @@ -5297,51 +5297,51 @@ LINPHONE_PUBLIC void linphone_core_set_friends_database_path(LinphoneCore *lc, c LINPHONE_PUBLIC const char* linphone_core_get_friends_database_path(LinphoneCore *lc); /** - * Create a new empty LinphoneFriendList object. - * @param[in] lc LinphoneCore object. - * @return A new LinphoneFriendList object. + * Create a new empty #LinphoneFriendList object. + * @param[in] lc #LinphoneCore object. + * @return A new #LinphoneFriendList object. **/ LINPHONE_PUBLIC LinphoneFriendList * linphone_core_create_friend_list(LinphoneCore *lc); /** * Add a friend list. - * @param[in] lc LinphoneCore object - * @param[in] list LinphoneFriendList object + * @param[in] lc #LinphoneCore object + * @param[in] list #LinphoneFriendList object */ LINPHONE_PUBLIC void linphone_core_add_friend_list(LinphoneCore *lc, LinphoneFriendList *list); /** * Removes a friend list. - * @param[in] lc LinphoneCore object - * @param[in] list LinphoneFriendList object + * @param[in] lc #LinphoneCore object + * @param[in] list #LinphoneFriendList object */ LINPHONE_PUBLIC void linphone_core_remove_friend_list(LinphoneCore *lc, LinphoneFriendList *list); /** - * Retrieves the list of LinphoneFriendList from the core. - * @param[in] lc LinphoneCore object - * @return \bctbx_list{LinphoneFriendList} a list of LinphoneFriendList + * Retrieves the list of #LinphoneFriendList from the core. + * @param[in] lc #LinphoneCore object + * @return \bctbx_list{LinphoneFriendList} a list of #LinphoneFriendList */ LINPHONE_PUBLIC const bctbx_list_t * linphone_core_get_friends_lists(const LinphoneCore *lc); /** - * Retrieves the first list of LinphoneFriend from the core. - * @param[in] lc LinphoneCore object - * @return the first LinphoneFriendList object or NULL + * Retrieves the first list of #LinphoneFriend from the core. + * @param[in] lc #LinphoneCore object + * @return the first #LinphoneFriendList object or NULL */ LINPHONE_PUBLIC LinphoneFriendList * linphone_core_get_default_friend_list(const LinphoneCore *lc); /** - * Retrieves a list of LinphoneAddress sort and filter - * @param[in] lc LinphoneCore object + * Retrieves a list of #LinphoneAddress sort and filter + * @param[in] lc #LinphoneCore object * @param[in] filter Chars used for the filter* * @param[in] sip_only Only sip address or not - * @return \bctbx_list{LinphoneAddress} a list of filtered LinphoneAddress + the LinphoneAddress created with the filter + * @return \bctbx_list{LinphoneAddress} a list of filtered #LinphoneAddress + the #LinphoneAddress created with the filter **/ LINPHONE_PUBLIC const bctbx_list_t * linphone_core_find_contacts_by_char(LinphoneCore *core, const char *filter, bool_t sip_only); /** - * Create a LinphonePresenceActivity with the given type and description. + * Create a #LinphonePresenceActivity with the given type and description. * @param[in] lc #LinphoneCore object. * @param[in] acttype The #LinphonePresenceActivityType to set for the activity. * @param[in] description An additional description of the activity to set for the activity. Can be NULL if no additional description is to be added. @@ -5357,7 +5357,7 @@ LINPHONE_PUBLIC LinphonePresenceActivity * linphone_core_create_presence_activit LINPHONE_PUBLIC LinphonePresenceModel * linphone_core_create_presence_model(LinphoneCore *lc); /** - * Create a LinphonePresenceModel with the given activity type and activity description. + * Create a #LinphonePresenceModel with the given activity type and activity description. * @param[in] lc #LinphoneCore object. * @param[in] acttype The #LinphonePresenceActivityType to set for the activity of the created model. * @param[in] description An additional description of the activity to set for the activity. Can be NULL if no additional description is to be added. @@ -5366,7 +5366,7 @@ LINPHONE_PUBLIC LinphonePresenceModel * linphone_core_create_presence_model(Linp LINPHONE_PUBLIC LinphonePresenceModel * linphone_core_create_presence_model_with_activity(LinphoneCore *lc, LinphonePresenceActivityType acttype, const char *description); /** - * Create a LinphonePresenceModel with the given activity type, activity description, note content and note language. + * Create a #LinphonePresenceModel with the given activity type, activity description, note content and note language. * @param[in] lc #LinphoneCore object. * @param[in] acttype The #LinphonePresenceActivityType to set for the activity of the created model. * @param[in] description An additional description of the activity to set for the activity. Can be NULL if no additional description is to be added. @@ -5377,7 +5377,7 @@ LINPHONE_PUBLIC LinphonePresenceModel * linphone_core_create_presence_model_with LINPHONE_PUBLIC LinphonePresenceModel * linphone_core_create_presence_model_with_activity_and_note(LinphoneCore *lc, LinphonePresenceActivityType acttype, const char *description, const char *note, const char *lang); /** - * Create a LinphonePresenceNote with the given content and language. + * Create a #LinphonePresenceNote with the given content and language. * @param[in] lc #LinphoneCore object. * @param[in] content The content of the note to be created. * @param[in] lang The language of the note to be created. @@ -5386,7 +5386,7 @@ LINPHONE_PUBLIC LinphonePresenceModel * linphone_core_create_presence_model_with LINPHONE_PUBLIC LinphonePresenceNote * linphone_core_create_presence_note(LinphoneCore *lc, const char *content, const char *lang); /** - * Create a LinphonePresencePerson with the given id. + * Create a #LinphonePresencePerson with the given id. * @param[in] lc #LinphoneCore object * @param[in] id The id of the person to be created. * @return The created #LinphonePresencePerson object. @@ -5394,7 +5394,7 @@ LINPHONE_PUBLIC LinphonePresenceNote * linphone_core_create_presence_note(Linpho LINPHONE_PUBLIC LinphonePresencePerson * linphone_core_create_presence_person(LinphoneCore *lc, const char *id); /** - * Create a LinphonePresenceService with the given id, basic status and contact. + * Create a #LinphonePresenceService with the given id, basic status and contact. * @param[in] lc #LinphoneCore object. * @param[in] id The id of the service to be created. * @param[in] basic_status The basic status of the service to be created. @@ -5433,37 +5433,37 @@ LINPHONE_PUBLIC void linphone_core_notify_notify_presence_received_for_uri_or_te /** - * Create a new LinphoneNatPolicy object with every policies being disabled. - * @param[in] lc LinphoneCore object - * @return A new LinphoneNatPolicy object. + * Create a new #LinphoneNatPolicy object with every policies being disabled. + * @param[in] lc #LinphoneCore object + * @return A new #LinphoneNatPolicy object. * @ingroup network_parameters */ LINPHONE_PUBLIC LinphoneNatPolicy * linphone_core_create_nat_policy(LinphoneCore *lc); /** - * Create a new LinphoneNatPolicy by reading the config of a LinphoneCore according to the passed ref. - * @param[in] lc LinphoneCore object - * @param[in] ref The reference of a NAT policy in the config of the LinphoneCore - * @return A new LinphoneNatPolicy object. + * Create a new #LinphoneNatPolicy by reading the config of a #LinphoneCore according to the passed ref. + * @param[in] lc #LinphoneCore object + * @param[in] ref The reference of a NAT policy in the config of the #LinphoneCore + * @return A new #LinphoneNatPolicy object. * @ingroup network_parameters */ LINPHONE_PUBLIC LinphoneNatPolicy * linphone_core_create_nat_policy_from_config(LinphoneCore *lc, const char *ref); /** - * Create a LinphoneAccountCreator and set Linphone Request callbacks. - * @param[in] core The LinphoneCore used for the XML-RPC communication + * Create a #LinphoneAccountCreator and set Linphone Request callbacks. + * @param[in] core The #LinphoneCore used for the XML-RPC communication * @param[in] xmlrpc_url The URL to the XML-RPC server. Must be NON NULL. - * @return The new LinphoneAccountCreator object. + * @return The new #LinphoneAccountCreator object. * @ingroup account_creator **/ LINPHONE_PUBLIC LinphoneAccountCreator * linphone_core_create_account_creator(LinphoneCore *core, const char *xmlrpc_url); /** - * Create a LinphoneXmlRpcSession for a given url. - * @param[in] lc The LinphoneCore used for the XML-RPC communication + * Create a #LinphoneXmlRpcSession for a given url. + * @param[in] lc The #LinphoneCore used for the XML-RPC communication * @param[in] url The URL to the XML-RPC server. Must be NON NULL. - * @return The new LinphoneXmlRpcSession object. + * @return The new #LinphoneXmlRpcSession object. * @ingroup misc **/ LINPHONE_PUBLIC LinphoneXmlRpcSession * linphone_core_create_xml_rpc_session(LinphoneCore *lc, const char *url); diff --git a/include/linphone/error_info.h b/include/linphone/error_info.h index 121983924..23a26c753 100644 --- a/include/linphone/error_info.h +++ b/include/linphone/error_info.h @@ -32,9 +32,9 @@ extern "C" { */ /** - * Create an empty LinphoneErrorInfo object. - * The LinphoneErrorInfo object carries these fields: - * - a LinphoneReason enum member giving overall signification of the error reported. + * Create an empty #LinphoneErrorInfo object. + * The #LinphoneErrorInfo object carries these fields: + * - a #LinphoneReason enum member giving overall signification of the error reported. * - the "protocol" name in which the protocol reason code has meaning, for example SIP or Q.850 * - the "protocol code", an integer referencing the kind of error reported * - the "phrase", a text phrase describing the error @@ -63,10 +63,10 @@ LINPHONE_PUBLIC void linphone_error_info_unref(LinphoneErrorInfo *ei); LINPHONE_PUBLIC LinphoneReason linphone_error_info_get_reason(const LinphoneErrorInfo *ei); /** - * Get pointer to chained LinphoneErrorInfo set in sub_ei. + * Get pointer to chained #LinphoneErrorInfo set in sub_ei. * It corresponds to a Reason header in a received SIP response. * @param ei ErrorInfo object - * @return LinphoneErrorInfo pointer defined in the ei object. + * @return #LinphoneErrorInfo pointer defined in the ei object. */ LINPHONE_PUBLIC LinphoneErrorInfo* linphone_error_info_get_sub_error_info(const LinphoneErrorInfo *ei); @@ -102,10 +102,10 @@ LINPHONE_PUBLIC const char * linphone_error_info_get_warnings(const LinphoneErro LINPHONE_PUBLIC int linphone_error_info_get_protocol_code(const LinphoneErrorInfo *ei); /** - * Assign information to a LinphoneErrorInfo object. + * Assign information to a #LinphoneErrorInfo object. * @param[in] ei ErrorInfo object * @param[in] protocol protocol name - * @param[in] reason reason from LinphoneReason enum + * @param[in] reason reason from #LinphoneReason enum * @param[in] code protocol code * @param[in] status_string description of the reason * @param[in] warning warning message @@ -113,44 +113,44 @@ LINPHONE_PUBLIC int linphone_error_info_get_protocol_code(const LinphoneErrorInf LINPHONE_PUBLIC void linphone_error_info_set(LinphoneErrorInfo *ei, const char *protocol, LinphoneReason reason, int code, const char *status_string, const char *warning); /** - * Set the sub_ei in LinphoneErrorInfo to another LinphoneErrorInfo. - * Used when a reason header is to be added in a SIP response. The first level LinphoneErrorInfo defines the SIP response code and phrase, - * the second (sub) LinphoneErroInfo defining the content of the Reason header. - * @param[in] ei LinphoneErrorInfo object to which the other LinphoneErrorInfo will be appended as ei->sub_ei. - * @param[in] appended_ei LinphoneErrorInfo to append + * Set the sub_ei in #LinphoneErrorInfo to another LinphoneErrorInfo. + * Used when a reason header is to be added in a SIP response. The first level #LinphoneErrorInfo defines the SIP response code and phrase, + * the second (sub) #LinphoneErroInfo defining the content of the Reason header. + * @param[in] ei #LinphoneErrorInfo object to which the other #LinphoneErrorInfo will be appended as ei->sub_ei. + * @param[in] appended_ei #LinphoneErrorInfo to append */ LINPHONE_PUBLIC void linphone_error_info_set_sub_error_info(LinphoneErrorInfo *ei, LinphoneErrorInfo *appended_ei); /** - * Assign reason LinphoneReason to a LinphoneErrorInfo object. + * Assign reason #LinphoneReason to a #LinphoneErrorInfo object. * @param[in] ei ErrorInfo object - * @param[in] reason reason from LinphoneReason enum + * @param[in] reason reason from #LinphoneReason enum */ LINPHONE_PUBLIC void linphone_error_info_set_reason(LinphoneErrorInfo *ei, LinphoneReason reason); /** - * Assign protocol name to a LinphoneErrorInfo object. + * Assign protocol name to a #LinphoneErrorInfo object. * @param[in] ei ErrorInfo object * @param[in] proto the protocol name */ LINPHONE_PUBLIC void linphone_error_info_set_protocol(LinphoneErrorInfo *ei, const char *proto); /** - * Assign protocol code to a LinphoneErrorInfo object. + * Assign protocol code to a #LinphoneErrorInfo object. * @param[in] ei ErrorInfo object * @param[in] code the protocol code */ LINPHONE_PUBLIC void linphone_error_info_set_protocol_code(LinphoneErrorInfo *ei, int code); /** - * Assign phrase to a LinphoneErrorInfo object. + * Assign phrase to a #LinphoneErrorInfo object. * @param[in] ei ErrorInfo object * @param[in] phrase the phrase explaining the error */ LINPHONE_PUBLIC void linphone_error_info_set_phrase(LinphoneErrorInfo *ei, const char *phrase); /** - * Assign warnings to a LinphoneErrorInfo object. + * Assign warnings to a #LinphoneErrorInfo object. * @param[in] ei ErrorInfo object * @param[in] phrase the warnings */ diff --git a/include/linphone/event.h b/include/linphone/event.h index c49ab0167..a379f8de1 100644 --- a/include/linphone/event.h +++ b/include/linphone/event.h @@ -33,7 +33,7 @@ extern "C" { /** * Send a subscription previously created by linphone_core_create_subscribe(). - * @param ev the LinphoneEvent + * @param ev the #LinphoneEvent * @param body optional content to attach with the subscription. * @return 0 if successful, -1 otherwise. **/ @@ -41,14 +41,14 @@ LINPHONE_PUBLIC LinphoneStatus linphone_event_send_subscribe(LinphoneEvent *ev, /** * Update (refresh) an outgoing subscription, changing the body. - * @param lev a LinphoneEvent + * @param lev a #LinphoneEvent * @param body an optional body to include in the subscription update, may be NULL. **/ LINPHONE_PUBLIC LinphoneStatus linphone_event_update_subscribe(LinphoneEvent *lev, const LinphoneContent *body); /** * Refresh an outgoing subscription keeping the same body. - * @param lev LinphoneEvent object. + * @param lev #LinphoneEvent object. * @return 0 if successful, -1 otherwise. */ LINPHONE_PUBLIC LinphoneStatus linphone_event_refresh_subscribe(LinphoneEvent *lev); @@ -88,7 +88,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_event_update_publish(LinphoneEvent *lev, /** * Refresh an outgoing publish keeping the same body. - * @param lev LinphoneEvent object. + * @param lev #LinphoneEvent object. * @return 0 if successful, -1 otherwise. */ LINPHONE_PUBLIC LinphoneStatus linphone_event_refresh_publish(LinphoneEvent *lev); @@ -140,7 +140,7 @@ LINPHONE_PUBLIC void *linphone_event_get_user_data(const LinphoneEvent *ev); /** * Add a custom header to an outgoing susbscription or publish. - * @param ev the LinphoneEvent + * @param ev the #LinphoneEvent * @param name header's name * @param value the header's value. **/ @@ -148,7 +148,7 @@ LINPHONE_PUBLIC void linphone_event_add_custom_header(LinphoneEvent *ev, const c /** * Obtain the value of a given header for an incoming subscription. - * @param ev the LinphoneEvent + * @param ev the #LinphoneEvent * @param name header's name * @return the header's value or NULL if such header doesn't exist. **/ @@ -156,14 +156,14 @@ LINPHONE_PUBLIC const char *linphone_event_get_custom_header(LinphoneEvent *ev, /** * Terminate an incoming or outgoing subscription that was previously acccepted, or a previous publication. - * The LinphoneEvent shall not be used anymore after this operation, unless the application explicitely took a reference on the object with + * The #LinphoneEvent shall not be used anymore after this operation, unless the application explicitely took a reference on the object with * linphone_event_ref(). **/ LINPHONE_PUBLIC void linphone_event_terminate(LinphoneEvent *lev); /** * Increase reference count of LinphoneEvent. - * By default LinphoneEvents created by the core are owned by the core only. + * By default #LinphoneEvents created by the core are owned by the core only. * An application that wishes to retain a reference to it must call linphone_event_ref(). * When this reference is no longer needed, linphone_event_unref() must be called. * @@ -193,13 +193,13 @@ LINPHONE_PUBLIC const LinphoneAddress *linphone_event_get_resource(const Linphon /** * Get the "contact" address of the subscription. - * @param[in] lev LinphoneEvent object + * @param[in] lev #LinphoneEvent object * @return The "contact" address of the subscription */ LINPHONE_PUBLIC const LinphoneAddress *linphone_event_get_remote_contact (const LinphoneEvent *lev); /** - * Returns back pointer to the LinphoneCore that created this LinphoneEvent + * Returns back pointer to the #LinphoneCore that created this #LinphoneEvent **/ LINPHONE_PUBLIC LinphoneCore *linphone_event_get_core(const LinphoneEvent *lev); diff --git a/include/linphone/factory.h b/include/linphone/factory.h index 932e5d953..9686f96ea 100644 --- a/include/linphone/factory.h +++ b/include/linphone/factory.h @@ -47,7 +47,7 @@ LINPHONE_PUBLIC void linphone_factory_clean(void); /** * Instanciate a #LinphoneCore object. * - * The LinphoneCore object is the primary handle for doing all phone actions. + * The #LinphoneCore object is the primary handle for doing all phone actions. * It should be unique within your application. * @param factory The #LinphoneFactory singleton. * @param cbs a #LinphoneCoreCbs object holding your application callbacks. A reference @@ -74,7 +74,7 @@ LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneCore *linphone_factory_create_core( /** * Instanciate a #LinphoneCore object. * - * The LinphoneCore object is the primary handle for doing all phone actions. + * The #LinphoneCore object is the primary handle for doing all phone actions. * It should be unique within your application. * @param factory The #LinphoneFactory singleton. * @param cbs a #LinphoneCoreCbs object holding your application callbacks. A reference @@ -105,13 +105,13 @@ LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneCore *linphone_factory_create_core_2 /** * Instantiate a #LinphoneCore object. * - * The LinphoneCore object is the primary handle for doing all phone actions. It should be unique within your + * The #LinphoneCore object is the primary handle for doing all phone actions. It should be unique within your * application. - * The LinphoneCore object is not started automatically, you need to call linphone_core_start() to that effect. + * The #LinphoneCore object is not started automatically, you need to call linphone_core_start() to that effect. * @param[in] factory The #LinphoneFactory singleton. * @param[in] config_path A path to a config file. If it does not exists it will be created. The config file is used to - * store all settings, proxies... so that all these settings become persistent over the life of the LinphoneCore object. - * It is allowed to set a NULL config file. In that case LinphoneCore will not store any settings. + * store all settings, proxies... so that all these settings become persistent over the life of the #LinphoneCore object. + * It is allowed to set a NULL config file. In that case #LinphoneCore will not store any settings. * @param[in] factory_config_path A path to a read-only config file that can be used to store hard-coded preferences * such as proxy settings or internal preferences. The settings in this factory file always override the ones in the * normal config file. It is optional, use NULL if unneeded. @@ -127,15 +127,15 @@ LINPHONE_PUBLIC LinphoneCore *linphone_factory_create_core_3 ( ); /** - * Instantiates a LinphoneCore object with a given LpConfig. + * Instantiates a #LinphoneCore object with a given LpConfig. * * @param factory The #LinphoneFactory singleton. - * The LinphoneCore object is the primary handle for doing all phone actions. + * The #LinphoneCore object is the primary handle for doing all phone actions. * It should be unique within your application. * @param cbs a #LinphoneCoreCbs object holding your application callbacks. A reference * will be taken on it until the destruciton of the core or the unregistration * with linphone_core_remove_cbs(). - * @param config a pointer to an LpConfig object holding the configuration of the LinphoneCore to be instantiated. + * @param config a pointer to an LpConfig object holding the configuration of the #LinphoneCore to be instantiated. * @see linphone_core_new * @deprecated 2018-01-10: Use linphone_factory_create_core_with_config_3() instead */ @@ -146,15 +146,15 @@ LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneCore *linphone_factory_create_core_w ); /** - * Instantiates a LinphoneCore object with a given LpConfig. + * Instantiates a #LinphoneCore object with a given LpConfig. * * @param factory The #LinphoneFactory singleton. - * The LinphoneCore object is the primary handle for doing all phone actions. + * The #LinphoneCore object is the primary handle for doing all phone actions. * It should be unique within your application. * @param cbs a #LinphoneCoreCbs object holding your application callbacks. A reference * will be taken on it until the destruciton of the core or the unregistration * with linphone_core_remove_cbs(). - * @param config a pointer to an LpConfig object holding the configuration of the LinphoneCore to be instantiated. + * @param config a pointer to an LpConfig object holding the configuration of the #LinphoneCore to be instantiated. * @param user_data an application pointer associated with the returned core. * @param system_context a pointer to a system object required by the core to operate. Currently it is required to pass an android Context on android, pass NULL on other platforms. * @see linphone_core_new @@ -169,13 +169,13 @@ LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneCore *linphone_factory_create_core_w ); /** - * Instantiate a LinphoneCore object with a given LinphoneConfig. + * Instantiate a #LinphoneCore object with a given LinphoneConfig. * - * The LinphoneCore object is the primary handle for doing all phone actions. It should be unique within your + * The #LinphoneCore object is the primary handle for doing all phone actions. It should be unique within your * application. - * The LinphoneCore object is not started automatically, you need to call linphone_core_start() to that effect. + * The #LinphoneCore object is not started automatically, you need to call linphone_core_start() to that effect. * @param[in] factory The #LinphoneFactory singleton. - * @param[in] config A #LinphoneConfig object holding the configuration for the LinphoneCore to be instantiated. + * @param[in] config A #LinphoneConfig object holding the configuration for the #LinphoneCore to be instantiated. * @param[in] system_context A pointer to a system object required by the core to operate. Currently it is required to * pass an android Context on android, pass NULL on other platforms. * @see linphone_factory_create_core_3 @@ -212,15 +212,15 @@ LINPHONE_PUBLIC LinphoneAddress *linphone_factory_create_address(const LinphoneF * @param ha1 The ha1-encrypted password if password is not given in clear text. * @param realm The authentication domain (which can be larger than the sip domain. Unfortunately many SIP servers don't use this parameter. * @param domain The SIP domain for which this authentication information is valid, if it has to be restricted for a single SIP domain. - * @return A #LinphoneAuthInfo object. linphone_auth_info_destroy() must be used to destroy it when no longer needed. The LinphoneCore makes a copy of LinphoneAuthInfo + * @return A #LinphoneAuthInfo object. linphone_auth_info_destroy() must be used to destroy it when no longer needed. The #LinphoneCore makes a copy of #LinphoneAuthInfo * passed through linphone_core_add_auth_info(). */ LINPHONE_PUBLIC LinphoneAuthInfo *linphone_factory_create_auth_info(const LinphoneFactory *factory, const char *username, const char *userid, const char *passwd, const char *ha1, const char *realm, const char *domain); /** - * Create a LinphoneCallCbs object that holds callbacks for events happening on a call. - * @param[in] factory LinphoneFactory singletion object - * @return A new LinphoneCallCbs object + * Create a #LinphoneCallCbs object that holds callbacks for events happening on a call. + * @param[in] factory #LinphoneFactory singletion object + * @return A new #LinphoneCallCbs object */ LINPHONE_PUBLIC LinphoneCallCbs * linphone_factory_create_call_cbs(const LinphoneFactory *factory); @@ -232,32 +232,32 @@ LINPHONE_PUBLIC LinphoneCallCbs * linphone_factory_create_call_cbs(const Linphon LINPHONE_PUBLIC LinphoneVcard *linphone_factory_create_vcard(LinphoneFactory *factory); /** - * Create a LinphoneVideoDefinition from a given width and height - * @param[in] factory LinphoneFactory singleton object + * Create a #LinphoneVideoDefinition from a given width and height + * @param[in] factory #LinphoneFactory singleton object * @param[in] width The width of the created video definition * @param[in] height The height of the created video definition - * @return A new LinphoneVideoDefinition object + * @return A new #LinphoneVideoDefinition object */ LINPHONE_PUBLIC LinphoneVideoDefinition * linphone_factory_create_video_definition(const LinphoneFactory *factory, unsigned int width, unsigned int height); /** - * Create a LinphoneVideoDefinition from a given standard definition name - * @param[in] factory LinphoneFactory singleton object + * Create a #LinphoneVideoDefinition from a given standard definition name + * @param[in] factory #LinphoneFactory singleton object * @param[in] name The standard definition name of the video definition to create - * @return A new LinphoneVideoDefinition object + * @return A new #LinphoneVideoDefinition object */ LINPHONE_PUBLIC LinphoneVideoDefinition * linphone_factory_create_video_definition_from_name(const LinphoneFactory *factory, const char *name); /** * Get the list of standard video definitions supported by Linphone. - * @param[in] factory LinphoneFactory singleton object + * @param[in] factory #LinphoneFactory singleton object * @return \bctbx_list{LinphoneVideoDefinition} */ LINPHONE_PUBLIC const bctbx_list_t * linphone_factory_get_supported_video_definitions(const LinphoneFactory *factory); /** * Get the top directory where the resources are located. - * @param[in] factory LinphoneFactory object + * @param[in] factory #LinphoneFactory object * @return The path to the top directory where the resources are located */ LINPHONE_PUBLIC const char * linphone_factory_get_top_resources_dir(const LinphoneFactory *factory); @@ -265,195 +265,195 @@ LINPHONE_PUBLIC const char * linphone_factory_get_top_resources_dir(const Linpho /** * Set the top directory where the resources are located. * If you only define this top directory, the other resources directory will automatically be derived form this one. - * @param[in] factory LinphoneFactory object + * @param[in] factory #LinphoneFactory object * @param[in] path The path to the top directory where the resources are located */ LINPHONE_PUBLIC void linphone_factory_set_top_resources_dir(LinphoneFactory *factory, const char *path); /** * Get the directory where the data resources are located. - * @param[in] factory LinphoneFactory object + * @param[in] factory #LinphoneFactory object * @return The path to the directory where the data resources are located */ LINPHONE_PUBLIC const char * linphone_factory_get_data_resources_dir(LinphoneFactory *factory); /** * Set the directory where the data resources are located. - * @param[in] factory LinphoneFactory object + * @param[in] factory #LinphoneFactory object * @param[in] path The path where the data resources are located */ LINPHONE_PUBLIC void linphone_factory_set_data_resources_dir(LinphoneFactory *factory, const char *path); /** * Get the directory where the sound resources are located. - * @param[in] factory LinphoneFactory object + * @param[in] factory #LinphoneFactory object * @return The path to the directory where the sound resources are located */ LINPHONE_PUBLIC const char * linphone_factory_get_sound_resources_dir(LinphoneFactory *factory); /** * Set the directory where the sound resources are located. - * @param[in] factory LinphoneFactory object + * @param[in] factory #LinphoneFactory object * @param[in] path The path where the sound resources are located */ LINPHONE_PUBLIC void linphone_factory_set_sound_resources_dir(LinphoneFactory *factory, const char *path); /** * Get the directory where the ring resources are located. - * @param[in] factory LinphoneFactory object + * @param[in] factory #LinphoneFactory object * @return The path to the directory where the ring resources are located */ LINPHONE_PUBLIC const char * linphone_factory_get_ring_resources_dir(LinphoneFactory *factory); /** * Set the directory where the ring resources are located. - * @param[in] factory LinphoneFactory object + * @param[in] factory #LinphoneFactory object * @param[in] path The path where the ring resources are located */ LINPHONE_PUBLIC void linphone_factory_set_ring_resources_dir(LinphoneFactory *factory, const char *path); /** * Get the directory where the image resources are located. - * @param[in] factory LinphoneFactory object + * @param[in] factory #LinphoneFactory object * @return The path to the directory where the image resources are located */ LINPHONE_PUBLIC const char * linphone_factory_get_image_resources_dir(LinphoneFactory *factory); /** * Set the directory where the image resources are located. - * @param[in] factory LinphoneFactory object + * @param[in] factory #LinphoneFactory object * @param[in] path The path where the image resources are located */ LINPHONE_PUBLIC void linphone_factory_set_image_resources_dir(LinphoneFactory *factory, const char *path); /** * Get the directory where the mediastreamer2 plugins are located. - * @param[in] factory LinphoneFactory object + * @param[in] factory #LinphoneFactory object * @return The path to the directory where the mediastreamer2 plugins are located, or NULL if it has not been set */ LINPHONE_PUBLIC const char * linphone_factory_get_msplugins_dir(LinphoneFactory *factory); /** * Set the directory where the mediastreamer2 plugins are located. - * @param[in] factory LinphoneFactory object + * @param[in] factory #LinphoneFactory object * @param[in] path The path to the directory where the mediastreamer2 plugins are located */ LINPHONE_PUBLIC void linphone_factory_set_msplugins_dir(LinphoneFactory *factory, const char *path); /** * Creates an object LinphoneErrorInfo. - * @param[in] factory LinphoneFactory object - * @return LinphoneErrorInfo object. + * @param[in] factory #LinphoneFactory object + * @return #LinphoneErrorInfo object. */ LINPHONE_PUBLIC LinphoneErrorInfo *linphone_factory_create_error_info(LinphoneFactory *factory); /** * Creates an object LinphoneRange. - * @param[in] factory LinphoneFactory object - * @return LinphoneRange object. + * @param[in] factory #LinphoneFactory object + * @return #LinphoneRange object. */ LINPHONE_PUBLIC LinphoneRange *linphone_factory_create_range(LinphoneFactory *factory); /** * Creates an object LinphoneTransports. - * @param[in] factory LinphoneFactory object - * @return LinphoneTransports object. + * @param[in] factory #LinphoneFactory object + * @return #LinphoneTransports object. */ LINPHONE_PUBLIC LinphoneTransports *linphone_factory_create_transports(LinphoneFactory *factory); /** * Creates an object LinphoneVideoActivationPolicy. - * @param[in] factory LinphoneFactory object - * @return LinphoneVideoActivationPolicy object. + * @param[in] factory #LinphoneFactory object + * @return #LinphoneVideoActivationPolicy object. */ LINPHONE_PUBLIC LinphoneVideoActivationPolicy *linphone_factory_create_video_activation_policy(LinphoneFactory *factory); /** * Returns a bctbx_list_t of all DialPlans - * @param[in] factory the LinphoneFactory object + * @param[in] factory the #LinphoneFactory object * @return \bctbx_list{LinphoneDialPlan} a list of DialPlan */ LINPHONE_PUBLIC const bctbx_list_t * linphone_factory_get_dial_plans(const LinphoneFactory *factory); /** - * Creates an object LinphoneContent - * @param[in] factory the LinphoneFactory - * @return a LinphoneContent + * Creates an object #LinphoneContent + * @param[in] factory the #LinphoneFactory + * @return a #LinphoneContent */ LINPHONE_PUBLIC LinphoneContent *linphone_factory_create_content(LinphoneFactory *factory); /** - * Creates an object LinphoneBuffer - * @param[in] factory the LinphoneFactory - * @return a LinphoneBuffer + * Creates an object #LinphoneBuffer + * @param[in] factory the #LinphoneFactory + * @return a #LinphoneBuffer */ LINPHONE_PUBLIC LinphoneBuffer *linphone_factory_create_buffer(LinphoneFactory *factory); /** - * Creates an object LinphoneBuffer - * @param[in] factory the LinphoneFactory + * Creates an object #LinphoneBuffer + * @param[in] factory the #LinphoneFactory * @param[in] data the data to set in the buffer * @param[in] size the size of the data - * @return a LinphoneBuffer + * @return a #LinphoneBuffer */ LINPHONE_PUBLIC LinphoneBuffer *linphone_factory_create_buffer_from_data(LinphoneFactory *factory, const uint8_t *data, size_t size); /** - * Creates an object LinphoneBuffer - * @param[in] factory the LinphoneFactory + * Creates an object #LinphoneBuffer + * @param[in] factory the #LinphoneFactory * @param[in] data the data to set in the buffer - * @return a LinphoneBuffer + * @return a #LinphoneBuffer */ LINPHONE_PUBLIC LinphoneBuffer *linphone_factory_create_buffer_from_string(LinphoneFactory *factory, const char *data); /** - * Creates an object LinphoneConfig - * @param[in] factory the LinphoneFactory + * Creates an object #LinphoneConfig + * @param[in] factory the #LinphoneFactory * @param[in] the path of the config - * @return a LinphoneConfig + * @return a #LinphoneConfig */ LINPHONE_PUBLIC LinphoneConfig *linphone_factory_create_config(LinphoneFactory *factory, const char *path); /** - * Creates an object LinphoneConfig - * @param[in] factory the LinphoneFactory + * Creates an object #LinphoneConfig + * @param[in] factory the #LinphoneFactory * @param[in] the path of the config * @param[in] the path of the factory - * @return a LinphoneConfig + * @return a #LinphoneConfig */ LINPHONE_PUBLIC LinphoneConfig *linphone_factory_create_config_with_factory(LinphoneFactory *factory, const char *path, const char *factory_path); /** - * Creates an object LinphoneConfig - * @param[in] factory the LinphoneFactory - * @return a LinphoneConfig + * Creates an object #LinphoneConfig + * @param[in] factory the #LinphoneFactory + * @return a #LinphoneConfig */ LINPHONE_PUBLIC LinphoneConfig *linphone_factory_create_config_from_string(LinphoneFactory *factory, const char *data); /** - * Gets the user data in the LinphoneFactory object - * @param[in] factory the LinphoneFactory + * Gets the user data in the #LinphoneFactory object + * @param[in] factory the #LinphoneFactory * @return the user data */ LINPHONE_PUBLIC void *linphone_factory_get_user_data(const LinphoneFactory *factory); /** - * Sets the user data in the LinphoneFactory object - * @param[in] factory the LinphoneFactory object + * Sets the user data in the #LinphoneFactory object + * @param[in] factory the #LinphoneFactory object * @param[in] data the user data */ LINPHONE_PUBLIC void linphone_factory_set_user_data(LinphoneFactory *factory, void *data); /** * Sets the log collection path - * @param[in] factory the LinphoneFactory + * @param[in] factory the #LinphoneFactory * @param[in] the path of the logs */ LINPHONE_PUBLIC void linphone_factory_set_log_collection_path(LinphoneFactory *factory, const char *path); /** * Enables or disables log collection - * @param[in] factory the LinphoneFactory + * @param[in] factory the #LinphoneFactory * @param[in] the policy for log collection */ LINPHONE_PUBLIC void linphone_factory_enable_log_collection(LinphoneFactory *factory, LinphoneLogCollectionState state); diff --git a/include/linphone/friend.h b/include/linphone/friend.h index b4edf3835..b87636260 100644 --- a/include/linphone/friend.h +++ b/include/linphone/friend.h @@ -56,7 +56,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneFriend *linphone_friend_new_with_add /** * Destroy a LinphoneFriend. - * @param lf LinphoneFriend object + * @param lf #LinphoneFriend object * @deprecated Use linphone_friend_unref() instead. * @donotwrap */ @@ -77,7 +77,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_friend_set_address(LinphoneFriend *fr, c /** * Get address of this friend. - * @note the LinphoneAddress object returned is hold by the LinphoneFriend, however calling several time this function may return different objects. + * @note the #LinphoneAddress object returned is hold by the LinphoneFriend, however calling several time this function may return different objects. * @param lf #LinphoneFriend object * @return #LinphoneAddress */ @@ -215,7 +215,7 @@ LINPHONE_PUBLIC const LinphonePresenceModel * linphone_friend_get_presence_model /** * Get the consolidated presence of a friend. - * @param[in] lf LinphoneFriend object + * @param[in] lf #LinphoneFriend object * @return The consolidated presence of the friend */ LINPHONE_PUBLIC LinphoneConsolidatedPresence linphone_friend_get_consolidated_presence(const LinphoneFriend *lf); @@ -285,39 +285,39 @@ LINPHONE_PUBLIC bool_t linphone_friend_in_list(const LinphoneFriend *lf); /** * Acquire a reference to the linphone friend. - * @param[in] lf LinphoneFriend object - * @return The same LinphoneFriend object + * @param[in] lf #LinphoneFriend object + * @return The same #LinphoneFriend object **/ LINPHONE_PUBLIC LinphoneFriend * linphone_friend_ref(LinphoneFriend *lf); /** * Release a reference to the linphone friend. - * @param[in] lf LinphoneFriend object + * @param[in] lf #LinphoneFriend object **/ LINPHONE_PUBLIC void linphone_friend_unref(LinphoneFriend *lf); /** - * Returns the LinphoneCore object managing this friend, if any. - * @param[in] fr LinphoneFriend object + * Returns the #LinphoneCore object managing this friend, if any. + * @param[in] fr #LinphoneFriend object */ LINPHONE_PUBLIC LinphoneCore *linphone_friend_get_core(const LinphoneFriend *fr); /** * Returns the vCard object associated to this friend, if any - * @param[in] fr LinphoneFriend object + * @param[in] fr #LinphoneFriend object */ LINPHONE_PUBLIC LinphoneVcard* linphone_friend_get_vcard(LinphoneFriend *fr); /** * Binds a vCard object to a friend - * @param[in] fr LinphoneFriend object + * @param[in] fr #LinphoneFriend object * @param[in] vcard The vCard object to bind */ LINPHONE_PUBLIC void linphone_friend_set_vcard(LinphoneFriend *fr, LinphoneVcard *vcard); /** * Creates a vCard object associated to this friend if there isn't one yet and if the full name is available, either by the parameter or the one in the friend's SIP URI - * @param[in] fr LinphoneFriend object + * @param[in] fr #LinphoneFriend object * @param[in] name The full name of the friend or NULL to use the one from the friend's SIP URI * @return true if the vCard has been created, false if it wasn't possible (for exemple if name and the friend's SIP URI are null or if the friend's SIP URI doesn't have a display name), or if there is already one vcard */ diff --git a/include/linphone/friendlist.h b/include/linphone/friendlist.h index 1780e8723..b64536717 100644 --- a/include/linphone/friendlist.h +++ b/include/linphone/friendlist.h @@ -36,126 +36,126 @@ extern "C" { /** * Acquire a reference to the friend list. - * @param[in] list LinphoneFriendList object. - * @return The same LinphoneFriendList object. + * @param[in] list #LinphoneFriendList object. + * @return The same #LinphoneFriendList object. **/ LINPHONE_PUBLIC LinphoneFriendList * linphone_friend_list_ref(LinphoneFriendList *list); /** * Release reference to the friend list. - * @param[in] list LinphoneFriendList object. + * @param[in] list #LinphoneFriendList object. **/ LINPHONE_PUBLIC void linphone_friend_list_unref(LinphoneFriendList *list); /** * Retrieve the user pointer associated with the friend list. - * @param[in] list LinphoneFriendList object. + * @param[in] list #LinphoneFriendList object. * @return The user pointer associated with the friend list. **/ LINPHONE_PUBLIC void * linphone_friend_list_get_user_data(const LinphoneFriendList *list); /** * Assign a user pointer to the friend list. - * @param[in] list LinphoneFriendList object. + * @param[in] list #LinphoneFriendList object. * @param[in] ud The user pointer to associate with the friend list. **/ LINPHONE_PUBLIC void linphone_friend_list_set_user_data(LinphoneFriendList *list, void *ud); /** * Get the display name of the friend list. - * @param[in] list LinphoneFriendList object. + * @param[in] list #LinphoneFriendList object. * @return The display name of the friend list. **/ LINPHONE_PUBLIC const char * linphone_friend_list_get_display_name(const LinphoneFriendList *list); /** * Set the display name of the friend list. - * @param[in] list LinphoneFriendList object. + * @param[in] list #LinphoneFriendList object. * @param[in] display_name The new display name of the friend list. **/ LINPHONE_PUBLIC void linphone_friend_list_set_display_name(LinphoneFriendList *list, const char *display_name); /** * Get the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence. - * @param[in] list LinphoneFriendList object. + * @param[in] list #LinphoneFriendList object. * @return The RLS URI associated with the friend list. **/ LINPHONE_PUBLIC const char * linphone_friend_list_get_rls_uri(const LinphoneFriendList *list); /** * Set the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence. - * @param[in] list LinphoneFriendList object. + * @param[in] list #LinphoneFriendList object. * @param[in] rls_uri The RLS URI to associate with the friend list. **/ LINPHONE_PUBLIC void linphone_friend_list_set_rls_uri(LinphoneFriendList *list, const char *rls_uri); /** * Get the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence. - * @param[in] list LinphoneFriendList object. + * @param[in] list #LinphoneFriendList object. * @return The RLS URI associated with the friend list. **/ LINPHONE_PUBLIC const LinphoneAddress * linphone_friend_list_get_rls_address(const LinphoneFriendList *list); /** * Set the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence. - * @param[in] list LinphoneFriendList object. + * @param[in] list #LinphoneFriendList object. * @param[in] rls_addr The RLS URI to associate with the friend list. **/ LINPHONE_PUBLIC void linphone_friend_list_set_rls_address(LinphoneFriendList *list, const LinphoneAddress *rls_addr); /** * Add a friend to a friend list. If or when a remote CardDAV server will be attached to the list, the friend will be sent to the server. - * @param[in] list LinphoneFriendList object. - * @param[in] lf LinphoneFriend object to add to the friend list. - * @return LinphoneFriendListOK if successfully added, LinphoneFriendListInvalidFriend if the friend is not valid. + * @param[in] list #LinphoneFriendList object. + * @param[in] lf #LinphoneFriend object to add to the friend list. + * @return #LinphoneFriendListOK if successfully added, #LinphoneFriendListInvalidFriend if the friend is not valid. **/ LINPHONE_PUBLIC LinphoneFriendListStatus linphone_friend_list_add_friend(LinphoneFriendList *list, LinphoneFriend *lf); /** * Add a friend to a friend list. The friend will never be sent to a remote CardDAV server. - * Warning! LinphoneFriends added this way will be removed on the next synchronization, and the callback contact_deleted will be called. - * @param[in] list LinphoneFriendList object. - * @param[in] lf LinphoneFriend object to add to the friend list. - * @return LinphoneFriendListOK if successfully added, LinphoneFriendListInvalidFriend if the friend is not valid. + * Warning! #LinphoneFriends added this way will be removed on the next synchronization, and the callback contact_deleted will be called. + * @param[in] list #LinphoneFriendList object. + * @param[in] lf #LinphoneFriend object to add to the friend list. + * @return #LinphoneFriendListOK if successfully added, #LinphoneFriendListInvalidFriend if the friend is not valid. **/ LINPHONE_PUBLIC LinphoneFriendListStatus linphone_friend_list_add_local_friend(LinphoneFriendList *list, LinphoneFriend *lf); /** * Remove a friend from a friend list. - * @param[in] list LinphoneFriendList object. - * @param[in] lf LinphoneFriend object to remove from the friend list. - * @return LinphoneFriendListOK if removed successfully, LinphoneFriendListNonExistentFriend if the friend is not in the list. + * @param[in] list #LinphoneFriendList object. + * @param[in] lf #LinphoneFriend object to remove from the friend list. + * @return #LinphoneFriendListOK if removed successfully, #LinphoneFriendListNonExistentFriend if the friend is not in the list. **/ LINPHONE_PUBLIC LinphoneFriendListStatus linphone_friend_list_remove_friend(LinphoneFriendList *list, LinphoneFriend *lf); /** - * Retrieves the list of LinphoneFriend from this LinphoneFriendList. - * @param[in] list LinphoneFriendList object - * @return \bctbx_list{LinphoneFriend} a list of LinphoneFriend + * Retrieves the list of #LinphoneFriend from this LinphoneFriendList. + * @param[in] list #LinphoneFriendList object + * @return \bctbx_list{LinphoneFriend} a list of #LinphoneFriend */ LINPHONE_PUBLIC const bctbx_list_t * linphone_friend_list_get_friends(const LinphoneFriendList *list); /** * Find a friend in the friend list using a LinphoneAddress. - * @param[in] list LinphoneFriendList object. - * @param[in] address LinphoneAddress object of the friend we want to search for. - * @return A LinphoneFriend if found, NULL otherwise. + * @param[in] list #LinphoneFriendList object. + * @param[in] address #LinphoneAddress object of the friend we want to search for. + * @return A #LinphoneFriend if found, NULL otherwise. **/ LINPHONE_PUBLIC LinphoneFriend * linphone_friend_list_find_friend_by_address(const LinphoneFriendList *list, const LinphoneAddress *address); /** * Find a friend in the friend list using an URI string. - * @param[in] list LinphoneFriendList object. + * @param[in] list #LinphoneFriendList object. * @param[in] uri A string containing the URI of the friend we want to search for. - * @return A LinphoneFriend if found, NULL otherwise. + * @return A #LinphoneFriend if found, NULL otherwise. **/ LINPHONE_PUBLIC LinphoneFriend * linphone_friend_list_find_friend_by_uri(const LinphoneFriendList *list, const char *uri); /** * Find a friend in the friend list using a ref key. - * @param[in] list LinphoneFriendList object. + * @param[in] list #LinphoneFriendList object. * @param[in] ref_key The ref key string of the friend we want to search for. - * @return A LinphoneFriend if found, NULL otherwise. + * @return A #LinphoneFriend if found, NULL otherwise. **/ LINPHONE_PUBLIC LinphoneFriend * linphone_friend_list_find_friend_by_ref_key(const LinphoneFriendList *list, const char *ref_key); @@ -168,174 +168,174 @@ LINPHONE_PUBLIC void linphone_friend_list_update_subscriptions(LinphoneFriendLis /** * Notify our presence to all the friends in the friend list that have subscribed to our presence directly (not using a RLS). - * @param[in] list LinphoneFriendList object. - * @param[in] presence LinphonePresenceModel object. + * @param[in] list #LinphoneFriendList object. + * @param[in] presence #LinphonePresenceModel object. **/ LINPHONE_PUBLIC void linphone_friend_list_notify_presence(LinphoneFriendList *list, LinphonePresenceModel *presence); /** * Get the URI associated with the friend list. - * @param[in] list LinphoneFriendList object. + * @param[in] list #LinphoneFriendList object. * @return The URI associated with the friend list. **/ LINPHONE_PUBLIC const char * linphone_friend_list_get_uri(const LinphoneFriendList *list); /** * Set the URI associated with the friend list. - * @param[in] list LinphoneFriendList object. + * @param[in] list #LinphoneFriendList object. * @param[in] uri The URI to associate with the friend list. **/ LINPHONE_PUBLIC void linphone_friend_list_set_uri(LinphoneFriendList *list, const char *uri); /** * Sets the revision from the last synchronization. - * @param[in] list LinphoneFriendList object. + * @param[in] list #LinphoneFriendList object. * @param[in] rev The revision */ LINPHONE_PUBLIC void linphone_friend_list_update_revision(LinphoneFriendList *list, int rev); /** - * Get the LinphoneFriendListCbs object associated with a LinphoneFriendList. - * @param[in] list LinphoneFriendList object - * @return The LinphoneFriendListCbs object associated with the LinphoneFriendList. + * Get the #LinphoneFriendListCbs object associated with a LinphoneFriendList. + * @param[in] list #LinphoneFriendList object + * @return The #LinphoneFriendListCbs object associated with the LinphoneFriendList. **/ LINPHONE_PUBLIC LinphoneFriendListCbs * linphone_friend_list_get_callbacks(const LinphoneFriendList *list); /** - * Acquire a reference to a LinphoneFriendListCbs object. - * @param[in] cbs LinphoneFriendListCbs object. - * @return The same LinphoneFriendListCbs object. + * Acquire a reference to a #LinphoneFriendListCbs object. + * @param[in] cbs #LinphoneFriendListCbs object. + * @return The same #LinphoneFriendListCbs object. **/ LINPHONE_PUBLIC LinphoneFriendListCbs * linphone_friend_list_cbs_ref(LinphoneFriendListCbs *cbs); /** - * Release a reference to a LinphoneFriendListCbs object. - * @param[in] cbs LinphoneFriendListCbs object. + * Release a reference to a #LinphoneFriendListCbs object. + * @param[in] cbs #LinphoneFriendListCbs object. **/ LINPHONE_PUBLIC void linphone_friend_list_cbs_unref(LinphoneFriendListCbs *cbs); /** - * Retrieve the user pointer associated with a LinphoneFriendListCbs object. - * @param[in] cbs LinphoneFriendListCbs object. - * @return The user pointer associated with the LinphoneFriendListCbs object. + * Retrieve the user pointer associated with a #LinphoneFriendListCbs object. + * @param[in] cbs #LinphoneFriendListCbs object. + * @return The user pointer associated with the #LinphoneFriendListCbs object. **/ LINPHONE_PUBLIC void *linphone_friend_list_cbs_get_user_data(const LinphoneFriendListCbs *cbs); /** - * Assign a user pointer to a LinphoneFriendListCbs object. - * @param[in] cbs LinphoneFriendListCbs object. - * @param[in] ud The user pointer to associate with the LinphoneFriendListCbs object. + * Assign a user pointer to a #LinphoneFriendListCbs object. + * @param[in] cbs #LinphoneFriendListCbs object. + * @param[in] ud The user pointer to associate with the #LinphoneFriendListCbs object. **/ LINPHONE_PUBLIC void linphone_friend_list_cbs_set_user_data(LinphoneFriendListCbs *cbs, void *ud); /** * Get the contact created callback. - * @param[in] cbs LinphoneFriendListCbs object. + * @param[in] cbs #LinphoneFriendListCbs object. * @return The current contact created callback. **/ LINPHONE_PUBLIC LinphoneFriendListCbsContactCreatedCb linphone_friend_list_cbs_get_contact_created(const LinphoneFriendListCbs *cbs); /** * Set the contact created callback. - * @param[in] cbs LinphoneFriendListCbs object. + * @param[in] cbs #LinphoneFriendListCbs object. * @param[in] cb The contact created to be used. **/ LINPHONE_PUBLIC void linphone_friend_list_cbs_set_contact_created(LinphoneFriendListCbs *cbs, LinphoneFriendListCbsContactCreatedCb cb); /** * Get the contact deleted callback. - * @param[in] cbs LinphoneFriendListCbs object. + * @param[in] cbs #LinphoneFriendListCbs object. * @return The current contact deleted callback. **/ LINPHONE_PUBLIC LinphoneFriendListCbsContactDeletedCb linphone_friend_list_cbs_get_contact_deleted(const LinphoneFriendListCbs *cbs); /** * Set the contact deleted callback. - * @param[in] cbs LinphoneFriendListCbs object. + * @param[in] cbs #LinphoneFriendListCbs object. * @param[in] cb The contact deleted to be used. **/ LINPHONE_PUBLIC void linphone_friend_list_cbs_set_contact_deleted(LinphoneFriendListCbs *cbs, LinphoneFriendListCbsContactDeletedCb cb); /** * Get the contact updated callback. - * @param[in] cbs LinphoneFriendListCbs object. + * @param[in] cbs #LinphoneFriendListCbs object. * @return The current contact updated callback. **/ LINPHONE_PUBLIC LinphoneFriendListCbsContactUpdatedCb linphone_friend_list_cbs_get_contact_updated(const LinphoneFriendListCbs *cbs); /** * Set the contact updated callback. - * @param[in] cbs LinphoneFriendListCbs object. + * @param[in] cbs #LinphoneFriendListCbs object. * @param[in] cb The contact updated to be used. **/ LINPHONE_PUBLIC void linphone_friend_list_cbs_set_contact_updated(LinphoneFriendListCbs *cbs, LinphoneFriendListCbsContactUpdatedCb cb); /** * Get the sync status changed callback. - * @param[in] cbs LinphoneFriendListCbs object. + * @param[in] cbs #LinphoneFriendListCbs object. * @return The current sync status changedcallback. **/ LINPHONE_PUBLIC LinphoneFriendListCbsSyncStateChangedCb linphone_friend_list_cbs_get_sync_status_changed(const LinphoneFriendListCbs *cbs); /** * Set the contact updated callback. - * @param[in] cbs LinphoneFriendListCbs object. + * @param[in] cbs #LinphoneFriendListCbs object. * @param[in] cb The sync status changed to be used. **/ LINPHONE_PUBLIC void linphone_friend_list_cbs_set_sync_status_changed(LinphoneFriendListCbs *cbs, LinphoneFriendListCbsSyncStateChangedCb cb); /** * Starts a CardDAV synchronization using value set using linphone_friend_list_set_uri. - * @param[in] list LinphoneFriendList object. + * @param[in] list #LinphoneFriendList object. */ LINPHONE_PUBLIC void linphone_friend_list_synchronize_friends_from_server(LinphoneFriendList *list); /** - * Goes through all the LinphoneFriend that are dirty and does a CardDAV PUT to update the server. - * @param[in] list LinphoneFriendList object. + * Goes through all the #LinphoneFriend that are dirty and does a CardDAV PUT to update the server. + * @param[in] list #LinphoneFriendList object. */ LINPHONE_PUBLIC void linphone_friend_list_update_dirty_friends(LinphoneFriendList *list); /** - * Returns the LinphoneCore object attached to this LinphoneFriendList. - * @param[in] list LinphoneFriendList object. - * @return a LinphoneCore object + * Returns the #LinphoneCore object attached to this LinphoneFriendList. + * @param[in] list #LinphoneFriendList object. + * @return a #LinphoneCore object */ LINPHONE_PUBLIC LinphoneCore* linphone_friend_list_get_core(const LinphoneFriendList *list); /** - * Creates and adds LinphoneFriend objects to LinphoneFriendList from a file that contains the vCard(s) to parse - * @param[in] list the LinphoneFriendList object + * Creates and adds #LinphoneFriend objects to #LinphoneFriendList from a file that contains the vCard(s) to parse + * @param[in] list the #LinphoneFriendList object * @param[in] vcard_file the path to a file that contains the vCard(s) to parse * @return the amount of linphone friends created */ LINPHONE_PUBLIC LinphoneStatus linphone_friend_list_import_friends_from_vcard4_file(LinphoneFriendList *list, const char *vcard_file); /** - * Creates and adds LinphoneFriend objects to LinphoneFriendList from a buffer that contains the vCard(s) to parse - * @param[in] list the LinphoneFriendList object + * Creates and adds #LinphoneFriend objects to #LinphoneFriendList from a buffer that contains the vCard(s) to parse + * @param[in] list the #LinphoneFriendList object * @param[in] vcard_buffer the buffer that contains the vCard(s) to parse * @return the amount of linphone friends created */ LINPHONE_PUBLIC LinphoneStatus linphone_friend_list_import_friends_from_vcard4_buffer(LinphoneFriendList *list, const char *vcard_buffer); /** - * Creates and export LinphoneFriend objects from LinphoneFriendList to a file using vCard 4 format - * @param[in] list the LinphoneFriendList object + * Creates and export #LinphoneFriend objects from #LinphoneFriendList to a file using vCard 4 format + * @param[in] list the #LinphoneFriendList object * @param[in] vcard_file the path to a file that will contain the vCards */ LINPHONE_PUBLIC void linphone_friend_list_export_friends_as_vcard4_file(LinphoneFriendList *list, const char *vcard_file); /** * Enable subscription to NOTIFYes of all friends list - * @param[in] list the LinphoneFriendList object + * @param[in] list the #LinphoneFriendList object * @param[in] enabled should subscription be enabled or not */ LINPHONE_PUBLIC void linphone_friend_list_enable_subscriptions(LinphoneFriendList *list, bool_t enabled); /** * Gets whether subscription to NOTIFYes of all friends list are enabled or not - * @param[in] list the LinphoneFriendList object + * @param[in] list the #LinphoneFriendList object * @return Whether subscriptions are enabled or not */ LINPHONE_PUBLIC bool_t linphone_friend_list_subscriptions_enabled(LinphoneFriendList *list); diff --git a/include/linphone/headers.h b/include/linphone/headers.h index f2b20aa56..986eb90b7 100644 --- a/include/linphone/headers.h +++ b/include/linphone/headers.h @@ -46,7 +46,7 @@ LINPHONE_PUBLIC void linphone_headers_unref(LinphoneHeaders *obj); /** * Search for a given header name and return its value. - * @param obj the LinphoneHeaders object + * @param obj the #LinphoneHeaders object * @param name the header's name * @return the header's value or NULL if not found. **/ @@ -55,7 +55,7 @@ LINPHONE_PUBLIC const char* linphone_headers_get_value(LinphoneHeaders *obj, con /** * Add given header name and corresponding value. - * @param obj the LinphoneHeaders object + * @param obj the #LinphoneHeaders object * @param name the header's name * @param the header's value **/ @@ -63,7 +63,7 @@ LINPHONE_PUBLIC void linphone_headers_add(LinphoneHeaders *obj, const char *name /** * Add given header name and corresponding value. - * @param obj the LinphoneHeaders object + * @param obj the #LinphoneHeaders object * @param name the header's name * @param the header's value **/ diff --git a/include/linphone/im_encryption_engine.h b/include/linphone/im_encryption_engine.h index 2a39661a9..8a6bc53b6 100644 --- a/include/linphone/im_encryption_engine.h +++ b/include/linphone/im_encryption_engine.h @@ -33,30 +33,30 @@ extern "C" { /** * Acquire a reference to the LinphoneImEncryptionEngineCbs. - * @param[in] cbs LinphoneImEncryptionEngineCbs object. - * @return The same LinphoneImEncryptionEngineCbs object. + * @param[in] cbs #LinphoneImEncryptionEngineCbs object. + * @return The same #LinphoneImEncryptionEngineCbs object. * @donotwrap **/ LinphoneImEncryptionEngineCbs * linphone_im_encryption_engine_cbs_ref(LinphoneImEncryptionEngineCbs *cbs); /** * Release reference to the LinphoneImEncryptionEngineCbs. - * @param[in] cbs LinphoneImEncryptionEngineCbs object. + * @param[in] cbs #LinphoneImEncryptionEngineCbs object. * @donotwrap **/ void linphone_im_encryption_engine_cbs_unref(LinphoneImEncryptionEngineCbs *cbs); /** - * Gets the user data in the LinphoneImEncryptionEngineCbs object - * @param[in] cbs the LinphoneImEncryptionEngineCbs + * Gets the user data in the #LinphoneImEncryptionEngineCbs object + * @param[in] cbs the #LinphoneImEncryptionEngineCbs * @return the user data * @donotwrap */ LINPHONE_PUBLIC void *linphone_im_encryption_engine_cbs_get_user_data(const LinphoneImEncryptionEngineCbs *cbs); /** - * Sets the user data in the LinphoneImEncryptionEngineCbs object - * @param[in] cbs the LinphoneImEncryptionEngineCbs object + * Sets the user data in the #LinphoneImEncryptionEngineCbs object + * @param[in] cbs the #LinphoneImEncryptionEngineCbs object * @param[in] data the user data * @donotwrap */ @@ -64,54 +64,54 @@ LINPHONE_PUBLIC void linphone_im_encryption_engine_cbs_set_user_data(LinphoneImE /** * Acquire a reference to the LinphoneImEncryptionEngine. - * @param[in] imee LinphoneImEncryptionEngine object. - * @return The same LinphoneImEncryptionEngine object. + * @param[in] imee #LinphoneImEncryptionEngine object. + * @return The same #LinphoneImEncryptionEngine object. * @donotwrap **/ LINPHONE_PUBLIC LinphoneImEncryptionEngine * linphone_im_encryption_engine_ref(LinphoneImEncryptionEngine *imee); /** * Release reference to the LinphoneImEncryptionEngine. - * @param[in] imee LinphoneImEncryptionEngine object. + * @param[in] imee #LinphoneImEncryptionEngine object. * @donotwrap **/ LINPHONE_PUBLIC void linphone_im_encryption_engine_unref(LinphoneImEncryptionEngine *imee); /** - * Gets the user data in the LinphoneImEncryptionEngine object - * @param[in] imee the LinphoneImEncryptionEngine + * Gets the user data in the #LinphoneImEncryptionEngine object + * @param[in] imee the #LinphoneImEncryptionEngine * @return the user data * @donotwrap */ LINPHONE_PUBLIC void *linphone_im_encryption_engine_get_user_data(const LinphoneImEncryptionEngine *imee); /** - * Sets the user data in the LinphoneImEncryptionEngine object - * @param[in] imee the LinphoneImEncryptionEngine object + * Sets the user data in the #LinphoneImEncryptionEngine object + * @param[in] imee the #LinphoneImEncryptionEngine object * @param[in] data the user data * @donotwrap */ LINPHONE_PUBLIC void linphone_im_encryption_engine_set_user_data(LinphoneImEncryptionEngine *imee, void *data); /** - * Gets the LinphoneCore object that created the IM encryption engine - * @param[in] imee LinphoneImEncryptionEngine object - * @return The LinphoneCore object that created the IM encryption engine + * Gets the #LinphoneCore object that created the IM encryption engine + * @param[in] imee #LinphoneImEncryptionEngine object + * @return The #LinphoneCore object that created the IM encryption engine * @donotwrap */ LINPHONE_PUBLIC LinphoneCore * linphone_im_encryption_engine_get_core(LinphoneImEncryptionEngine *imee); /** - * Gets the LinphoneImEncryptionEngineCbs object that holds the callbacks - * @param[in] imee the LinphoneImEncryptionEngine object - * @return the LinphoneImEncryptionEngineCbs object + * Gets the #LinphoneImEncryptionEngineCbs object that holds the callbacks + * @param[in] imee the #LinphoneImEncryptionEngine object + * @return the #LinphoneImEncryptionEngineCbs object * @donotwrap */ LINPHONE_PUBLIC LinphoneImEncryptionEngineCbs* linphone_im_encryption_engine_get_callbacks(const LinphoneImEncryptionEngine *imee); /** * Gets the callback that will decrypt the chat messages upon reception - * @param[in] cbs the LinphoneImEncryptionEngineCbs object + * @param[in] cbs the #LinphoneImEncryptionEngineCbs object * @return the callback * @donotwrap */ @@ -119,7 +119,7 @@ LINPHONE_PUBLIC LinphoneImEncryptionEngineCbsIncomingMessageCb linphone_im_encry /** * Sets the callback that will decrypt the chat messages upon reception - * @param[in] cbs the LinphoneImEncryptionEngineCbs object + * @param[in] cbs the #LinphoneImEncryptionEngineCbs object * @param[in] cb the callback to call * @donotwrap */ @@ -127,7 +127,7 @@ LINPHONE_PUBLIC void linphone_im_encryption_engine_cbs_set_process_incoming_mess /** * Gets the callback that will encrypt the chat messages before sending them - * @param[in] cbs the LinphoneImEncryptionEngineCbs object + * @param[in] cbs the #LinphoneImEncryptionEngineCbs object * @return the callback * @donotwrap */ @@ -135,7 +135,7 @@ LINPHONE_PUBLIC LinphoneImEncryptionEngineCbsOutgoingMessageCb linphone_im_encry /** * Sets the callback that will encrypt the chat messages before sending them - * @param[in] cbs the LinphoneImEncryptionEngineCbs object + * @param[in] cbs the #LinphoneImEncryptionEngineCbs object * @param[in] cb the callback to call * @donotwrap */ @@ -143,7 +143,7 @@ LINPHONE_PUBLIC void linphone_im_encryption_engine_cbs_set_process_outgoing_mess /** * Gets the callback that will decrypt the files while downloading them - * @param[in] cbs the LinphoneImEncryptionEngineCbs object + * @param[in] cbs the #LinphoneImEncryptionEngineCbs object * @return the callback * @donotwrap */ @@ -151,7 +151,7 @@ LINPHONE_PUBLIC LinphoneImEncryptionEngineCbsDownloadingFileCb linphone_im_encry /** * Sets the callback that will decrypt the files while downloading them - * @param[in] cbs the LinphoneImEncryptionEngineCbs object + * @param[in] cbs the #LinphoneImEncryptionEngineCbs object * @param[in] cb the callback to call * @donotwrap */ @@ -159,7 +159,7 @@ LINPHONE_PUBLIC void linphone_im_encryption_engine_cbs_set_process_downloading_f /** * Gets the callback that will will encrypt the files while uploading them - * @param[in] cbs the LinphoneImEncryptionEngineCbs object + * @param[in] cbs the #LinphoneImEncryptionEngineCbs object * @return the callback * @donotwrap */ @@ -167,7 +167,7 @@ LINPHONE_PUBLIC LinphoneImEncryptionEngineCbsUploadingFileCb linphone_im_encrypt /** * Sets the callback that will encrypt the files while uploading them - * @param[in] cbs the LinphoneImEncryptionEngineCbs object + * @param[in] cbs the #LinphoneImEncryptionEngineCbs object * @param[in] cb the callback to call * @donotwrap */ @@ -175,7 +175,7 @@ LINPHONE_PUBLIC void linphone_im_encryption_engine_cbs_set_process_uploading_fil /** * Gets the callback telling wheter or not to encrypt the files - * @param[in] cbs the LinphoneImEncryptionEngineCbs object + * @param[in] cbs the #LinphoneImEncryptionEngineCbs object * @return the callback * @donotwrap */ @@ -183,7 +183,7 @@ LINPHONE_PUBLIC LinphoneImEncryptionEngineCbsIsEncryptionEnabledForFileTransferC /** * Sets the callback telling wheter or not to encrypt the files - * @param[in] cbs the LinphoneImEncryptionEngineCbs object + * @param[in] cbs the #LinphoneImEncryptionEngineCbs object * @param[in] cb the callback to call * @donotwrap */ @@ -191,7 +191,7 @@ LINPHONE_PUBLIC void linphone_im_encryption_engine_cbs_set_is_encryption_enabled /** * Gets the callback that will generate the key to encrypt the file before uploading it - * @param[in] cbs the LinphoneImEncryptionEngineCbs object + * @param[in] cbs the #LinphoneImEncryptionEngineCbs object * @return the callback * @donotwrap */ @@ -199,14 +199,14 @@ LINPHONE_PUBLIC LinphoneImEncryptionEngineCbsGenerateFileTransferKeyCb linphone_ /** * Sets the callback that will generate the key to encrypt the file before uploading it - * @param[in] cbs the LinphoneImEncryptionEngineCbs object + * @param[in] cbs the #LinphoneImEncryptionEngineCbs object * @param[in] cb the callback to call * @donotwrap */ LINPHONE_PUBLIC void linphone_im_encryption_engine_cbs_set_generate_file_transfer_key(LinphoneImEncryptionEngineCbs *cbs, LinphoneImEncryptionEngineCbsGenerateFileTransferKeyCb cb); /** Set a chat message text to be sent by #linphone_chat_room_send_message - * @param[in] msg LinphoneChatMessage + * @param[in] msg #LinphoneChatMessage * @param[in] text Const char * * @returns 0 if succeed. * @donotwrap diff --git a/include/linphone/im_notif_policy.h b/include/linphone/im_notif_policy.h index ee2c1a5a3..33aba022d 100644 --- a/include/linphone/im_notif_policy.h +++ b/include/linphone/im_notif_policy.h @@ -35,124 +35,124 @@ extern "C" { */ /** - * Acquire a reference to the LinphoneImNotifPolicy object. - * @param[in] policy LinphoneImNotifPolicy object. - * @return The same LinphoneImNotifPolicy object. + * Acquire a reference to the #LinphoneImNotifPolicy object. + * @param[in] policy #LinphoneImNotifPolicy object. + * @return The same #LinphoneImNotifPolicy object. **/ LINPHONE_PUBLIC LinphoneImNotifPolicy * linphone_im_notif_policy_ref(LinphoneImNotifPolicy *policy); /** - * Release reference to the LinphoneImNotifPolicy object. - * @param[in] policy LinphoneImNotifPolicy object. + * Release reference to the #LinphoneImNotifPolicy object. + * @param[in] policy #LinphoneImNotifPolicy object. **/ LINPHONE_PUBLIC void linphone_im_notif_policy_unref(LinphoneImNotifPolicy *policy); /** - * Retrieve the user pointer associated with the LinphoneImNotifPolicy object. - * @param[in] policy LinphoneImNotifPolicy object. - * @return The user pointer associated with the LinphoneImNotifPolicy object. + * Retrieve the user pointer associated with the #LinphoneImNotifPolicy object. + * @param[in] policy #LinphoneImNotifPolicy object. + * @return The user pointer associated with the #LinphoneImNotifPolicy object. **/ LINPHONE_PUBLIC void *linphone_im_notif_policy_get_user_data(const LinphoneImNotifPolicy *policy); /** - * Assign a user pointer to the LinphoneImNotifPolicy object. - * @param[in] policy LinphoneImNotifPolicy object. - * @param[in] ud The user pointer to associate with the LinphoneImNotifPolicy object. + * Assign a user pointer to the #LinphoneImNotifPolicy object. + * @param[in] policy #LinphoneImNotifPolicy object. + * @param[in] ud The user pointer to associate with the #LinphoneImNotifPolicy object. **/ LINPHONE_PUBLIC void linphone_im_notif_policy_set_user_data(LinphoneImNotifPolicy *policy, void *ud); /** * Clear an IM notif policy (deactivate all receiving and sending of notifications). - * @param[in] policy LinphoneImNotifPolicy object. + * @param[in] policy #LinphoneImNotifPolicy object. */ LINPHONE_PUBLIC void linphone_im_notif_policy_clear(LinphoneImNotifPolicy *policy); /** * Enable all receiving and sending of notifications. - * @param[in] policy LinphoneImNotifPolicy object. + * @param[in] policy #LinphoneImNotifPolicy object. */ LINPHONE_PUBLIC void linphone_im_notif_policy_enable_all(LinphoneImNotifPolicy *policy); /** * Tell whether is_composing notifications are being sent. - * @param[in] policy LinphoneImNotifPolicy object + * @param[in] policy #LinphoneImNotifPolicy object * @return Boolean value telling whether is_composing notifications are being sent. */ LINPHONE_PUBLIC bool_t linphone_im_notif_policy_get_send_is_composing(const LinphoneImNotifPolicy *policy); /** * Enable is_composing notifications sending. - * @param[in] policy LinphoneImNotifPolicy object + * @param[in] policy #LinphoneImNotifPolicy object * @param[in] enable Boolean value telling whether to send is_composing notifications. */ LINPHONE_PUBLIC void linphone_im_notif_policy_set_send_is_composing(LinphoneImNotifPolicy *policy, bool_t enable); /** * Tell whether is_composing notifications are being notified when received. - * @param[in] policy LinphoneImNotifPolicy object + * @param[in] policy #LinphoneImNotifPolicy object * @return Boolean value telling whether is_composing notifications are being notified when received. */ LINPHONE_PUBLIC bool_t linphone_im_notif_policy_get_recv_is_composing(const LinphoneImNotifPolicy *policy); /** * Enable is_composing notifications receiving. - * @param[in] policy LinphoneImNotifPolicy object + * @param[in] policy #LinphoneImNotifPolicy object * @param[in] enable Boolean value telling whether to notify received is_composing notifications. */ LINPHONE_PUBLIC void linphone_im_notif_policy_set_recv_is_composing(LinphoneImNotifPolicy *policy, bool_t enable); /** * Tell whether imdn delivered notifications are being sent. - * @param[in] policy LinphoneImNotifPolicy object + * @param[in] policy #LinphoneImNotifPolicy object * @return Boolean value telling whether imdn delivered notifications are being sent. */ LINPHONE_PUBLIC bool_t linphone_im_notif_policy_get_send_imdn_delivered(const LinphoneImNotifPolicy *policy); /** * Enable imdn delivered notifications sending. - * @param[in] policy LinphoneImNotifPolicy object + * @param[in] policy #LinphoneImNotifPolicy object * @param[in] enable Boolean value telling whether to send imdn delivered notifications. */ LINPHONE_PUBLIC void linphone_im_notif_policy_set_send_imdn_delivered(LinphoneImNotifPolicy *policy, bool_t enable); /** * Tell whether imdn delivered notifications are being notified when received. - * @param[in] policy LinphoneImNotifPolicy object + * @param[in] policy #LinphoneImNotifPolicy object * @return Boolean value telling whether imdn delivered notifications are being notified when received. */ LINPHONE_PUBLIC bool_t linphone_im_notif_policy_get_recv_imdn_delivered(const LinphoneImNotifPolicy *policy); /** * Enable imdn delivered notifications receiving. - * @param[in] policy LinphoneImNotifPolicy object + * @param[in] policy #LinphoneImNotifPolicy object * @param[in] enable Boolean value telling whether to notify received imdn delivered notifications. */ LINPHONE_PUBLIC void linphone_im_notif_policy_set_recv_imdn_delivered(LinphoneImNotifPolicy *policy, bool_t enable); /** * Tell whether imdn displayed notifications are being sent. - * @param[in] policy LinphoneImNotifPolicy object + * @param[in] policy #LinphoneImNotifPolicy object * @return Boolean value telling whether imdn displayed notifications are being sent. */ LINPHONE_PUBLIC bool_t linphone_im_notif_policy_get_send_imdn_displayed(const LinphoneImNotifPolicy *policy); /** * Enable imdn displayed notifications sending. - * @param[in] policy LinphoneImNotifPolicy object + * @param[in] policy #LinphoneImNotifPolicy object * @param[in] enable Boolean value telling whether to send imdn displayed notifications. */ LINPHONE_PUBLIC void linphone_im_notif_policy_set_send_imdn_displayed(LinphoneImNotifPolicy *policy, bool_t enable); /** * Tell whether imdn displayed notifications are being notified when received. - * @param[in] policy LinphoneImNotifPolicy object + * @param[in] policy #LinphoneImNotifPolicy object * @return Boolean value telling whether imdn displayed notifications are being notified when received. */ LINPHONE_PUBLIC bool_t linphone_im_notif_policy_get_recv_imdn_displayed(const LinphoneImNotifPolicy *policy); /** * Enable imdn displayed notifications receiving. - * @param[in] policy LinphoneImNotifPolicy object + * @param[in] policy #LinphoneImNotifPolicy object * @param[in] enable Boolean value telling whether to notify received imdn displayed notifications. */ LINPHONE_PUBLIC void linphone_im_notif_policy_set_recv_imdn_displayed(LinphoneImNotifPolicy *policy, bool_t enable); diff --git a/include/linphone/info_message.h b/include/linphone/info_message.h index 268fb124c..99804bb14 100644 --- a/include/linphone/info_message.h +++ b/include/linphone/info_message.h @@ -55,7 +55,7 @@ LINPHONE_PUBLIC const char *linphone_info_message_get_header(const LinphoneInfoM * Assign a content to the info message. * @param im the linphone info message * @param content the content described as a #LinphoneContent structure. - * All fields of the LinphoneContent are copied, thus the application can destroy/modify/recycloe the content object freely ater the function returns. + * All fields of the #LinphoneContent are copied, thus the application can destroy/modify/recycloe the content object freely ater the function returns. **/ LINPHONE_PUBLIC void linphone_info_message_set_content(LinphoneInfoMessage *im, const LinphoneContent *content); diff --git a/include/linphone/lpconfig.h b/include/linphone/lpconfig.h index 816e2805c..4fa5f681b 100644 --- a/include/linphone/lpconfig.h +++ b/include/linphone/lpconfig.h @@ -33,7 +33,7 @@ */ /** - * Safely downcast a belle_sip_object into LinphoneConfig + * Safely downcast a belle_sip_object into #LinphoneConfig */ #define LINPHONE_CONFIG(obj) BELLE_SIP_CAST(obj, LinphoneConfig); @@ -42,59 +42,59 @@ extern "C" { #endif /** - * Instantiates a LinphoneConfig object from a user config file. + * Instantiates a #LinphoneConfig object from a user config file. * The caller of this constructor owns a reference. linphone_config_unref() must be called when this object is no longer needed. * @ingroup misc - * @param filename the filename of the config file to read to fill the instantiated LinphoneConfig + * @param filename the filename of the config file to read to fill the instantiated #LinphoneConfig * @see linphone_config_new_with_factory */ LINPHONE_PUBLIC LinphoneConfig * linphone_config_new(const char *filename); /** - * Instantiates a LinphoneConfig object from a user provided buffer. + * Instantiates a #LinphoneConfig object from a user provided buffer. * The caller of this constructor owns a reference. linphone_config_unref() must be called when this object is no longer needed. * @ingroup misc - * @param buffer the buffer from which the LinphoneConfig will be retrieved. We expect the buffer to be null-terminated. + * @param buffer the buffer from which the #LinphoneConfig will be retrieved. We expect the buffer to be null-terminated. * @see linphone_config_new_with_factory * @see linphone_config_new */ LINPHONE_PUBLIC LinphoneConfig * linphone_config_new_from_buffer(const char *buffer); /** - * Instantiates a LinphoneConfig object from a user config file and a factory config file. + * Instantiates a #LinphoneConfig object from a user config file and a factory config file. * The caller of this constructor owns a reference. linphone_config_unref() must be called when this object is no longer needed. * @ingroup misc - * @param config_filename the filename of the user config file to read to fill the instantiated LinphoneConfig - * @param factory_config_filename the filename of the factory config file to read to fill the instantiated LinphoneConfig + * @param config_filename the filename of the user config file to read to fill the instantiated #LinphoneConfig + * @param factory_config_filename the filename of the factory config file to read to fill the instantiated #LinphoneConfig * @see linphone_config_new * - * The user config file is read first to fill the LinphoneConfig and then the factory config file is read. + * The user config file is read first to fill the #LinphoneConfig and then the factory config file is read. * Therefore the configuration parameters defined in the user config file will be overwritten by the parameters * defined in the factory config file. */ LINPHONE_PUBLIC LinphoneConfig * linphone_config_new_with_factory(const char *config_filename, const char *factory_config_filename); /** - * Reads a user config file and fill the LinphoneConfig with the read config values. + * Reads a user config file and fill the #LinphoneConfig with the read config values. * @ingroup misc - * @param lpconfig The LinphoneConfig object to fill with the content of the file - * @param filename The filename of the config file to read to fill the LinphoneConfig + * @param lpconfig The #LinphoneConfig object to fill with the content of the file + * @param filename The filename of the config file to read to fill the #LinphoneConfig */ LINPHONE_PUBLIC LinphoneStatus linphone_config_read_file(LinphoneConfig *lpconfig, const char *filename); /** - * Reads a xml config file and fill the LinphoneConfig with the read config dynamic values. + * Reads a xml config file and fill the #LinphoneConfig with the read config dynamic values. * @ingroup misc - * @param lpconfig The LinphoneConfig object to fill with the content of the file - * @param filename The filename of the config file to read to fill the LinphoneConfig + * @param lpconfig The #LinphoneConfig object to fill with the content of the file + * @param filename The filename of the config file to read to fill the #LinphoneConfig */ LINPHONE_PUBLIC const char* linphone_config_load_from_xml_file(LinphoneConfig *lpc, const char *filename); /** - * Reads a xml config string and fill the LinphoneConfig with the read config dynamic values. + * Reads a xml config string and fill the #LinphoneConfig with the read config dynamic values. * @ingroup misc - * @param lpconfig The LinphoneConfig object to fill with the content of the file - * @param buffer The string of the config file to fill the LinphoneConfig + * @param lpconfig The #LinphoneConfig object to fill with the content of the file + * @param buffer The string of the config file to fill the #LinphoneConfig * @return 0 in case of success */ LINPHONE_PUBLIC LinphoneStatus linphone_config_load_from_xml_string(LpConfig *lpc, const char *buffer); @@ -214,7 +214,7 @@ LINPHONE_PUBLIC void linphone_config_clean_section(LinphoneConfig *lpconfig, con /** * Returns 1 if a given section with a given key is present in the configuration. - * @param[in] lpconfig The LinphoneConfig object + * @param[in] lpconfig The #LinphoneConfig object * @param[in] section * @param[in] key **/ @@ -222,7 +222,7 @@ LINPHONE_PUBLIC int linphone_config_has_entry(const LinphoneConfig *lpconfig, co /** * Removes entries for key,value in a section. - * @param[in] lpconfig The LinphoneConfig object + * @param[in] lpconfig The #LinphoneConfig object * @param[in] section * @param[in] key **/ @@ -230,7 +230,7 @@ LINPHONE_PUBLIC void linphone_config_clean_entry(LinphoneConfig *lpconfig, const /** * Returns the list of sections' names in the LinphoneConfig. - * @param[in] lpconfig The LinphoneConfig object + * @param[in] lpconfig The #LinphoneConfig object * @return a null terminated static array of strings * @deprecated use linphone_config_get_sections_names_list instead * @donotwrap @@ -239,7 +239,7 @@ LINPHONE_PUBLIC const char** linphone_config_get_sections_names(LinphoneConfig * /** * Returns the list of sections' names in the LinphoneConfig. - * @param[in] lpconfig The LinphoneConfig object + * @param[in] lpconfig The #LinphoneConfig object * @return \bctbx_list{char *} a null terminated static array of strings **/ LINPHONE_PUBLIC const bctbx_list_t * linphone_config_get_sections_names_list(LpConfig *lpconfig); @@ -303,7 +303,7 @@ LINPHONE_PUBLIC void linphone_config_unref(LinphoneConfig *lpconfig); /** * Write a string in a file placed relatively with the Linphone configuration file. - * @param lpconfig LinphoneConfig instance used as a reference + * @param lpconfig #LinphoneConfig instance used as a reference * @param filename Name of the file where to write data. The name is relative to the place of the config file * @param data String to write */ @@ -311,7 +311,7 @@ LINPHONE_PUBLIC void linphone_config_write_relative_file(const LinphoneConfig *l /** * Read a string from a file placed beside the Linphone configuration file - * @param lpconfig LinphoneConfig instance used as a reference + * @param lpconfig #LinphoneConfig instance used as a reference * @param filename Name of the file where data will be read from. The name is relative to the place of the config file * @param data Buffer where read string will be stored * @param max_length Length of the buffer @@ -326,15 +326,15 @@ LINPHONE_PUBLIC LinphoneStatus linphone_config_read_relative_file(const Linphone LINPHONE_PUBLIC bool_t linphone_config_relative_file_exists(const LinphoneConfig *lpconfig, const char *filename); /** - * Dumps the LinphoneConfig as XML into a buffer - * @param[in] lpconfig The LinphoneConfig object + * Dumps the #LinphoneConfig as XML into a buffer + * @param[in] lpconfig The #LinphoneConfig object * @return The buffer that contains the XML dump **/ LINPHONE_PUBLIC char* linphone_config_dump_as_xml(const LinphoneConfig *lpconfig); /** - * Dumps the LinphoneConfig as INI into a buffer - * @param[in] lpconfig The LinphoneConfig object + * Dumps the #LinphoneConfig as INI into a buffer + * @param[in] lpconfig The #LinphoneConfig object * @return The buffer that contains the config dump **/ LINPHONE_PUBLIC char* linphone_config_dump(const LinphoneConfig *lpconfig); diff --git a/include/linphone/misc.h b/include/linphone/misc.h index 8db519284..e95ce1252 100644 --- a/include/linphone/misc.h +++ b/include/linphone/misc.h @@ -102,9 +102,9 @@ LINPHONE_PUBLIC const char *linphone_configuring_state_to_string(LinphoneConfigu LINPHONE_PUBLIC const char* linphone_chat_message_state_to_string(const LinphoneChatMessageState state); /** - * Converts a LinphoneReason enum to a string. + * Converts a #LinphoneReason enum to a string. * @param[in] err A #LinphoneReason - * @return The string representation of the specified LinphoneReason + * @return The string representation of the specified #LinphoneReason * @ingroup misc **/ LINPHONE_PUBLIC const char *linphone_reason_to_string(LinphoneReason err); @@ -118,10 +118,10 @@ LINPHONE_PUBLIC const char *linphone_reason_to_string(LinphoneReason err); LINPHONE_PUBLIC LINPHONE_DEPRECATED const char *linphone_online_status_to_string(LinphoneOnlineStatus ss); /** - * Convert a string into LinphoneTunnelMode enum + * Convert a string into #LinphoneTunnelMode enum * @param string String to convert - * @return An LinphoneTunnelMode enum. If the passed string is NULL or - * does not match with any mode, the LinphoneTunnelModeDisable is returned. + * @return An #LinphoneTunnelMode enum. If the passed string is NULL or + * does not match with any mode, the #LinphoneTunnelModeDisable is returned. */ LINPHONE_PUBLIC LinphoneTunnelMode linphone_tunnel_mode_from_string(const char *string); @@ -139,59 +139,59 @@ LINPHONE_PUBLIC const char *linphone_tunnel_mode_to_string(LinphoneTunnelMode mo LINPHONE_PUBLIC bool_t linphone_local_player_matroska_supported(void); /** - * Converts a LinphoneTransportType enum to a lowercase string. + * Converts a #LinphoneTransportType enum to a lowercase string. * @ingroup misc **/ LINPHONE_PUBLIC const char* linphone_transport_to_string(LinphoneTransportType transport); /** - * Converts a lowercase string to a LinphoneTransportType enum. + * Converts a lowercase string to a #LinphoneTransportType enum. * @ingroup misc - * @return Transport matching input, or LinphoneTransportUdp if nothing is found + * @return Transport matching input, or #LinphoneTransportUdp if nothing is found **/ LINPHONE_PUBLIC LinphoneTransportType linphone_transport_parse(const char* transport); /** * Converts an error code to a LinphoneReason. * @param[in] err An error code - * @return The LinphoneReason corresponding to the specified error code + * @return The #LinphoneReason corresponding to the specified error code * @ingroup misc **/ LINPHONE_PUBLIC LinphoneReason linphone_error_code_to_reason(int err); /** - * Converts a LinphoneReason to an error code. - * @param[in] reason A LinphoneReason - * @return The error code corresponding to the specified LinphoneReason + * Converts a #LinphoneReason to an error code. + * @param[in] reason A #LinphoneReason + * @return The error code corresponding to the specified #LinphoneReason * @ingroup misc */ LINPHONE_PUBLIC int linphone_reason_to_error_code(LinphoneReason reason); /** * Increment refcount. - * @param[in] range LinphoneRange object + * @param[in] range #LinphoneRange object * @ingroup misc **/ LINPHONE_PUBLIC LinphoneRange *linphone_range_ref(LinphoneRange *range); /** * Decrement refcount and possibly free the object. - * @param[in] range LinphoneRange object + * @param[in] range #LinphoneRange object * @ingroup misc **/ LINPHONE_PUBLIC void linphone_range_unref(LinphoneRange *range); /** - * Gets the user data in the LinphoneRange object - * @param[in] range the LinphoneRange + * Gets the user data in the #LinphoneRange object + * @param[in] range the #LinphoneRange * @return the user data * @ingroup misc */ LINPHONE_PUBLIC void *linphone_range_get_user_data(const LinphoneRange *range); /** - * Sets the user data in the LinphoneRange object - * @param[in] range the LinphoneRange object + * Sets the user data in the #LinphoneRange object + * @param[in] range the #LinphoneRange object * @param[in] data the user data * @ingroup misc */ @@ -199,7 +199,7 @@ LINPHONE_PUBLIC void linphone_range_set_user_data(LinphoneRange *range, void *da /** * Gets the lower value of the range - * @param[in] range a LinphoneRange + * @param[in] range a #LinphoneRange * @return The lower value * @ingroup misc */ @@ -207,7 +207,7 @@ LINPHONE_PUBLIC int linphone_range_get_min(const LinphoneRange *range); /** * Gets the higher value of the range - * @param[in] range a LinphoneRange + * @param[in] range a #LinphoneRange * @return The higher value * @ingroup misc */ @@ -215,7 +215,7 @@ LINPHONE_PUBLIC int linphone_range_get_max(const LinphoneRange *range); /** * Sets the lower value of the range - * @param[in] range a LinphoneRange + * @param[in] range a #LinphoneRange * @param[in] min the value to set * @ingroup misc */ @@ -223,7 +223,7 @@ LINPHONE_PUBLIC void linphone_range_set_min(LinphoneRange *range, int min); /** * Sets the higher value of the range - * @param[in] range a LinphoneRange + * @param[in] range a #LinphoneRange * @param[in] max the value to set * @ingroup misc */ diff --git a/include/linphone/nat_policy.h b/include/linphone/nat_policy.h index c6dcd97d9..cf275c65a 100644 --- a/include/linphone/nat_policy.h +++ b/include/linphone/nat_policy.h @@ -35,41 +35,41 @@ extern "C" { */ /** - * Acquire a reference to the LinphoneNatPolicy object. - * @param[in] policy LinphoneNatPolicy object. - * @return The same LinphoneNatPolicy object. + * Acquire a reference to the #LinphoneNatPolicy object. + * @param[in] policy #LinphoneNatPolicy object. + * @return The same #LinphoneNatPolicy object. **/ LINPHONE_PUBLIC LinphoneNatPolicy * linphone_nat_policy_ref(LinphoneNatPolicy *policy); /** - * Release reference to the LinphoneNatPolicy object. - * @param[in] policy LinphoneNatPolicy object. + * Release reference to the #LinphoneNatPolicy object. + * @param[in] policy #LinphoneNatPolicy object. **/ LINPHONE_PUBLIC void linphone_nat_policy_unref(LinphoneNatPolicy *policy); /** - * Retrieve the user pointer associated with the LinphoneNatPolicy object. - * @param[in] policy LinphoneNatPolicy object. - * @return The user pointer associated with the LinphoneNatPolicy object. + * Retrieve the user pointer associated with the #LinphoneNatPolicy object. + * @param[in] policy #LinphoneNatPolicy object. + * @return The user pointer associated with the #LinphoneNatPolicy object. **/ LINPHONE_PUBLIC void *linphone_nat_policy_get_user_data(const LinphoneNatPolicy *policy); /** - * Assign a user pointer to the LinphoneNatPolicy object. - * @param[in] policy LinphoneNatPolicy object. - * @param[in] ud The user pointer to associate with the LinphoneNatPolicy object. + * Assign a user pointer to the #LinphoneNatPolicy object. + * @param[in] policy #LinphoneNatPolicy object. + * @param[in] ud The user pointer to associate with the #LinphoneNatPolicy object. **/ LINPHONE_PUBLIC void linphone_nat_policy_set_user_data(LinphoneNatPolicy *policy, void *ud); /** * Clear a NAT policy (deactivate all protocols and unset the STUN server). - * @param[in] policy LinphoneNatPolicy object. + * @param[in] policy #LinphoneNatPolicy object. */ LINPHONE_PUBLIC void linphone_nat_policy_clear(LinphoneNatPolicy *policy); /** * Tell whether STUN is enabled. - * @param[in] policy LinphoneNatPolicy object + * @param[in] policy #LinphoneNatPolicy object * @return Boolean value telling whether STUN is enabled. */ LINPHONE_PUBLIC bool_t linphone_nat_policy_stun_enabled(const LinphoneNatPolicy *policy); @@ -77,14 +77,14 @@ LINPHONE_PUBLIC bool_t linphone_nat_policy_stun_enabled(const LinphoneNatPolicy /** * Enable STUN. * If TURN is also enabled, TURN will be used instead of STUN. - * @param[in] policy LinphoneNatPolicy object + * @param[in] policy #LinphoneNatPolicy object * @param[in] enable Boolean value telling whether to enable STUN. */ LINPHONE_PUBLIC void linphone_nat_policy_enable_stun(LinphoneNatPolicy *policy, bool_t enable); /** * Tell whether TURN is enabled. - * @param[in] policy LinphoneNatPolicy object + * @param[in] policy #LinphoneNatPolicy object * @return Boolean value telling whether TURN is enabled. */ LINPHONE_PUBLIC bool_t linphone_nat_policy_turn_enabled(const LinphoneNatPolicy *policy); @@ -92,14 +92,14 @@ LINPHONE_PUBLIC bool_t linphone_nat_policy_turn_enabled(const LinphoneNatPolicy /** * Enable TURN. * If STUN is also enabled, it is ignored and TURN is used. - * @param[in] policy LinphoneNatPolicy object + * @param[in] policy #LinphoneNatPolicy object * @param[in] enable Boolean value telling whether to enable TURN. */ LINPHONE_PUBLIC void linphone_nat_policy_enable_turn(LinphoneNatPolicy *policy, bool_t enable); /** * Tell whether ICE is enabled. - * @param[in] policy LinphoneNatPolicy object + * @param[in] policy #LinphoneNatPolicy object * @return Boolean value telling whether ICE is enabled. */ LINPHONE_PUBLIC bool_t linphone_nat_policy_ice_enabled(const LinphoneNatPolicy *policy); @@ -107,14 +107,14 @@ LINPHONE_PUBLIC bool_t linphone_nat_policy_ice_enabled(const LinphoneNatPolicy * /** * Enable ICE. * ICE can be enabled without STUN/TURN, in which case only the local candidates will be used. - * @param[in] policy LinphoneNatPolicy object + * @param[in] policy #LinphoneNatPolicy object * @param[in] enable Boolean value telling whether to enable ICE. */ LINPHONE_PUBLIC void linphone_nat_policy_enable_ice(LinphoneNatPolicy *policy, bool_t enable); /** * Tell whether uPnP is enabled. - * @param[in] policy LinphoneNatPolicy object + * @param[in] policy #LinphoneNatPolicy object * @return Boolean value telling whether uPnP is enabled. */ LINPHONE_PUBLIC bool_t linphone_nat_policy_upnp_enabled(const LinphoneNatPolicy *policy); @@ -122,7 +122,7 @@ LINPHONE_PUBLIC bool_t linphone_nat_policy_upnp_enabled(const LinphoneNatPolicy /** * Enable uPnP. * This has the effect to disable every other policies (ICE, STUN and TURN). - * @param[in] policy LinphoneNatPolicy object + * @param[in] policy #LinphoneNatPolicy object * @param[in] enable Boolean value telling whether to enable uPnP. */ LINPHONE_PUBLIC void linphone_nat_policy_enable_upnp(LinphoneNatPolicy *policy, bool_t enable); @@ -130,7 +130,7 @@ LINPHONE_PUBLIC void linphone_nat_policy_enable_upnp(LinphoneNatPolicy *policy, /** * Get the STUN/TURN server to use with this NAT policy. * Used when STUN or TURN are enabled. - * @param[in] policy LinphoneNatPolicy object + * @param[in] policy #LinphoneNatPolicy object * @return The STUN server used by this NAT policy. */ LINPHONE_PUBLIC const char * linphone_nat_policy_get_stun_server(const LinphoneNatPolicy *policy); @@ -138,47 +138,47 @@ LINPHONE_PUBLIC const char * linphone_nat_policy_get_stun_server(const LinphoneN /** * Set the STUN/TURN server to use with this NAT policy. * Used when STUN or TURN are enabled. - * @param[in] policy LinphoneNatPolicy object + * @param[in] policy #LinphoneNatPolicy object * @param[in] stun_server The STUN server to use with this NAT policy. */ LINPHONE_PUBLIC void linphone_nat_policy_set_stun_server(LinphoneNatPolicy *policy, const char *stun_server); /** * Get the username used to authenticate with the STUN/TURN server. - * The authentication will search for a LinphoneAuthInfo with this username. - * If it is not set the username of the currently used LinphoneProxyConfig is used to search for a LinphoneAuthInfo. - * @param[in] policy LinphoneNatPolicy object + * The authentication will search for a #LinphoneAuthInfo with this username. + * If it is not set the username of the currently used #LinphoneProxyConfig is used to search for a LinphoneAuthInfo. + * @param[in] policy #LinphoneNatPolicy object * @return The username used to authenticate with the STUN/TURN server. */ LINPHONE_PUBLIC const char * linphone_nat_policy_get_stun_server_username(const LinphoneNatPolicy *policy); /** * Set the username used to authenticate with the STUN/TURN server. - * The authentication will search for a LinphoneAuthInfo with this username. - * If it is not set the username of the currently used LinphoneProxyConfig is used to search for a LinphoneAuthInfo. - * @param[in] policy LinphoneNatPolicy object + * The authentication will search for a #LinphoneAuthInfo with this username. + * If it is not set the username of the currently used #LinphoneProxyConfig is used to search for a LinphoneAuthInfo. + * @param[in] policy #LinphoneNatPolicy object * @param[in] username The username used to authenticate with the STUN/TURN server. */ LINPHONE_PUBLIC void linphone_nat_policy_set_stun_server_username(LinphoneNatPolicy *policy, const char *username); /** * Start a STUN server DNS resolution. - * @param[in] policy LinphoneNatPolicy object + * @param[in] policy #LinphoneNatPolicy object */ LINPHONE_PUBLIC void linphone_nat_policy_resolve_stun_server(LinphoneNatPolicy *policy); /** * Get the addrinfo representation of the STUN server address. * WARNING: This function may block for up to 1 second. - * @param[in] policy LinphoneNatPolicy object + * @param[in] policy #LinphoneNatPolicy object * @return addrinfo representation of the STUN server address. * @donotwrap */ LINPHONE_PUBLIC const struct addrinfo * linphone_nat_policy_get_stun_server_addrinfo(LinphoneNatPolicy *policy); /** - * Returns the LinphoneCore object managing this nat policy, if any. - * @param[in] fr LinphoneNatPolicy object + * Returns the #LinphoneCore object managing this nat policy, if any. + * @param[in] fr #LinphoneNatPolicy object */ LINPHONE_PUBLIC LinphoneCore *linphone_nat_policy_get_core(const LinphoneNatPolicy *policy); diff --git a/include/linphone/payload_type.h b/include/linphone/payload_type.h index f2cab35ce..a8e420f22 100644 --- a/include/linphone/payload_type.h +++ b/include/linphone/payload_type.h @@ -114,7 +114,7 @@ LINPHONE_PUBLIC int linphone_payload_type_get_channels(const LinphonePayloadType LINPHONE_PUBLIC int linphone_payload_type_get_number(const LinphonePayloadType *pt); /** - * Force a number for a payload type. The LinphoneCore does payload type number assignment automatically. + * Force a number for a payload type. The #LinphoneCore does payload type number assignment automatically. * This function is mainly to be used for tests, in order to override the automatic assignment mechanism. * @param[in] pt The payload type. * @param[in] number The number to assign to the payload type. diff --git a/include/linphone/player.h b/include/linphone/player.h index e061bdc1c..60633f9e6 100644 --- a/include/linphone/player.h +++ b/include/linphone/player.h @@ -37,62 +37,62 @@ extern "C" { /** * Acquire a reference to the player. - * @param[in] player LinphonePlayer object. - * @return The same LinphonePlayer object. + * @param[in] player #LinphonePlayer object. + * @return The same #LinphonePlayer object. **/ LINPHONE_PUBLIC LinphonePlayer * linphone_player_ref(LinphonePlayer *player); /** * Release reference to the player. - * @param[in] player LinphonePlayer object. + * @param[in] player #LinphonePlayer object. **/ LINPHONE_PUBLIC void linphone_player_unref(LinphonePlayer *player); /** * Retrieve the user pointer associated with the player. - * @param[in] player LinphonePlayer object. + * @param[in] player #LinphonePlayer object. * @return The user pointer associated with the player. **/ LINPHONE_PUBLIC void *linphone_player_get_user_data(const LinphonePlayer *player); /** * Assign a user pointer to the player. - * @param[in] player LinphonePlayer object. + * @param[in] player #LinphonePlayer object. * @param[in] ud The user pointer to associate with the player. **/ LINPHONE_PUBLIC void linphone_player_set_user_data(LinphonePlayer *player, void *ud); /** - * Get the LinphonePlayerCbs object associated with the LinphonePlayer. - * @param[in] player LinphonePlayer object - * @return The LinphonePlayerCbs object associated with the LinphonePlayer. + * Get the #LinphonePlayerCbs object associated with the LinphonePlayer. + * @param[in] player #LinphonePlayer object + * @return The #LinphonePlayerCbs object associated with the LinphonePlayer. */ LINPHONE_PUBLIC LinphonePlayerCbs * linphone_player_get_callbacks(const LinphonePlayer *player); /** * Open a file for playing. - * @param[in] obj LinphonePlayer object + * @param[in] obj #LinphonePlayer object * @param[in] filename The path to the file to open */ LINPHONE_PUBLIC LinphoneStatus linphone_player_open(LinphonePlayer *obj, const char *filename); /** * Start playing a file that has been opened with linphone_player_open(). - * @param[in] obj LinphonePlayer object + * @param[in] obj #LinphonePlayer object * @return 0 on success, a negative value otherwise */ LINPHONE_PUBLIC LinphoneStatus linphone_player_start(LinphonePlayer *obj); /** * Pause the playing of a file. - * @param[in] obj LinphonePlayer object + * @param[in] obj #LinphonePlayer object * @return 0 on success, a negative value otherwise */ LINPHONE_PUBLIC LinphoneStatus linphone_player_pause(LinphonePlayer *obj); /** * Seek in an opened file. - * @param[in] obj LinphonePlayer object + * @param[in] obj #LinphonePlayer object * @param[in] time_ms The time we want to go to in the file (in milliseconds). * @return 0 on success, a negative value otherwise. */ @@ -100,74 +100,74 @@ LINPHONE_PUBLIC LinphoneStatus linphone_player_seek(LinphonePlayer *obj, int tim /** * Get the current state of a player. - * @param[in] obj LinphonePlayer object + * @param[in] obj #LinphonePlayer object * @return The current state of the player. */ LINPHONE_PUBLIC LinphonePlayerState linphone_player_get_state(LinphonePlayer *obj); /** * Get the duration of the opened file. - * @param[in] obj LinphonePlayer object + * @param[in] obj #LinphonePlayer object * @return The duration of the opened file */ LINPHONE_PUBLIC int linphone_player_get_duration(LinphonePlayer *obj); /** * Get the current position in the opened file. - * @param[in] obj LinphonePlayer object + * @param[in] obj #LinphonePlayer object * @return The current position in the opened file */ LINPHONE_PUBLIC int linphone_player_get_current_position(LinphonePlayer *obj); /** * Close the opened file. - * @param[in] obj LinphonePlayer object + * @param[in] obj #LinphonePlayer object */ LINPHONE_PUBLIC void linphone_player_close(LinphonePlayer *obj); /** - * Returns the LinphoneCore object managing this player's call, if any. - * @param[in] fr LinphonePlayer object + * Returns the #LinphoneCore object managing this player's call, if any. + * @param[in] fr #LinphonePlayer object */ LINPHONE_PUBLIC LinphoneCore *linphone_player_get_core(const LinphonePlayer *player); /** - * Acquire a reference to the LinphonePlayerCbs object. - * @param[in] cbs LinphonePlayerCbs object. - * @return The same LinphonePlayerCbs object. + * Acquire a reference to the #LinphonePlayerCbs object. + * @param[in] cbs #LinphonePlayerCbs object. + * @return The same #LinphonePlayerCbs object. */ LINPHONE_PUBLIC LinphonePlayerCbs * linphone_player_cbs_ref(LinphonePlayerCbs *cbs); /** - * Release reference to the LinphonePlayerCbs object. - * @param[in] cbs LinphonePlayerCbs object. + * Release reference to the #LinphonePlayerCbs object. + * @param[in] cbs #LinphonePlayerCbs object. */ LINPHONE_PUBLIC void linphone_player_cbs_unref(LinphonePlayerCbs *cbs); /** - * Retrieve the user pointer associated with the LinphonePlayerCbs object. - * @param[in] cbs LinphonePlayerCbs object. - * @return The user pointer associated with the LinphonePlayerCbs object. + * Retrieve the user pointer associated with the #LinphonePlayerCbs object. + * @param[in] cbs #LinphonePlayerCbs object. + * @return The user pointer associated with the #LinphonePlayerCbs object. */ LINPHONE_PUBLIC void *linphone_player_cbs_get_user_data(const LinphonePlayerCbs *cbs); /** - * Assign a user pointer to the LinphonePlayerCbs object. - * @param[in] cbs LinphonePlayerCbs object. - * @param[in] ud The user pointer to associate with the LinphonePlayerCbs object. + * Assign a user pointer to the #LinphonePlayerCbs object. + * @param[in] cbs #LinphonePlayerCbs object. + * @param[in] ud The user pointer to associate with the #LinphonePlayerCbs object. */ LINPHONE_PUBLIC void linphone_player_cbs_set_user_data(LinphonePlayerCbs *cbs, void *ud); /** * Get the end-of-file reached callback. - * @param[in] cbs LinphonePlayerCbs object. + * @param[in] cbs #LinphonePlayerCbs object. * @return The current end-of-file reached callback. */ LINPHONE_PUBLIC LinphonePlayerCbsEofReachedCb linphone_player_cbs_get_eof_reached(const LinphonePlayerCbs *cbs); /** * Set the end-of-file reached callback. - * @param[in] cbs LinphonePlayerCbs object. + * @param[in] cbs #LinphonePlayerCbs object. * @param[in] cb The end-of-file reached callback to be used. */ LINPHONE_PUBLIC void linphone_player_cbs_set_eof_reached(LinphonePlayerCbs *cbs, LinphonePlayerCbsEofReachedCb cb); diff --git a/include/linphone/presence.h b/include/linphone/presence.h index 455508d7e..5290fd223 100644 --- a/include/linphone/presence.h +++ b/include/linphone/presence.h @@ -197,8 +197,8 @@ LINPHONE_PUBLIC LinphoneStatus linphone_presence_model_clear_notes(LinphonePrese /** * Get the consolidated presence from a presence model. - * @param[in] model LinphonePresenceModel object - * @return The LinphoneConsolidatedPresence corresponding to the presence model + * @param[in] model #LinphonePresenceModel object + * @return The #LinphoneConsolidatedPresence corresponding to the presence model */ LINPHONE_PUBLIC LinphoneConsolidatedPresence linphone_presence_model_get_consolidated_presence(const LinphonePresenceModel *model); @@ -282,7 +282,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_presence_model_clear_persons(LinphonePre * It is any of theses cases: * - basic status is'open' and no activities * - explicit 'online' tag in the status - * @param[in] model LinphonePresenceModel object + * @param[in] model #LinphonePresenceModel object * @return A boolean value telling whether the presence model is considered online or not. */ LINPHONE_PUBLIC bool_t linphone_presence_model_is_online(const LinphonePresenceModel *model); @@ -294,7 +294,7 @@ LINPHONE_PUBLIC bool_t linphone_presence_model_is_online(const LinphonePresenceM /** * Gets the string representation of a presence basic status. - * @param[in] basic_status A LinphonePresenceBasicStatus for which to get a string representation. + * @param[in] basic_status A #LinphonePresenceBasicStatus for which to get a string representation. * @return A pointer a dynamically allocated string representing the given basic status. * * The returned string is to be freed by calling ms_free(). diff --git a/include/linphone/proxy_config.h b/include/linphone/proxy_config.h index ead6e6663..6f5861f0b 100644 --- a/include/linphone/proxy_config.h +++ b/include/linphone/proxy_config.h @@ -388,7 +388,7 @@ LINPHONE_PUBLIC const char* linphone_proxy_config_get_transport(const LinphonePr /** * Destroys a proxy config. - * @note: LinphoneProxyConfig that have been removed from LinphoneCore with + * @note: #LinphoneProxyConfig that have been removed from #LinphoneCore with * linphone_core_remove_proxy_config() must not be freed. * @deprecated * @donotwrap @@ -449,7 +449,7 @@ LINPHONE_PUBLIC LinphoneAddress* linphone_proxy_config_normalize_sip_uri(Linphon /** * Set default privacy policy for all calls routed through this proxy. * @param[in] cfg #LinphoneProxyConfig object. - * @param privacy LinphonePrivacy to configure privacy + * @param privacy #LinphonePrivacy to configure privacy * */ LINPHONE_PUBLIC void linphone_proxy_config_set_privacy(LinphoneProxyConfig *cfg, LinphonePrivacyMask privacy); @@ -511,14 +511,14 @@ LINPHONE_PUBLIC uint8_t linphone_proxy_config_get_avpf_rr_interval(const Linphon /** * Get enablement status of RTCP feedback (also known as AVPF profile). * @param[in] cfg #LinphoneProxyConfig object. - * @return the enablement mode, which can be LinphoneAVPFDefault (use LinphoneCore's mode), LinphoneAVPFEnabled (avpf is enabled), or LinphoneAVPFDisabled (disabled). + * @return the enablement mode, which can be #LinphoneAVPFDefault (use LinphoneCore's mode), #LinphoneAVPFEnabled (avpf is enabled), or #LinphoneAVPFDisabled (disabled). **/ LINPHONE_PUBLIC LinphoneAVPFMode linphone_proxy_config_get_avpf_mode(const LinphoneProxyConfig *cfg); /** * Enable the use of RTCP feedback (also known as AVPF profile). * @param[in] cfg #LinphoneProxyConfig object. - * @param[in] mode the enablement mode, which can be LinphoneAVPFDefault (use LinphoneCore's mode), LinphoneAVPFEnabled (avpf is enabled), or LinphoneAVPFDisabled (disabled). + * @param[in] mode the enablement mode, which can be #LinphoneAVPFDefault (use LinphoneCore's mode), #LinphoneAVPFEnabled (avpf is enabled), or #LinphoneAVPFDisabled (disabled). **/ LINPHONE_PUBLIC void linphone_proxy_config_set_avpf_mode(LinphoneProxyConfig *cfg, LinphoneAVPFMode mode); @@ -571,7 +571,7 @@ LINPHONE_PUBLIC void linphone_proxy_config_set_ref_key(LinphoneProxyConfig *cfg, * Get The policy that is used to pass through NATs/firewalls when using this proxy config. * If it is set to NULL, the default NAT policy from the core will be used instead. * @param[in] cfg #LinphoneProxyConfig object - * @return LinphoneNatPolicy object in use. + * @return #LinphoneNatPolicy object in use. * @see linphone_core_get_nat_policy() */ LINPHONE_PUBLIC LinphoneNatPolicy * linphone_proxy_config_get_nat_policy(const LinphoneProxyConfig *cfg); @@ -580,7 +580,7 @@ LINPHONE_PUBLIC LinphoneNatPolicy * linphone_proxy_config_get_nat_policy(const L * Set the policy to use to pass through NATs/firewalls when using this proxy config. * If it is set to NULL, the default NAT policy from the core will be used instead. * @param[in] cfg #LinphoneProxyConfig object - * @param[in] policy LinphoneNatPolicy object + * @param[in] policy #LinphoneNatPolicy object * @see linphone_core_set_nat_policy() */ LINPHONE_PUBLIC void linphone_proxy_config_set_nat_policy(LinphoneProxyConfig *cfg, LinphoneNatPolicy *policy); diff --git a/include/linphone/ringtoneplayer.h b/include/linphone/ringtoneplayer.h index 81dc5f45d..fce0dd739 100644 --- a/include/linphone/ringtoneplayer.h +++ b/include/linphone/ringtoneplayer.h @@ -35,7 +35,7 @@ LINPHONE_PUBLIC LinphoneStatus linphone_ringtoneplayer_start(MSFactory *factory, /** * Start a ringtone player * @param factory A MSFactory object - * @param rp LinphoneRingtonePlayer object + * @param rp #LinphoneRingtonePlayer object * @param card unused argument * @param ringtone path to the ringtone to play * @param loop_pause_ms pause interval in milliseconds to be observed between end of play and resuming at start. A value of -1 disables loop mode diff --git a/include/linphone/tunnel.h b/include/linphone/tunnel.h index 3fbfa9c4b..fbd174a0f 100644 --- a/include/linphone/tunnel.h +++ b/include/linphone/tunnel.h @@ -37,13 +37,13 @@ /** * Linphone tunnel aims is to bypass IP traffic blocking due to aggressive firewalls which typically only authorize TCP traffic with destination port 443. *
Its principle is tunneling all SIP and/or RTP traffic through a single secure https connection up to a detunnelizer server. - *
This set of methods enhance LinphoneCore functionalities in order to provide an easy to use API to + *
This set of methods enhance #LinphoneCore functionalities in order to provide an easy to use API to * \li provision tunnel servers IP addresses and ports. This functionality is an option not implemented under GPL. Availability can be check at runtime using function #linphone_core_tunnel_available * \li start/stop the tunneling service * \li perform auto-detection whether tunneling is required, based on a test of sending/receiving a flow of UDP packets. * * It takes in charge automatically the SIP registration procedure when connecting or disconnecting to a tunnel server. - * No other action on LinphoneCore is required to enable full operation in tunnel mode. + * No other action on #LinphoneCore is required to enable full operation in tunnel mode. * *
Provision is done using object #LinphoneTunnelConfig created by function #linphone_tunnel_config_new(). Functions #linphone_tunnel_config_set_host * and #linphone_tunnel_config_set_port allow to point to tunnel server IP/port. Once set, use function #linphone_tunnel_add_server to provision a tunnel server. @@ -108,56 +108,56 @@ LINPHONE_PUBLIC void linphone_tunnel_unref(LinphoneTunnel *tunnel); /** * Set the IP address or hostname of the tunnel server. - * @param tunnel LinphoneTunnelConfig object + * @param tunnel #LinphoneTunnelConfig object * @param host The tunnel server IP address or hostname */ LINPHONE_PUBLIC void linphone_tunnel_config_set_host(LinphoneTunnelConfig *tunnel, const char *host); /** * Get the IP address or hostname of the tunnel server. - * @param tunnel LinphoneTunnelConfig object + * @param tunnel #LinphoneTunnelConfig object * @return The tunnel server IP address or hostname */ LINPHONE_PUBLIC const char *linphone_tunnel_config_get_host(const LinphoneTunnelConfig *tunnel); /** * Set tls port of server. - * @param tunnel LinphoneTunnelConfig object + * @param tunnel #LinphoneTunnelConfig object * @param port The tunnel server TLS port, recommended value is 443 */ LINPHONE_PUBLIC void linphone_tunnel_config_set_port(LinphoneTunnelConfig *tunnel, int port); /** * Get the TLS port of the tunnel server. - * @param tunnel LinphoneTunnelConfig object + * @param tunnel #LinphoneTunnelConfig object * @return The TLS port of the tunnel server */ LINPHONE_PUBLIC int linphone_tunnel_config_get_port(const LinphoneTunnelConfig *tunnel); /** * Set the IP address or hostname of the second tunnel server when using dual tunnel client. - * @param tunnel LinphoneTunnelConfig object + * @param tunnel #LinphoneTunnelConfig object * @param host The tunnel server IP address or hostname */ LINPHONE_PUBLIC void linphone_tunnel_config_set_host2(LinphoneTunnelConfig *tunnel, const char *host); /** * Get the IP address or hostname of the second tunnel server when using dual tunnel client. - * @param tunnel LinphoneTunnelConfig object + * @param tunnel #LinphoneTunnelConfig object * @return The tunnel server IP address or hostname */ LINPHONE_PUBLIC const char *linphone_tunnel_config_get_host2(const LinphoneTunnelConfig *tunnel); /** * Set tls port of the second server when using dual tunnel client. - * @param tunnel LinphoneTunnelConfig object + * @param tunnel #LinphoneTunnelConfig object * @param port The tunnel server TLS port, recommended value is 443 */ LINPHONE_PUBLIC void linphone_tunnel_config_set_port2(LinphoneTunnelConfig *tunnel, int port); /** * Get the TLS port of the second tunnel server when using dual tunnel client. - * @param tunnel LinphoneTunnelConfig object + * @param tunnel #LinphoneTunnelConfig object * @return The TLS port of the tunnel server */ LINPHONE_PUBLIC int linphone_tunnel_config_get_port2(const LinphoneTunnelConfig *tunnel); @@ -165,7 +165,7 @@ LINPHONE_PUBLIC int linphone_tunnel_config_get_port2(const LinphoneTunnelConfig /** * Set the remote port on the tunnel server side used to test UDP reachability. * This is used when the mode is set auto, to detect whether the tunnel has to be enabled or not. - * @param tunnel LinphoneTunnelConfig object + * @param tunnel #LinphoneTunnelConfig object * @param remote_udp_mirror_port The remote port on the tunnel server side used to test UDP reachability, set to -1 to disable the feature */ LINPHONE_PUBLIC void linphone_tunnel_config_set_remote_udp_mirror_port(LinphoneTunnelConfig *tunnel, int remote_udp_mirror_port); @@ -173,40 +173,40 @@ LINPHONE_PUBLIC void linphone_tunnel_config_set_remote_udp_mirror_port(LinphoneT /** * Get the remote port on the tunnel server side used to test UDP reachability. * This is used when the mode is set auto, to detect whether the tunnel has to be enabled or not. - * @param tunnel LinphoneTunnelConfig object + * @param tunnel #LinphoneTunnelConfig object * @return The remote port on the tunnel server side used to test UDP reachability */ LINPHONE_PUBLIC int linphone_tunnel_config_get_remote_udp_mirror_port(const LinphoneTunnelConfig *tunnel); /** * Set the UDP packet round trip delay in ms for a tunnel configuration. - * @param tunnel LinphoneTunnelConfig object + * @param tunnel #LinphoneTunnelConfig object * @param delay The UDP packet round trip delay in ms considered as acceptable (recommended value is 1000 ms). */ LINPHONE_PUBLIC void linphone_tunnel_config_set_delay(LinphoneTunnelConfig *tunnel, int delay); /** * Get the UDP packet round trip delay in ms for a tunnel configuration. - * @param tunnel LinphoneTunnelConfig object + * @param tunnel #LinphoneTunnelConfig object * @return The UDP packet round trip delay in ms. */ LINPHONE_PUBLIC int linphone_tunnel_config_get_delay(const LinphoneTunnelConfig *tunnel); /** - * Increment the refcount of LinphoneTunnelConfig object. - * @param cfg the LinphoneTunnelConfig object. + * Increment the refcount of #LinphoneTunnelConfig object. + * @param cfg the #LinphoneTunnelConfig object. * @return the same cfg object. **/ LINPHONE_PUBLIC LinphoneTunnelConfig * linphone_tunnel_config_ref(LinphoneTunnelConfig *cfg); /** - * Decrement the refcount of LinphoneTunnelConfig object. - * @param cfg the LinphoneTunnelConfig object. + * Decrement the refcount of #LinphoneTunnelConfig object. + * @param cfg the #LinphoneTunnelConfig object. **/ LINPHONE_PUBLIC void linphone_tunnel_config_unref(LinphoneTunnelConfig *cfg); /** * Destroy a tunnel configuration - * @param tunnel LinphoneTunnelConfig object + * @param tunnel #LinphoneTunnelConfig object * @deprecated use linphone_tunnel_config_unref(). * @donotwrap */ @@ -228,28 +228,28 @@ LINPHONE_PUBLIC void *linphone_tunnel_config_get_user_data(LinphoneTunnelConfig /** * Add a tunnel server configuration. - * @param tunnel LinphoneTunnel object - * @param tunnel_config LinphoneTunnelConfig object + * @param tunnel #LinphoneTunnel object + * @param tunnel_config #LinphoneTunnelConfig object */ LINPHONE_PUBLIC void linphone_tunnel_add_server(LinphoneTunnel *tunnel, LinphoneTunnelConfig *tunnel_config); /** * Remove a tunnel server configuration. - * @param tunnel LinphoneTunnel object - * @param tunnel_config LinphoneTunnelConfig object + * @param tunnel #LinphoneTunnel object + * @param tunnel_config #LinphoneTunnelConfig object */ LINPHONE_PUBLIC void linphone_tunnel_remove_server(LinphoneTunnel *tunnel, LinphoneTunnelConfig *tunnel_config); /** * Get added servers - * @param tunnel LinphoneTunnel object + * @param tunnel #LinphoneTunnel object * @return \bctbx_list{LinphoneTunnelConfig} */ LINPHONE_PUBLIC const bctbx_list_t *linphone_tunnel_get_servers(const LinphoneTunnel *tunnel); /** * Remove all tunnel server addresses previously entered with linphone_tunnel_add_server() - * @param tunnel LinphoneTunnel object + * @param tunnel #LinphoneTunnel object **/ LINPHONE_PUBLIC void linphone_tunnel_clean_servers(LinphoneTunnel *tunnel); @@ -259,15 +259,15 @@ LINPHONE_PUBLIC void linphone_tunnel_clean_servers(LinphoneTunnel *tunnel); * If the mode is set to 'auto', the tunnel manager will try to established an RTP session * with the tunnel server on the UdpMirrorPort. If the connection fail, the tunnel is automatically * activated whereas the tunnel is automatically disabled if the connection succeed. - * @param tunnel LinphoneTunnel object - * @param mode The desired LinphoneTunnelMode + * @param tunnel #LinphoneTunnel object + * @param mode The desired #LinphoneTunnelMode **/ LINPHONE_PUBLIC void linphone_tunnel_set_mode(LinphoneTunnel *tunnel, LinphoneTunnelMode mode); /** * Get the tunnel mode - * @param tunnel LinphoneTunnel object - * @return The current LinphoneTunnelMode + * @param tunnel #LinphoneTunnel object + * @return The current #LinphoneTunnelMode **/ LINPHONE_PUBLIC LinphoneTunnelMode linphone_tunnel_get_mode(const LinphoneTunnel *tunnel); @@ -275,14 +275,14 @@ LINPHONE_PUBLIC LinphoneTunnelMode linphone_tunnel_get_mode(const LinphoneTunnel * Sets whether or not to use the dual tunnel client mode. * By default this feature is disabled. * After enabling it, add a server with 2 hosts and 2 ports for the feature to work. - * @param tunnel LinphoneTunnel object + * @param tunnel #LinphoneTunnel object * @param dual_mode_enabled TRUE to enable it, FALSE to disable it */ LINPHONE_PUBLIC void linphone_tunnel_enable_dual_mode(LinphoneTunnel *tunnel, bool_t dual_mode_enabled); /** * Get the dual tunnel client mode - * @param tunnel LinphoneTunnel object + * @param tunnel #LinphoneTunnel object * @return TRUE if dual tunnel client mode is enabled, FALSE otherwise **/ LINPHONE_PUBLIC bool_t linphone_tunnel_dual_mode_enabled(const LinphoneTunnel *tunnel); @@ -298,7 +298,7 @@ LINPHONE_PUBLIC bool_t linphone_tunnel_get_activated(const LinphoneTunnel *tunne /** * Check whether the tunnel is connected - * @param tunnel LinphoneTunnel object + * @param tunnel #LinphoneTunnel object * @return A boolean value telling if the tunnel is connected **/ LINPHONE_PUBLIC bool_t linphone_tunnel_connected(const LinphoneTunnel *tunnel); @@ -308,27 +308,27 @@ LINPHONE_PUBLIC bool_t linphone_tunnel_connected(const LinphoneTunnel *tunnel); * This method is useful when the device switches from wifi to Edge/3G or vice versa. In most cases the tunnel client socket * won't be notified promptly that its connection is now zombie, so it is recommended to call this method that will cause * the lost connection to be closed and new connection to be issued. - * @param tunnel LinphoneTunnel object + * @param tunnel #LinphoneTunnel object **/ LINPHONE_PUBLIC void linphone_tunnel_reconnect(LinphoneTunnel *tunnel); /** * Set whether SIP packets must be directly sent to a UA or pass through the tunnel - * @param tunnel LinphoneTunnel object + * @param tunnel #LinphoneTunnel object * @param enable If true, SIP packets shall pass through the tunnel */ LINPHONE_PUBLIC void linphone_tunnel_enable_sip(LinphoneTunnel *tunnel, bool_t enable); /** * Check whether tunnel is set to transport SIP packets - * @param tunnel LinphoneTunnel object + * @param tunnel #LinphoneTunnel object * @return A boolean value telling whether SIP packets shall pass through the tunnel */ LINPHONE_PUBLIC bool_t linphone_tunnel_sip_enabled(const LinphoneTunnel *tunnel); /** * Set an optional http proxy to go through when connecting to tunnel server. - * @param tunnel LinphoneTunnel object + * @param tunnel #LinphoneTunnel object * @param host http proxy host * @param port http proxy port * @param username Optional http proxy username if the proxy request authentication. Currently only basic authentication is supported. Use NULL if not needed. @@ -338,7 +338,7 @@ LINPHONE_PUBLIC void linphone_tunnel_set_http_proxy(LinphoneTunnel *tunnel, cons /** * Retrieve optional http proxy configuration previously set with linphone_tunnel_set_http_proxy(). - * @param tunnel LinphoneTunnel object + * @param tunnel #LinphoneTunnel object * @param host http proxy host * @param port http proxy port * @param username Optional http proxy username if the proxy request authentication. Currently only basic authentication is supported. Use NULL if not needed. @@ -349,7 +349,7 @@ LINPHONE_PUBLIC void linphone_tunnel_get_http_proxy(LinphoneTunnel*tunnel,const /** * Set authentication info for the http proxy - * @param tunnel LinphoneTunnel object + * @param tunnel #LinphoneTunnel object * @param username User name * @param passwd Password */ @@ -387,7 +387,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_tunnel_auto_detect(LinphoneTun /** * Tell whether tunnel auto detection is enabled. - * @param[in] tunnel LinphoneTunnel object. + * @param[in] tunnel #LinphoneTunnel object. * @return TRUE if auto detection is enabled, FALSE otherwise. * @deprecated Replaced by linphone_tunnel_get_mode() * @donotwrap diff --git a/include/linphone/types.h b/include/linphone/types.h index d3b03ce25..defbeb454 100644 --- a/include/linphone/types.h +++ b/include/linphone/types.h @@ -30,20 +30,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "linphone/api/c-types.h" /** - * The LinphoneAccountCreator object used to configure an account on a server via XML-RPC. + * The #LinphoneAccountCreator object used to configure an account on a server via XML-RPC. * @ingroup account_creator **/ typedef struct _LinphoneAccountCreator LinphoneAccountCreator; /** - * An object to define a LinphoneAccountCreator service. + * An object to define a #LinphoneAccountCreator service. * @ingroup account_creator * @donotwrap **/ typedef struct _LinphoneAccountCreatorService LinphoneAccountCreatorService; /** - * An object to handle the responses callbacks for handling the LinphoneAccountCreator operations. + * An object to handle the responses callbacks for handling the #LinphoneAccountCreator operations. * @ingroup account_creator **/ typedef struct _LinphoneAccountCreatorCbs LinphoneAccountCreatorCbs; @@ -200,13 +200,13 @@ typedef enum _LinphoneAudioRoute { * Sometimes, a userid is required by proxy, and realm can be useful to discriminate * different SIP domains. * - * Once created and filled, a LinphoneAuthInfo must be added to the LinphoneCore in + * Once created and filled, a #LinphoneAuthInfo must be added to the #LinphoneCore in * order to become known and used automatically when needed. * Use linphone_core_add_auth_info() for that purpose. * - * The LinphoneCore object can take the initiative to request authentication information + * The #LinphoneCore object can take the initiative to request authentication information * when needed to the application through the auth_info_requested callback of the - * LinphoneCoreVTable structure. + * #LinphoneCoreVTable structure. * * The application can respond to this information request later using * linphone_core_add_auth_info(). This will unblock all pending authentication @@ -236,7 +236,7 @@ typedef enum _LinphoneAVPFMode { } LinphoneAVPFMode; /** - * The LinphoneContent object representing a data buffer. + * The #LinphoneContent object representing a data buffer. * @ingroup misc **/ typedef struct _LinphoneBuffer LinphoneBuffer; @@ -257,7 +257,7 @@ typedef enum _LinphoneCallDir { typedef struct _LinphoneCallLog LinphoneCallLog; /** - * The LinphoneCallParams is an object containing various call related parameters. + * The #LinphoneCallParams is an object containing various call related parameters. * It can be used to retrieve parameters from a currently running call or modify * the call's characteristics dynamically. * @ingroup call_control @@ -265,10 +265,10 @@ typedef struct _LinphoneCallLog LinphoneCallLog; typedef struct _LinphoneCallParams LinphoneCallParams; /** - * The LinphoneCallStats objects carries various statistic informations regarding quality of audio or video streams. + * The #LinphoneCallStats objects carries various statistic informations regarding quality of audio or video streams. * - * To receive these informations periodically and as soon as they are computed, the application is invited to place a #LinphoneCoreCallStatsUpdatedCb callback in the LinphoneCoreVTable structure - * it passes for instanciating the LinphoneCore object (see linphone_core_new() ). + * To receive these informations periodically and as soon as they are computed, the application is invited to place a #LinphoneCoreCallStatsUpdatedCb callback in the #LinphoneCoreVTable structure + * it passes for instanciating the #LinphoneCore object (see linphone_core_new() ). * * At any time, the application can access last computed statistics using linphone_call_get_audio_stats() or linphone_call_get_video_stats(). * @ingroup call_misc @@ -290,7 +290,7 @@ typedef enum _LinphoneCallStatus { } LinphoneCallStatus; /** - * LinphoneConference class + * #LinphoneConference class * The _LinphoneConference struct does not exists, it's the Conference C++ class that is used behind * @ingroup call_control */ @@ -304,7 +304,7 @@ typedef struct _LinphoneConference LinphoneConference; typedef struct _LinphoneConferenceParams LinphoneConferenceParams; /** - * The LinphoneConfig object is used to manipulate a configuration file. + * The #LinphoneConfig object is used to manipulate a configuration file. * * The format of the configuration file is a .ini like format: * - sections are defined in [] @@ -330,7 +330,7 @@ typedef struct _LpConfig LinphoneConfig; #define LpConfig LinphoneConfig /** - * LinphoneGlobalState describes the global state of the LinphoneCore object. + * #LinphoneGlobalState describes the global state of the #LinphoneCore object. * It is notified via the LinphoneCoreVTable::global_state_changed * @ingroup initializing **/ @@ -361,14 +361,14 @@ typedef struct _LinphoneContactSearch LinphoneContactSearch; typedef unsigned int LinphoneContactSearchID; /** - * Old name of LinphoneContactSearchID + * Old name of #LinphoneContactSearchID * @deprecated * @donotwrap */ LINPHONE_DEPRECATED typedef LinphoneContactSearchID ContactSearchID; /** - * The LinphoneContent object holds data that can be embedded in a signaling message. + * The #LinphoneContent object holds data that can be embedded in a signaling message. * @ingroup misc **/ typedef struct _LinphoneContent LinphoneContent; @@ -406,7 +406,7 @@ typedef enum _LinphoneEcCalibratorStatus { /** * Object representing full details about a signaling error or status. - * All LinphoneErrorInfo object returned by the liblinphone API are readonly and transcients. For safety they must be used immediately + * All #LinphoneErrorInfo object returned by the liblinphone API are readonly and transcients. For safety they must be used immediately * after obtaining them. Any other function call to the liblinphone may change their content or invalidate the pointer. * @ingroup misc **/ @@ -448,13 +448,13 @@ typedef enum _LinphoneFirewallPolicy { typedef struct _LinphoneFriend LinphoneFriend; /** - * The LinphoneFriendList object representing a list of friends. + * The #LinphoneFriendList object representing a list of friends. * @ingroup buddy_list **/ typedef struct _LinphoneFriendList LinphoneFriendList; /** - * An object to handle the callbacks for LinphoneFriend synchronization. + * An object to handle the callbacks for #LinphoneFriend synchronization. * @ingroup buddy_list **/ typedef struct _LinphoneFriendListCbs LinphoneFriendListCbs; @@ -480,7 +480,7 @@ typedef enum _LinphoneFriendListSyncStatus { } LinphoneFriendListSyncStatus; /** - * LinphoneGlobalState describes the global state of the LinphoneCore object. + * #LinphoneGlobalState describes the global state of the #LinphoneCore object. * It is notified via the LinphoneCoreVTable::global_state_changed * @ingroup initializing **/ @@ -513,7 +513,7 @@ typedef enum _LinphoneIceState { typedef struct _LinphoneImEncryptionEngine LinphoneImEncryptionEngine; /** - * An object to handle the callbacks for the handling a LinphoneImEncryptionEngine object. + * An object to handle the callbacks for the handling a #LinphoneImEncryptionEngine object. * @ingroup misc * @donotwrap */ @@ -527,7 +527,7 @@ typedef struct _LinphoneImEncryptionEngineCbs LinphoneImEncryptionEngineCbs; typedef struct _LinphoneImNotifPolicy LinphoneImNotifPolicy; /** - * The LinphoneInfoMessage is an object representing an informational message sent or received by the core. + * The #LinphoneInfoMessage is an object representing an informational message sent or received by the core. * @ingroup misc **/ typedef struct _LinphoneInfoMessage LinphoneInfoMessage; @@ -555,7 +555,7 @@ typedef enum _LinphoneLogCollectionState { } LinphoneLogCollectionState; /** - * LinphoneCoreLogCollectionUploadState is used to notify if log collection upload have been succesfully delivered or not. + * #LinphoneCoreLogCollectionUploadState is used to notify if log collection upload have been succesfully delivered or not. * @ingroup initializing */ typedef enum _LinphoneCoreLogCollectionUploadState { @@ -622,7 +622,7 @@ typedef enum _LinphoneOnlineStatus{ typedef struct _LinphonePlayer LinphonePlayer; /** - * An object to handle the callbacks for the handling a LinphonePlayer objects. + * An object to handle the callbacks for the handling a #LinphonePlayer objects. * @ingroup call_control */ typedef struct _LinphonePlayerCbs LinphonePlayerCbs; @@ -832,11 +832,11 @@ typedef enum _LinphonePrivacy { typedef unsigned int LinphonePrivacyMask; /** - * The LinphoneProxyConfig object represents a proxy configuration to be used - * by the LinphoneCore object. + * The #LinphoneProxyConfig object represents a proxy configuration to be used + * by the #LinphoneCore object. * Its fields must not be used directly in favour of the accessors methods. - * Once created and filled properly the LinphoneProxyConfig can be given to - * LinphoneCore with linphone_core_add_proxy_config(). + * Once created and filled properly the #LinphoneProxyConfig can be given to + * #LinphoneCore with linphone_core_add_proxy_config(). * This will automatically triggers the registration, if enabled. * * The proxy configuration are persistent to restarts because they are saved @@ -900,7 +900,7 @@ typedef enum _LinphoneReason{ #define LinphoneReasonMedia LinphoneReasonUnsupportedContent /** - * LinphoneRegistrationState describes proxy registration states. + * #LinphoneRegistrationState describes proxy registration states. * @ingroup proxies **/ typedef enum _LinphoneRegistrationState { @@ -936,7 +936,7 @@ typedef struct _LinphoneSipTransports { typedef struct _LinphoneTransports LinphoneTransports; /** - * Old name of LinphoneSipTransports + * Old name of #LinphoneSipTransports * @deprecated * @donotwrap */ @@ -982,7 +982,7 @@ typedef enum _LinphoneSubscriptionDir{ /** * Enum for subscription states. - * LinphoneSubscriptionTerminated and LinphoneSubscriptionError are final states. + * #LinphoneSubscriptionTerminated and #LinphoneSubscriptionError are final states. * @ingroup event_api **/ typedef enum _LinphoneSubscriptionState{ @@ -1058,7 +1058,7 @@ typedef enum _LinphoneUpnpState { } LinphoneUpnpState; /** - * The LinphoneVcard object. + * The #LinphoneVcard object. * @ingroup carddav_vcard */ typedef struct _LinphoneVcard LinphoneVcard; @@ -1074,7 +1074,7 @@ typedef enum _LinphoneVersionUpdateCheckResult { } LinphoneVersionUpdateCheckResult; /** - * The LinphoneVideoDefinition object represents a video definition, eg. its width and its height. + * The #LinphoneVideoDefinition object represents a video definition, eg. its width and its height. * @ingroup media_parameters */ typedef struct _LinphoneVideoDefinition LinphoneVideoDefinition; @@ -1103,7 +1103,7 @@ typedef struct LinphoneVideoSizeDef { } LinphoneVideoSizeDef; /** - * Old name of LinphoneVideoSizeDef + * Old name of #LinphoneVideoSizeDef * @deprecated */ typedef LinphoneVideoSizeDef MSVideoSizeDef; @@ -1125,19 +1125,19 @@ typedef enum _LinphoneXmlRpcArgType { } LinphoneXmlRpcArgType; /** - * The LinphoneXmlRpcRequest object representing a XML-RPC request to be sent. + * The #LinphoneXmlRpcRequest object representing a XML-RPC request to be sent. * @ingroup misc **/ typedef struct _LinphoneXmlRpcRequest LinphoneXmlRpcRequest; /** - * An object to handle the callbacks for handling the LinphoneXmlRpcRequest operations. + * An object to handle the callbacks for handling the #LinphoneXmlRpcRequest operations. * @ingroup misc **/ typedef struct _LinphoneXmlRpcRequestCbs LinphoneXmlRpcRequestCbs; /** - * The LinphoneXmlRpcSession object used to send XML-RPC requests and handle their responses. + * The #LinphoneXmlRpcSession object used to send XML-RPC requests and handle their responses. * @ingroup misc **/ typedef struct _LinphoneXmlRpcSession LinphoneXmlRpcSession; diff --git a/include/linphone/vcard.h b/include/linphone/vcard.h index fd12db4fb..9f7527f08 100644 --- a/include/linphone/vcard.h +++ b/include/linphone/vcard.h @@ -38,16 +38,16 @@ extern "C" #define LINPHONE_VCARD BELLE_SIP_CAST(object, LinphoneVcard) /** - * Creates a LinphoneVcard object that has a pointer to an empty vCard - * @return a new LinphoneVcard object + * Creates a #LinphoneVcard object that has a pointer to an empty vCard + * @return a new #LinphoneVcard object * @deprecated Use linphone_factory_create_vcard() instead. * @donotwrap */ LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneVcard* linphone_vcard_new(void); /** - * Deletes a LinphoneVcard object properly - * @param[in] vCard the LinphoneVcard to destroy + * Deletes a #LinphoneVcard object properly + * @param[in] vCard the #LinphoneVcard to destroy * @deprecated Use linphone_vcard_unref() or belle_sip_object_unref() instead. * @donotwrap */ @@ -55,145 +55,145 @@ LINPHONE_DEPRECATED LINPHONE_PUBLIC void linphone_vcard_free(LinphoneVcard *vCar /** * Take a ref on a #LinphoneVcard. - * @param[in] vCard LinphoneVcard object + * @param[in] vCard #LinphoneVcard object */ LINPHONE_PUBLIC LinphoneVcard *linphone_vcard_ref(LinphoneVcard *vCard); /** * Release a #LinphoneVcard. - * @param[in] vCard LinphoneVcard object + * @param[in] vCard #LinphoneVcard object */ LINPHONE_PUBLIC void linphone_vcard_unref(LinphoneVcard *vCard); /** * Clone a #LinphoneVcard. - * @param[in] vCard LinphoneVcard object - * @return a new LinphoneVcard object + * @param[in] vCard #LinphoneVcard object + * @return a new #LinphoneVcard object */ LINPHONE_PUBLIC LinphoneVcard *linphone_vcard_clone(const LinphoneVcard *vCard); /** * Returns the vCard4 representation of the LinphoneVcard. - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @return a const char * that represents the vCard */ LINPHONE_PUBLIC const char* linphone_vcard_as_vcard4_string(LinphoneVcard *vCard); /** * Sets the FN attribute of the vCard (which is mandatory). - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @param[in] name the display name to set for the vCard */ LINPHONE_PUBLIC void linphone_vcard_set_full_name(LinphoneVcard *vCard, const char *name); /** * Returns the FN attribute of the vCard, or NULL if it isn't set yet. - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @return the display name of the vCard, or NULL */ LINPHONE_PUBLIC const char* linphone_vcard_get_full_name(const LinphoneVcard *vCard); /** * Sets the skipFieldValidation property of the vcard - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @param[in] skip skipFieldValidation property of the vcard */ LINPHONE_PUBLIC void linphone_vcard_set_skip_validation(LinphoneVcard *vCard, bool_t skip); /** * Returns the skipFieldValidation property of the vcard. - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @return the skipFieldValidation property of the vcard */ LINPHONE_PUBLIC bool_t linphone_vcard_get_skip_validation(const LinphoneVcard *vCard); /** * Sets the family name in the N attribute of the vCard. - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @param[in] name the family name to set for the vCard */ LINPHONE_PUBLIC void linphone_vcard_set_family_name(LinphoneVcard *vCard, const char *name); /** * Returns the family name in the N attribute of the vCard, or NULL if it isn't set yet. - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @return the family name of the vCard, or NULL */ LINPHONE_PUBLIC const char* linphone_vcard_get_family_name(const LinphoneVcard *vCard); /** * Sets the given name in the N attribute of the vCard. - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @param[in] name the given name to set for the vCard */ LINPHONE_PUBLIC void linphone_vcard_set_given_name(LinphoneVcard *vCard, const char *name); /** * Returns the given name in the N attribute of the vCard, or NULL if it isn't set yet. - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @return the given name of the vCard, or NULL */ LINPHONE_PUBLIC const char* linphone_vcard_get_given_name(const LinphoneVcard *vCard); /** * Adds a SIP address in the vCard, using the IMPP property - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @param[in] sip_address the SIP address to add */ LINPHONE_PUBLIC void linphone_vcard_add_sip_address(LinphoneVcard *vCard, const char *sip_address); /** * Removes a SIP address in the vCard (if it exists), using the IMPP property - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @param[in] sip_address the SIP address to remove */ LINPHONE_PUBLIC void linphone_vcard_remove_sip_address(LinphoneVcard *vCard, const char *sip_address); /** * Edits the preferred SIP address in the vCard (or the first one), using the IMPP property - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @param[in] sip_address the new SIP address */ LINPHONE_PUBLIC void linphone_vcard_edit_main_sip_address(LinphoneVcard *vCard, const char *sip_address); /** * Returns the list of SIP addresses (as LinphoneAddress) in the vCard (all the IMPP attributes that has an URI value starting by "sip:") or NULL - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @return \bctbx_list{LinphoneAddress} */ LINPHONE_PUBLIC const bctbx_list_t* linphone_vcard_get_sip_addresses(LinphoneVcard *vCard); /** * Adds a phone number in the vCard, using the TEL property - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @param[in] phone the phone number to add */ LINPHONE_PUBLIC void linphone_vcard_add_phone_number(LinphoneVcard *vCard, const char *phone); /** * Removes a phone number in the vCard (if it exists), using the TEL property - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @param[in] phone the phone number to remove */ LINPHONE_PUBLIC void linphone_vcard_remove_phone_number(LinphoneVcard *vCard, const char *phone); /** * Returns the list of phone numbers (as string) in the vCard (all the TEL attributes) or NULL - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @return \bctbx_list{const char *} */ LINPHONE_PUBLIC bctbx_list_t* linphone_vcard_get_phone_numbers(const LinphoneVcard *vCard); /** * Fills the Organization field of the vCard - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @param[in] organization the Organization */ LINPHONE_PUBLIC void linphone_vcard_set_organization(LinphoneVcard *vCard, const char *organization); /** * Gets the Organization of the vCard - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @return the Organization of the vCard or NULL */ LINPHONE_PUBLIC const char* linphone_vcard_get_organization(const LinphoneVcard *vCard); @@ -201,49 +201,49 @@ LINPHONE_PUBLIC const char* linphone_vcard_get_organization(const LinphoneVcard /** * Generates a random unique id for the vCard. * If is required to be able to synchronize the vCard with a CardDAV server - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @return TRUE if operation is successful, otherwise FALSE (for example if it already has an unique ID) */ LINPHONE_PUBLIC bool_t linphone_vcard_generate_unique_id(LinphoneVcard *vCard); /** * Sets the unique ID of the vCard - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @param[in] uid the unique id */ LINPHONE_PUBLIC void linphone_vcard_set_uid(LinphoneVcard *vCard, const char *uid); /** * Gets the UID of the vCard - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @return the UID of the vCard, otherwise NULL */ LINPHONE_PUBLIC const char* linphone_vcard_get_uid(const LinphoneVcard *vCard); /** * Sets the eTAG of the vCard - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @param[in] etag the eTAG */ LINPHONE_PUBLIC void linphone_vcard_set_etag(LinphoneVcard *vCard, const char * etag); /** * Gets the eTag of the vCard - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @return the eTag of the vCard in the CardDAV server, otherwise NULL */ LINPHONE_PUBLIC const char* linphone_vcard_get_etag(const LinphoneVcard *vCard); /** * Sets the URL of the vCard - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @param[in] url the URL */ LINPHONE_PUBLIC void linphone_vcard_set_url(LinphoneVcard *vCard, const char *url); /** * Gets the URL of the vCard - * @param[in] vCard the LinphoneVcard + * @param[in] vCard the #LinphoneVcard * @return the URL of the vCard in the CardDAV server, otherwise NULL */ LINPHONE_PUBLIC const char* linphone_vcard_get_url(const LinphoneVcard *vCard); diff --git a/include/linphone/video_definition.h b/include/linphone/video_definition.h index 4b8c10e68..4b38e020f 100644 --- a/include/linphone/video_definition.h +++ b/include/linphone/video_definition.h @@ -36,69 +36,69 @@ extern "C" { /** * Acquire a reference to the video definition. - * @param[in] vdef LinphoneVideoDefinition object. - * @return The same LinphoneVideoDefinition object. + * @param[in] vdef #LinphoneVideoDefinition object. + * @return The same #LinphoneVideoDefinition object. **/ LINPHONE_PUBLIC LinphoneVideoDefinition * linphone_video_definition_ref(LinphoneVideoDefinition *vdef); /** * Release reference to the video definition. - * @param[in] vdef LinphoneVideoDefinition object. + * @param[in] vdef #LinphoneVideoDefinition object. **/ LINPHONE_PUBLIC void linphone_video_definition_unref(LinphoneVideoDefinition *vdef); /** * Retrieve the user pointer associated with the video definition. - * @param[in] vdef LinphoneVideoDefinition object. + * @param[in] vdef #LinphoneVideoDefinition object. * @return The user pointer associated with the video definition. **/ LINPHONE_PUBLIC void *linphone_video_definition_get_user_data(const LinphoneVideoDefinition *vdef); /** * Assign a user pointer to the video definition. - * @param[in] vdef LinphoneVideoDefinition object. + * @param[in] vdef #LinphoneVideoDefinition object. * @param[in] ud The user pointer to associate with the video definition. **/ LINPHONE_PUBLIC void linphone_video_definition_set_user_data(LinphoneVideoDefinition *vdef, void *ud); /** * Clone a video definition. - * @param[in] vdef LinphoneVideoDefinition object to be cloned + * @param[in] vdef #LinphoneVideoDefinition object to be cloned * @return The new clone of the video definition */ LINPHONE_PUBLIC LinphoneVideoDefinition * linphone_video_definition_clone(const LinphoneVideoDefinition *vdef); /** * Get the width of the video definition. - * @param[in] vdef LinphoneVideoDefinition object + * @param[in] vdef #LinphoneVideoDefinition object * @return The width of the video definition */ LINPHONE_PUBLIC unsigned int linphone_video_definition_get_width(const LinphoneVideoDefinition *vdef); /** * Set the width of the video definition. - * @param[in] vdef LinphoneVideoDefinition object + * @param[in] vdef #LinphoneVideoDefinition object * @param[in] width The width of the video definition */ LINPHONE_PUBLIC void linphone_video_definition_set_width(LinphoneVideoDefinition *vdef, unsigned int width); /** * Get the height of the video definition. - * @param[in] vdef LinphoneVideoDefinition object + * @param[in] vdef #LinphoneVideoDefinition object * @return The height of the video definition */ LINPHONE_PUBLIC unsigned int linphone_video_definition_get_height(const LinphoneVideoDefinition *vdef); /** * Set the height of the video definition. - * @param[in] vdef LinphoneVideoDefinition object + * @param[in] vdef #LinphoneVideoDefinition object * @param[in] height The height of the video definition */ LINPHONE_PUBLIC void linphone_video_definition_set_height(LinphoneVideoDefinition *vdef, unsigned int height); /** * Set the width and the height of the video definition. - * @param[in] vdef LinphoneVideoDefinition object + * @param[in] vdef #LinphoneVideoDefinition object * @param[in] width The width of the video definition * @param[in] height The height of the video definition */ @@ -106,38 +106,38 @@ LINPHONE_PUBLIC void linphone_video_definition_set_definition(LinphoneVideoDefin /** * Get the name of the video definition. - * @param[in] vdef LinphoneVideoDefinition object + * @param[in] vdef #LinphoneVideoDefinition object * @return The name of the video definition */ LINPHONE_PUBLIC const char * linphone_video_definition_get_name(const LinphoneVideoDefinition *vdef); /** * Set the name of the video definition. - * @param[in] vdef LinphoneVideoDefinition object + * @param[in] vdef #LinphoneVideoDefinition object * @param[in] name The name of the video definition */ LINPHONE_PUBLIC void linphone_video_definition_set_name(LinphoneVideoDefinition *vdef, const char *name); /** - * Tells whether two LinphoneVideoDefinition objects are equal (the widths and the heights are the same but can be switched). - * @param[in] vdef1 LinphoneVideoDefinition object - * @param[in] vdef2 LinphoneVideoDefinition object - * @return A boolean value telling whether the two LinphoneVideoDefinition objects are equal. + * Tells whether two #LinphoneVideoDefinition objects are equal (the widths and the heights are the same but can be switched). + * @param[in] vdef1 #LinphoneVideoDefinition object + * @param[in] vdef2 #LinphoneVideoDefinition object + * @return A boolean value telling whether the two #LinphoneVideoDefinition objects are equal. */ LINPHONE_PUBLIC bool_t linphone_video_definition_equals(const LinphoneVideoDefinition *vdef1, const LinphoneVideoDefinition *vdef2); /** - * Tells whether two LinphoneVideoDefinition objects are strictly equal (the widths are the same and the heights are the same). - * @param[in] vdef1 LinphoneVideoDefinition object - * @param[in] vdef2 LinphoneVideoDefinition object - * @return A boolean value telling whether the two LinphoneVideoDefinition objects are strictly equal. + * Tells whether two #LinphoneVideoDefinition objects are strictly equal (the widths are the same and the heights are the same). + * @param[in] vdef1 #LinphoneVideoDefinition object + * @param[in] vdef2 #LinphoneVideoDefinition object + * @return A boolean value telling whether the two #LinphoneVideoDefinition objects are strictly equal. */ LINPHONE_PUBLIC bool_t linphone_video_definition_strict_equals(const LinphoneVideoDefinition *vdef1, const LinphoneVideoDefinition *vdef2); /** - * Tells whether a LinphoneVideoDefinition is undefined. - * @param[in] vdef LinphoneVideoDefinition object - * @return A boolean value telling whether the LinphoneVideoDefinition is undefined. + * Tells whether a #LinphoneVideoDefinition is undefined. + * @param[in] vdef #LinphoneVideoDefinition object + * @return A boolean value telling whether the #LinphoneVideoDefinition is undefined. */ LINPHONE_PUBLIC bool_t linphone_video_definition_is_undefined(const LinphoneVideoDefinition *vdef); diff --git a/include/linphone/wrapper_utils.h b/include/linphone/wrapper_utils.h index 2a034c36a..2e19ad9a3 100644 --- a/include/linphone/wrapper_utils.h +++ b/include/linphone/wrapper_utils.h @@ -74,7 +74,7 @@ LINPHONE_PUBLIC void linphone_chat_room_send_chat_message_2(LinphoneChatRoom *cr * instead of totaly takes ownership on it. Thus, the #LinphoneChatMessage object must be released by the API user after calling * that function. * - * @param[in] msg LinphoneChatMessage object + * @param[in] msg #LinphoneChatMessage object */ LINPHONE_PUBLIC void linphone_chat_message_resend_2(LinphoneChatMessage *msg); diff --git a/include/linphone/xmlrpc.h b/include/linphone/xmlrpc.h index 67f8df2ad..ce3cecfc6 100644 --- a/include/linphone/xmlrpc.h +++ b/include/linphone/xmlrpc.h @@ -35,78 +35,78 @@ extern "C" { */ /** - * Create a new LinphoneXmlRpcRequest object. + * Create a new #LinphoneXmlRpcRequest object. * @param[in] return_type The expected XML-RPC response type. * @param[in] method The XML-RPC method to call. - * @return A new LinphoneXmlRpcRequest object. + * @return A new #LinphoneXmlRpcRequest object. **/ LINPHONE_PUBLIC LinphoneXmlRpcRequest * linphone_xml_rpc_request_new(LinphoneXmlRpcArgType return_type, const char *method); /** * Acquire a reference to the XML-RPC request. - * @param[in] request LinphoneXmlRpcRequest object. - * @return The same LinphoneXmlRpcRequest object. + * @param[in] request #LinphoneXmlRpcRequest object. + * @return The same #LinphoneXmlRpcRequest object. **/ LINPHONE_PUBLIC LinphoneXmlRpcRequest * linphone_xml_rpc_request_ref(LinphoneXmlRpcRequest *request); /** * Release reference to the XML-RPC request. - * @param[in] request LinphoneXmlRpcRequest object. + * @param[in] request #LinphoneXmlRpcRequest object. **/ LINPHONE_PUBLIC void linphone_xml_rpc_request_unref(LinphoneXmlRpcRequest *request); /** * Retrieve the user pointer associated with the XML-RPC request. - * @param[in] request LinphoneXmlRpcRequest object. + * @param[in] request #LinphoneXmlRpcRequest object. * @return The user pointer associated with the XML-RPC request. **/ LINPHONE_PUBLIC void *linphone_xml_rpc_request_get_user_data(const LinphoneXmlRpcRequest *request); /** * Assign a user pointer to the XML-RPC request. - * @param[in] request LinphoneXmlRpcRequest object. + * @param[in] request #LinphoneXmlRpcRequest object. * @param[in] ud The user pointer to associate with the XML-RPC request. **/ LINPHONE_PUBLIC void linphone_xml_rpc_request_set_user_data(LinphoneXmlRpcRequest *request, void *ud); /** * Add an integer argument to an XML-RPC request. - * @param[in] request LinphoneXmlRpcRequest object. + * @param[in] request #LinphoneXmlRpcRequest object. * @param[in] value The integer value of the added argument. **/ LINPHONE_PUBLIC void linphone_xml_rpc_request_add_int_arg(LinphoneXmlRpcRequest *request, int value); /** * Add a string argument to an XML-RPC request. - * @param[in] request LinphoneXmlRpcRequest object. + * @param[in] request #LinphoneXmlRpcRequest object. * @param[in] value The string value of the added argument. **/ LINPHONE_PUBLIC void linphone_xml_rpc_request_add_string_arg(LinphoneXmlRpcRequest *request, const char *value); /** - * Get the LinphoneXmlRpcRequestCbs object associated with a LinphoneXmlRpcRequest. - * @param[in] request LinphoneXmlRpcRequest object - * @return The LinphoneXmlRpcRequestCbs object associated with the LinphoneXmlRpcRequest. + * Get the #LinphoneXmlRpcRequestCbs object associated with a LinphoneXmlRpcRequest. + * @param[in] request #LinphoneXmlRpcRequest object + * @return The #LinphoneXmlRpcRequestCbs object associated with the LinphoneXmlRpcRequest. **/ LINPHONE_PUBLIC LinphoneXmlRpcRequestCbs * linphone_xml_rpc_request_get_callbacks(const LinphoneXmlRpcRequest *request); /** * Get the content of the XML-RPC request. - * @param[in] request LinphoneXmlRpcRequest object. + * @param[in] request #LinphoneXmlRpcRequest object. * @return The string representation of the content of the XML-RPC request. */ LINPHONE_PUBLIC const char * linphone_xml_rpc_request_get_content(const LinphoneXmlRpcRequest *request); /** * Get the status of the XML-RPC request. - * @param[in] request LinphoneXmlRpcRequest object. + * @param[in] request #LinphoneXmlRpcRequest object. * @return The status of the XML-RPC request. **/ LINPHONE_PUBLIC LinphoneXmlRpcStatus linphone_xml_rpc_request_get_status(const LinphoneXmlRpcRequest *request); /** * Get the response to an XML-RPC request sent with linphone_xml_rpc_session_send_request() and returning an integer response. - * @param[in] request LinphoneXmlRpcRequest object. + * @param[in] request #LinphoneXmlRpcRequest object. * @return The integer response to the XML-RPC request. **/ LINPHONE_PUBLIC int linphone_xml_rpc_request_get_int_response(const LinphoneXmlRpcRequest *request); @@ -119,101 +119,101 @@ LINPHONE_PUBLIC int linphone_xml_rpc_request_get_int_response(const LinphoneXmlR LINPHONE_PUBLIC const char * linphone_xml_rpc_request_get_string_response(const LinphoneXmlRpcRequest *request); /** - * Create a new LinphoneXmlRpcSession object. - * @param[in] core The LinphoneCore object used to send the XML-RPC requests. + * Create a new #LinphoneXmlRpcSession object. + * @param[in] core The #LinphoneCore object used to send the XML-RPC requests. * @param[in] url The URL of the XML-RPC server to send the XML-RPC requests to. - * @return A new LinphoneXmlRpcSession object. + * @return A new #LinphoneXmlRpcSession object. */ LINPHONE_PUBLIC LinphoneXmlRpcSession * linphone_xml_rpc_session_new(LinphoneCore *core, const char *url); /** * Acquire a reference to the XML-RPC session. - * @param[in] session LinphoneXmlRpcSession object. - * @return The same LinphoneXmlRpcSession object. + * @param[in] session #LinphoneXmlRpcSession object. + * @return The same #LinphoneXmlRpcSession object. **/ LINPHONE_PUBLIC LinphoneXmlRpcSession * linphone_xml_rpc_session_ref(LinphoneXmlRpcSession *session); /** * Release reference to the XML-RPC session. - * @param[in] session LinphoneXmlRpcSession object. + * @param[in] session #LinphoneXmlRpcSession object. * @warning This will not stop pending xml-rpc requests. Use linphone_xml_rpc_session_release() instead if this is intended. **/ LINPHONE_PUBLIC void linphone_xml_rpc_session_unref(LinphoneXmlRpcSession *session); /** * Retrieve the user pointer associated with the XML-RPC session. - * @param[in] session LinphoneXmlRpcSession object. + * @param[in] session #LinphoneXmlRpcSession object. * @return The user pointer associated with the XML-RPC session. **/ LINPHONE_PUBLIC void *linphone_xml_rpc_session_get_user_data(const LinphoneXmlRpcSession *session); /** * Assign a user pointer to the XML-RPC session. - * @param[in] session LinphoneXmlRpcSession object. + * @param[in] session #LinphoneXmlRpcSession object. * @param[in] ud The user pointer to associate with the XML-RPC session. **/ LINPHONE_PUBLIC void linphone_xml_rpc_session_set_user_data(LinphoneXmlRpcSession *session, void *ud); /** * Send an XML-RPC request. - * @param[in] session LinphoneXmlRpcSession object. - * @param[in] request The LinphoneXmlRpcRequest to be sent. + * @param[in] session #LinphoneXmlRpcSession object. + * @param[in] request The #LinphoneXmlRpcRequest to be sent. **/ LINPHONE_PUBLIC void linphone_xml_rpc_session_send_request(LinphoneXmlRpcSession *session, LinphoneXmlRpcRequest *request); /** * Stop and unref an XML rpc session. Pending requests will be aborted. - * @param[in] session LinphoneXmlRpcSession object. + * @param[in] session #LinphoneXmlRpcSession object. **/ LINPHONE_PUBLIC void linphone_xml_rpc_session_release(LinphoneXmlRpcSession *session); /** - * Acquire a reference to a LinphoneXmlRpcRequestCbs object. - * @param[in] cbs LinphoneXmlRpcRequestCbs object. - * @return The same LinphoneXmlRpcRequestCbs object. + * Acquire a reference to a #LinphoneXmlRpcRequestCbs object. + * @param[in] cbs #LinphoneXmlRpcRequestCbs object. + * @return The same #LinphoneXmlRpcRequestCbs object. **/ LINPHONE_PUBLIC LinphoneXmlRpcRequestCbs * linphone_xml_rpc_request_cbs_ref(LinphoneXmlRpcRequestCbs *cbs); /** - * Release a reference to a LinphoneXmlRpcRequestCbs object. - * @param[in] cbs LinphoneXmlRpcRequestCbs object. + * Release a reference to a #LinphoneXmlRpcRequestCbs object. + * @param[in] cbs #LinphoneXmlRpcRequestCbs object. **/ LINPHONE_PUBLIC void linphone_xml_rpc_request_cbs_unref(LinphoneXmlRpcRequestCbs *cbs); /** - * Retrieve the user pointer associated with a LinphoneXmlRpcRequestCbs object. - * @param[in] cbs LinphoneXmlRpcRequestCbs object. - * @return The user pointer associated with the LinphoneXmlRpcRequestCbs object. + * Retrieve the user pointer associated with a #LinphoneXmlRpcRequestCbs object. + * @param[in] cbs #LinphoneXmlRpcRequestCbs object. + * @return The user pointer associated with the #LinphoneXmlRpcRequestCbs object. **/ LINPHONE_PUBLIC void *linphone_xml_rpc_request_cbs_get_user_data(const LinphoneXmlRpcRequestCbs *cbs); /** - * Assign a user pointer to a LinphoneXmlRpcRequestCbs object. - * @param[in] cbs LinphoneXmlRpcRequestCbs object. - * @param[in] ud The user pointer to associate with the LinphoneXmlRpcRequestCbs object. + * Assign a user pointer to a #LinphoneXmlRpcRequestCbs object. + * @param[in] cbs #LinphoneXmlRpcRequestCbs object. + * @param[in] ud The user pointer to associate with the #LinphoneXmlRpcRequestCbs object. **/ LINPHONE_PUBLIC void linphone_xml_rpc_request_cbs_set_user_data(LinphoneXmlRpcRequestCbs *cbs, void *ud); /** * Get the response callback. - * @param[in] cbs LinphoneXmlRpcRequestCbs object. + * @param[in] cbs #LinphoneXmlRpcRequestCbs object. * @return The current response callback. **/ LINPHONE_PUBLIC LinphoneXmlRpcRequestCbsResponseCb linphone_xml_rpc_request_cbs_get_response(const LinphoneXmlRpcRequestCbs *cbs); /** * Set the response callback. - * @param[in] cbs LinphoneXmlRpcRequestCbs object. + * @param[in] cbs #LinphoneXmlRpcRequestCbs object. * @param[in] cb The response callback to be used. **/ LINPHONE_PUBLIC void linphone_xml_rpc_request_cbs_set_response(LinphoneXmlRpcRequestCbs *cbs, LinphoneXmlRpcRequestCbsResponseCb cb); /** - * Creates a LinphoneXmlRpcRequest from a LinphoneXmlRpcSession - * @param[in] session the LinphoneXmlRpcSession - * @param[in] return_type the return type of the request as a LinphoneXmlRpcArgType + * Creates a #LinphoneXmlRpcRequest from a #LinphoneXmlRpcSession + * @param[in] session the #LinphoneXmlRpcSession + * @param[in] return_type the return type of the request as a #LinphoneXmlRpcArgType * @param[in] method the function name to call - * @return a LinphoneXmlRpcRequest object + * @return a #LinphoneXmlRpcRequest object */ LINPHONE_PUBLIC LinphoneXmlRpcRequest * linphone_xml_rpc_session_create_request(LinphoneXmlRpcSession *session, LinphoneXmlRpcArgType return_type, const char *method); From 2d5a23927504a96c80407f15a29cd486d95998b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Thu, 8 Mar 2018 13:46:42 +0100 Subject: [PATCH 011/121] Adds a logo in the side panel --- coreapi/help/doc/sphinx/CMakeLists.txt | 1 + coreapi/help/doc/sphinx/conf.py.in | 7 ++++++- coreapi/help/doc/sphinx/logo.png | Bin 0 -> 1174 bytes 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 coreapi/help/doc/sphinx/logo.png diff --git a/coreapi/help/doc/sphinx/CMakeLists.txt b/coreapi/help/doc/sphinx/CMakeLists.txt index 15abb7480..0d569a438 100644 --- a/coreapi/help/doc/sphinx/CMakeLists.txt +++ b/coreapi/help/doc/sphinx/CMakeLists.txt @@ -42,6 +42,7 @@ if (ENABLE_SPHINX_DOC) ) configure_file(conf.py.in source/conf.py) configure_file(source/index.rst source/index.rst COPYONLY) + configure_file(logo.png source/logo.png COPYONLY) add_custom_command(OUTPUT ${GENERATED_SPHINX_SOURCES} COMMAND ${CMAKE_COMMAND} -E remove -f ${DOCUMENTATION_DIRS} COMMAND ${PYTHON_EXECUTABLE} '${CMAKE_CURRENT_SOURCE_DIR}/gendoc.py' '${LINPHONE_DOXYGEN_XML_DIR}' -o 'source' diff --git a/coreapi/help/doc/sphinx/conf.py.in b/coreapi/help/doc/sphinx/conf.py.in index ad43af725..f2cece998 100644 --- a/coreapi/help/doc/sphinx/conf.py.in +++ b/coreapi/help/doc/sphinx/conf.py.in @@ -90,13 +90,18 @@ html_theme = 'classic' # further. For a list of options available for each theme, see the # documentation. # -# html_theme_options = {} +html_theme_options = { + 'collapsiblesidebar': 'true' +} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] +# Path to the picture to use as logo. +html_logo = 'logo.png' + # -- Options for HTMLHelp output ------------------------------------------ diff --git a/coreapi/help/doc/sphinx/logo.png b/coreapi/help/doc/sphinx/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..de261e94ab30c74508743b5dc03e42b7026261af GIT binary patch literal 1174 zcmV;H1Zn$;P)C0000pP)t-sY;SY_ zTma;3BL8R*-)}1abtC_RIRA@A|CCq%p=tlIga5*v|JcC)V!c+(|@1RCwC$o7;MK+^ZrhP% z$cdkspP$*r@!tzJjz5cy!)rFay#7KkylO8y;NyZ0&;dF?2j~DDpaXP(4$uKQKnM6+ z08scQfG~d2uK|E^(=>VZ5&)lH{$uz`41luJYU*zQn2<_ot&|ij`SKt0@H7CE2Hn2E z#~fl2Cq1%RJ}&!N$C1rky!V{FDfX1EW)*Jv4dAjLqnRZ{K@z}|hH7#c_*wvn zut6#b_clRR0uIm*|+PDA?sSqHj5rDZS9!MXpnr(g(K^qFYrm9hMccV63Cl zP5yLR(g`sn07F8srwtJ8LghCMyxirNGJ<8t!=bq&)h@^EeGgf|3*Nx-T!i<;>V+T> z${=@jvg?W4`{y+_f?Ut+sQ@M}kHYexXzP>i3s&jx@T8AM?L!$`1;vRWRb!-G*(|T) z_32^2g!~wXgkJj8wcYwgUK2**V0nVZNxrsQZ_Q#)Ulq?FODsX)px+zrRVZo$@#py;f`RD)t0j&JSJshT*K>z>%07*qoM6N<$f`u0tn*aa+ literal 0 HcmV?d00001 From 5f2305dc9702a713ef53cfa563613ec62349a69a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Thu, 8 Mar 2018 14:32:07 +0100 Subject: [PATCH 012/121] Make the body width to adapt to browser window width --- coreapi/help/doc/sphinx/conf.py.in | 1 + 1 file changed, 1 insertion(+) diff --git a/coreapi/help/doc/sphinx/conf.py.in b/coreapi/help/doc/sphinx/conf.py.in index f2cece998..7deb8b4fd 100644 --- a/coreapi/help/doc/sphinx/conf.py.in +++ b/coreapi/help/doc/sphinx/conf.py.in @@ -91,6 +91,7 @@ html_theme = 'classic' # documentation. # html_theme_options = { + 'body_max_width': '100%', 'collapsiblesidebar': 'true' } From ddfae7e2e1dd37e009fd3c94b78e5861c609106f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Thu, 8 Mar 2018 15:24:07 +0100 Subject: [PATCH 013/121] Enable HTML5 writer --- coreapi/help/doc/sphinx/conf.py.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coreapi/help/doc/sphinx/conf.py.in b/coreapi/help/doc/sphinx/conf.py.in index 7deb8b4fd..89b2a4937 100644 --- a/coreapi/help/doc/sphinx/conf.py.in +++ b/coreapi/help/doc/sphinx/conf.py.in @@ -103,6 +103,8 @@ html_static_path = ['_static'] # Path to the picture to use as logo. html_logo = 'logo.png' +# Enable html5 +html_experimental_html5_writer = True # -- Options for HTMLHelp output ------------------------------------------ From aba5f7e473beea10d474262788de0e301626e322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Thu, 8 Mar 2018 15:49:51 +0100 Subject: [PATCH 014/121] Removes all items from the side panel except the search bar --- coreapi/help/doc/sphinx/conf.py.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/coreapi/help/doc/sphinx/conf.py.in b/coreapi/help/doc/sphinx/conf.py.in index 89b2a4937..fcff75b1a 100644 --- a/coreapi/help/doc/sphinx/conf.py.in +++ b/coreapi/help/doc/sphinx/conf.py.in @@ -106,6 +106,11 @@ html_logo = 'logo.png' # Enable html5 html_experimental_html5_writer = True +# Side bar customization +html_sidebars = { + '**': ['searchbox.html'] +} + # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. From 98d377694bfef5421b04b68309d3b70caaa776a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Fri, 9 Mar 2018 11:24:54 +0100 Subject: [PATCH 015/121] Support of enums inside class --- coreapi/help/doc/sphinx/class_page.mustache | 47 ++++++++ coreapi/help/doc/sphinx/enums_page.mustache | 2 +- coreapi/help/doc/sphinx/gendoc.py | 125 +++++++++++--------- 3 files changed, 120 insertions(+), 54 deletions(-) diff --git a/coreapi/help/doc/sphinx/class_page.mustache b/coreapi/help/doc/sphinx/class_page.mustache index fe747bf4e..ad128e5b2 100644 --- a/coreapi/help/doc/sphinx/class_page.mustache +++ b/coreapi/help/doc/sphinx/class_page.mustache @@ -35,6 +35,13 @@ Summary ======= +{{#hasEnums}} +Enums +----- + +{{{enumsSummary}}} +{{/hasEnums}} + {{#hasProperties}} Properties ---------- @@ -56,9 +63,49 @@ Class methods {{{classMethodsSummary}}} {{/hasClassMethods}} + Detailed descriptions ===================== +{{#hasEnums}} +Enums +----- + +{{#enums}} + +.. _{{{ref_label}}}: + +{{#make_subsection}}{{{name}}}{{/make_subsection}} +.. {{#write_declarator}}enum{{/write_declarator}}:: {{{declaration}}} + + {{#briefDesc}} + {{#lines}} + {{{line}}} + {{/lines}} + {{/briefDesc}} + + {{{selector}}} + + {{#enumerators}} + {{#isNotJava}} + .. {{#write_declarator}}enumerator{{/write_declarator}}:: {{{name}}} + + {{/isNotJava}} + {{#isJava}} + **{{{name}}}** + {{/isJava}} + {{#briefDesc}} + {{#lines}} + {{{line}}} + {{/lines}} + {{/briefDesc}} + + {{{selector}}} + + {{/enumerators}} +{{/enums}} +{{/hasEnums}} + {{#hasProperties}} Properties ---------- diff --git a/coreapi/help/doc/sphinx/enums_page.mustache b/coreapi/help/doc/sphinx/enums_page.mustache index cd74bd73c..cf6ce2564 100644 --- a/coreapi/help/doc/sphinx/enums_page.mustache +++ b/coreapi/help/doc/sphinx/enums_page.mustache @@ -6,7 +6,7 @@ {{/namespace}} {{#enums}} -{{{sectionName}}} +{{#make_section}}{{{name}}}{{/make_section}} .. {{#write_declarator}}enum{{/write_declarator}}:: {{{declaration}}} diff --git a/coreapi/help/doc/sphinx/gendoc.py b/coreapi/help/doc/sphinx/gendoc.py index 6a5556fa6..d772f87f1 100755 --- a/coreapi/help/doc/sphinx/gendoc.py +++ b/coreapi/help/doc/sphinx/gendoc.py @@ -144,25 +144,24 @@ class LangInfo: } -class SphinxPage(object): - def __init__(self, lang, langs, filename): +class SphinxPart(object): + def __init__(self, lang, langs): object.__init__(self) self.lang = lang self.langs = langs - self.filename = filename - - @property - def hasNamespaceDeclarator(self): - return ('namespaceDeclarator' in dir(self.docTranslator)) - + @property def language(self): return self.lang.displayName - + @property def docTranslator(self): return self.lang.docTranslator + @property + def hasNamespaceDeclarator(self): + return ('namespaceDeclarator' in dir(self.docTranslator)) + @property def isJava(self): return self.lang.langCode == 'Java' @@ -170,29 +169,22 @@ class SphinxPage(object): @property def isNotJava(self): return not self.isJava - + def make_chapter(self): return lambda text: RstTools.make_chapter(pystache.render(text, self)) - + def make_section(self): return lambda text: RstTools.make_section(pystache.render(text, self)) - + def make_subsection(self): - return lambda text: RstTools.make_subsection(pystache.render(text, self.properties)) - + return lambda text: RstTools.make_subsection(pystache.render(text, self)) + + def make_subsection(self): + return lambda text: RstTools.make_subsubsection(pystache.render(text, self)) + def write_declarator(self): return lambda text: self.docTranslator.get_declarator(text) - - def write(self, directory): - r = pystache.Renderer() - filepath = os.path.join(directory, self.filename) - with open(filepath, mode='w') as f: - f.write(r.render(self)) - - def _get_translated_namespace(self, obj): - namespace = obj.find_first_ancestor_by_type(abstractapi.Namespace) - return namespace.name.translate(self.lang.nameTranslator, recursive=True) - + def _make_selector(self, obj): links = [] for lang in self.langs: @@ -206,6 +198,46 @@ class SphinxPage(object): link = ref.translate(lang.docTranslator, label=lang.displayName) links.append(link) return ' '.join(links) + + +class EnumPart(SphinxPart): + def __init__(self, enum, lang, langs, namespace=None): + SphinxPart.__init__(self, lang, langs) + self.name = enum.name.translate(self.lang.nameTranslator) + self.fullName = enum.name.translate(self.lang.nameTranslator, recursive=True) + self.briefDesc = enum.briefDescription.translate(self.docTranslator) + self.enumerators = [self._translate_enumerator(enumerator) for enumerator in enum.enumerators] + self.selector = self._make_selector(enum) + self.sectionName = RstTools.make_section(self.name) + self.declaration = 'public enum {0}'.format(self.name) if self.lang.langCode == 'Java' else self.name + self.ref_label = '{langCode}_{name}'.format( + langCode=lang.langCode, + name=enum.name.to_c() + ) + + def _translate_enumerator(self, enumerator): + return { + 'name' : enumerator.name.translate(self.lang.nameTranslator), + 'briefDesc' : enumerator.briefDescription.translate(self.docTranslator), + 'value' : enumerator.translate_value(self.lang.langTranslator), + 'selector' : self._make_selector(enumerator) + } + + +class SphinxPage(SphinxPart): + def __init__(self, lang, langs, filename): + SphinxPart.__init__(self, lang, langs) + self.filename = filename + + def write(self, directory): + r = pystache.Renderer() + filepath = os.path.join(directory, self.filename) + with open(filepath, mode='w') as f: + f.write(r.render(self)) + + def _get_translated_namespace(self, obj): + namespace = obj.find_first_ancestor_by_type(abstractapi.Namespace) + return namespace.name.translate(self.lang.nameTranslator, recursive=True) @staticmethod def _classname_to_filename(classname): @@ -225,34 +257,7 @@ class EnumsPage(SphinxPage): def __init__(self, lang, langs, api): SphinxPage.__init__(self, lang, langs, 'enums.rst') self.namespace = api.namespace.name.translate(lang.nameTranslator) if lang.langCode != 'C' else None - self._translate_enums(api.namespace.enums) - - def _translate_enums(self, enums): - self.enums = [] - for enum in enums: - translatedEnum = { - 'name' : enum.name.translate(self.lang.nameTranslator), - 'fullName' : enum.name.translate(self.lang.nameTranslator, recursive=True), - 'briefDesc' : enum.briefDescription.translate(self.docTranslator), - 'enumerators' : self._translate_enum_values(enum), - 'selector' : self._make_selector(enum) - } - translatedEnum['sectionName'] = RstTools.make_section(translatedEnum['name']) - translatedEnum['declaration'] = 'public enum {0}'.format(translatedEnum['name']) if self.lang.langCode == 'Java' else translatedEnum['name'] - self.enums.append(translatedEnum) - - def _translate_enum_values(self, enum): - translatedEnumerators = [] - for enumerator in enum.enumerators: - translatedValue = { - 'name' : enumerator.name.translate(self.lang.nameTranslator), - 'briefDesc' : enumerator.briefDescription.translate(self.docTranslator), - 'value' : enumerator.translate_value(self.lang.langTranslator), - 'selector' : self._make_selector(enumerator) - } - translatedEnumerators.append(translatedValue) - - return translatedEnumerators + self.enums = [EnumPart(enum, lang, langs, namespace=api.namespace) for enum in api.namespace.enums] class ClassPage(SphinxPage): @@ -265,6 +270,7 @@ class ClassPage(SphinxPage): self.fullClassName = _class.name.translate(self.lang.nameTranslator, recursive=True) self.briefDoc = _class.briefDescription.translate(self.docTranslator) self.detailedDoc = _class.detailedDescription.translate(self.docTranslator) if _class.detailedDescription is not None else None + self.enums = [EnumPart(enum, lang, langs) for enum in _class.enums] self.properties = self._translate_properties(_class.properties) self.methods = self._translate_methods(_class.instanceMethods) self.classMethods = self._translate_methods(_class.classMethods) @@ -285,6 +291,10 @@ class ClassPage(SphinxPage): @property def hasProperties(self): return len(self.properties) > 0 + + @property + def hasEnums(self): + return len(self.enums) > 0 def _translate_properties(self, properties): translatedProperties = [] @@ -318,6 +328,15 @@ class ClassPage(SphinxPage): reference.relatedObject = method methAttr['link'] = reference.translate(self.lang.docTranslator, namespace=method.find_first_ancestor_by_type(abstractapi.Class, abstractapi.Interface)) return methAttr + + @property + def enumsSummary(self): + table = RstTools.Table() + for enum in self.enums: + reference = ':ref:`{0}`'.format(enum.ref_label) + briefDoc = '\n'.join([line['line'] for line in enum.briefDesc['lines']]) + table.addrow([reference, briefDoc]) + return table @property def propertiesSummary(self): From 19555f443e22e54914488cb5addf023528b7ba04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Fri, 9 Mar 2018 15:49:30 +0100 Subject: [PATCH 016/121] Fixes translate_class_reference() method --- coreapi/help/doc/sphinx/class_page.mustache | 3 --- coreapi/help/doc/sphinx/gendoc.py | 11 +++++------ tools/metadoc.py | 4 +++- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/coreapi/help/doc/sphinx/class_page.mustache b/coreapi/help/doc/sphinx/class_page.mustache index ad128e5b2..947336994 100644 --- a/coreapi/help/doc/sphinx/class_page.mustache +++ b/coreapi/help/doc/sphinx/class_page.mustache @@ -72,9 +72,6 @@ Enums ----- {{#enums}} - -.. _{{{ref_label}}}: - {{#make_subsection}}{{{name}}}{{/make_subsection}} .. {{#write_declarator}}enum{{/write_declarator}}:: {{{declaration}}} diff --git a/coreapi/help/doc/sphinx/gendoc.py b/coreapi/help/doc/sphinx/gendoc.py index d772f87f1..76cc77113 100755 --- a/coreapi/help/doc/sphinx/gendoc.py +++ b/coreapi/help/doc/sphinx/gendoc.py @@ -210,10 +210,10 @@ class EnumPart(SphinxPart): self.selector = self._make_selector(enum) self.sectionName = RstTools.make_section(self.name) self.declaration = 'public enum {0}'.format(self.name) if self.lang.langCode == 'Java' else self.name - self.ref_label = '{langCode}_{name}'.format( - langCode=lang.langCode, - name=enum.name.to_c() - ) + + ref = metadoc.ClassReference(None) + ref.relatedObject = enum + self.link = ref.translate(lang.docTranslator) def _translate_enumerator(self, enumerator): return { @@ -333,9 +333,8 @@ class ClassPage(SphinxPage): def enumsSummary(self): table = RstTools.Table() for enum in self.enums: - reference = ':ref:`{0}`'.format(enum.ref_label) briefDoc = '\n'.join([line['line'] for line in enum.briefDesc['lines']]) - table.addrow([reference, briefDoc]) + table.addrow((enum.link, briefDoc)) return table @property diff --git a/tools/metadoc.py b/tools/metadoc.py index 3db05655f..312e05547 100644 --- a/tools/metadoc.py +++ b/tools/metadoc.py @@ -437,7 +437,9 @@ class Translator: if namespace is None: description = ref.find_root() namespace = description.relatedObject.find_first_ancestor_by_type(abstractapi.Namespace, abstractapi.Class) - if namespace.name.is_prefix_of(ref.relatedObject.name): + if namespace is abstractapi.GlobalNs: + commonName = None + elif namespace.name.is_prefix_of(ref.relatedObject.name): commonName = namespace.name else: commonName = metaname.Name.find_common_parent(ref.relatedObject.name, namespace.name) From b6678d64b6149b39e086f17cb0e4584abb6f4d90 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 26 Mar 2018 10:34:18 +0200 Subject: [PATCH 017/121] Fix error messages printed by mediastreamer2 due to empty string instead of null string. --- src/conference/session/media-session.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/conference/session/media-session.cpp b/src/conference/session/media-session.cpp index d4a4c873f..a124200cf 100644 --- a/src/conference/session/media-session.cpp +++ b/src/conference/session/media-session.cpp @@ -2697,7 +2697,7 @@ void MediaSessionPrivate::startAudioStream (CallSession::State targetState, bool io.output.soundcard = playcard; } else { io.output.type = MSResourceFile; - io.output.file = recfile.c_str(); + io.output.file = recfile.empty() ? nullptr : recfile.c_str(); } } else { io.input.type = io.output.type = MSResourceRtp; @@ -2711,7 +2711,7 @@ void MediaSessionPrivate::startAudioStream (CallSession::State targetState, bool io.output.soundcard = playcard; } else { io.output.type = MSResourceFile; - io.output.file = recfile.c_str(); + io.output.file = recfile.empty() ? nullptr : recfile.c_str(); } if (captcard) { io.input.type = MSResourceSoundcard; From eb2c46536ed61939d289664c69411576d4c774cf Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 22 Sep 2017 15:01:14 +0200 Subject: [PATCH 018/121] add offer answer test for payload types --- tester/offeranswer_tester.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tester/offeranswer_tester.c b/tester/offeranswer_tester.c index b524381d5..5a70a42ba 100644 --- a/tester/offeranswer_tester.c +++ b/tester/offeranswer_tester.c @@ -105,6 +105,42 @@ static void simple_call_with_different_codec_mappings(void) { linphone_core_manager_destroy(pauline); } +static void simple_call_with_fmtps(void){ + LinphoneCoreManager* marie; + LinphoneCoreManager* pauline; + LinphoneCall *pauline_call; + + marie = linphone_core_manager_new( "marie_rc"); + pauline = linphone_core_manager_new( "pauline_tcp_rc"); + + disable_all_audio_codecs_except_one(marie->lc,"pcmu",-1); + disable_all_audio_codecs_except_one(pauline->lc,"pcmu",-1); + + /*marie set a fantasy fmtp to PCMU*/ + linphone_payload_type_set_recv_fmtp(linphone_core_get_payload_type(marie->lc, "PCMU", 8000, -1), "parles-plus-fort=1"); + + BC_ASSERT_TRUE(call(marie,pauline)); + pauline_call=linphone_core_get_current_call(pauline->lc); + BC_ASSERT_PTR_NOT_NULL(pauline_call); + if (pauline_call){ + LinphonePayloadType *pt = linphone_call_params_get_used_audio_payload_type(linphone_call_get_current_params(pauline_call)); + BC_ASSERT_PTR_NOT_NULL(pt); + if (pt){ + BC_ASSERT_STRING_EQUAL(linphone_payload_type_get_send_fmtp(pt),"parles-plus-fort=1"); + } + pt = linphone_call_params_get_used_audio_payload_type(linphone_call_get_current_params(linphone_core_get_current_call(marie->lc))); + BC_ASSERT_PTR_NOT_NULL(pt); + if (pt){ + ms_message("send_fmtp=%s, recv_fmtp=%s", linphone_payload_type_get_send_fmtp(pt), linphone_payload_type_get_recv_fmtp(pt)); + BC_ASSERT_STRING_EQUAL(linphone_payload_type_get_recv_fmtp(pt),"parles-plus-fort=1"); + } + } + + end_call(marie,pauline); + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(pauline); +} + static void call_failed_because_of_codecs(void) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_tcp_rc"); @@ -492,6 +528,7 @@ static test_t offeranswer_tests[] = { TEST_NO_TAG("Start with no config", start_with_no_config), TEST_NO_TAG("Call failed because of codecs", call_failed_because_of_codecs), TEST_NO_TAG("Simple call with different codec mappings", simple_call_with_different_codec_mappings), + TEST_NO_TAG("Simple call with fmtps", simple_call_with_fmtps), TEST_NO_TAG("AVP to AVP call", avp_to_avp_call), TEST_NO_TAG("AVP to AVPF call", avp_to_avpf_call), TEST_NO_TAG("AVP to SAVP call", avp_to_savp_call), From 3ca2b0232d3f7c333d6533836e0887904fed059b Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Fri, 22 Sep 2017 16:33:35 +0200 Subject: [PATCH 019/121] Fix cancelled_ringing_call test --- tester/call_single_tester.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tester/call_single_tester.c b/tester/call_single_tester.c index 029f921b8..88a6de226 100644 --- a/tester/call_single_tester.c +++ b/tester/call_single_tester.c @@ -1163,6 +1163,8 @@ static void cancel_other_device_after_accept(void) { BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc,&callee_mgr_2->stat.number_of_LinphoneCallEnd,1)); BC_ASSERT_TRUE(wait_for(caller_mgr->lc,callee_mgr_2->lc,&callee_mgr_2->stat.number_of_LinphoneCallReleased,1)); + wait_for_until(caller_mgr->lc,callee_mgr_2->lc,NULL,0,500); + rei = linphone_call_get_error_info(call_callee_2); BC_ASSERT_PTR_NOT_NULL(rei); if (rei){ @@ -1353,9 +1355,10 @@ static void cancelled_ringing_call(void) { BC_ASSERT_EQUAL(pauline->stat.number_of_LinphoneCallEnd,1, int, "%d"); call_history = linphone_core_get_call_history(marie->lc); - BC_ASSERT_PTR_NOT_NULL(call_history); - BC_ASSERT_EQUAL((int)bctbx_list_size(call_history),1, int,"%i"); - BC_ASSERT_EQUAL(linphone_call_log_get_status((LinphoneCallLog*)bctbx_list_get_data(call_history)), LinphoneCallMissed, LinphoneCallStatus, "%i"); + if (BC_ASSERT_PTR_NOT_NULL(call_history)) { + BC_ASSERT_EQUAL((int)bctbx_list_size(call_history),1, int,"%i"); + BC_ASSERT_EQUAL(linphone_call_log_get_status((LinphoneCallLog*)bctbx_list_get_data(call_history)), LinphoneCallMissed, LinphoneCallStatus, "%i"); + } linphone_call_unref(out_call); linphone_core_manager_destroy(marie); @@ -5082,6 +5085,7 @@ static void recovered_call_on_network_switch_during_reinvite_1(void) { wait_for(marie->lc, pauline->lc, &marie->stat.number_of_NetworkReachableTrue, 2); BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallPaused, 1)); + wait_for_until(marie->lc, pauline->lc, NULL, 1, 2000); linphone_call_terminate(incoming_call); BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &pauline->stat.number_of_LinphoneCallEnd, 1)); BC_ASSERT_TRUE(wait_for(marie->lc, pauline->lc, &marie->stat.number_of_LinphoneCallReleased, 1)); From 0945515d6c4e50959537473e801f8c545870f543 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 26 Mar 2018 15:40:51 +0200 Subject: [PATCH 020/121] Fix unreliability with custom header handling. (retrofit of commit 384669 from master branch) --- src/sal/sal.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/sal/sal.cpp b/src/sal/sal.cpp index 3346ab05e..a25236587 100644 --- a/src/sal/sal.cpp +++ b/src/sal/sal.cpp @@ -218,11 +218,14 @@ void Sal::process_request_event_cb (void *ud, const belle_sip_request_event_t *e if (!op->call_id) { op->call_id=ms_strdup(belle_sip_header_call_id_get_call_id(BELLE_SIP_HEADER_CALL_ID(belle_sip_message_get_header_by_type(BELLE_SIP_MESSAGE(req), belle_sip_header_call_id_t)))); } - /*It is worth noting that proxies can (and - will) remove this header field*/ + /*It is worth noting that proxies can (and will) remove this header field*/ op->set_privacy_from_message((belle_sip_message_t*)req); - - op->assign_recv_headers((belle_sip_message_t*)req); + + if (strcmp("ACK",method) != 0){ + /*The ACK custom header is processed specifically later on*/ + op->assign_recv_headers((belle_sip_message_t*)req); + } + if (op->callbacks && op->callbacks->process_request_event) { op->callbacks->process_request_event(op,event); } else { From 75f38a97e0ef67891b4cf7760f41b97aaccd1a54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 27 Mar 2018 17:21:59 +0200 Subject: [PATCH 021/121] Remove source directory --- coreapi/help/doc/sphinx/CMakeLists.txt | 2 +- coreapi/help/doc/sphinx/{source => }/index.rst | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename coreapi/help/doc/sphinx/{source => }/index.rst (100%) diff --git a/coreapi/help/doc/sphinx/CMakeLists.txt b/coreapi/help/doc/sphinx/CMakeLists.txt index 0d569a438..c6058f6d7 100644 --- a/coreapi/help/doc/sphinx/CMakeLists.txt +++ b/coreapi/help/doc/sphinx/CMakeLists.txt @@ -41,7 +41,7 @@ if (ENABLE_SPHINX_DOC) index_page.mustache ) configure_file(conf.py.in source/conf.py) - configure_file(source/index.rst source/index.rst COPYONLY) + configure_file(index.rst source/index.rst COPYONLY) configure_file(logo.png source/logo.png COPYONLY) add_custom_command(OUTPUT ${GENERATED_SPHINX_SOURCES} COMMAND ${CMAKE_COMMAND} -E remove -f ${DOCUMENTATION_DIRS} diff --git a/coreapi/help/doc/sphinx/source/index.rst b/coreapi/help/doc/sphinx/index.rst similarity index 100% rename from coreapi/help/doc/sphinx/source/index.rst rename to coreapi/help/doc/sphinx/index.rst From 0d604bd547e4335da52b1bc8f4f8de662dc77f1d Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Wed, 28 Mar 2018 13:03:54 +0200 Subject: [PATCH 022/121] add performance test for resource list subscription --- tester/flexisip/userdb.conf | 2019 ++++++++++++++++++++++++++++++- tester/presence_server_tester.c | 25 +- 2 files changed, 2035 insertions(+), 9 deletions(-) diff --git a/tester/flexisip/userdb.conf b/tester/flexisip/userdb.conf index 5e861921d..b5d995365 100644 --- a/tester/flexisip/userdb.conf +++ b/tester/flexisip/userdb.conf @@ -1,9 +1,2012 @@ version:1 -liblinphone_tester@sip.example.org clrtxt:secret ; -liblinphone_tester@auth.example.org clrtxt:secret ; -liblinphone_tester@auth1.example.org clrtxt:secret ; -tester@sip.example.org clrtxt:secret ; -pauline@sip.example.org clrtxt:secret ; -marie@sip.example.org cltxt:secret ; -laure@sip.example.org clrtxt:secret ; -bellesip@sip.example.org clrtxt:secret ; +liblinphone_tester@sip.example.org md5:19ffdcec6adc70629617046a60e529fc ; liblinphone_tester +33123456789 +liblinphone_tester@auth.example.org md5:db9ddf59cb75ae15f51745192d23ddae ; +liblinphone_tester@auth1.example.org md5:fe32fa7157d629145f1282a73a36a961 ; +tester@sip.example.org md5:61d963d04c360eceb424043e0d53676b ; +pauline@sip.example.org md5:46b03c8f72e61f4340a6d3d06a726d2e ; +marie@sip.example.org md5:c4ce0fe4c1c82e4b700726e085aee9b3 ; +laure@sip.example.org md5:63d09951793c1361768531f9a9011331 ; +bellesip@sip.example.org md5:2fc013743b860819a784b0e6c4bee11a ; +liblinphone_sha_tester@sip.example.org clrtxt:secret ; +test%20username@sip.example.org clrtxt:secret ; + +sip:user_1@sip.example.org clrtxt:secret ; +sip:user_2@sip.example.org clrtxt:secret ; +sip:user_3@sip.example.org clrtxt:secret ; +sip:user_4@sip.example.org clrtxt:secret ; +sip:user_5@sip.example.org clrtxt:secret ; +sip:user_6@sip.example.org clrtxt:secret ; +sip:user_7@sip.example.org clrtxt:secret ; +sip:user_8@sip.example.org clrtxt:secret ; +sip:user_9@sip.example.org clrtxt:secret ; +sip:user_10@sip.example.org clrtxt:secret ; +sip:user_11@sip.example.org clrtxt:secret ; +sip:user_12@sip.example.org clrtxt:secret ; +sip:user_13@sip.example.org clrtxt:secret ; +sip:user_14@sip.example.org clrtxt:secret ; +sip:user_15@sip.example.org clrtxt:secret ; +sip:user_16@sip.example.org clrtxt:secret ; +sip:user_17@sip.example.org clrtxt:secret ; +sip:user_18@sip.example.org clrtxt:secret ; +sip:user_19@sip.example.org clrtxt:secret ; +sip:user_20@sip.example.org clrtxt:secret ; +sip:user_21@sip.example.org clrtxt:secret ; +sip:user_22@sip.example.org clrtxt:secret ; +sip:user_23@sip.example.org clrtxt:secret ; +sip:user_24@sip.example.org clrtxt:secret ; +sip:user_25@sip.example.org clrtxt:secret ; +sip:user_26@sip.example.org clrtxt:secret ; +sip:user_27@sip.example.org clrtxt:secret ; +sip:user_28@sip.example.org clrtxt:secret ; +sip:user_29@sip.example.org clrtxt:secret ; +sip:user_30@sip.example.org clrtxt:secret ; +sip:user_31@sip.example.org clrtxt:secret ; +sip:user_32@sip.example.org clrtxt:secret ; +sip:user_33@sip.example.org clrtxt:secret ; +sip:user_34@sip.example.org clrtxt:secret ; +sip:user_35@sip.example.org clrtxt:secret ; +sip:user_36@sip.example.org clrtxt:secret ; +sip:user_37@sip.example.org clrtxt:secret ; +sip:user_38@sip.example.org clrtxt:secret ; +sip:user_39@sip.example.org clrtxt:secret ; +sip:user_40@sip.example.org clrtxt:secret ; +sip:user_41@sip.example.org clrtxt:secret ; +sip:user_42@sip.example.org clrtxt:secret ; +sip:user_43@sip.example.org clrtxt:secret ; +sip:user_44@sip.example.org clrtxt:secret ; +sip:user_45@sip.example.org clrtxt:secret ; +sip:user_46@sip.example.org clrtxt:secret ; +sip:user_47@sip.example.org clrtxt:secret ; +sip:user_48@sip.example.org clrtxt:secret ; +sip:user_49@sip.example.org clrtxt:secret ; +sip:user_50@sip.example.org clrtxt:secret ; +sip:user_51@sip.example.org clrtxt:secret ; +sip:user_52@sip.example.org clrtxt:secret ; +sip:user_53@sip.example.org clrtxt:secret ; +sip:user_54@sip.example.org clrtxt:secret ; +sip:user_55@sip.example.org clrtxt:secret ; +sip:user_56@sip.example.org clrtxt:secret ; +sip:user_57@sip.example.org clrtxt:secret ; +sip:user_58@sip.example.org clrtxt:secret ; +sip:user_59@sip.example.org clrtxt:secret ; +sip:user_60@sip.example.org clrtxt:secret ; +sip:user_61@sip.example.org clrtxt:secret ; +sip:user_62@sip.example.org clrtxt:secret ; +sip:user_63@sip.example.org clrtxt:secret ; +sip:user_64@sip.example.org clrtxt:secret ; +sip:user_65@sip.example.org clrtxt:secret ; +sip:user_66@sip.example.org clrtxt:secret ; +sip:user_67@sip.example.org clrtxt:secret ; +sip:user_68@sip.example.org clrtxt:secret ; +sip:user_69@sip.example.org clrtxt:secret ; +sip:user_70@sip.example.org clrtxt:secret ; +sip:user_71@sip.example.org clrtxt:secret ; +sip:user_72@sip.example.org clrtxt:secret ; +sip:user_73@sip.example.org clrtxt:secret ; +sip:user_74@sip.example.org clrtxt:secret ; +sip:user_75@sip.example.org clrtxt:secret ; +sip:user_76@sip.example.org clrtxt:secret ; +sip:user_77@sip.example.org clrtxt:secret ; +sip:user_78@sip.example.org clrtxt:secret ; +sip:user_79@sip.example.org clrtxt:secret ; +sip:user_80@sip.example.org clrtxt:secret ; +sip:user_81@sip.example.org clrtxt:secret ; +sip:user_82@sip.example.org clrtxt:secret ; +sip:user_83@sip.example.org clrtxt:secret ; +sip:user_84@sip.example.org clrtxt:secret ; +sip:user_85@sip.example.org clrtxt:secret ; +sip:user_86@sip.example.org clrtxt:secret ; +sip:user_87@sip.example.org clrtxt:secret ; +sip:user_88@sip.example.org clrtxt:secret ; +sip:user_89@sip.example.org clrtxt:secret ; +sip:user_90@sip.example.org clrtxt:secret ; +sip:user_91@sip.example.org clrtxt:secret ; +sip:user_92@sip.example.org clrtxt:secret ; +sip:user_93@sip.example.org clrtxt:secret ; +sip:user_94@sip.example.org clrtxt:secret ; +sip:user_95@sip.example.org clrtxt:secret ; +sip:user_96@sip.example.org clrtxt:secret ; +sip:user_97@sip.example.org clrtxt:secret ; +sip:user_98@sip.example.org clrtxt:secret ; +sip:user_99@sip.example.org clrtxt:secret ; +sip:user_100@sip.example.org clrtxt:secret ; +sip:user_101@sip.example.org clrtxt:secret ; +sip:user_102@sip.example.org clrtxt:secret ; +sip:user_103@sip.example.org clrtxt:secret ; +sip:user_104@sip.example.org clrtxt:secret ; +sip:user_105@sip.example.org clrtxt:secret ; +sip:user_106@sip.example.org clrtxt:secret ; +sip:user_107@sip.example.org clrtxt:secret ; +sip:user_108@sip.example.org clrtxt:secret ; +sip:user_109@sip.example.org clrtxt:secret ; +sip:user_110@sip.example.org clrtxt:secret ; +sip:user_111@sip.example.org clrtxt:secret ; +sip:user_112@sip.example.org clrtxt:secret ; +sip:user_113@sip.example.org clrtxt:secret ; +sip:user_114@sip.example.org clrtxt:secret ; +sip:user_115@sip.example.org clrtxt:secret ; +sip:user_116@sip.example.org clrtxt:secret ; +sip:user_117@sip.example.org clrtxt:secret ; +sip:user_118@sip.example.org clrtxt:secret ; +sip:user_119@sip.example.org clrtxt:secret ; +sip:user_120@sip.example.org clrtxt:secret ; +sip:user_121@sip.example.org clrtxt:secret ; +sip:user_122@sip.example.org clrtxt:secret ; +sip:user_123@sip.example.org clrtxt:secret ; +sip:user_124@sip.example.org clrtxt:secret ; +sip:user_125@sip.example.org clrtxt:secret ; +sip:user_126@sip.example.org clrtxt:secret ; +sip:user_127@sip.example.org clrtxt:secret ; +sip:user_128@sip.example.org clrtxt:secret ; +sip:user_129@sip.example.org clrtxt:secret ; +sip:user_130@sip.example.org clrtxt:secret ; +sip:user_131@sip.example.org clrtxt:secret ; +sip:user_132@sip.example.org clrtxt:secret ; +sip:user_133@sip.example.org clrtxt:secret ; +sip:user_134@sip.example.org clrtxt:secret ; +sip:user_135@sip.example.org clrtxt:secret ; +sip:user_136@sip.example.org clrtxt:secret ; +sip:user_137@sip.example.org clrtxt:secret ; +sip:user_138@sip.example.org clrtxt:secret ; +sip:user_139@sip.example.org clrtxt:secret ; +sip:user_140@sip.example.org clrtxt:secret ; +sip:user_141@sip.example.org clrtxt:secret ; +sip:user_142@sip.example.org clrtxt:secret ; +sip:user_143@sip.example.org clrtxt:secret ; +sip:user_144@sip.example.org clrtxt:secret ; +sip:user_145@sip.example.org clrtxt:secret ; +sip:user_146@sip.example.org clrtxt:secret ; +sip:user_147@sip.example.org clrtxt:secret ; +sip:user_148@sip.example.org clrtxt:secret ; +sip:user_149@sip.example.org clrtxt:secret ; +sip:user_150@sip.example.org clrtxt:secret ; +sip:user_151@sip.example.org clrtxt:secret ; +sip:user_152@sip.example.org clrtxt:secret ; +sip:user_153@sip.example.org clrtxt:secret ; +sip:user_154@sip.example.org clrtxt:secret ; +sip:user_155@sip.example.org clrtxt:secret ; +sip:user_156@sip.example.org clrtxt:secret ; +sip:user_157@sip.example.org clrtxt:secret ; +sip:user_158@sip.example.org clrtxt:secret ; +sip:user_159@sip.example.org clrtxt:secret ; +sip:user_160@sip.example.org clrtxt:secret ; +sip:user_161@sip.example.org clrtxt:secret ; +sip:user_162@sip.example.org clrtxt:secret ; +sip:user_163@sip.example.org clrtxt:secret ; +sip:user_164@sip.example.org clrtxt:secret ; +sip:user_165@sip.example.org clrtxt:secret ; +sip:user_166@sip.example.org clrtxt:secret ; +sip:user_167@sip.example.org clrtxt:secret ; +sip:user_168@sip.example.org clrtxt:secret ; +sip:user_169@sip.example.org clrtxt:secret ; +sip:user_170@sip.example.org clrtxt:secret ; +sip:user_171@sip.example.org clrtxt:secret ; +sip:user_172@sip.example.org clrtxt:secret ; +sip:user_173@sip.example.org clrtxt:secret ; +sip:user_174@sip.example.org clrtxt:secret ; +sip:user_175@sip.example.org clrtxt:secret ; +sip:user_176@sip.example.org clrtxt:secret ; +sip:user_177@sip.example.org clrtxt:secret ; +sip:user_178@sip.example.org clrtxt:secret ; +sip:user_179@sip.example.org clrtxt:secret ; +sip:user_180@sip.example.org clrtxt:secret ; +sip:user_181@sip.example.org clrtxt:secret ; +sip:user_182@sip.example.org clrtxt:secret ; +sip:user_183@sip.example.org clrtxt:secret ; +sip:user_184@sip.example.org clrtxt:secret ; +sip:user_185@sip.example.org clrtxt:secret ; +sip:user_186@sip.example.org clrtxt:secret ; +sip:user_187@sip.example.org clrtxt:secret ; +sip:user_188@sip.example.org clrtxt:secret ; +sip:user_189@sip.example.org clrtxt:secret ; +sip:user_190@sip.example.org clrtxt:secret ; +sip:user_191@sip.example.org clrtxt:secret ; +sip:user_192@sip.example.org clrtxt:secret ; +sip:user_193@sip.example.org clrtxt:secret ; +sip:user_194@sip.example.org clrtxt:secret ; +sip:user_195@sip.example.org clrtxt:secret ; +sip:user_196@sip.example.org clrtxt:secret ; +sip:user_197@sip.example.org clrtxt:secret ; +sip:user_198@sip.example.org clrtxt:secret ; +sip:user_199@sip.example.org clrtxt:secret ; +sip:user_200@sip.example.org clrtxt:secret ; +sip:user_201@sip.example.org clrtxt:secret ; +sip:user_202@sip.example.org clrtxt:secret ; +sip:user_203@sip.example.org clrtxt:secret ; +sip:user_204@sip.example.org clrtxt:secret ; +sip:user_205@sip.example.org clrtxt:secret ; +sip:user_206@sip.example.org clrtxt:secret ; +sip:user_207@sip.example.org clrtxt:secret ; +sip:user_208@sip.example.org clrtxt:secret ; +sip:user_209@sip.example.org clrtxt:secret ; +sip:user_210@sip.example.org clrtxt:secret ; +sip:user_211@sip.example.org clrtxt:secret ; +sip:user_212@sip.example.org clrtxt:secret ; +sip:user_213@sip.example.org clrtxt:secret ; +sip:user_214@sip.example.org clrtxt:secret ; +sip:user_215@sip.example.org clrtxt:secret ; +sip:user_216@sip.example.org clrtxt:secret ; +sip:user_217@sip.example.org clrtxt:secret ; +sip:user_218@sip.example.org clrtxt:secret ; +sip:user_219@sip.example.org clrtxt:secret ; +sip:user_220@sip.example.org clrtxt:secret ; +sip:user_221@sip.example.org clrtxt:secret ; +sip:user_222@sip.example.org clrtxt:secret ; +sip:user_223@sip.example.org clrtxt:secret ; +sip:user_224@sip.example.org clrtxt:secret ; +sip:user_225@sip.example.org clrtxt:secret ; +sip:user_226@sip.example.org clrtxt:secret ; +sip:user_227@sip.example.org clrtxt:secret ; +sip:user_228@sip.example.org clrtxt:secret ; +sip:user_229@sip.example.org clrtxt:secret ; +sip:user_230@sip.example.org clrtxt:secret ; +sip:user_231@sip.example.org clrtxt:secret ; +sip:user_232@sip.example.org clrtxt:secret ; +sip:user_233@sip.example.org clrtxt:secret ; +sip:user_234@sip.example.org clrtxt:secret ; +sip:user_235@sip.example.org clrtxt:secret ; +sip:user_236@sip.example.org clrtxt:secret ; +sip:user_237@sip.example.org clrtxt:secret ; +sip:user_238@sip.example.org clrtxt:secret ; +sip:user_239@sip.example.org clrtxt:secret ; +sip:user_240@sip.example.org clrtxt:secret ; +sip:user_241@sip.example.org clrtxt:secret ; +sip:user_242@sip.example.org clrtxt:secret ; +sip:user_243@sip.example.org clrtxt:secret ; +sip:user_244@sip.example.org clrtxt:secret ; +sip:user_245@sip.example.org clrtxt:secret ; +sip:user_246@sip.example.org clrtxt:secret ; +sip:user_247@sip.example.org clrtxt:secret ; +sip:user_248@sip.example.org clrtxt:secret ; +sip:user_249@sip.example.org clrtxt:secret ; +sip:user_250@sip.example.org clrtxt:secret ; +sip:user_251@sip.example.org clrtxt:secret ; +sip:user_252@sip.example.org clrtxt:secret ; +sip:user_253@sip.example.org clrtxt:secret ; +sip:user_254@sip.example.org clrtxt:secret ; +sip:user_255@sip.example.org clrtxt:secret ; +sip:user_256@sip.example.org clrtxt:secret ; +sip:user_257@sip.example.org clrtxt:secret ; +sip:user_258@sip.example.org clrtxt:secret ; +sip:user_259@sip.example.org clrtxt:secret ; +sip:user_260@sip.example.org clrtxt:secret ; +sip:user_261@sip.example.org clrtxt:secret ; +sip:user_262@sip.example.org clrtxt:secret ; +sip:user_263@sip.example.org clrtxt:secret ; +sip:user_264@sip.example.org clrtxt:secret ; +sip:user_265@sip.example.org clrtxt:secret ; +sip:user_266@sip.example.org clrtxt:secret ; +sip:user_267@sip.example.org clrtxt:secret ; +sip:user_268@sip.example.org clrtxt:secret ; +sip:user_269@sip.example.org clrtxt:secret ; +sip:user_270@sip.example.org clrtxt:secret ; +sip:user_271@sip.example.org clrtxt:secret ; +sip:user_272@sip.example.org clrtxt:secret ; +sip:user_273@sip.example.org clrtxt:secret ; +sip:user_274@sip.example.org clrtxt:secret ; +sip:user_275@sip.example.org clrtxt:secret ; +sip:user_276@sip.example.org clrtxt:secret ; +sip:user_277@sip.example.org clrtxt:secret ; +sip:user_278@sip.example.org clrtxt:secret ; +sip:user_279@sip.example.org clrtxt:secret ; +sip:user_280@sip.example.org clrtxt:secret ; +sip:user_281@sip.example.org clrtxt:secret ; +sip:user_282@sip.example.org clrtxt:secret ; +sip:user_283@sip.example.org clrtxt:secret ; +sip:user_284@sip.example.org clrtxt:secret ; +sip:user_285@sip.example.org clrtxt:secret ; +sip:user_286@sip.example.org clrtxt:secret ; +sip:user_287@sip.example.org clrtxt:secret ; +sip:user_288@sip.example.org clrtxt:secret ; +sip:user_289@sip.example.org clrtxt:secret ; +sip:user_290@sip.example.org clrtxt:secret ; +sip:user_291@sip.example.org clrtxt:secret ; +sip:user_292@sip.example.org clrtxt:secret ; +sip:user_293@sip.example.org clrtxt:secret ; +sip:user_294@sip.example.org clrtxt:secret ; +sip:user_295@sip.example.org clrtxt:secret ; +sip:user_296@sip.example.org clrtxt:secret ; +sip:user_297@sip.example.org clrtxt:secret ; +sip:user_298@sip.example.org clrtxt:secret ; +sip:user_299@sip.example.org clrtxt:secret ; +sip:user_300@sip.example.org clrtxt:secret ; +sip:user_301@sip.example.org clrtxt:secret ; +sip:user_302@sip.example.org clrtxt:secret ; +sip:user_303@sip.example.org clrtxt:secret ; +sip:user_304@sip.example.org clrtxt:secret ; +sip:user_305@sip.example.org clrtxt:secret ; +sip:user_306@sip.example.org clrtxt:secret ; +sip:user_307@sip.example.org clrtxt:secret ; +sip:user_308@sip.example.org clrtxt:secret ; +sip:user_309@sip.example.org clrtxt:secret ; +sip:user_310@sip.example.org clrtxt:secret ; +sip:user_311@sip.example.org clrtxt:secret ; +sip:user_312@sip.example.org clrtxt:secret ; +sip:user_313@sip.example.org clrtxt:secret ; +sip:user_314@sip.example.org clrtxt:secret ; +sip:user_315@sip.example.org clrtxt:secret ; +sip:user_316@sip.example.org clrtxt:secret ; +sip:user_317@sip.example.org clrtxt:secret ; +sip:user_318@sip.example.org clrtxt:secret ; +sip:user_319@sip.example.org clrtxt:secret ; +sip:user_320@sip.example.org clrtxt:secret ; +sip:user_321@sip.example.org clrtxt:secret ; +sip:user_322@sip.example.org clrtxt:secret ; +sip:user_323@sip.example.org clrtxt:secret ; +sip:user_324@sip.example.org clrtxt:secret ; +sip:user_325@sip.example.org clrtxt:secret ; +sip:user_326@sip.example.org clrtxt:secret ; +sip:user_327@sip.example.org clrtxt:secret ; +sip:user_328@sip.example.org clrtxt:secret ; +sip:user_329@sip.example.org clrtxt:secret ; +sip:user_330@sip.example.org clrtxt:secret ; +sip:user_331@sip.example.org clrtxt:secret ; +sip:user_332@sip.example.org clrtxt:secret ; +sip:user_333@sip.example.org clrtxt:secret ; +sip:user_334@sip.example.org clrtxt:secret ; +sip:user_335@sip.example.org clrtxt:secret ; +sip:user_336@sip.example.org clrtxt:secret ; +sip:user_337@sip.example.org clrtxt:secret ; +sip:user_338@sip.example.org clrtxt:secret ; +sip:user_339@sip.example.org clrtxt:secret ; +sip:user_340@sip.example.org clrtxt:secret ; +sip:user_341@sip.example.org clrtxt:secret ; +sip:user_342@sip.example.org clrtxt:secret ; +sip:user_343@sip.example.org clrtxt:secret ; +sip:user_344@sip.example.org clrtxt:secret ; +sip:user_345@sip.example.org clrtxt:secret ; +sip:user_346@sip.example.org clrtxt:secret ; +sip:user_347@sip.example.org clrtxt:secret ; +sip:user_348@sip.example.org clrtxt:secret ; +sip:user_349@sip.example.org clrtxt:secret ; +sip:user_350@sip.example.org clrtxt:secret ; +sip:user_351@sip.example.org clrtxt:secret ; +sip:user_352@sip.example.org clrtxt:secret ; +sip:user_353@sip.example.org clrtxt:secret ; +sip:user_354@sip.example.org clrtxt:secret ; +sip:user_355@sip.example.org clrtxt:secret ; +sip:user_356@sip.example.org clrtxt:secret ; +sip:user_357@sip.example.org clrtxt:secret ; +sip:user_358@sip.example.org clrtxt:secret ; +sip:user_359@sip.example.org clrtxt:secret ; +sip:user_360@sip.example.org clrtxt:secret ; +sip:user_361@sip.example.org clrtxt:secret ; +sip:user_362@sip.example.org clrtxt:secret ; +sip:user_363@sip.example.org clrtxt:secret ; +sip:user_364@sip.example.org clrtxt:secret ; +sip:user_365@sip.example.org clrtxt:secret ; +sip:user_366@sip.example.org clrtxt:secret ; +sip:user_367@sip.example.org clrtxt:secret ; +sip:user_368@sip.example.org clrtxt:secret ; +sip:user_369@sip.example.org clrtxt:secret ; +sip:user_370@sip.example.org clrtxt:secret ; +sip:user_371@sip.example.org clrtxt:secret ; +sip:user_372@sip.example.org clrtxt:secret ; +sip:user_373@sip.example.org clrtxt:secret ; +sip:user_374@sip.example.org clrtxt:secret ; +sip:user_375@sip.example.org clrtxt:secret ; +sip:user_376@sip.example.org clrtxt:secret ; +sip:user_377@sip.example.org clrtxt:secret ; +sip:user_378@sip.example.org clrtxt:secret ; +sip:user_379@sip.example.org clrtxt:secret ; +sip:user_380@sip.example.org clrtxt:secret ; +sip:user_381@sip.example.org clrtxt:secret ; +sip:user_382@sip.example.org clrtxt:secret ; +sip:user_383@sip.example.org clrtxt:secret ; +sip:user_384@sip.example.org clrtxt:secret ; +sip:user_385@sip.example.org clrtxt:secret ; +sip:user_386@sip.example.org clrtxt:secret ; +sip:user_387@sip.example.org clrtxt:secret ; +sip:user_388@sip.example.org clrtxt:secret ; +sip:user_389@sip.example.org clrtxt:secret ; +sip:user_390@sip.example.org clrtxt:secret ; +sip:user_391@sip.example.org clrtxt:secret ; +sip:user_392@sip.example.org clrtxt:secret ; +sip:user_393@sip.example.org clrtxt:secret ; +sip:user_394@sip.example.org clrtxt:secret ; +sip:user_395@sip.example.org clrtxt:secret ; +sip:user_396@sip.example.org clrtxt:secret ; +sip:user_397@sip.example.org clrtxt:secret ; +sip:user_398@sip.example.org clrtxt:secret ; +sip:user_399@sip.example.org clrtxt:secret ; +sip:user_400@sip.example.org clrtxt:secret ; +sip:user_401@sip.example.org clrtxt:secret ; +sip:user_402@sip.example.org clrtxt:secret ; +sip:user_403@sip.example.org clrtxt:secret ; +sip:user_404@sip.example.org clrtxt:secret ; +sip:user_405@sip.example.org clrtxt:secret ; +sip:user_406@sip.example.org clrtxt:secret ; +sip:user_407@sip.example.org clrtxt:secret ; +sip:user_408@sip.example.org clrtxt:secret ; +sip:user_409@sip.example.org clrtxt:secret ; +sip:user_410@sip.example.org clrtxt:secret ; +sip:user_411@sip.example.org clrtxt:secret ; +sip:user_412@sip.example.org clrtxt:secret ; +sip:user_413@sip.example.org clrtxt:secret ; +sip:user_414@sip.example.org clrtxt:secret ; +sip:user_415@sip.example.org clrtxt:secret ; +sip:user_416@sip.example.org clrtxt:secret ; +sip:user_417@sip.example.org clrtxt:secret ; +sip:user_418@sip.example.org clrtxt:secret ; +sip:user_419@sip.example.org clrtxt:secret ; +sip:user_420@sip.example.org clrtxt:secret ; +sip:user_421@sip.example.org clrtxt:secret ; +sip:user_422@sip.example.org clrtxt:secret ; +sip:user_423@sip.example.org clrtxt:secret ; +sip:user_424@sip.example.org clrtxt:secret ; +sip:user_425@sip.example.org clrtxt:secret ; +sip:user_426@sip.example.org clrtxt:secret ; +sip:user_427@sip.example.org clrtxt:secret ; +sip:user_428@sip.example.org clrtxt:secret ; +sip:user_429@sip.example.org clrtxt:secret ; +sip:user_430@sip.example.org clrtxt:secret ; +sip:user_431@sip.example.org clrtxt:secret ; +sip:user_432@sip.example.org clrtxt:secret ; +sip:user_433@sip.example.org clrtxt:secret ; +sip:user_434@sip.example.org clrtxt:secret ; +sip:user_435@sip.example.org clrtxt:secret ; +sip:user_436@sip.example.org clrtxt:secret ; +sip:user_437@sip.example.org clrtxt:secret ; +sip:user_438@sip.example.org clrtxt:secret ; +sip:user_439@sip.example.org clrtxt:secret ; +sip:user_440@sip.example.org clrtxt:secret ; +sip:user_441@sip.example.org clrtxt:secret ; +sip:user_442@sip.example.org clrtxt:secret ; +sip:user_443@sip.example.org clrtxt:secret ; +sip:user_444@sip.example.org clrtxt:secret ; +sip:user_445@sip.example.org clrtxt:secret ; +sip:user_446@sip.example.org clrtxt:secret ; +sip:user_447@sip.example.org clrtxt:secret ; +sip:user_448@sip.example.org clrtxt:secret ; +sip:user_449@sip.example.org clrtxt:secret ; +sip:user_450@sip.example.org clrtxt:secret ; +sip:user_451@sip.example.org clrtxt:secret ; +sip:user_452@sip.example.org clrtxt:secret ; +sip:user_453@sip.example.org clrtxt:secret ; +sip:user_454@sip.example.org clrtxt:secret ; +sip:user_455@sip.example.org clrtxt:secret ; +sip:user_456@sip.example.org clrtxt:secret ; +sip:user_457@sip.example.org clrtxt:secret ; +sip:user_458@sip.example.org clrtxt:secret ; +sip:user_459@sip.example.org clrtxt:secret ; +sip:user_460@sip.example.org clrtxt:secret ; +sip:user_461@sip.example.org clrtxt:secret ; +sip:user_462@sip.example.org clrtxt:secret ; +sip:user_463@sip.example.org clrtxt:secret ; +sip:user_464@sip.example.org clrtxt:secret ; +sip:user_465@sip.example.org clrtxt:secret ; +sip:user_466@sip.example.org clrtxt:secret ; +sip:user_467@sip.example.org clrtxt:secret ; +sip:user_468@sip.example.org clrtxt:secret ; +sip:user_469@sip.example.org clrtxt:secret ; +sip:user_470@sip.example.org clrtxt:secret ; +sip:user_471@sip.example.org clrtxt:secret ; +sip:user_472@sip.example.org clrtxt:secret ; +sip:user_473@sip.example.org clrtxt:secret ; +sip:user_474@sip.example.org clrtxt:secret ; +sip:user_475@sip.example.org clrtxt:secret ; +sip:user_476@sip.example.org clrtxt:secret ; +sip:user_477@sip.example.org clrtxt:secret ; +sip:user_478@sip.example.org clrtxt:secret ; +sip:user_479@sip.example.org clrtxt:secret ; +sip:user_480@sip.example.org clrtxt:secret ; +sip:user_481@sip.example.org clrtxt:secret ; +sip:user_482@sip.example.org clrtxt:secret ; +sip:user_483@sip.example.org clrtxt:secret ; +sip:user_484@sip.example.org clrtxt:secret ; +sip:user_485@sip.example.org clrtxt:secret ; +sip:user_486@sip.example.org clrtxt:secret ; +sip:user_487@sip.example.org clrtxt:secret ; +sip:user_488@sip.example.org clrtxt:secret ; +sip:user_489@sip.example.org clrtxt:secret ; +sip:user_490@sip.example.org clrtxt:secret ; +sip:user_491@sip.example.org clrtxt:secret ; +sip:user_492@sip.example.org clrtxt:secret ; +sip:user_493@sip.example.org clrtxt:secret ; +sip:user_494@sip.example.org clrtxt:secret ; +sip:user_495@sip.example.org clrtxt:secret ; +sip:user_496@sip.example.org clrtxt:secret ; +sip:user_497@sip.example.org clrtxt:secret ; +sip:user_498@sip.example.org clrtxt:secret ; +sip:user_499@sip.example.org clrtxt:secret ; +sip:user_500@sip.example.org clrtxt:secret ; +sip:user_501@sip.example.org clrtxt:secret ; +sip:user_502@sip.example.org clrtxt:secret ; +sip:user_503@sip.example.org clrtxt:secret ; +sip:user_504@sip.example.org clrtxt:secret ; +sip:user_505@sip.example.org clrtxt:secret ; +sip:user_506@sip.example.org clrtxt:secret ; +sip:user_507@sip.example.org clrtxt:secret ; +sip:user_508@sip.example.org clrtxt:secret ; +sip:user_509@sip.example.org clrtxt:secret ; +sip:user_510@sip.example.org clrtxt:secret ; +sip:user_511@sip.example.org clrtxt:secret ; +sip:user_512@sip.example.org clrtxt:secret ; +sip:user_513@sip.example.org clrtxt:secret ; +sip:user_514@sip.example.org clrtxt:secret ; +sip:user_515@sip.example.org clrtxt:secret ; +sip:user_516@sip.example.org clrtxt:secret ; +sip:user_517@sip.example.org clrtxt:secret ; +sip:user_518@sip.example.org clrtxt:secret ; +sip:user_519@sip.example.org clrtxt:secret ; +sip:user_520@sip.example.org clrtxt:secret ; +sip:user_521@sip.example.org clrtxt:secret ; +sip:user_522@sip.example.org clrtxt:secret ; +sip:user_523@sip.example.org clrtxt:secret ; +sip:user_524@sip.example.org clrtxt:secret ; +sip:user_525@sip.example.org clrtxt:secret ; +sip:user_526@sip.example.org clrtxt:secret ; +sip:user_527@sip.example.org clrtxt:secret ; +sip:user_528@sip.example.org clrtxt:secret ; +sip:user_529@sip.example.org clrtxt:secret ; +sip:user_530@sip.example.org clrtxt:secret ; +sip:user_531@sip.example.org clrtxt:secret ; +sip:user_532@sip.example.org clrtxt:secret ; +sip:user_533@sip.example.org clrtxt:secret ; +sip:user_534@sip.example.org clrtxt:secret ; +sip:user_535@sip.example.org clrtxt:secret ; +sip:user_536@sip.example.org clrtxt:secret ; +sip:user_537@sip.example.org clrtxt:secret ; +sip:user_538@sip.example.org clrtxt:secret ; +sip:user_539@sip.example.org clrtxt:secret ; +sip:user_540@sip.example.org clrtxt:secret ; +sip:user_541@sip.example.org clrtxt:secret ; +sip:user_542@sip.example.org clrtxt:secret ; +sip:user_543@sip.example.org clrtxt:secret ; +sip:user_544@sip.example.org clrtxt:secret ; +sip:user_545@sip.example.org clrtxt:secret ; +sip:user_546@sip.example.org clrtxt:secret ; +sip:user_547@sip.example.org clrtxt:secret ; +sip:user_548@sip.example.org clrtxt:secret ; +sip:user_549@sip.example.org clrtxt:secret ; +sip:user_550@sip.example.org clrtxt:secret ; +sip:user_551@sip.example.org clrtxt:secret ; +sip:user_552@sip.example.org clrtxt:secret ; +sip:user_553@sip.example.org clrtxt:secret ; +sip:user_554@sip.example.org clrtxt:secret ; +sip:user_555@sip.example.org clrtxt:secret ; +sip:user_556@sip.example.org clrtxt:secret ; +sip:user_557@sip.example.org clrtxt:secret ; +sip:user_558@sip.example.org clrtxt:secret ; +sip:user_559@sip.example.org clrtxt:secret ; +sip:user_560@sip.example.org clrtxt:secret ; +sip:user_561@sip.example.org clrtxt:secret ; +sip:user_562@sip.example.org clrtxt:secret ; +sip:user_563@sip.example.org clrtxt:secret ; +sip:user_564@sip.example.org clrtxt:secret ; +sip:user_565@sip.example.org clrtxt:secret ; +sip:user_566@sip.example.org clrtxt:secret ; +sip:user_567@sip.example.org clrtxt:secret ; +sip:user_568@sip.example.org clrtxt:secret ; +sip:user_569@sip.example.org clrtxt:secret ; +sip:user_570@sip.example.org clrtxt:secret ; +sip:user_571@sip.example.org clrtxt:secret ; +sip:user_572@sip.example.org clrtxt:secret ; +sip:user_573@sip.example.org clrtxt:secret ; +sip:user_574@sip.example.org clrtxt:secret ; +sip:user_575@sip.example.org clrtxt:secret ; +sip:user_576@sip.example.org clrtxt:secret ; +sip:user_577@sip.example.org clrtxt:secret ; +sip:user_578@sip.example.org clrtxt:secret ; +sip:user_579@sip.example.org clrtxt:secret ; +sip:user_580@sip.example.org clrtxt:secret ; +sip:user_581@sip.example.org clrtxt:secret ; +sip:user_582@sip.example.org clrtxt:secret ; +sip:user_583@sip.example.org clrtxt:secret ; +sip:user_584@sip.example.org clrtxt:secret ; +sip:user_585@sip.example.org clrtxt:secret ; +sip:user_586@sip.example.org clrtxt:secret ; +sip:user_587@sip.example.org clrtxt:secret ; +sip:user_588@sip.example.org clrtxt:secret ; +sip:user_589@sip.example.org clrtxt:secret ; +sip:user_590@sip.example.org clrtxt:secret ; +sip:user_591@sip.example.org clrtxt:secret ; +sip:user_592@sip.example.org clrtxt:secret ; +sip:user_593@sip.example.org clrtxt:secret ; +sip:user_594@sip.example.org clrtxt:secret ; +sip:user_595@sip.example.org clrtxt:secret ; +sip:user_596@sip.example.org clrtxt:secret ; +sip:user_597@sip.example.org clrtxt:secret ; +sip:user_598@sip.example.org clrtxt:secret ; +sip:user_599@sip.example.org clrtxt:secret ; +sip:user_600@sip.example.org clrtxt:secret ; +sip:user_601@sip.example.org clrtxt:secret ; +sip:user_602@sip.example.org clrtxt:secret ; +sip:user_603@sip.example.org clrtxt:secret ; +sip:user_604@sip.example.org clrtxt:secret ; +sip:user_605@sip.example.org clrtxt:secret ; +sip:user_606@sip.example.org clrtxt:secret ; +sip:user_607@sip.example.org clrtxt:secret ; +sip:user_608@sip.example.org clrtxt:secret ; +sip:user_609@sip.example.org clrtxt:secret ; +sip:user_610@sip.example.org clrtxt:secret ; +sip:user_611@sip.example.org clrtxt:secret ; +sip:user_612@sip.example.org clrtxt:secret ; +sip:user_613@sip.example.org clrtxt:secret ; +sip:user_614@sip.example.org clrtxt:secret ; +sip:user_615@sip.example.org clrtxt:secret ; +sip:user_616@sip.example.org clrtxt:secret ; +sip:user_617@sip.example.org clrtxt:secret ; +sip:user_618@sip.example.org clrtxt:secret ; +sip:user_619@sip.example.org clrtxt:secret ; +sip:user_620@sip.example.org clrtxt:secret ; +sip:user_621@sip.example.org clrtxt:secret ; +sip:user_622@sip.example.org clrtxt:secret ; +sip:user_623@sip.example.org clrtxt:secret ; +sip:user_624@sip.example.org clrtxt:secret ; +sip:user_625@sip.example.org clrtxt:secret ; +sip:user_626@sip.example.org clrtxt:secret ; +sip:user_627@sip.example.org clrtxt:secret ; +sip:user_628@sip.example.org clrtxt:secret ; +sip:user_629@sip.example.org clrtxt:secret ; +sip:user_630@sip.example.org clrtxt:secret ; +sip:user_631@sip.example.org clrtxt:secret ; +sip:user_632@sip.example.org clrtxt:secret ; +sip:user_633@sip.example.org clrtxt:secret ; +sip:user_634@sip.example.org clrtxt:secret ; +sip:user_635@sip.example.org clrtxt:secret ; +sip:user_636@sip.example.org clrtxt:secret ; +sip:user_637@sip.example.org clrtxt:secret ; +sip:user_638@sip.example.org clrtxt:secret ; +sip:user_639@sip.example.org clrtxt:secret ; +sip:user_640@sip.example.org clrtxt:secret ; +sip:user_641@sip.example.org clrtxt:secret ; +sip:user_642@sip.example.org clrtxt:secret ; +sip:user_643@sip.example.org clrtxt:secret ; +sip:user_644@sip.example.org clrtxt:secret ; +sip:user_645@sip.example.org clrtxt:secret ; +sip:user_646@sip.example.org clrtxt:secret ; +sip:user_647@sip.example.org clrtxt:secret ; +sip:user_648@sip.example.org clrtxt:secret ; +sip:user_649@sip.example.org clrtxt:secret ; +sip:user_650@sip.example.org clrtxt:secret ; +sip:user_651@sip.example.org clrtxt:secret ; +sip:user_652@sip.example.org clrtxt:secret ; +sip:user_653@sip.example.org clrtxt:secret ; +sip:user_654@sip.example.org clrtxt:secret ; +sip:user_655@sip.example.org clrtxt:secret ; +sip:user_656@sip.example.org clrtxt:secret ; +sip:user_657@sip.example.org clrtxt:secret ; +sip:user_658@sip.example.org clrtxt:secret ; +sip:user_659@sip.example.org clrtxt:secret ; +sip:user_660@sip.example.org clrtxt:secret ; +sip:user_661@sip.example.org clrtxt:secret ; +sip:user_662@sip.example.org clrtxt:secret ; +sip:user_663@sip.example.org clrtxt:secret ; +sip:user_664@sip.example.org clrtxt:secret ; +sip:user_665@sip.example.org clrtxt:secret ; +sip:user_666@sip.example.org clrtxt:secret ; +sip:user_667@sip.example.org clrtxt:secret ; +sip:user_668@sip.example.org clrtxt:secret ; +sip:user_669@sip.example.org clrtxt:secret ; +sip:user_670@sip.example.org clrtxt:secret ; +sip:user_671@sip.example.org clrtxt:secret ; +sip:user_672@sip.example.org clrtxt:secret ; +sip:user_673@sip.example.org clrtxt:secret ; +sip:user_674@sip.example.org clrtxt:secret ; +sip:user_675@sip.example.org clrtxt:secret ; +sip:user_676@sip.example.org clrtxt:secret ; +sip:user_677@sip.example.org clrtxt:secret ; +sip:user_678@sip.example.org clrtxt:secret ; +sip:user_679@sip.example.org clrtxt:secret ; +sip:user_680@sip.example.org clrtxt:secret ; +sip:user_681@sip.example.org clrtxt:secret ; +sip:user_682@sip.example.org clrtxt:secret ; +sip:user_683@sip.example.org clrtxt:secret ; +sip:user_684@sip.example.org clrtxt:secret ; +sip:user_685@sip.example.org clrtxt:secret ; +sip:user_686@sip.example.org clrtxt:secret ; +sip:user_687@sip.example.org clrtxt:secret ; +sip:user_688@sip.example.org clrtxt:secret ; +sip:user_689@sip.example.org clrtxt:secret ; +sip:user_690@sip.example.org clrtxt:secret ; +sip:user_691@sip.example.org clrtxt:secret ; +sip:user_692@sip.example.org clrtxt:secret ; +sip:user_693@sip.example.org clrtxt:secret ; +sip:user_694@sip.example.org clrtxt:secret ; +sip:user_695@sip.example.org clrtxt:secret ; +sip:user_696@sip.example.org clrtxt:secret ; +sip:user_697@sip.example.org clrtxt:secret ; +sip:user_698@sip.example.org clrtxt:secret ; +sip:user_699@sip.example.org clrtxt:secret ; +sip:user_700@sip.example.org clrtxt:secret ; +sip:user_701@sip.example.org clrtxt:secret ; +sip:user_702@sip.example.org clrtxt:secret ; +sip:user_703@sip.example.org clrtxt:secret ; +sip:user_704@sip.example.org clrtxt:secret ; +sip:user_705@sip.example.org clrtxt:secret ; +sip:user_706@sip.example.org clrtxt:secret ; +sip:user_707@sip.example.org clrtxt:secret ; +sip:user_708@sip.example.org clrtxt:secret ; +sip:user_709@sip.example.org clrtxt:secret ; +sip:user_710@sip.example.org clrtxt:secret ; +sip:user_711@sip.example.org clrtxt:secret ; +sip:user_712@sip.example.org clrtxt:secret ; +sip:user_713@sip.example.org clrtxt:secret ; +sip:user_714@sip.example.org clrtxt:secret ; +sip:user_715@sip.example.org clrtxt:secret ; +sip:user_716@sip.example.org clrtxt:secret ; +sip:user_717@sip.example.org clrtxt:secret ; +sip:user_718@sip.example.org clrtxt:secret ; +sip:user_719@sip.example.org clrtxt:secret ; +sip:user_720@sip.example.org clrtxt:secret ; +sip:user_721@sip.example.org clrtxt:secret ; +sip:user_722@sip.example.org clrtxt:secret ; +sip:user_723@sip.example.org clrtxt:secret ; +sip:user_724@sip.example.org clrtxt:secret ; +sip:user_725@sip.example.org clrtxt:secret ; +sip:user_726@sip.example.org clrtxt:secret ; +sip:user_727@sip.example.org clrtxt:secret ; +sip:user_728@sip.example.org clrtxt:secret ; +sip:user_729@sip.example.org clrtxt:secret ; +sip:user_730@sip.example.org clrtxt:secret ; +sip:user_731@sip.example.org clrtxt:secret ; +sip:user_732@sip.example.org clrtxt:secret ; +sip:user_733@sip.example.org clrtxt:secret ; +sip:user_734@sip.example.org clrtxt:secret ; +sip:user_735@sip.example.org clrtxt:secret ; +sip:user_736@sip.example.org clrtxt:secret ; +sip:user_737@sip.example.org clrtxt:secret ; +sip:user_738@sip.example.org clrtxt:secret ; +sip:user_739@sip.example.org clrtxt:secret ; +sip:user_740@sip.example.org clrtxt:secret ; +sip:user_741@sip.example.org clrtxt:secret ; +sip:user_742@sip.example.org clrtxt:secret ; +sip:user_743@sip.example.org clrtxt:secret ; +sip:user_744@sip.example.org clrtxt:secret ; +sip:user_745@sip.example.org clrtxt:secret ; +sip:user_746@sip.example.org clrtxt:secret ; +sip:user_747@sip.example.org clrtxt:secret ; +sip:user_748@sip.example.org clrtxt:secret ; +sip:user_749@sip.example.org clrtxt:secret ; +sip:user_750@sip.example.org clrtxt:secret ; +sip:user_751@sip.example.org clrtxt:secret ; +sip:user_752@sip.example.org clrtxt:secret ; +sip:user_753@sip.example.org clrtxt:secret ; +sip:user_754@sip.example.org clrtxt:secret ; +sip:user_755@sip.example.org clrtxt:secret ; +sip:user_756@sip.example.org clrtxt:secret ; +sip:user_757@sip.example.org clrtxt:secret ; +sip:user_758@sip.example.org clrtxt:secret ; +sip:user_759@sip.example.org clrtxt:secret ; +sip:user_760@sip.example.org clrtxt:secret ; +sip:user_761@sip.example.org clrtxt:secret ; +sip:user_762@sip.example.org clrtxt:secret ; +sip:user_763@sip.example.org clrtxt:secret ; +sip:user_764@sip.example.org clrtxt:secret ; +sip:user_765@sip.example.org clrtxt:secret ; +sip:user_766@sip.example.org clrtxt:secret ; +sip:user_767@sip.example.org clrtxt:secret ; +sip:user_768@sip.example.org clrtxt:secret ; +sip:user_769@sip.example.org clrtxt:secret ; +sip:user_770@sip.example.org clrtxt:secret ; +sip:user_771@sip.example.org clrtxt:secret ; +sip:user_772@sip.example.org clrtxt:secret ; +sip:user_773@sip.example.org clrtxt:secret ; +sip:user_774@sip.example.org clrtxt:secret ; +sip:user_775@sip.example.org clrtxt:secret ; +sip:user_776@sip.example.org clrtxt:secret ; +sip:user_777@sip.example.org clrtxt:secret ; +sip:user_778@sip.example.org clrtxt:secret ; +sip:user_779@sip.example.org clrtxt:secret ; +sip:user_780@sip.example.org clrtxt:secret ; +sip:user_781@sip.example.org clrtxt:secret ; +sip:user_782@sip.example.org clrtxt:secret ; +sip:user_783@sip.example.org clrtxt:secret ; +sip:user_784@sip.example.org clrtxt:secret ; +sip:user_785@sip.example.org clrtxt:secret ; +sip:user_786@sip.example.org clrtxt:secret ; +sip:user_787@sip.example.org clrtxt:secret ; +sip:user_788@sip.example.org clrtxt:secret ; +sip:user_789@sip.example.org clrtxt:secret ; +sip:user_790@sip.example.org clrtxt:secret ; +sip:user_791@sip.example.org clrtxt:secret ; +sip:user_792@sip.example.org clrtxt:secret ; +sip:user_793@sip.example.org clrtxt:secret ; +sip:user_794@sip.example.org clrtxt:secret ; +sip:user_795@sip.example.org clrtxt:secret ; +sip:user_796@sip.example.org clrtxt:secret ; +sip:user_797@sip.example.org clrtxt:secret ; +sip:user_798@sip.example.org clrtxt:secret ; +sip:user_799@sip.example.org clrtxt:secret ; +sip:user_800@sip.example.org clrtxt:secret ; +sip:user_801@sip.example.org clrtxt:secret ; +sip:user_802@sip.example.org clrtxt:secret ; +sip:user_803@sip.example.org clrtxt:secret ; +sip:user_804@sip.example.org clrtxt:secret ; +sip:user_805@sip.example.org clrtxt:secret ; +sip:user_806@sip.example.org clrtxt:secret ; +sip:user_807@sip.example.org clrtxt:secret ; +sip:user_808@sip.example.org clrtxt:secret ; +sip:user_809@sip.example.org clrtxt:secret ; +sip:user_810@sip.example.org clrtxt:secret ; +sip:user_811@sip.example.org clrtxt:secret ; +sip:user_812@sip.example.org clrtxt:secret ; +sip:user_813@sip.example.org clrtxt:secret ; +sip:user_814@sip.example.org clrtxt:secret ; +sip:user_815@sip.example.org clrtxt:secret ; +sip:user_816@sip.example.org clrtxt:secret ; +sip:user_817@sip.example.org clrtxt:secret ; +sip:user_818@sip.example.org clrtxt:secret ; +sip:user_819@sip.example.org clrtxt:secret ; +sip:user_820@sip.example.org clrtxt:secret ; +sip:user_821@sip.example.org clrtxt:secret ; +sip:user_822@sip.example.org clrtxt:secret ; +sip:user_823@sip.example.org clrtxt:secret ; +sip:user_824@sip.example.org clrtxt:secret ; +sip:user_825@sip.example.org clrtxt:secret ; +sip:user_826@sip.example.org clrtxt:secret ; +sip:user_827@sip.example.org clrtxt:secret ; +sip:user_828@sip.example.org clrtxt:secret ; +sip:user_829@sip.example.org clrtxt:secret ; +sip:user_830@sip.example.org clrtxt:secret ; +sip:user_831@sip.example.org clrtxt:secret ; +sip:user_832@sip.example.org clrtxt:secret ; +sip:user_833@sip.example.org clrtxt:secret ; +sip:user_834@sip.example.org clrtxt:secret ; +sip:user_835@sip.example.org clrtxt:secret ; +sip:user_836@sip.example.org clrtxt:secret ; +sip:user_837@sip.example.org clrtxt:secret ; +sip:user_838@sip.example.org clrtxt:secret ; +sip:user_839@sip.example.org clrtxt:secret ; +sip:user_840@sip.example.org clrtxt:secret ; +sip:user_841@sip.example.org clrtxt:secret ; +sip:user_842@sip.example.org clrtxt:secret ; +sip:user_843@sip.example.org clrtxt:secret ; +sip:user_844@sip.example.org clrtxt:secret ; +sip:user_845@sip.example.org clrtxt:secret ; +sip:user_846@sip.example.org clrtxt:secret ; +sip:user_847@sip.example.org clrtxt:secret ; +sip:user_848@sip.example.org clrtxt:secret ; +sip:user_849@sip.example.org clrtxt:secret ; +sip:user_850@sip.example.org clrtxt:secret ; +sip:user_851@sip.example.org clrtxt:secret ; +sip:user_852@sip.example.org clrtxt:secret ; +sip:user_853@sip.example.org clrtxt:secret ; +sip:user_854@sip.example.org clrtxt:secret ; +sip:user_855@sip.example.org clrtxt:secret ; +sip:user_856@sip.example.org clrtxt:secret ; +sip:user_857@sip.example.org clrtxt:secret ; +sip:user_858@sip.example.org clrtxt:secret ; +sip:user_859@sip.example.org clrtxt:secret ; +sip:user_860@sip.example.org clrtxt:secret ; +sip:user_861@sip.example.org clrtxt:secret ; +sip:user_862@sip.example.org clrtxt:secret ; +sip:user_863@sip.example.org clrtxt:secret ; +sip:user_864@sip.example.org clrtxt:secret ; +sip:user_865@sip.example.org clrtxt:secret ; +sip:user_866@sip.example.org clrtxt:secret ; +sip:user_867@sip.example.org clrtxt:secret ; +sip:user_868@sip.example.org clrtxt:secret ; +sip:user_869@sip.example.org clrtxt:secret ; +sip:user_870@sip.example.org clrtxt:secret ; +sip:user_871@sip.example.org clrtxt:secret ; +sip:user_872@sip.example.org clrtxt:secret ; +sip:user_873@sip.example.org clrtxt:secret ; +sip:user_874@sip.example.org clrtxt:secret ; +sip:user_875@sip.example.org clrtxt:secret ; +sip:user_876@sip.example.org clrtxt:secret ; +sip:user_877@sip.example.org clrtxt:secret ; +sip:user_878@sip.example.org clrtxt:secret ; +sip:user_879@sip.example.org clrtxt:secret ; +sip:user_880@sip.example.org clrtxt:secret ; +sip:user_881@sip.example.org clrtxt:secret ; +sip:user_882@sip.example.org clrtxt:secret ; +sip:user_883@sip.example.org clrtxt:secret ; +sip:user_884@sip.example.org clrtxt:secret ; +sip:user_885@sip.example.org clrtxt:secret ; +sip:user_886@sip.example.org clrtxt:secret ; +sip:user_887@sip.example.org clrtxt:secret ; +sip:user_888@sip.example.org clrtxt:secret ; +sip:user_889@sip.example.org clrtxt:secret ; +sip:user_890@sip.example.org clrtxt:secret ; +sip:user_891@sip.example.org clrtxt:secret ; +sip:user_892@sip.example.org clrtxt:secret ; +sip:user_893@sip.example.org clrtxt:secret ; +sip:user_894@sip.example.org clrtxt:secret ; +sip:user_895@sip.example.org clrtxt:secret ; +sip:user_896@sip.example.org clrtxt:secret ; +sip:user_897@sip.example.org clrtxt:secret ; +sip:user_898@sip.example.org clrtxt:secret ; +sip:user_899@sip.example.org clrtxt:secret ; +sip:user_900@sip.example.org clrtxt:secret ; +sip:user_901@sip.example.org clrtxt:secret ; +sip:user_902@sip.example.org clrtxt:secret ; +sip:user_903@sip.example.org clrtxt:secret ; +sip:user_904@sip.example.org clrtxt:secret ; +sip:user_905@sip.example.org clrtxt:secret ; +sip:user_906@sip.example.org clrtxt:secret ; +sip:user_907@sip.example.org clrtxt:secret ; +sip:user_908@sip.example.org clrtxt:secret ; +sip:user_909@sip.example.org clrtxt:secret ; +sip:user_910@sip.example.org clrtxt:secret ; +sip:user_911@sip.example.org clrtxt:secret ; +sip:user_912@sip.example.org clrtxt:secret ; +sip:user_913@sip.example.org clrtxt:secret ; +sip:user_914@sip.example.org clrtxt:secret ; +sip:user_915@sip.example.org clrtxt:secret ; +sip:user_916@sip.example.org clrtxt:secret ; +sip:user_917@sip.example.org clrtxt:secret ; +sip:user_918@sip.example.org clrtxt:secret ; +sip:user_919@sip.example.org clrtxt:secret ; +sip:user_920@sip.example.org clrtxt:secret ; +sip:user_921@sip.example.org clrtxt:secret ; +sip:user_922@sip.example.org clrtxt:secret ; +sip:user_923@sip.example.org clrtxt:secret ; +sip:user_924@sip.example.org clrtxt:secret ; +sip:user_925@sip.example.org clrtxt:secret ; +sip:user_926@sip.example.org clrtxt:secret ; +sip:user_927@sip.example.org clrtxt:secret ; +sip:user_928@sip.example.org clrtxt:secret ; +sip:user_929@sip.example.org clrtxt:secret ; +sip:user_930@sip.example.org clrtxt:secret ; +sip:user_931@sip.example.org clrtxt:secret ; +sip:user_932@sip.example.org clrtxt:secret ; +sip:user_933@sip.example.org clrtxt:secret ; +sip:user_934@sip.example.org clrtxt:secret ; +sip:user_935@sip.example.org clrtxt:secret ; +sip:user_936@sip.example.org clrtxt:secret ; +sip:user_937@sip.example.org clrtxt:secret ; +sip:user_938@sip.example.org clrtxt:secret ; +sip:user_939@sip.example.org clrtxt:secret ; +sip:user_940@sip.example.org clrtxt:secret ; +sip:user_941@sip.example.org clrtxt:secret ; +sip:user_942@sip.example.org clrtxt:secret ; +sip:user_943@sip.example.org clrtxt:secret ; +sip:user_944@sip.example.org clrtxt:secret ; +sip:user_945@sip.example.org clrtxt:secret ; +sip:user_946@sip.example.org clrtxt:secret ; +sip:user_947@sip.example.org clrtxt:secret ; +sip:user_948@sip.example.org clrtxt:secret ; +sip:user_949@sip.example.org clrtxt:secret ; +sip:user_950@sip.example.org clrtxt:secret ; +sip:user_951@sip.example.org clrtxt:secret ; +sip:user_952@sip.example.org clrtxt:secret ; +sip:user_953@sip.example.org clrtxt:secret ; +sip:user_954@sip.example.org clrtxt:secret ; +sip:user_955@sip.example.org clrtxt:secret ; +sip:user_956@sip.example.org clrtxt:secret ; +sip:user_957@sip.example.org clrtxt:secret ; +sip:user_958@sip.example.org clrtxt:secret ; +sip:user_959@sip.example.org clrtxt:secret ; +sip:user_960@sip.example.org clrtxt:secret ; +sip:user_961@sip.example.org clrtxt:secret ; +sip:user_962@sip.example.org clrtxt:secret ; +sip:user_963@sip.example.org clrtxt:secret ; +sip:user_964@sip.example.org clrtxt:secret ; +sip:user_965@sip.example.org clrtxt:secret ; +sip:user_966@sip.example.org clrtxt:secret ; +sip:user_967@sip.example.org clrtxt:secret ; +sip:user_968@sip.example.org clrtxt:secret ; +sip:user_969@sip.example.org clrtxt:secret ; +sip:user_970@sip.example.org clrtxt:secret ; +sip:user_971@sip.example.org clrtxt:secret ; +sip:user_972@sip.example.org clrtxt:secret ; +sip:user_973@sip.example.org clrtxt:secret ; +sip:user_974@sip.example.org clrtxt:secret ; +sip:user_975@sip.example.org clrtxt:secret ; +sip:user_976@sip.example.org clrtxt:secret ; +sip:user_977@sip.example.org clrtxt:secret ; +sip:user_978@sip.example.org clrtxt:secret ; +sip:user_979@sip.example.org clrtxt:secret ; +sip:user_980@sip.example.org clrtxt:secret ; +sip:user_981@sip.example.org clrtxt:secret ; +sip:user_982@sip.example.org clrtxt:secret ; +sip:user_983@sip.example.org clrtxt:secret ; +sip:user_984@sip.example.org clrtxt:secret ; +sip:user_985@sip.example.org clrtxt:secret ; +sip:user_986@sip.example.org clrtxt:secret ; +sip:user_987@sip.example.org clrtxt:secret ; +sip:user_988@sip.example.org clrtxt:secret ; +sip:user_989@sip.example.org clrtxt:secret ; +sip:user_990@sip.example.org clrtxt:secret ; +sip:user_991@sip.example.org clrtxt:secret ; +sip:user_992@sip.example.org clrtxt:secret ; +sip:user_993@sip.example.org clrtxt:secret ; +sip:user_994@sip.example.org clrtxt:secret ; +sip:user_995@sip.example.org clrtxt:secret ; +sip:user_996@sip.example.org clrtxt:secret ; +sip:user_997@sip.example.org clrtxt:secret ; +sip:user_998@sip.example.org clrtxt:secret ; +sip:user_999@sip.example.org clrtxt:secret ; +sip:user_1000@sip.example.org clrtxt:secret ; +sip:user_1001@sip.example.org clrtxt:secret ; +sip:user_1002@sip.example.org clrtxt:secret ; +sip:user_1003@sip.example.org clrtxt:secret ; +sip:user_1004@sip.example.org clrtxt:secret ; +sip:user_1005@sip.example.org clrtxt:secret ; +sip:user_1006@sip.example.org clrtxt:secret ; +sip:user_1007@sip.example.org clrtxt:secret ; +sip:user_1008@sip.example.org clrtxt:secret ; +sip:user_1009@sip.example.org clrtxt:secret ; +sip:user_1010@sip.example.org clrtxt:secret ; +sip:user_1011@sip.example.org clrtxt:secret ; +sip:user_1012@sip.example.org clrtxt:secret ; +sip:user_1013@sip.example.org clrtxt:secret ; +sip:user_1014@sip.example.org clrtxt:secret ; +sip:user_1015@sip.example.org clrtxt:secret ; +sip:user_1016@sip.example.org clrtxt:secret ; +sip:user_1017@sip.example.org clrtxt:secret ; +sip:user_1018@sip.example.org clrtxt:secret ; +sip:user_1019@sip.example.org clrtxt:secret ; +sip:user_1020@sip.example.org clrtxt:secret ; +sip:user_1021@sip.example.org clrtxt:secret ; +sip:user_1022@sip.example.org clrtxt:secret ; +sip:user_1023@sip.example.org clrtxt:secret ; +sip:user_1024@sip.example.org clrtxt:secret ; +sip:user_1025@sip.example.org clrtxt:secret ; +sip:user_1026@sip.example.org clrtxt:secret ; +sip:user_1027@sip.example.org clrtxt:secret ; +sip:user_1028@sip.example.org clrtxt:secret ; +sip:user_1029@sip.example.org clrtxt:secret ; +sip:user_1030@sip.example.org clrtxt:secret ; +sip:user_1031@sip.example.org clrtxt:secret ; +sip:user_1032@sip.example.org clrtxt:secret ; +sip:user_1033@sip.example.org clrtxt:secret ; +sip:user_1034@sip.example.org clrtxt:secret ; +sip:user_1035@sip.example.org clrtxt:secret ; +sip:user_1036@sip.example.org clrtxt:secret ; +sip:user_1037@sip.example.org clrtxt:secret ; +sip:user_1038@sip.example.org clrtxt:secret ; +sip:user_1039@sip.example.org clrtxt:secret ; +sip:user_1040@sip.example.org clrtxt:secret ; +sip:user_1041@sip.example.org clrtxt:secret ; +sip:user_1042@sip.example.org clrtxt:secret ; +sip:user_1043@sip.example.org clrtxt:secret ; +sip:user_1044@sip.example.org clrtxt:secret ; +sip:user_1045@sip.example.org clrtxt:secret ; +sip:user_1046@sip.example.org clrtxt:secret ; +sip:user_1047@sip.example.org clrtxt:secret ; +sip:user_1048@sip.example.org clrtxt:secret ; +sip:user_1049@sip.example.org clrtxt:secret ; +sip:user_1050@sip.example.org clrtxt:secret ; +sip:user_1051@sip.example.org clrtxt:secret ; +sip:user_1052@sip.example.org clrtxt:secret ; +sip:user_1053@sip.example.org clrtxt:secret ; +sip:user_1054@sip.example.org clrtxt:secret ; +sip:user_1055@sip.example.org clrtxt:secret ; +sip:user_1056@sip.example.org clrtxt:secret ; +sip:user_1057@sip.example.org clrtxt:secret ; +sip:user_1058@sip.example.org clrtxt:secret ; +sip:user_1059@sip.example.org clrtxt:secret ; +sip:user_1060@sip.example.org clrtxt:secret ; +sip:user_1061@sip.example.org clrtxt:secret ; +sip:user_1062@sip.example.org clrtxt:secret ; +sip:user_1063@sip.example.org clrtxt:secret ; +sip:user_1064@sip.example.org clrtxt:secret ; +sip:user_1065@sip.example.org clrtxt:secret ; +sip:user_1066@sip.example.org clrtxt:secret ; +sip:user_1067@sip.example.org clrtxt:secret ; +sip:user_1068@sip.example.org clrtxt:secret ; +sip:user_1069@sip.example.org clrtxt:secret ; +sip:user_1070@sip.example.org clrtxt:secret ; +sip:user_1071@sip.example.org clrtxt:secret ; +sip:user_1072@sip.example.org clrtxt:secret ; +sip:user_1073@sip.example.org clrtxt:secret ; +sip:user_1074@sip.example.org clrtxt:secret ; +sip:user_1075@sip.example.org clrtxt:secret ; +sip:user_1076@sip.example.org clrtxt:secret ; +sip:user_1077@sip.example.org clrtxt:secret ; +sip:user_1078@sip.example.org clrtxt:secret ; +sip:user_1079@sip.example.org clrtxt:secret ; +sip:user_1080@sip.example.org clrtxt:secret ; +sip:user_1081@sip.example.org clrtxt:secret ; +sip:user_1082@sip.example.org clrtxt:secret ; +sip:user_1083@sip.example.org clrtxt:secret ; +sip:user_1084@sip.example.org clrtxt:secret ; +sip:user_1085@sip.example.org clrtxt:secret ; +sip:user_1086@sip.example.org clrtxt:secret ; +sip:user_1087@sip.example.org clrtxt:secret ; +sip:user_1088@sip.example.org clrtxt:secret ; +sip:user_1089@sip.example.org clrtxt:secret ; +sip:user_1090@sip.example.org clrtxt:secret ; +sip:user_1091@sip.example.org clrtxt:secret ; +sip:user_1092@sip.example.org clrtxt:secret ; +sip:user_1093@sip.example.org clrtxt:secret ; +sip:user_1094@sip.example.org clrtxt:secret ; +sip:user_1095@sip.example.org clrtxt:secret ; +sip:user_1096@sip.example.org clrtxt:secret ; +sip:user_1097@sip.example.org clrtxt:secret ; +sip:user_1098@sip.example.org clrtxt:secret ; +sip:user_1099@sip.example.org clrtxt:secret ; +sip:user_1100@sip.example.org clrtxt:secret ; +sip:user_1101@sip.example.org clrtxt:secret ; +sip:user_1102@sip.example.org clrtxt:secret ; +sip:user_1103@sip.example.org clrtxt:secret ; +sip:user_1104@sip.example.org clrtxt:secret ; +sip:user_1105@sip.example.org clrtxt:secret ; +sip:user_1106@sip.example.org clrtxt:secret ; +sip:user_1107@sip.example.org clrtxt:secret ; +sip:user_1108@sip.example.org clrtxt:secret ; +sip:user_1109@sip.example.org clrtxt:secret ; +sip:user_1110@sip.example.org clrtxt:secret ; +sip:user_1111@sip.example.org clrtxt:secret ; +sip:user_1112@sip.example.org clrtxt:secret ; +sip:user_1113@sip.example.org clrtxt:secret ; +sip:user_1114@sip.example.org clrtxt:secret ; +sip:user_1115@sip.example.org clrtxt:secret ; +sip:user_1116@sip.example.org clrtxt:secret ; +sip:user_1117@sip.example.org clrtxt:secret ; +sip:user_1118@sip.example.org clrtxt:secret ; +sip:user_1119@sip.example.org clrtxt:secret ; +sip:user_1120@sip.example.org clrtxt:secret ; +sip:user_1121@sip.example.org clrtxt:secret ; +sip:user_1122@sip.example.org clrtxt:secret ; +sip:user_1123@sip.example.org clrtxt:secret ; +sip:user_1124@sip.example.org clrtxt:secret ; +sip:user_1125@sip.example.org clrtxt:secret ; +sip:user_1126@sip.example.org clrtxt:secret ; +sip:user_1127@sip.example.org clrtxt:secret ; +sip:user_1128@sip.example.org clrtxt:secret ; +sip:user_1129@sip.example.org clrtxt:secret ; +sip:user_1130@sip.example.org clrtxt:secret ; +sip:user_1131@sip.example.org clrtxt:secret ; +sip:user_1132@sip.example.org clrtxt:secret ; +sip:user_1133@sip.example.org clrtxt:secret ; +sip:user_1134@sip.example.org clrtxt:secret ; +sip:user_1135@sip.example.org clrtxt:secret ; +sip:user_1136@sip.example.org clrtxt:secret ; +sip:user_1137@sip.example.org clrtxt:secret ; +sip:user_1138@sip.example.org clrtxt:secret ; +sip:user_1139@sip.example.org clrtxt:secret ; +sip:user_1140@sip.example.org clrtxt:secret ; +sip:user_1141@sip.example.org clrtxt:secret ; +sip:user_1142@sip.example.org clrtxt:secret ; +sip:user_1143@sip.example.org clrtxt:secret ; +sip:user_1144@sip.example.org clrtxt:secret ; +sip:user_1145@sip.example.org clrtxt:secret ; +sip:user_1146@sip.example.org clrtxt:secret ; +sip:user_1147@sip.example.org clrtxt:secret ; +sip:user_1148@sip.example.org clrtxt:secret ; +sip:user_1149@sip.example.org clrtxt:secret ; +sip:user_1150@sip.example.org clrtxt:secret ; +sip:user_1151@sip.example.org clrtxt:secret ; +sip:user_1152@sip.example.org clrtxt:secret ; +sip:user_1153@sip.example.org clrtxt:secret ; +sip:user_1154@sip.example.org clrtxt:secret ; +sip:user_1155@sip.example.org clrtxt:secret ; +sip:user_1156@sip.example.org clrtxt:secret ; +sip:user_1157@sip.example.org clrtxt:secret ; +sip:user_1158@sip.example.org clrtxt:secret ; +sip:user_1159@sip.example.org clrtxt:secret ; +sip:user_1160@sip.example.org clrtxt:secret ; +sip:user_1161@sip.example.org clrtxt:secret ; +sip:user_1162@sip.example.org clrtxt:secret ; +sip:user_1163@sip.example.org clrtxt:secret ; +sip:user_1164@sip.example.org clrtxt:secret ; +sip:user_1165@sip.example.org clrtxt:secret ; +sip:user_1166@sip.example.org clrtxt:secret ; +sip:user_1167@sip.example.org clrtxt:secret ; +sip:user_1168@sip.example.org clrtxt:secret ; +sip:user_1169@sip.example.org clrtxt:secret ; +sip:user_1170@sip.example.org clrtxt:secret ; +sip:user_1171@sip.example.org clrtxt:secret ; +sip:user_1172@sip.example.org clrtxt:secret ; +sip:user_1173@sip.example.org clrtxt:secret ; +sip:user_1174@sip.example.org clrtxt:secret ; +sip:user_1175@sip.example.org clrtxt:secret ; +sip:user_1176@sip.example.org clrtxt:secret ; +sip:user_1177@sip.example.org clrtxt:secret ; +sip:user_1178@sip.example.org clrtxt:secret ; +sip:user_1179@sip.example.org clrtxt:secret ; +sip:user_1180@sip.example.org clrtxt:secret ; +sip:user_1181@sip.example.org clrtxt:secret ; +sip:user_1182@sip.example.org clrtxt:secret ; +sip:user_1183@sip.example.org clrtxt:secret ; +sip:user_1184@sip.example.org clrtxt:secret ; +sip:user_1185@sip.example.org clrtxt:secret ; +sip:user_1186@sip.example.org clrtxt:secret ; +sip:user_1187@sip.example.org clrtxt:secret ; +sip:user_1188@sip.example.org clrtxt:secret ; +sip:user_1189@sip.example.org clrtxt:secret ; +sip:user_1190@sip.example.org clrtxt:secret ; +sip:user_1191@sip.example.org clrtxt:secret ; +sip:user_1192@sip.example.org clrtxt:secret ; +sip:user_1193@sip.example.org clrtxt:secret ; +sip:user_1194@sip.example.org clrtxt:secret ; +sip:user_1195@sip.example.org clrtxt:secret ; +sip:user_1196@sip.example.org clrtxt:secret ; +sip:user_1197@sip.example.org clrtxt:secret ; +sip:user_1198@sip.example.org clrtxt:secret ; +sip:user_1199@sip.example.org clrtxt:secret ; +sip:user_1200@sip.example.org clrtxt:secret ; +sip:user_1201@sip.example.org clrtxt:secret ; +sip:user_1202@sip.example.org clrtxt:secret ; +sip:user_1203@sip.example.org clrtxt:secret ; +sip:user_1204@sip.example.org clrtxt:secret ; +sip:user_1205@sip.example.org clrtxt:secret ; +sip:user_1206@sip.example.org clrtxt:secret ; +sip:user_1207@sip.example.org clrtxt:secret ; +sip:user_1208@sip.example.org clrtxt:secret ; +sip:user_1209@sip.example.org clrtxt:secret ; +sip:user_1210@sip.example.org clrtxt:secret ; +sip:user_1211@sip.example.org clrtxt:secret ; +sip:user_1212@sip.example.org clrtxt:secret ; +sip:user_1213@sip.example.org clrtxt:secret ; +sip:user_1214@sip.example.org clrtxt:secret ; +sip:user_1215@sip.example.org clrtxt:secret ; +sip:user_1216@sip.example.org clrtxt:secret ; +sip:user_1217@sip.example.org clrtxt:secret ; +sip:user_1218@sip.example.org clrtxt:secret ; +sip:user_1219@sip.example.org clrtxt:secret ; +sip:user_1220@sip.example.org clrtxt:secret ; +sip:user_1221@sip.example.org clrtxt:secret ; +sip:user_1222@sip.example.org clrtxt:secret ; +sip:user_1223@sip.example.org clrtxt:secret ; +sip:user_1224@sip.example.org clrtxt:secret ; +sip:user_1225@sip.example.org clrtxt:secret ; +sip:user_1226@sip.example.org clrtxt:secret ; +sip:user_1227@sip.example.org clrtxt:secret ; +sip:user_1228@sip.example.org clrtxt:secret ; +sip:user_1229@sip.example.org clrtxt:secret ; +sip:user_1230@sip.example.org clrtxt:secret ; +sip:user_1231@sip.example.org clrtxt:secret ; +sip:user_1232@sip.example.org clrtxt:secret ; +sip:user_1233@sip.example.org clrtxt:secret ; +sip:user_1234@sip.example.org clrtxt:secret ; +sip:user_1235@sip.example.org clrtxt:secret ; +sip:user_1236@sip.example.org clrtxt:secret ; +sip:user_1237@sip.example.org clrtxt:secret ; +sip:user_1238@sip.example.org clrtxt:secret ; +sip:user_1239@sip.example.org clrtxt:secret ; +sip:user_1240@sip.example.org clrtxt:secret ; +sip:user_1241@sip.example.org clrtxt:secret ; +sip:user_1242@sip.example.org clrtxt:secret ; +sip:user_1243@sip.example.org clrtxt:secret ; +sip:user_1244@sip.example.org clrtxt:secret ; +sip:user_1245@sip.example.org clrtxt:secret ; +sip:user_1246@sip.example.org clrtxt:secret ; +sip:user_1247@sip.example.org clrtxt:secret ; +sip:user_1248@sip.example.org clrtxt:secret ; +sip:user_1249@sip.example.org clrtxt:secret ; +sip:user_1250@sip.example.org clrtxt:secret ; +sip:user_1251@sip.example.org clrtxt:secret ; +sip:user_1252@sip.example.org clrtxt:secret ; +sip:user_1253@sip.example.org clrtxt:secret ; +sip:user_1254@sip.example.org clrtxt:secret ; +sip:user_1255@sip.example.org clrtxt:secret ; +sip:user_1256@sip.example.org clrtxt:secret ; +sip:user_1257@sip.example.org clrtxt:secret ; +sip:user_1258@sip.example.org clrtxt:secret ; +sip:user_1259@sip.example.org clrtxt:secret ; +sip:user_1260@sip.example.org clrtxt:secret ; +sip:user_1261@sip.example.org clrtxt:secret ; +sip:user_1262@sip.example.org clrtxt:secret ; +sip:user_1263@sip.example.org clrtxt:secret ; +sip:user_1264@sip.example.org clrtxt:secret ; +sip:user_1265@sip.example.org clrtxt:secret ; +sip:user_1266@sip.example.org clrtxt:secret ; +sip:user_1267@sip.example.org clrtxt:secret ; +sip:user_1268@sip.example.org clrtxt:secret ; +sip:user_1269@sip.example.org clrtxt:secret ; +sip:user_1270@sip.example.org clrtxt:secret ; +sip:user_1271@sip.example.org clrtxt:secret ; +sip:user_1272@sip.example.org clrtxt:secret ; +sip:user_1273@sip.example.org clrtxt:secret ; +sip:user_1274@sip.example.org clrtxt:secret ; +sip:user_1275@sip.example.org clrtxt:secret ; +sip:user_1276@sip.example.org clrtxt:secret ; +sip:user_1277@sip.example.org clrtxt:secret ; +sip:user_1278@sip.example.org clrtxt:secret ; +sip:user_1279@sip.example.org clrtxt:secret ; +sip:user_1280@sip.example.org clrtxt:secret ; +sip:user_1281@sip.example.org clrtxt:secret ; +sip:user_1282@sip.example.org clrtxt:secret ; +sip:user_1283@sip.example.org clrtxt:secret ; +sip:user_1284@sip.example.org clrtxt:secret ; +sip:user_1285@sip.example.org clrtxt:secret ; +sip:user_1286@sip.example.org clrtxt:secret ; +sip:user_1287@sip.example.org clrtxt:secret ; +sip:user_1288@sip.example.org clrtxt:secret ; +sip:user_1289@sip.example.org clrtxt:secret ; +sip:user_1290@sip.example.org clrtxt:secret ; +sip:user_1291@sip.example.org clrtxt:secret ; +sip:user_1292@sip.example.org clrtxt:secret ; +sip:user_1293@sip.example.org clrtxt:secret ; +sip:user_1294@sip.example.org clrtxt:secret ; +sip:user_1295@sip.example.org clrtxt:secret ; +sip:user_1296@sip.example.org clrtxt:secret ; +sip:user_1297@sip.example.org clrtxt:secret ; +sip:user_1298@sip.example.org clrtxt:secret ; +sip:user_1299@sip.example.org clrtxt:secret ; +sip:user_1300@sip.example.org clrtxt:secret ; +sip:user_1301@sip.example.org clrtxt:secret ; +sip:user_1302@sip.example.org clrtxt:secret ; +sip:user_1303@sip.example.org clrtxt:secret ; +sip:user_1304@sip.example.org clrtxt:secret ; +sip:user_1305@sip.example.org clrtxt:secret ; +sip:user_1306@sip.example.org clrtxt:secret ; +sip:user_1307@sip.example.org clrtxt:secret ; +sip:user_1308@sip.example.org clrtxt:secret ; +sip:user_1309@sip.example.org clrtxt:secret ; +sip:user_1310@sip.example.org clrtxt:secret ; +sip:user_1311@sip.example.org clrtxt:secret ; +sip:user_1312@sip.example.org clrtxt:secret ; +sip:user_1313@sip.example.org clrtxt:secret ; +sip:user_1314@sip.example.org clrtxt:secret ; +sip:user_1315@sip.example.org clrtxt:secret ; +sip:user_1316@sip.example.org clrtxt:secret ; +sip:user_1317@sip.example.org clrtxt:secret ; +sip:user_1318@sip.example.org clrtxt:secret ; +sip:user_1319@sip.example.org clrtxt:secret ; +sip:user_1320@sip.example.org clrtxt:secret ; +sip:user_1321@sip.example.org clrtxt:secret ; +sip:user_1322@sip.example.org clrtxt:secret ; +sip:user_1323@sip.example.org clrtxt:secret ; +sip:user_1324@sip.example.org clrtxt:secret ; +sip:user_1325@sip.example.org clrtxt:secret ; +sip:user_1326@sip.example.org clrtxt:secret ; +sip:user_1327@sip.example.org clrtxt:secret ; +sip:user_1328@sip.example.org clrtxt:secret ; +sip:user_1329@sip.example.org clrtxt:secret ; +sip:user_1330@sip.example.org clrtxt:secret ; +sip:user_1331@sip.example.org clrtxt:secret ; +sip:user_1332@sip.example.org clrtxt:secret ; +sip:user_1333@sip.example.org clrtxt:secret ; +sip:user_1334@sip.example.org clrtxt:secret ; +sip:user_1335@sip.example.org clrtxt:secret ; +sip:user_1336@sip.example.org clrtxt:secret ; +sip:user_1337@sip.example.org clrtxt:secret ; +sip:user_1338@sip.example.org clrtxt:secret ; +sip:user_1339@sip.example.org clrtxt:secret ; +sip:user_1340@sip.example.org clrtxt:secret ; +sip:user_1341@sip.example.org clrtxt:secret ; +sip:user_1342@sip.example.org clrtxt:secret ; +sip:user_1343@sip.example.org clrtxt:secret ; +sip:user_1344@sip.example.org clrtxt:secret ; +sip:user_1345@sip.example.org clrtxt:secret ; +sip:user_1346@sip.example.org clrtxt:secret ; +sip:user_1347@sip.example.org clrtxt:secret ; +sip:user_1348@sip.example.org clrtxt:secret ; +sip:user_1349@sip.example.org clrtxt:secret ; +sip:user_1350@sip.example.org clrtxt:secret ; +sip:user_1351@sip.example.org clrtxt:secret ; +sip:user_1352@sip.example.org clrtxt:secret ; +sip:user_1353@sip.example.org clrtxt:secret ; +sip:user_1354@sip.example.org clrtxt:secret ; +sip:user_1355@sip.example.org clrtxt:secret ; +sip:user_1356@sip.example.org clrtxt:secret ; +sip:user_1357@sip.example.org clrtxt:secret ; +sip:user_1358@sip.example.org clrtxt:secret ; +sip:user_1359@sip.example.org clrtxt:secret ; +sip:user_1360@sip.example.org clrtxt:secret ; +sip:user_1361@sip.example.org clrtxt:secret ; +sip:user_1362@sip.example.org clrtxt:secret ; +sip:user_1363@sip.example.org clrtxt:secret ; +sip:user_1364@sip.example.org clrtxt:secret ; +sip:user_1365@sip.example.org clrtxt:secret ; +sip:user_1366@sip.example.org clrtxt:secret ; +sip:user_1367@sip.example.org clrtxt:secret ; +sip:user_1368@sip.example.org clrtxt:secret ; +sip:user_1369@sip.example.org clrtxt:secret ; +sip:user_1370@sip.example.org clrtxt:secret ; +sip:user_1371@sip.example.org clrtxt:secret ; +sip:user_1372@sip.example.org clrtxt:secret ; +sip:user_1373@sip.example.org clrtxt:secret ; +sip:user_1374@sip.example.org clrtxt:secret ; +sip:user_1375@sip.example.org clrtxt:secret ; +sip:user_1376@sip.example.org clrtxt:secret ; +sip:user_1377@sip.example.org clrtxt:secret ; +sip:user_1378@sip.example.org clrtxt:secret ; +sip:user_1379@sip.example.org clrtxt:secret ; +sip:user_1380@sip.example.org clrtxt:secret ; +sip:user_1381@sip.example.org clrtxt:secret ; +sip:user_1382@sip.example.org clrtxt:secret ; +sip:user_1383@sip.example.org clrtxt:secret ; +sip:user_1384@sip.example.org clrtxt:secret ; +sip:user_1385@sip.example.org clrtxt:secret ; +sip:user_1386@sip.example.org clrtxt:secret ; +sip:user_1387@sip.example.org clrtxt:secret ; +sip:user_1388@sip.example.org clrtxt:secret ; +sip:user_1389@sip.example.org clrtxt:secret ; +sip:user_1390@sip.example.org clrtxt:secret ; +sip:user_1391@sip.example.org clrtxt:secret ; +sip:user_1392@sip.example.org clrtxt:secret ; +sip:user_1393@sip.example.org clrtxt:secret ; +sip:user_1394@sip.example.org clrtxt:secret ; +sip:user_1395@sip.example.org clrtxt:secret ; +sip:user_1396@sip.example.org clrtxt:secret ; +sip:user_1397@sip.example.org clrtxt:secret ; +sip:user_1398@sip.example.org clrtxt:secret ; +sip:user_1399@sip.example.org clrtxt:secret ; +sip:user_1400@sip.example.org clrtxt:secret ; +sip:user_1401@sip.example.org clrtxt:secret ; +sip:user_1402@sip.example.org clrtxt:secret ; +sip:user_1403@sip.example.org clrtxt:secret ; +sip:user_1404@sip.example.org clrtxt:secret ; +sip:user_1405@sip.example.org clrtxt:secret ; +sip:user_1406@sip.example.org clrtxt:secret ; +sip:user_1407@sip.example.org clrtxt:secret ; +sip:user_1408@sip.example.org clrtxt:secret ; +sip:user_1409@sip.example.org clrtxt:secret ; +sip:user_1410@sip.example.org clrtxt:secret ; +sip:user_1411@sip.example.org clrtxt:secret ; +sip:user_1412@sip.example.org clrtxt:secret ; +sip:user_1413@sip.example.org clrtxt:secret ; +sip:user_1414@sip.example.org clrtxt:secret ; +sip:user_1415@sip.example.org clrtxt:secret ; +sip:user_1416@sip.example.org clrtxt:secret ; +sip:user_1417@sip.example.org clrtxt:secret ; +sip:user_1418@sip.example.org clrtxt:secret ; +sip:user_1419@sip.example.org clrtxt:secret ; +sip:user_1420@sip.example.org clrtxt:secret ; +sip:user_1421@sip.example.org clrtxt:secret ; +sip:user_1422@sip.example.org clrtxt:secret ; +sip:user_1423@sip.example.org clrtxt:secret ; +sip:user_1424@sip.example.org clrtxt:secret ; +sip:user_1425@sip.example.org clrtxt:secret ; +sip:user_1426@sip.example.org clrtxt:secret ; +sip:user_1427@sip.example.org clrtxt:secret ; +sip:user_1428@sip.example.org clrtxt:secret ; +sip:user_1429@sip.example.org clrtxt:secret ; +sip:user_1430@sip.example.org clrtxt:secret ; +sip:user_1431@sip.example.org clrtxt:secret ; +sip:user_1432@sip.example.org clrtxt:secret ; +sip:user_1433@sip.example.org clrtxt:secret ; +sip:user_1434@sip.example.org clrtxt:secret ; +sip:user_1435@sip.example.org clrtxt:secret ; +sip:user_1436@sip.example.org clrtxt:secret ; +sip:user_1437@sip.example.org clrtxt:secret ; +sip:user_1438@sip.example.org clrtxt:secret ; +sip:user_1439@sip.example.org clrtxt:secret ; +sip:user_1440@sip.example.org clrtxt:secret ; +sip:user_1441@sip.example.org clrtxt:secret ; +sip:user_1442@sip.example.org clrtxt:secret ; +sip:user_1443@sip.example.org clrtxt:secret ; +sip:user_1444@sip.example.org clrtxt:secret ; +sip:user_1445@sip.example.org clrtxt:secret ; +sip:user_1446@sip.example.org clrtxt:secret ; +sip:user_1447@sip.example.org clrtxt:secret ; +sip:user_1448@sip.example.org clrtxt:secret ; +sip:user_1449@sip.example.org clrtxt:secret ; +sip:user_1450@sip.example.org clrtxt:secret ; +sip:user_1451@sip.example.org clrtxt:secret ; +sip:user_1452@sip.example.org clrtxt:secret ; +sip:user_1453@sip.example.org clrtxt:secret ; +sip:user_1454@sip.example.org clrtxt:secret ; +sip:user_1455@sip.example.org clrtxt:secret ; +sip:user_1456@sip.example.org clrtxt:secret ; +sip:user_1457@sip.example.org clrtxt:secret ; +sip:user_1458@sip.example.org clrtxt:secret ; +sip:user_1459@sip.example.org clrtxt:secret ; +sip:user_1460@sip.example.org clrtxt:secret ; +sip:user_1461@sip.example.org clrtxt:secret ; +sip:user_1462@sip.example.org clrtxt:secret ; +sip:user_1463@sip.example.org clrtxt:secret ; +sip:user_1464@sip.example.org clrtxt:secret ; +sip:user_1465@sip.example.org clrtxt:secret ; +sip:user_1466@sip.example.org clrtxt:secret ; +sip:user_1467@sip.example.org clrtxt:secret ; +sip:user_1468@sip.example.org clrtxt:secret ; +sip:user_1469@sip.example.org clrtxt:secret ; +sip:user_1470@sip.example.org clrtxt:secret ; +sip:user_1471@sip.example.org clrtxt:secret ; +sip:user_1472@sip.example.org clrtxt:secret ; +sip:user_1473@sip.example.org clrtxt:secret ; +sip:user_1474@sip.example.org clrtxt:secret ; +sip:user_1475@sip.example.org clrtxt:secret ; +sip:user_1476@sip.example.org clrtxt:secret ; +sip:user_1477@sip.example.org clrtxt:secret ; +sip:user_1478@sip.example.org clrtxt:secret ; +sip:user_1479@sip.example.org clrtxt:secret ; +sip:user_1480@sip.example.org clrtxt:secret ; +sip:user_1481@sip.example.org clrtxt:secret ; +sip:user_1482@sip.example.org clrtxt:secret ; +sip:user_1483@sip.example.org clrtxt:secret ; +sip:user_1484@sip.example.org clrtxt:secret ; +sip:user_1485@sip.example.org clrtxt:secret ; +sip:user_1486@sip.example.org clrtxt:secret ; +sip:user_1487@sip.example.org clrtxt:secret ; +sip:user_1488@sip.example.org clrtxt:secret ; +sip:user_1489@sip.example.org clrtxt:secret ; +sip:user_1490@sip.example.org clrtxt:secret ; +sip:user_1491@sip.example.org clrtxt:secret ; +sip:user_1492@sip.example.org clrtxt:secret ; +sip:user_1493@sip.example.org clrtxt:secret ; +sip:user_1494@sip.example.org clrtxt:secret ; +sip:user_1495@sip.example.org clrtxt:secret ; +sip:user_1496@sip.example.org clrtxt:secret ; +sip:user_1497@sip.example.org clrtxt:secret ; +sip:user_1498@sip.example.org clrtxt:secret ; +sip:user_1499@sip.example.org clrtxt:secret ; +sip:user_1500@sip.example.org clrtxt:secret ; +sip:user_1501@sip.example.org clrtxt:secret ; +sip:user_1502@sip.example.org clrtxt:secret ; +sip:user_1503@sip.example.org clrtxt:secret ; +sip:user_1504@sip.example.org clrtxt:secret ; +sip:user_1505@sip.example.org clrtxt:secret ; +sip:user_1506@sip.example.org clrtxt:secret ; +sip:user_1507@sip.example.org clrtxt:secret ; +sip:user_1508@sip.example.org clrtxt:secret ; +sip:user_1509@sip.example.org clrtxt:secret ; +sip:user_1510@sip.example.org clrtxt:secret ; +sip:user_1511@sip.example.org clrtxt:secret ; +sip:user_1512@sip.example.org clrtxt:secret ; +sip:user_1513@sip.example.org clrtxt:secret ; +sip:user_1514@sip.example.org clrtxt:secret ; +sip:user_1515@sip.example.org clrtxt:secret ; +sip:user_1516@sip.example.org clrtxt:secret ; +sip:user_1517@sip.example.org clrtxt:secret ; +sip:user_1518@sip.example.org clrtxt:secret ; +sip:user_1519@sip.example.org clrtxt:secret ; +sip:user_1520@sip.example.org clrtxt:secret ; +sip:user_1521@sip.example.org clrtxt:secret ; +sip:user_1522@sip.example.org clrtxt:secret ; +sip:user_1523@sip.example.org clrtxt:secret ; +sip:user_1524@sip.example.org clrtxt:secret ; +sip:user_1525@sip.example.org clrtxt:secret ; +sip:user_1526@sip.example.org clrtxt:secret ; +sip:user_1527@sip.example.org clrtxt:secret ; +sip:user_1528@sip.example.org clrtxt:secret ; +sip:user_1529@sip.example.org clrtxt:secret ; +sip:user_1530@sip.example.org clrtxt:secret ; +sip:user_1531@sip.example.org clrtxt:secret ; +sip:user_1532@sip.example.org clrtxt:secret ; +sip:user_1533@sip.example.org clrtxt:secret ; +sip:user_1534@sip.example.org clrtxt:secret ; +sip:user_1535@sip.example.org clrtxt:secret ; +sip:user_1536@sip.example.org clrtxt:secret ; +sip:user_1537@sip.example.org clrtxt:secret ; +sip:user_1538@sip.example.org clrtxt:secret ; +sip:user_1539@sip.example.org clrtxt:secret ; +sip:user_1540@sip.example.org clrtxt:secret ; +sip:user_1541@sip.example.org clrtxt:secret ; +sip:user_1542@sip.example.org clrtxt:secret ; +sip:user_1543@sip.example.org clrtxt:secret ; +sip:user_1544@sip.example.org clrtxt:secret ; +sip:user_1545@sip.example.org clrtxt:secret ; +sip:user_1546@sip.example.org clrtxt:secret ; +sip:user_1547@sip.example.org clrtxt:secret ; +sip:user_1548@sip.example.org clrtxt:secret ; +sip:user_1549@sip.example.org clrtxt:secret ; +sip:user_1550@sip.example.org clrtxt:secret ; +sip:user_1551@sip.example.org clrtxt:secret ; +sip:user_1552@sip.example.org clrtxt:secret ; +sip:user_1553@sip.example.org clrtxt:secret ; +sip:user_1554@sip.example.org clrtxt:secret ; +sip:user_1555@sip.example.org clrtxt:secret ; +sip:user_1556@sip.example.org clrtxt:secret ; +sip:user_1557@sip.example.org clrtxt:secret ; +sip:user_1558@sip.example.org clrtxt:secret ; +sip:user_1559@sip.example.org clrtxt:secret ; +sip:user_1560@sip.example.org clrtxt:secret ; +sip:user_1561@sip.example.org clrtxt:secret ; +sip:user_1562@sip.example.org clrtxt:secret ; +sip:user_1563@sip.example.org clrtxt:secret ; +sip:user_1564@sip.example.org clrtxt:secret ; +sip:user_1565@sip.example.org clrtxt:secret ; +sip:user_1566@sip.example.org clrtxt:secret ; +sip:user_1567@sip.example.org clrtxt:secret ; +sip:user_1568@sip.example.org clrtxt:secret ; +sip:user_1569@sip.example.org clrtxt:secret ; +sip:user_1570@sip.example.org clrtxt:secret ; +sip:user_1571@sip.example.org clrtxt:secret ; +sip:user_1572@sip.example.org clrtxt:secret ; +sip:user_1573@sip.example.org clrtxt:secret ; +sip:user_1574@sip.example.org clrtxt:secret ; +sip:user_1575@sip.example.org clrtxt:secret ; +sip:user_1576@sip.example.org clrtxt:secret ; +sip:user_1577@sip.example.org clrtxt:secret ; +sip:user_1578@sip.example.org clrtxt:secret ; +sip:user_1579@sip.example.org clrtxt:secret ; +sip:user_1580@sip.example.org clrtxt:secret ; +sip:user_1581@sip.example.org clrtxt:secret ; +sip:user_1582@sip.example.org clrtxt:secret ; +sip:user_1583@sip.example.org clrtxt:secret ; +sip:user_1584@sip.example.org clrtxt:secret ; +sip:user_1585@sip.example.org clrtxt:secret ; +sip:user_1586@sip.example.org clrtxt:secret ; +sip:user_1587@sip.example.org clrtxt:secret ; +sip:user_1588@sip.example.org clrtxt:secret ; +sip:user_1589@sip.example.org clrtxt:secret ; +sip:user_1590@sip.example.org clrtxt:secret ; +sip:user_1591@sip.example.org clrtxt:secret ; +sip:user_1592@sip.example.org clrtxt:secret ; +sip:user_1593@sip.example.org clrtxt:secret ; +sip:user_1594@sip.example.org clrtxt:secret ; +sip:user_1595@sip.example.org clrtxt:secret ; +sip:user_1596@sip.example.org clrtxt:secret ; +sip:user_1597@sip.example.org clrtxt:secret ; +sip:user_1598@sip.example.org clrtxt:secret ; +sip:user_1599@sip.example.org clrtxt:secret ; +sip:user_1600@sip.example.org clrtxt:secret ; +sip:user_1601@sip.example.org clrtxt:secret ; +sip:user_1602@sip.example.org clrtxt:secret ; +sip:user_1603@sip.example.org clrtxt:secret ; +sip:user_1604@sip.example.org clrtxt:secret ; +sip:user_1605@sip.example.org clrtxt:secret ; +sip:user_1606@sip.example.org clrtxt:secret ; +sip:user_1607@sip.example.org clrtxt:secret ; +sip:user_1608@sip.example.org clrtxt:secret ; +sip:user_1609@sip.example.org clrtxt:secret ; +sip:user_1610@sip.example.org clrtxt:secret ; +sip:user_1611@sip.example.org clrtxt:secret ; +sip:user_1612@sip.example.org clrtxt:secret ; +sip:user_1613@sip.example.org clrtxt:secret ; +sip:user_1614@sip.example.org clrtxt:secret ; +sip:user_1615@sip.example.org clrtxt:secret ; +sip:user_1616@sip.example.org clrtxt:secret ; +sip:user_1617@sip.example.org clrtxt:secret ; +sip:user_1618@sip.example.org clrtxt:secret ; +sip:user_1619@sip.example.org clrtxt:secret ; +sip:user_1620@sip.example.org clrtxt:secret ; +sip:user_1621@sip.example.org clrtxt:secret ; +sip:user_1622@sip.example.org clrtxt:secret ; +sip:user_1623@sip.example.org clrtxt:secret ; +sip:user_1624@sip.example.org clrtxt:secret ; +sip:user_1625@sip.example.org clrtxt:secret ; +sip:user_1626@sip.example.org clrtxt:secret ; +sip:user_1627@sip.example.org clrtxt:secret ; +sip:user_1628@sip.example.org clrtxt:secret ; +sip:user_1629@sip.example.org clrtxt:secret ; +sip:user_1630@sip.example.org clrtxt:secret ; +sip:user_1631@sip.example.org clrtxt:secret ; +sip:user_1632@sip.example.org clrtxt:secret ; +sip:user_1633@sip.example.org clrtxt:secret ; +sip:user_1634@sip.example.org clrtxt:secret ; +sip:user_1635@sip.example.org clrtxt:secret ; +sip:user_1636@sip.example.org clrtxt:secret ; +sip:user_1637@sip.example.org clrtxt:secret ; +sip:user_1638@sip.example.org clrtxt:secret ; +sip:user_1639@sip.example.org clrtxt:secret ; +sip:user_1640@sip.example.org clrtxt:secret ; +sip:user_1641@sip.example.org clrtxt:secret ; +sip:user_1642@sip.example.org clrtxt:secret ; +sip:user_1643@sip.example.org clrtxt:secret ; +sip:user_1644@sip.example.org clrtxt:secret ; +sip:user_1645@sip.example.org clrtxt:secret ; +sip:user_1646@sip.example.org clrtxt:secret ; +sip:user_1647@sip.example.org clrtxt:secret ; +sip:user_1648@sip.example.org clrtxt:secret ; +sip:user_1649@sip.example.org clrtxt:secret ; +sip:user_1650@sip.example.org clrtxt:secret ; +sip:user_1651@sip.example.org clrtxt:secret ; +sip:user_1652@sip.example.org clrtxt:secret ; +sip:user_1653@sip.example.org clrtxt:secret ; +sip:user_1654@sip.example.org clrtxt:secret ; +sip:user_1655@sip.example.org clrtxt:secret ; +sip:user_1656@sip.example.org clrtxt:secret ; +sip:user_1657@sip.example.org clrtxt:secret ; +sip:user_1658@sip.example.org clrtxt:secret ; +sip:user_1659@sip.example.org clrtxt:secret ; +sip:user_1660@sip.example.org clrtxt:secret ; +sip:user_1661@sip.example.org clrtxt:secret ; +sip:user_1662@sip.example.org clrtxt:secret ; +sip:user_1663@sip.example.org clrtxt:secret ; +sip:user_1664@sip.example.org clrtxt:secret ; +sip:user_1665@sip.example.org clrtxt:secret ; +sip:user_1666@sip.example.org clrtxt:secret ; +sip:user_1667@sip.example.org clrtxt:secret ; +sip:user_1668@sip.example.org clrtxt:secret ; +sip:user_1669@sip.example.org clrtxt:secret ; +sip:user_1670@sip.example.org clrtxt:secret ; +sip:user_1671@sip.example.org clrtxt:secret ; +sip:user_1672@sip.example.org clrtxt:secret ; +sip:user_1673@sip.example.org clrtxt:secret ; +sip:user_1674@sip.example.org clrtxt:secret ; +sip:user_1675@sip.example.org clrtxt:secret ; +sip:user_1676@sip.example.org clrtxt:secret ; +sip:user_1677@sip.example.org clrtxt:secret ; +sip:user_1678@sip.example.org clrtxt:secret ; +sip:user_1679@sip.example.org clrtxt:secret ; +sip:user_1680@sip.example.org clrtxt:secret ; +sip:user_1681@sip.example.org clrtxt:secret ; +sip:user_1682@sip.example.org clrtxt:secret ; +sip:user_1683@sip.example.org clrtxt:secret ; +sip:user_1684@sip.example.org clrtxt:secret ; +sip:user_1685@sip.example.org clrtxt:secret ; +sip:user_1686@sip.example.org clrtxt:secret ; +sip:user_1687@sip.example.org clrtxt:secret ; +sip:user_1688@sip.example.org clrtxt:secret ; +sip:user_1689@sip.example.org clrtxt:secret ; +sip:user_1690@sip.example.org clrtxt:secret ; +sip:user_1691@sip.example.org clrtxt:secret ; +sip:user_1692@sip.example.org clrtxt:secret ; +sip:user_1693@sip.example.org clrtxt:secret ; +sip:user_1694@sip.example.org clrtxt:secret ; +sip:user_1695@sip.example.org clrtxt:secret ; +sip:user_1696@sip.example.org clrtxt:secret ; +sip:user_1697@sip.example.org clrtxt:secret ; +sip:user_1698@sip.example.org clrtxt:secret ; +sip:user_1699@sip.example.org clrtxt:secret ; +sip:user_1700@sip.example.org clrtxt:secret ; +sip:user_1701@sip.example.org clrtxt:secret ; +sip:user_1702@sip.example.org clrtxt:secret ; +sip:user_1703@sip.example.org clrtxt:secret ; +sip:user_1704@sip.example.org clrtxt:secret ; +sip:user_1705@sip.example.org clrtxt:secret ; +sip:user_1706@sip.example.org clrtxt:secret ; +sip:user_1707@sip.example.org clrtxt:secret ; +sip:user_1708@sip.example.org clrtxt:secret ; +sip:user_1709@sip.example.org clrtxt:secret ; +sip:user_1710@sip.example.org clrtxt:secret ; +sip:user_1711@sip.example.org clrtxt:secret ; +sip:user_1712@sip.example.org clrtxt:secret ; +sip:user_1713@sip.example.org clrtxt:secret ; +sip:user_1714@sip.example.org clrtxt:secret ; +sip:user_1715@sip.example.org clrtxt:secret ; +sip:user_1716@sip.example.org clrtxt:secret ; +sip:user_1717@sip.example.org clrtxt:secret ; +sip:user_1718@sip.example.org clrtxt:secret ; +sip:user_1719@sip.example.org clrtxt:secret ; +sip:user_1720@sip.example.org clrtxt:secret ; +sip:user_1721@sip.example.org clrtxt:secret ; +sip:user_1722@sip.example.org clrtxt:secret ; +sip:user_1723@sip.example.org clrtxt:secret ; +sip:user_1724@sip.example.org clrtxt:secret ; +sip:user_1725@sip.example.org clrtxt:secret ; +sip:user_1726@sip.example.org clrtxt:secret ; +sip:user_1727@sip.example.org clrtxt:secret ; +sip:user_1728@sip.example.org clrtxt:secret ; +sip:user_1729@sip.example.org clrtxt:secret ; +sip:user_1730@sip.example.org clrtxt:secret ; +sip:user_1731@sip.example.org clrtxt:secret ; +sip:user_1732@sip.example.org clrtxt:secret ; +sip:user_1733@sip.example.org clrtxt:secret ; +sip:user_1734@sip.example.org clrtxt:secret ; +sip:user_1735@sip.example.org clrtxt:secret ; +sip:user_1736@sip.example.org clrtxt:secret ; +sip:user_1737@sip.example.org clrtxt:secret ; +sip:user_1738@sip.example.org clrtxt:secret ; +sip:user_1739@sip.example.org clrtxt:secret ; +sip:user_1740@sip.example.org clrtxt:secret ; +sip:user_1741@sip.example.org clrtxt:secret ; +sip:user_1742@sip.example.org clrtxt:secret ; +sip:user_1743@sip.example.org clrtxt:secret ; +sip:user_1744@sip.example.org clrtxt:secret ; +sip:user_1745@sip.example.org clrtxt:secret ; +sip:user_1746@sip.example.org clrtxt:secret ; +sip:user_1747@sip.example.org clrtxt:secret ; +sip:user_1748@sip.example.org clrtxt:secret ; +sip:user_1749@sip.example.org clrtxt:secret ; +sip:user_1750@sip.example.org clrtxt:secret ; +sip:user_1751@sip.example.org clrtxt:secret ; +sip:user_1752@sip.example.org clrtxt:secret ; +sip:user_1753@sip.example.org clrtxt:secret ; +sip:user_1754@sip.example.org clrtxt:secret ; +sip:user_1755@sip.example.org clrtxt:secret ; +sip:user_1756@sip.example.org clrtxt:secret ; +sip:user_1757@sip.example.org clrtxt:secret ; +sip:user_1758@sip.example.org clrtxt:secret ; +sip:user_1759@sip.example.org clrtxt:secret ; +sip:user_1760@sip.example.org clrtxt:secret ; +sip:user_1761@sip.example.org clrtxt:secret ; +sip:user_1762@sip.example.org clrtxt:secret ; +sip:user_1763@sip.example.org clrtxt:secret ; +sip:user_1764@sip.example.org clrtxt:secret ; +sip:user_1765@sip.example.org clrtxt:secret ; +sip:user_1766@sip.example.org clrtxt:secret ; +sip:user_1767@sip.example.org clrtxt:secret ; +sip:user_1768@sip.example.org clrtxt:secret ; +sip:user_1769@sip.example.org clrtxt:secret ; +sip:user_1770@sip.example.org clrtxt:secret ; +sip:user_1771@sip.example.org clrtxt:secret ; +sip:user_1772@sip.example.org clrtxt:secret ; +sip:user_1773@sip.example.org clrtxt:secret ; +sip:user_1774@sip.example.org clrtxt:secret ; +sip:user_1775@sip.example.org clrtxt:secret ; +sip:user_1776@sip.example.org clrtxt:secret ; +sip:user_1777@sip.example.org clrtxt:secret ; +sip:user_1778@sip.example.org clrtxt:secret ; +sip:user_1779@sip.example.org clrtxt:secret ; +sip:user_1780@sip.example.org clrtxt:secret ; +sip:user_1781@sip.example.org clrtxt:secret ; +sip:user_1782@sip.example.org clrtxt:secret ; +sip:user_1783@sip.example.org clrtxt:secret ; +sip:user_1784@sip.example.org clrtxt:secret ; +sip:user_1785@sip.example.org clrtxt:secret ; +sip:user_1786@sip.example.org clrtxt:secret ; +sip:user_1787@sip.example.org clrtxt:secret ; +sip:user_1788@sip.example.org clrtxt:secret ; +sip:user_1789@sip.example.org clrtxt:secret ; +sip:user_1790@sip.example.org clrtxt:secret ; +sip:user_1791@sip.example.org clrtxt:secret ; +sip:user_1792@sip.example.org clrtxt:secret ; +sip:user_1793@sip.example.org clrtxt:secret ; +sip:user_1794@sip.example.org clrtxt:secret ; +sip:user_1795@sip.example.org clrtxt:secret ; +sip:user_1796@sip.example.org clrtxt:secret ; +sip:user_1797@sip.example.org clrtxt:secret ; +sip:user_1798@sip.example.org clrtxt:secret ; +sip:user_1799@sip.example.org clrtxt:secret ; +sip:user_1800@sip.example.org clrtxt:secret ; +sip:user_1801@sip.example.org clrtxt:secret ; +sip:user_1802@sip.example.org clrtxt:secret ; +sip:user_1803@sip.example.org clrtxt:secret ; +sip:user_1804@sip.example.org clrtxt:secret ; +sip:user_1805@sip.example.org clrtxt:secret ; +sip:user_1806@sip.example.org clrtxt:secret ; +sip:user_1807@sip.example.org clrtxt:secret ; +sip:user_1808@sip.example.org clrtxt:secret ; +sip:user_1809@sip.example.org clrtxt:secret ; +sip:user_1810@sip.example.org clrtxt:secret ; +sip:user_1811@sip.example.org clrtxt:secret ; +sip:user_1812@sip.example.org clrtxt:secret ; +sip:user_1813@sip.example.org clrtxt:secret ; +sip:user_1814@sip.example.org clrtxt:secret ; +sip:user_1815@sip.example.org clrtxt:secret ; +sip:user_1816@sip.example.org clrtxt:secret ; +sip:user_1817@sip.example.org clrtxt:secret ; +sip:user_1818@sip.example.org clrtxt:secret ; +sip:user_1819@sip.example.org clrtxt:secret ; +sip:user_1820@sip.example.org clrtxt:secret ; +sip:user_1821@sip.example.org clrtxt:secret ; +sip:user_1822@sip.example.org clrtxt:secret ; +sip:user_1823@sip.example.org clrtxt:secret ; +sip:user_1824@sip.example.org clrtxt:secret ; +sip:user_1825@sip.example.org clrtxt:secret ; +sip:user_1826@sip.example.org clrtxt:secret ; +sip:user_1827@sip.example.org clrtxt:secret ; +sip:user_1828@sip.example.org clrtxt:secret ; +sip:user_1829@sip.example.org clrtxt:secret ; +sip:user_1830@sip.example.org clrtxt:secret ; +sip:user_1831@sip.example.org clrtxt:secret ; +sip:user_1832@sip.example.org clrtxt:secret ; +sip:user_1833@sip.example.org clrtxt:secret ; +sip:user_1834@sip.example.org clrtxt:secret ; +sip:user_1835@sip.example.org clrtxt:secret ; +sip:user_1836@sip.example.org clrtxt:secret ; +sip:user_1837@sip.example.org clrtxt:secret ; +sip:user_1838@sip.example.org clrtxt:secret ; +sip:user_1839@sip.example.org clrtxt:secret ; +sip:user_1840@sip.example.org clrtxt:secret ; +sip:user_1841@sip.example.org clrtxt:secret ; +sip:user_1842@sip.example.org clrtxt:secret ; +sip:user_1843@sip.example.org clrtxt:secret ; +sip:user_1844@sip.example.org clrtxt:secret ; +sip:user_1845@sip.example.org clrtxt:secret ; +sip:user_1846@sip.example.org clrtxt:secret ; +sip:user_1847@sip.example.org clrtxt:secret ; +sip:user_1848@sip.example.org clrtxt:secret ; +sip:user_1849@sip.example.org clrtxt:secret ; +sip:user_1850@sip.example.org clrtxt:secret ; +sip:user_1851@sip.example.org clrtxt:secret ; +sip:user_1852@sip.example.org clrtxt:secret ; +sip:user_1853@sip.example.org clrtxt:secret ; +sip:user_1854@sip.example.org clrtxt:secret ; +sip:user_1855@sip.example.org clrtxt:secret ; +sip:user_1856@sip.example.org clrtxt:secret ; +sip:user_1857@sip.example.org clrtxt:secret ; +sip:user_1858@sip.example.org clrtxt:secret ; +sip:user_1859@sip.example.org clrtxt:secret ; +sip:user_1860@sip.example.org clrtxt:secret ; +sip:user_1861@sip.example.org clrtxt:secret ; +sip:user_1862@sip.example.org clrtxt:secret ; +sip:user_1863@sip.example.org clrtxt:secret ; +sip:user_1864@sip.example.org clrtxt:secret ; +sip:user_1865@sip.example.org clrtxt:secret ; +sip:user_1866@sip.example.org clrtxt:secret ; +sip:user_1867@sip.example.org clrtxt:secret ; +sip:user_1868@sip.example.org clrtxt:secret ; +sip:user_1869@sip.example.org clrtxt:secret ; +sip:user_1870@sip.example.org clrtxt:secret ; +sip:user_1871@sip.example.org clrtxt:secret ; +sip:user_1872@sip.example.org clrtxt:secret ; +sip:user_1873@sip.example.org clrtxt:secret ; +sip:user_1874@sip.example.org clrtxt:secret ; +sip:user_1875@sip.example.org clrtxt:secret ; +sip:user_1876@sip.example.org clrtxt:secret ; +sip:user_1877@sip.example.org clrtxt:secret ; +sip:user_1878@sip.example.org clrtxt:secret ; +sip:user_1879@sip.example.org clrtxt:secret ; +sip:user_1880@sip.example.org clrtxt:secret ; +sip:user_1881@sip.example.org clrtxt:secret ; +sip:user_1882@sip.example.org clrtxt:secret ; +sip:user_1883@sip.example.org clrtxt:secret ; +sip:user_1884@sip.example.org clrtxt:secret ; +sip:user_1885@sip.example.org clrtxt:secret ; +sip:user_1886@sip.example.org clrtxt:secret ; +sip:user_1887@sip.example.org clrtxt:secret ; +sip:user_1888@sip.example.org clrtxt:secret ; +sip:user_1889@sip.example.org clrtxt:secret ; +sip:user_1890@sip.example.org clrtxt:secret ; +sip:user_1891@sip.example.org clrtxt:secret ; +sip:user_1892@sip.example.org clrtxt:secret ; +sip:user_1893@sip.example.org clrtxt:secret ; +sip:user_1894@sip.example.org clrtxt:secret ; +sip:user_1895@sip.example.org clrtxt:secret ; +sip:user_1896@sip.example.org clrtxt:secret ; +sip:user_1897@sip.example.org clrtxt:secret ; +sip:user_1898@sip.example.org clrtxt:secret ; +sip:user_1899@sip.example.org clrtxt:secret ; +sip:user_1900@sip.example.org clrtxt:secret ; +sip:user_1901@sip.example.org clrtxt:secret ; +sip:user_1902@sip.example.org clrtxt:secret ; +sip:user_1903@sip.example.org clrtxt:secret ; +sip:user_1904@sip.example.org clrtxt:secret ; +sip:user_1905@sip.example.org clrtxt:secret ; +sip:user_1906@sip.example.org clrtxt:secret ; +sip:user_1907@sip.example.org clrtxt:secret ; +sip:user_1908@sip.example.org clrtxt:secret ; +sip:user_1909@sip.example.org clrtxt:secret ; +sip:user_1910@sip.example.org clrtxt:secret ; +sip:user_1911@sip.example.org clrtxt:secret ; +sip:user_1912@sip.example.org clrtxt:secret ; +sip:user_1913@sip.example.org clrtxt:secret ; +sip:user_1914@sip.example.org clrtxt:secret ; +sip:user_1915@sip.example.org clrtxt:secret ; +sip:user_1916@sip.example.org clrtxt:secret ; +sip:user_1917@sip.example.org clrtxt:secret ; +sip:user_1918@sip.example.org clrtxt:secret ; +sip:user_1919@sip.example.org clrtxt:secret ; +sip:user_1920@sip.example.org clrtxt:secret ; +sip:user_1921@sip.example.org clrtxt:secret ; +sip:user_1922@sip.example.org clrtxt:secret ; +sip:user_1923@sip.example.org clrtxt:secret ; +sip:user_1924@sip.example.org clrtxt:secret ; +sip:user_1925@sip.example.org clrtxt:secret ; +sip:user_1926@sip.example.org clrtxt:secret ; +sip:user_1927@sip.example.org clrtxt:secret ; +sip:user_1928@sip.example.org clrtxt:secret ; +sip:user_1929@sip.example.org clrtxt:secret ; +sip:user_1930@sip.example.org clrtxt:secret ; +sip:user_1931@sip.example.org clrtxt:secret ; +sip:user_1932@sip.example.org clrtxt:secret ; +sip:user_1933@sip.example.org clrtxt:secret ; +sip:user_1934@sip.example.org clrtxt:secret ; +sip:user_1935@sip.example.org clrtxt:secret ; +sip:user_1936@sip.example.org clrtxt:secret ; +sip:user_1937@sip.example.org clrtxt:secret ; +sip:user_1938@sip.example.org clrtxt:secret ; +sip:user_1939@sip.example.org clrtxt:secret ; +sip:user_1940@sip.example.org clrtxt:secret ; +sip:user_1941@sip.example.org clrtxt:secret ; +sip:user_1942@sip.example.org clrtxt:secret ; +sip:user_1943@sip.example.org clrtxt:secret ; +sip:user_1944@sip.example.org clrtxt:secret ; +sip:user_1945@sip.example.org clrtxt:secret ; +sip:user_1946@sip.example.org clrtxt:secret ; +sip:user_1947@sip.example.org clrtxt:secret ; +sip:user_1948@sip.example.org clrtxt:secret ; +sip:user_1949@sip.example.org clrtxt:secret ; +sip:user_1950@sip.example.org clrtxt:secret ; +sip:user_1951@sip.example.org clrtxt:secret ; +sip:user_1952@sip.example.org clrtxt:secret ; +sip:user_1953@sip.example.org clrtxt:secret ; +sip:user_1954@sip.example.org clrtxt:secret ; +sip:user_1955@sip.example.org clrtxt:secret ; +sip:user_1956@sip.example.org clrtxt:secret ; +sip:user_1957@sip.example.org clrtxt:secret ; +sip:user_1958@sip.example.org clrtxt:secret ; +sip:user_1959@sip.example.org clrtxt:secret ; +sip:user_1960@sip.example.org clrtxt:secret ; +sip:user_1961@sip.example.org clrtxt:secret ; +sip:user_1962@sip.example.org clrtxt:secret ; +sip:user_1963@sip.example.org clrtxt:secret ; +sip:user_1964@sip.example.org clrtxt:secret ; +sip:user_1965@sip.example.org clrtxt:secret ; +sip:user_1966@sip.example.org clrtxt:secret ; +sip:user_1967@sip.example.org clrtxt:secret ; +sip:user_1968@sip.example.org clrtxt:secret ; +sip:user_1969@sip.example.org clrtxt:secret ; +sip:user_1970@sip.example.org clrtxt:secret ; +sip:user_1971@sip.example.org clrtxt:secret ; +sip:user_1972@sip.example.org clrtxt:secret ; +sip:user_1973@sip.example.org clrtxt:secret ; +sip:user_1974@sip.example.org clrtxt:secret ; +sip:user_1975@sip.example.org clrtxt:secret ; +sip:user_1976@sip.example.org clrtxt:secret ; +sip:user_1977@sip.example.org clrtxt:secret ; +sip:user_1978@sip.example.org clrtxt:secret ; +sip:user_1979@sip.example.org clrtxt:secret ; +sip:user_1980@sip.example.org clrtxt:secret ; +sip:user_1981@sip.example.org clrtxt:secret ; +sip:user_1982@sip.example.org clrtxt:secret ; +sip:user_1983@sip.example.org clrtxt:secret ; +sip:user_1984@sip.example.org clrtxt:secret ; +sip:user_1985@sip.example.org clrtxt:secret ; +sip:user_1986@sip.example.org clrtxt:secret ; +sip:user_1987@sip.example.org clrtxt:secret ; +sip:user_1988@sip.example.org clrtxt:secret ; +sip:user_1989@sip.example.org clrtxt:secret ; +sip:user_1990@sip.example.org clrtxt:secret ; +sip:user_1991@sip.example.org clrtxt:secret ; +sip:user_1992@sip.example.org clrtxt:secret ; +sip:user_1993@sip.example.org clrtxt:secret ; +sip:user_1994@sip.example.org clrtxt:secret ; +sip:user_1995@sip.example.org clrtxt:secret ; +sip:user_1996@sip.example.org clrtxt:secret ; +sip:user_1997@sip.example.org clrtxt:secret ; +sip:user_1998@sip.example.org clrtxt:secret ; +sip:user_1999@sip.example.org clrtxt:secret ; +sip:user_2000@sip.example.org clrtxt:secret ; diff --git a/tester/presence_server_tester.c b/tester/presence_server_tester.c index 62bb8a364..db3f0ca07 100644 --- a/tester/presence_server_tester.c +++ b/tester/presence_server_tester.c @@ -788,7 +788,7 @@ static void presence_list_subscribe_network_changes(void) { linphone_core_set_presence_model(pauline->lc, presence); linphone_presence_model_unref(presence); - BC_ASSERT_TRUE(wait_for_until(laure->lc, pauline->lc, &laure->stat.number_of_LinphonePresenceActivityAway, 1, 6000)); + BC_ASSERT_TRUE(wait_for_until(laure->lc, pauline->lc, &laure->stat.number_of_LinphonePresenceActivityAway, 2, 6000)); lf = linphone_friend_list_find_friend_by_uri(linphone_core_get_default_friend_list(laure->lc), pauline_identity); BC_ASSERT_EQUAL(linphone_friend_get_status(lf), LinphoneStatusAway, int, "%d"); @@ -829,6 +829,28 @@ static void long_term_presence_base(const char* addr, bool_t exist, const char* linphone_friend_unref(friend2); linphone_core_manager_destroy(pauline); } + +static void long_term_presence_large_number_of_subs(void) { + int i=0; + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); + linphone_core_set_user_agent(pauline->lc, "bypass", NULL); + LinphoneFriendList *friends = linphone_core_create_friend_list(pauline->lc); + linphone_friend_list_set_rls_uri(friends, "sip:rls@sip.example.org"); + for (i = 0 ; i <1000; i++ ) { + char user_id[256]; + snprintf(user_id, sizeof(user_id), "sip:user_%i@sip.example.org",i); + LinphoneFriend* friend2 =linphone_core_create_friend_with_address(pauline->lc, user_id); + linphone_friend_list_add_friend(friends,friend2); + linphone_friend_unref(friend2); + } + linphone_core_add_friend_list(pauline->lc, friends); + linphone_friend_list_unref(friends); + + BC_ASSERT_TRUE(wait_for(pauline->lc,NULL,&pauline->stat.number_of_NotifyPresenceReceived,i)); + + linphone_core_manager_destroy(pauline); +} + static void long_term_presence_existing_friend(void) { // this friend is not online, but is known from flexisip to be registered (see flexisip/userdb.conf), // so we expect to get a report that he is currently not online @@ -1739,6 +1761,7 @@ test_t presence_server_tests[] = { TEST_ONE_TAG("Long term presence with +164 phone, without sip",long_term_presence_with_e164_phone_without_sip, "longterm"), TEST_ONE_TAG("Long term presence with phone, without sip",long_term_presence_with_phone_without_sip, "longterm"), TEST_ONE_TAG("Long term presence with cross references", long_term_presence_with_crossed_references,"longtern"), + TEST_ONE_TAG("Long term presence with large number of subs", long_term_presence_large_number_of_subs,"longtern"), TEST_NO_TAG("Subscriber no longer reachable using server",subscriber_no_longer_reachable), TEST_NO_TAG("Subscribe with late publish", subscribe_with_late_publish), TEST_NO_TAG("Multiple publish aggregation", multiple_publish_aggregation), From ba68bf754c82ce3d53be5c91d93adf0e022774ad Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Wed, 28 Mar 2018 15:09:20 +0200 Subject: [PATCH 023/121] improve group chat tests reliability --- tester/group_chat_tester.c | 5 +++-- tester/rcfiles/marie_rc | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tester/group_chat_tester.c b/tester/group_chat_tester.c index bc9bb7159..9ddfc9329 100644 --- a/tester/group_chat_tester.c +++ b/tester/group_chat_tester.c @@ -2430,6 +2430,7 @@ static void group_chat_room_migrate_from_basic_to_client_fail (void) { BC_ASSERT_EQUAL(linphone_chat_room_get_history_size(paulineCr), 4, int, "%d"); // Activate groupchat on Pauline's side and wait for 5 seconds, the migration should now be done on next message sending + lp_config_set_int(linphone_core_get_config(marie->lc),"misc","basic_to_client_group_chat_room_migration_timer",5); linphone_core_set_linphone_specs(pauline->lc, "groupchat"); linphone_core_set_network_reachable(pauline->lc, FALSE); wait_for_list(coresList, &dummy, 1, 1000); @@ -2508,13 +2509,13 @@ static void group_chat_donot_room_migrate_from_basic_chat_room (void) { linphone_chat_message_send(msg); linphone_chat_message_unref(msg); BC_ASSERT_FALSE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateCreationPending, initialMarieStats.number_of_LinphoneChatRoomStateCreationPending + 1, 10000)); - BC_ASSERT_FALSE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateCreated, initialMarieStats.number_of_LinphoneChatRoomStateCreated + 1, 10000)); + BC_ASSERT_FALSE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateCreated, initialMarieStats.number_of_LinphoneChatRoomStateCreated + 1, 3000)); BC_ASSERT_TRUE(linphone_chat_room_get_capabilities(marieCr) & LinphoneChatRoomCapabilitiesBasic); BC_ASSERT_EQUAL(linphone_chat_room_get_nb_participants(marieCr), 1, int, "%d"); BC_ASSERT_EQUAL(linphone_chat_room_get_history_size(marieCr), 2, int, "%d"); BC_ASSERT_FALSE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneChatRoomStateCreationPending, initialPaulineStats.number_of_LinphoneChatRoomStateCreationPending + 1, 10000)); - BC_ASSERT_FALSE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneChatRoomStateCreated, initialPaulineStats.number_of_LinphoneChatRoomStateCreated + 1, 10000)); + BC_ASSERT_FALSE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneChatRoomStateCreated, initialPaulineStats.number_of_LinphoneChatRoomStateCreated + 1, 3000)); BC_ASSERT_TRUE(linphone_chat_room_get_capabilities(paulineCr) & LinphoneChatRoomCapabilitiesBasic); BC_ASSERT_EQUAL(linphone_chat_room_get_nb_participants(paulineCr), 1, int, "%d"); BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneMessageReceived, initialPaulineStats.number_of_LinphoneMessageReceived + 1, 1000)); diff --git a/tester/rcfiles/marie_rc b/tester/rcfiles/marie_rc index ce4c4877f..7c511b311 100644 --- a/tester/rcfiles/marie_rc +++ b/tester/rcfiles/marie_rc @@ -29,7 +29,7 @@ subscribe=0 [misc] enable_basic_to_client_group_chat_room_migration=1 -basic_to_client_group_chat_room_migration_timer=10 +basic_to_client_group_chat_room_migration_timer=180 [rtp] audio_rtp_port=18070-28000 From cd08c6e2fee6c99ead64dde6783337714c5aedc8 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 28 Mar 2018 15:28:49 +0200 Subject: [PATCH 024/121] Added missing doc in header --- include/linphone/api/c-chat-room.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linphone/api/c-chat-room.h b/include/linphone/api/c-chat-room.h index 63aa290cb..41f3c669e 100644 --- a/include/linphone/api/c-chat-room.h +++ b/include/linphone/api/c-chat-room.h @@ -227,6 +227,12 @@ LINPHONE_PUBLIC int linphone_chat_room_get_history_events_size(LinphoneChatRoom */ LINPHONE_PUBLIC LinphoneChatMessage *linphone_chat_room_get_last_message_in_history(LinphoneChatRoom *cr); +/** + * Gets the chat message sent or received in this chat room that matches the message_id + * @param[in] cr The #LinphoneChatRoom object corresponding to the conversation for which the message should be retrieved + * @param[in] message_id The id of the message to find + * @return the #LinphoneChatMessage + */ LINPHONE_PUBLIC LinphoneChatMessage * linphone_chat_room_find_message(LinphoneChatRoom *cr, const char *message_id); /** From 998d7633e8e5956c9c0e7cf14919532d7f1c2a68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Wed, 28 Mar 2018 16:52:53 +0200 Subject: [PATCH 025/121] Renames enums_page.mustache into enum_page.mustache --- .../help/doc/sphinx/{enums_page.mustache => enum_page.mustache} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename coreapi/help/doc/sphinx/{enums_page.mustache => enum_page.mustache} (100%) diff --git a/coreapi/help/doc/sphinx/enums_page.mustache b/coreapi/help/doc/sphinx/enum_page.mustache similarity index 100% rename from coreapi/help/doc/sphinx/enums_page.mustache rename to coreapi/help/doc/sphinx/enum_page.mustache From 8966c2ca77289366aa6bb93ec5199683d057acd8 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 28 Mar 2018 18:20:22 +0200 Subject: [PATCH 026/121] Started method to get participants in given state for given chat message --- include/linphone/api/c-chat-message.h | 2 ++ src/c-wrapper/api/c-chat-message.cpp | 5 +++++ src/chat/chat-message/chat-message-p.h | 1 + src/chat/chat-message/chat-message.cpp | 24 ++++++++++++++++++++++++ src/chat/chat-message/chat-message.h | 1 + src/db/main-db.cpp | 24 ++++++++++++++++++++++++ src/db/main-db.h | 1 + 7 files changed, 58 insertions(+) diff --git a/include/linphone/api/c-chat-message.h b/include/linphone/api/c-chat-message.h index f028464a2..1cd3dbd21 100644 --- a/include/linphone/api/c-chat-message.h +++ b/include/linphone/api/c-chat-message.h @@ -369,6 +369,8 @@ LINPHONE_PUBLIC const char* linphone_chat_message_get_text_content(const Linphon */ LINPHONE_PUBLIC bool_t linphone_chat_message_is_file_transfer_in_progress(LinphoneChatMessage *msg); +LINPHONE_PUBLIC bctbx_list_t *linphone_chat_message_get_participants_in_state (const LinphoneChatMessage *msg, const LinphoneChatMessageState state); + /** * @} */ diff --git a/src/c-wrapper/api/c-chat-message.cpp b/src/c-wrapper/api/c-chat-message.cpp index 902055f9a..a616a9659 100644 --- a/src/c-wrapper/api/c-chat-message.cpp +++ b/src/c-wrapper/api/c-chat-message.cpp @@ -31,6 +31,7 @@ #include "chat/notification/imdn.h" #include "content/content-type.h" #include "content/content.h" +#include "conference/participant.h" // ============================================================================= @@ -246,6 +247,10 @@ bool_t linphone_chat_message_is_file_transfer_in_progress(LinphoneChatMessage *m return L_GET_CPP_PTR_FROM_C_OBJECT(msg)->isFileTransferInProgress(); } +bctbx_list_t *linphone_chat_message_get_participants_in_state (const LinphoneChatMessage *msg, const LinphoneChatMessageState state) { + return L_GET_RESOLVED_C_LIST_FROM_CPP_LIST(L_GET_PRIVATE_FROM_C_OBJECT(msg)->getParticipantsInState((LinphonePrivate::ChatMessage::State) state)); +} + // ============================================================================= // Old listener // ============================================================================= diff --git a/src/chat/chat-message/chat-message-p.h b/src/chat/chat-message/chat-message-p.h index b665e0d1f..4c957ed71 100644 --- a/src/chat/chat-message/chat-message-p.h +++ b/src/chat/chat-message/chat-message-p.h @@ -59,6 +59,7 @@ public: void setDirection (ChatMessage::Direction dir); void setParticipantState (const IdentityAddress &participantAddress, ChatMessage::State newState); + std::list> getParticipantsInState (const ChatMessage::State state) const; void setState (ChatMessage::State newState, bool force = false); void setTime (time_t time); diff --git a/src/chat/chat-message/chat-message.cpp b/src/chat/chat-message/chat-message.cpp index eb2d1f029..0fcde7521 100644 --- a/src/chat/chat-message/chat-message.cpp +++ b/src/chat/chat-message/chat-message.cpp @@ -34,6 +34,7 @@ #include "chat/modifier/encryption-chat-message-modifier.h" #include "chat/modifier/file-transfer-chat-message-modifier.h" #include "chat/modifier/multipart-chat-message-modifier.h" +#include "conference/participant.h" #include "content/file-content.h" #include "content/content.h" #include "core/core.h" @@ -122,6 +123,29 @@ void ChatMessagePrivate::setParticipantState (const IdentityAddress &participant setState(ChatMessage::State::DeliveredToUser); } +list> ChatMessagePrivate::getParticipantsInState (const ChatMessage::State state) const { + L_Q(); + + list> participantsInState; + if (!(q->getChatRoom()->getCapabilities() & AbstractChatRoom::Capabilities::Conference) || !dbKey.isValid()) { + return participantsInState; + } + + unique_ptr &mainDb = q->getChatRoom()->getCore()->getPrivate()->mainDb; + shared_ptr eventLog = mainDb->getEventFromKey(dbKey); + list addressesInState = mainDb->getChatMessageParticipantsInState(eventLog, state); + const list> &participants = q->getChatRoom()->getParticipants(); + for (IdentityAddress addr : addressesInState) { + for (const auto &participant : participants) { + if (participant->getAddress() == addr) { + participantsInState.push_back(participant); + } + } + } + + return participantsInState; +} + void ChatMessagePrivate::setState (ChatMessage::State newState, bool force) { L_Q(); diff --git a/src/chat/chat-message/chat-message.h b/src/chat/chat-message/chat-message.h index 961455882..2b53bda7d 100644 --- a/src/chat/chat-message/chat-message.h +++ b/src/chat/chat-message/chat-message.h @@ -39,6 +39,7 @@ class AbstractChatRoom; class Content; class FileTransferContent; class ChatMessagePrivate; +class Participant; class LINPHONE_PUBLIC ChatMessage : public Object, public CoreAccessor { friend class BasicToClientGroupChatRoom; diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp index 983630099..e6cfd375d 100644 --- a/src/db/main-db.cpp +++ b/src/db/main-db.cpp @@ -1970,6 +1970,30 @@ list MainDb::getChatMessageParticipantStates (const shared_p }; } +list MainDb::getChatMessageParticipantsInState (const shared_ptr &eventLog, const ChatMessage::State state) const { + return L_DB_TRANSACTION { + L_D(); + + const EventLogPrivate *dEventLog = eventLog->getPrivate(); + MainDbKeyPrivate *dEventKey = static_cast(dEventLog->dbKey).getPrivate(); + const long long &eventId = dEventKey->storageId; + + int stateInt = static_cast(state); + list participantsAddresses; + + static const string query = "SELECT sip_address.value" + " FROM sip_address, chat_message_participant" + " WHERE event_id = :eventId AND state = :state" + " AND sip_address.id = chat_message_participant.participant_sip_address_id"; + soci::rowset rows = (d->dbSession.getBackendSession()->prepare << query, soci::use(eventId), soci::use(stateInt)); + for (const auto &row : rows) { + participantsAddresses.push_back(IdentityAddress(row.get(0))); + } + + return participantsAddresses; + }; +} + ChatMessage::State MainDb::getChatMessageParticipantState ( const shared_ptr &eventLog, const IdentityAddress &participantAddress diff --git a/src/db/main-db.h b/src/db/main-db.h index f0f4b6f06..ae46a5e3e 100644 --- a/src/db/main-db.h +++ b/src/db/main-db.h @@ -91,6 +91,7 @@ public: std::list> getUnreadChatMessages (const ChatRoomId &chatRoomId) const; std::list getChatMessageParticipantStates (const std::shared_ptr &eventLog) const; + std::list getChatMessageParticipantsInState (const std::shared_ptr &eventLog, const ChatMessage::State state) const; ChatMessage::State getChatMessageParticipantState ( const std::shared_ptr &eventLog, const IdentityAddress &participantAddress From 04fffe5c9053f2b4ec6f2d79b857d6907f4ce864 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 26 Sep 2017 10:22:08 +0200 Subject: [PATCH 027/121] attempt to fix a crash with LinphoneChatMessage (java) pointing to a null LinphoneChatMessage (C) --- coreapi/linphonecore_jni.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 707d229f3..6b33215d2 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -4742,7 +4742,7 @@ static void message_state_changed(LinphoneChatMessage* msg, LinphoneChatMessageS } jclass clazz = (jclass) env->GetObjectClass(listener); jmethodID method = env->GetMethodID(clazz, "onLinphoneChatMessageStateChanged","(Lorg/linphone/core/LinphoneChatMessage;Lorg/linphone/core/LinphoneChatMessage$State;)V"); - jobject jmessage = getChatMessage(env, msg); + jobject jmessage = (jobject)linphone_chat_message_get_user_data(msg); /*this returns a global ref that was taken in setListener*/ env->DeleteLocalRef(clazz); LinphoneChatRoom *room = linphone_chat_message_get_chat_room(msg); @@ -4756,6 +4756,10 @@ static void message_state_changed(LinphoneChatMessage* msg, LinphoneChatMessageS } if (jmessage) { env->DeleteLocalRef(jmessage); + //We are going to drop our global ref, as the listener is no longer needed. + //Before, replace it by a weak ref, as other messages. + linphone_chat_message_set_user_data(msg, env->NewWeakGlobalRef(jmessage)); + env->DeleteGlobalRef(jmessage); } } @@ -4840,11 +4844,17 @@ static LinphoneBuffer* file_transfer_send(LinphoneChatMessage *msg, const Linph return buffer; } +/* + * When the listener is set, we must take a global reference to the listener and the message, so that + * we are able to notify the state changes of the message, until it reaches its final state + */ extern "C" void Java_org_linphone_core_LinphoneChatMessageImpl_setListener(JNIEnv* env, jobject thiz, jlong ptr, jobject jlistener) { jobject listener = env->NewGlobalRef(jlistener); LinphoneChatMessage *message = (LinphoneChatMessage *)ptr; LinphoneChatMessageCbs *cbs; + jobject jmessage = env->NewGlobalRef(thiz); + linphone_chat_message_set_user_data(message, jmessage); linphone_chat_message_set_message_state_changed_cb_user_data(message, listener); cbs = linphone_chat_message_get_callbacks(message); linphone_chat_message_cbs_set_msg_state_changed(cbs, message_state_changed); @@ -4961,8 +4971,7 @@ extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_sendChatMessage(JNIE ,jlong chatroom_ptr ,jobject message ,jlong messagePtr) { - message = env->NewGlobalRef(message); - linphone_chat_message_set_user_data((LinphoneChatMessage*)messagePtr, message); + linphone_chat_room_send_chat_message_2((LinphoneChatRoom*)chatroom_ptr, (LinphoneChatMessage*)messagePtr); } From 4dd2b64c0b64371eabe4519565e5e7332ead7760 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 6 Oct 2017 13:39:47 +0200 Subject: [PATCH 028/121] Fix reference model of LinphoneChatMessage and its listener. --- coreapi/linphonecore_jni.cc | 134 +++++------------- .../org/linphone/core/LinphoneChatRoom.java | 5 - .../linphone/core/LinphoneChatRoomImpl.java | 20 +-- 3 files changed, 40 insertions(+), 119 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 6b33215d2..a6b01bb58 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -4462,7 +4462,7 @@ extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_getPeerAddress(JNIE ,jlong ptr) { return (jlong) linphone_chat_room_get_peer_address((LinphoneChatRoom*)ptr); } -extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_createLinphoneChatMessage(JNIEnv* env +extern "C" jobject Java_org_linphone_core_LinphoneChatRoomImpl_createLinphoneChatMessage(JNIEnv* env ,jobject thiz ,jlong ptr ,jstring jmessage) { @@ -4470,29 +4470,10 @@ extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_createLinphoneChatM LinphoneChatMessage *chatMessage = linphone_chat_room_create_message((LinphoneChatRoom *)ptr, message); ReleaseStringUTFChars(env, jmessage, message); - return (jlong) chatMessage; + return getChatMessage(env, chatMessage); } -extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_createLinphoneChatMessage2(JNIEnv* env - ,jobject thiz - ,jlong ptr - ,jstring jmessage - ,jstring jurl - ,jint state - ,jlong time - ,jboolean read - ,jboolean incoming) { - const char* message = GetStringUTFChars(env, jmessage); - const char* url = GetStringUTFChars(env, jurl); - LinphoneChatMessage *chatMessage = linphone_chat_room_create_message_2( - (LinphoneChatRoom *)ptr, message, url, (LinphoneChatMessageState)state, - (time_t)time, read, incoming); - ReleaseStringUTFChars(env, jmessage, message); - ReleaseStringUTFChars(env, jurl, url); - - return (jlong) chatMessage; -} extern "C" jint Java_org_linphone_core_LinphoneChatRoomImpl_getHistorySize (JNIEnv* env ,jobject thiz ,jlong ptr) { @@ -4527,7 +4508,7 @@ extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_markAsRead(JNIEnv* } -extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_createFileTransferMessage(JNIEnv* env, jobject thiz, jlong ptr, jstring jname, jstring jtype, jstring jsubtype, jint data_size) { +extern "C" jobject Java_org_linphone_core_LinphoneChatRoomImpl_createFileTransferMessage(JNIEnv* env, jobject thiz, jlong ptr, jstring jname, jstring jtype, jstring jsubtype, jint data_size) { LinphoneCore *lc = linphone_chat_room_get_core((LinphoneChatRoom*) ptr); LinphoneContent * content = linphone_core_create_content(lc); LinphoneChatMessage *message = NULL; @@ -4548,7 +4529,7 @@ extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_createFileTransferM linphone_content_unref(content); - return (jlong) message; + return getChatMessage(env, message); } extern "C" jboolean Java_org_linphone_core_LinphoneChatRoomImpl_islimeAvailable(JNIEnv *env, jobject thiz, jlong ptr) { @@ -4726,6 +4707,22 @@ extern "C" void Java_org_linphone_core_LinphoneChatMessageImpl_reSend(JNIEnv* e linphone_chat_message_resend_2((LinphoneChatMessage*)ptr); } +static jobject getMessageListener(JNIEnv *env, LinphoneChatMessage *msg){ + jobject listener = (jobject) linphone_chat_message_get_message_state_changed_cb_user_data(msg); + + if (listener == NULL) { + ms_error("message_state_changed() notification without listener"); + return NULL; + } + listener = env->NewLocalRef(listener); //promote the weak ref into a local ref*/ + if (listener == NULL){ + ms_error("message_state_changed() listener is no longer valid"); + linphone_chat_message_set_message_state_changed_cb_user_data(msg, NULL); + return NULL; + } + return listener; +} + static void message_state_changed(LinphoneChatMessage* msg, LinphoneChatMessageState state) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); @@ -4734,33 +4731,19 @@ static void message_state_changed(LinphoneChatMessage* msg, LinphoneChatMessageS return; } - jobject listener = (jobject) linphone_chat_message_get_message_state_changed_cb_user_data(msg); + jobject listener = getMessageListener(env, msg); + if (!listener) return; - if (listener == NULL) { - ms_error("message_state_changed() notification without listener"); - return ; - } jclass clazz = (jclass) env->GetObjectClass(listener); jmethodID method = env->GetMethodID(clazz, "onLinphoneChatMessageStateChanged","(Lorg/linphone/core/LinphoneChatMessage;Lorg/linphone/core/LinphoneChatMessage$State;)V"); - jobject jmessage = (jobject)linphone_chat_message_get_user_data(msg); /*this returns a global ref that was taken in setListener*/ + jobject jmessage = getChatMessage(env, msg); env->DeleteLocalRef(clazz); LinphoneChatRoom *room = linphone_chat_message_get_chat_room(msg); LinphoneCore *lc = linphone_chat_room_get_core(room); LinphoneJavaBindings *ljb = (LinphoneJavaBindings *)linphone_core_get_user_data(lc); env->CallVoidMethod(listener, method, jmessage, env->CallStaticObjectMethod(ljb->chatMessageStateClass, ljb->chatMessageStateFromIntId, (jint)state)); - - if (state == LinphoneChatMessageStateDisplayed) { - env->DeleteGlobalRef(listener); - linphone_chat_message_set_message_state_changed_cb_user_data(msg, NULL); - } - if (jmessage) { - env->DeleteLocalRef(jmessage); - //We are going to drop our global ref, as the listener is no longer needed. - //Before, replace it by a weak ref, as other messages. - linphone_chat_message_set_user_data(msg, env->NewWeakGlobalRef(jmessage)); - env->DeleteGlobalRef(jmessage); - } + env->DeleteLocalRef(listener); } static void file_transfer_progress_indication(LinphoneChatMessage *msg, const LinphoneContent* content, size_t offset, size_t total) { @@ -4771,7 +4754,8 @@ static void file_transfer_progress_indication(LinphoneChatMessage *msg, const Li return; } - jobject listener = (jobject) linphone_chat_message_get_message_state_changed_cb_user_data(msg); + jobject listener = getMessageListener(env, msg); + if (!listener) return; jclass clazz = (jclass) env->GetObjectClass(listener); jmethodID method = env->GetMethodID(clazz, "onLinphoneChatMessageFileTransferProgressChanged", "(Lorg/linphone/core/LinphoneChatMessage;Lorg/linphone/core/LinphoneContent;II)V"); env->DeleteLocalRef(clazz); @@ -4794,7 +4778,8 @@ static void file_transfer_recv(LinphoneChatMessage *msg, const LinphoneContent* return; } - jobject listener = (jobject) linphone_chat_message_get_message_state_changed_cb_user_data(msg); + jobject listener = getMessageListener(env, msg); + if (!listener) return; jclass clazz = (jclass) env->GetObjectClass(listener); jmethodID method = env->GetMethodID(clazz, "onLinphoneChatMessageFileTransferReceived", "(Lorg/linphone/core/LinphoneChatMessage;Lorg/linphone/core/LinphoneContent;Lorg/linphone/core/LinphoneBuffer;)V"); env->DeleteLocalRef(clazz); @@ -4823,7 +4808,8 @@ static LinphoneBuffer* file_transfer_send(LinphoneChatMessage *msg, const Linph return buffer; } - jobject listener = (jobject) linphone_chat_message_get_message_state_changed_cb_user_data(msg); + jobject listener = getMessageListener(env, msg); + if (!listener) return NULL; jclass clazz = (jclass) env->GetObjectClass(listener); jmethodID method = env->GetMethodID(clazz, "onLinphoneChatMessageFileTransferSent","(Lorg/linphone/core/LinphoneChatMessage;Lorg/linphone/core/LinphoneContent;IILorg/linphone/core/LinphoneBuffer;)V"); env->DeleteLocalRef(clazz); @@ -4849,13 +4835,10 @@ static LinphoneBuffer* file_transfer_send(LinphoneChatMessage *msg, const Linph * we are able to notify the state changes of the message, until it reaches its final state */ extern "C" void Java_org_linphone_core_LinphoneChatMessageImpl_setListener(JNIEnv* env, jobject thiz, jlong ptr, jobject jlistener) { - jobject listener = env->NewGlobalRef(jlistener); LinphoneChatMessage *message = (LinphoneChatMessage *)ptr; LinphoneChatMessageCbs *cbs; - jobject jmessage = env->NewGlobalRef(thiz); - linphone_chat_message_set_user_data(message, jmessage); - linphone_chat_message_set_message_state_changed_cb_user_data(message, listener); + linphone_chat_message_set_message_state_changed_cb_user_data(message, env->NewWeakGlobalRef(jlistener)); cbs = linphone_chat_message_get_callbacks(message); linphone_chat_message_cbs_set_msg_state_changed(cbs, message_state_changed); linphone_chat_message_cbs_set_file_transfer_progress_indication(cbs, file_transfer_progress_indication); @@ -4867,10 +4850,15 @@ extern "C" void Java_org_linphone_core_LinphoneChatMessageImpl_unref(JNIEnv* en ,jobject thiz ,jlong ptr) { jobject wref = (jobject)linphone_chat_message_get_user_data((LinphoneChatMessage*)ptr); + jobject listener_wref = (jobject) linphone_chat_message_get_message_state_changed_cb_user_data((LinphoneChatMessage*)ptr); linphone_chat_message_set_user_data((LinphoneChatMessage*)ptr, NULL); if (wref){ env->DeleteWeakGlobalRef(wref); } + if (listener_wref){ + linphone_chat_message_set_message_state_changed_cb_user_data((LinphoneChatMessage*)ptr, NULL); + env->DeleteWeakGlobalRef(listener_wref); + } linphone_chat_message_unref((LinphoneChatMessage*)ptr); } @@ -4905,34 +4893,6 @@ extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_sendMessage(JNIEnv* ReleaseStringUTFChars(env, jmessage, message); } -static void chat_room_impl_callback(LinphoneChatMessage* msg, LinphoneChatMessageState state, void* ud) { - JNIEnv *env = 0; - jint result = jvm->AttachCurrentThread(&env,NULL); - if (result != 0) { - ms_error("cannot attach VM\n"); - return; - } - - jobject listener = (jobject) ud; - jclass clazz = (jclass) env->GetObjectClass(listener); - jmethodID method = env->GetMethodID(clazz, "onLinphoneChatMessageStateChanged","(Lorg/linphone/core/LinphoneChatMessage;Lorg/linphone/core/LinphoneChatMessage$State;)V"); - jobject jmessage=(jobject)linphone_chat_message_get_user_data(msg); - - LinphoneChatRoom *room = linphone_chat_message_get_chat_room(msg); - LinphoneCore *lc = linphone_chat_room_get_core(room); - LinphoneJavaBindings *ljb = (LinphoneJavaBindings *)linphone_core_get_user_data(lc); - env->CallVoidMethod( - listener, - method, - jmessage, - env->CallStaticObjectMethod(ljb->chatMessageStateClass,ljb->chatMessageStateFromIntId,(jint)state)); - - if (state == LinphoneChatMessageStateDisplayed ) { - env->DeleteGlobalRef(listener); - env->DeleteGlobalRef(jmessage); - linphone_chat_message_set_user_data(msg,NULL); - } -} extern "C" jobject Java_org_linphone_core_LinphoneChatRoomImpl_getCore(JNIEnv* env ,jobject thiz @@ -4943,28 +4903,6 @@ extern "C" jobject Java_org_linphone_core_LinphoneChatRoomImpl_getCore(JNIEnv* return core; } -extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_sendMessage2(JNIEnv* env - ,jobject thiz - ,jlong chatroom_ptr - ,jobject message - ,jlong messagePtr - ,jobject jlistener) { - jobject listener = env->NewGlobalRef(jlistener); - LinphoneChatMessage *msg = (LinphoneChatMessage *)messagePtr; - message = env->NewGlobalRef(message); - linphone_chat_message_ref(msg); - linphone_chat_message_set_user_data(msg, message); - - LinphoneChatMessageCbs *cbs; - cbs = linphone_chat_message_get_callbacks(msg); - linphone_chat_message_cbs_set_user_data(cbs, (void *)listener); - linphone_chat_message_cbs_set_msg_state_changed(cbs, message_state_changed); - linphone_chat_message_cbs_set_file_transfer_progress_indication(cbs, file_transfer_progress_indication); - linphone_chat_message_cbs_set_file_transfer_recv(cbs, file_transfer_recv); - linphone_chat_message_cbs_set_file_transfer_send(cbs, file_transfer_send); - - linphone_chat_room_send_chat_message_2((LinphoneChatRoom*)chatroom_ptr, msg); -} extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_sendChatMessage(JNIEnv* env ,jobject thiz diff --git a/java/common/org/linphone/core/LinphoneChatRoom.java b/java/common/org/linphone/core/LinphoneChatRoom.java index e08378b02..65b635e51 100644 --- a/java/common/org/linphone/core/LinphoneChatRoom.java +++ b/java/common/org/linphone/core/LinphoneChatRoom.java @@ -115,11 +115,6 @@ public interface LinphoneChatRoom { */ void deleteMessage(LinphoneChatMessage message); - /** - * Create a LinphoneChatMessage - * @return LinphoneChatMessage object - */ - LinphoneChatMessage createLinphoneChatMessage(String message, String url, State state, long timestamp, boolean isRead, boolean isIncoming); /** * Returns a back pointer to the core managing the chat room. diff --git a/java/impl/org/linphone/core/LinphoneChatRoomImpl.java b/java/impl/org/linphone/core/LinphoneChatRoomImpl.java index f44c6ecf6..97c919716 100644 --- a/java/impl/org/linphone/core/LinphoneChatRoomImpl.java +++ b/java/impl/org/linphone/core/LinphoneChatRoomImpl.java @@ -25,7 +25,7 @@ import org.linphone.core.LinphoneCall; @SuppressWarnings("deprecation") class LinphoneChatRoomImpl implements LinphoneChatRoom { protected final long nativePtr; - private native long createLinphoneChatMessage(long ptr, String message); + private native Object createLinphoneChatMessage(long ptr, String message); private native long getPeerAddress(long ptr); private native void sendMessage(long ptr, String message); private native void sendMessage2(long ptr, Object msg, long messagePtr, StateListener listener); @@ -39,9 +39,6 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom { private native boolean isRemoteComposing(long ptr); private native void markAsRead(long ptr); private native void deleteMessage(long room, long message); - private native long createLinphoneChatMessage2(long ptr, String message, - String url, int state, long timestamp, boolean isRead, - boolean isIncoming); private native void sendChatMessage(long ptr, Object message, long messagePtr); private native void finalize(long nativePtr); private native boolean islimeAvailable(long nativePtr); @@ -77,7 +74,7 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom { @Override public LinphoneChatMessage createLinphoneChatMessage(String message) { synchronized(getCore()){ - return new LinphoneChatMessageImpl(createLinphoneChatMessage(nativePtr, message)); + return (LinphoneChatMessage)createLinphoneChatMessage(nativePtr, message); } } @@ -144,15 +141,6 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom { } } - @Override - public LinphoneChatMessage createLinphoneChatMessage(String message, - String url, State state, long timestamp, boolean isRead, - boolean isIncoming) { - synchronized(getCore()){ - return new LinphoneChatMessageImpl(createLinphoneChatMessage2( - nativePtr, message, url, state.value(), timestamp / 1000, isRead, isIncoming)); - } - } private native Object getCore(long nativePtr); @Override public synchronized LinphoneCore getCore() { @@ -162,11 +150,11 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom { return (LinphoneChatMessage[]) typesPtr; } - private native long createFileTransferMessage(long ptr, String name, String type, String subtype, int size); + private native Object createFileTransferMessage(long ptr, String name, String type, String subtype, int size); @Override public LinphoneChatMessage createFileTransferMessage(LinphoneContent content) { synchronized(getCore()) { - return new LinphoneChatMessageImpl(createFileTransferMessage(nativePtr, content.getName(), content.getType(), content.getSubtype(), content.getRealSize())); + return (LinphoneChatMessage)createFileTransferMessage(nativePtr, content.getName(), content.getType(), content.getSubtype(), content.getRealSize()); } } @Override From ac3c7c1fa3b150ea30b823e4edc984abaa85c4df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Fri, 30 Mar 2018 15:16:48 +0200 Subject: [PATCH 029/121] Doc generator: global table of content in the side pannel --- coreapi/help/doc/sphinx/CMakeLists.txt | 3 +- coreapi/help/doc/sphinx/conf.py.in | 4 +- coreapi/help/doc/sphinx/enum_page.mustache | 7 ++- coreapi/help/doc/sphinx/gendoc.py | 65 ++++++++++++++------- coreapi/help/doc/sphinx/index.rst | 11 +--- coreapi/help/doc/sphinx/index_page.mustache | 19 ++---- 6 files changed, 57 insertions(+), 52 deletions(-) diff --git a/coreapi/help/doc/sphinx/CMakeLists.txt b/coreapi/help/doc/sphinx/CMakeLists.txt index c6058f6d7..052e33ea3 100644 --- a/coreapi/help/doc/sphinx/CMakeLists.txt +++ b/coreapi/help/doc/sphinx/CMakeLists.txt @@ -29,7 +29,6 @@ if (ENABLE_SPHINX_DOC) list(APPEND DOCUMENTATION_DIRS ${DOCUMENTATION_DIR}) list(APPEND GENERATED_SPHINX_SOURCES ${DOCUMENTATION_DIR}/index.rst) endforeach(LANGUAGE_) - set(PYTHON_SCRIPTS gendoc.py ${linphone_SOURCE_DIR}/tools/abstractapi.py ${linphone_SOURCE_DIR}/tools/genapixml.py @@ -37,7 +36,7 @@ if (ENABLE_SPHINX_DOC) ${linphone_SOURCE_DIR}/tools/metaname.py ) set(MUSTACHE_TEMPLATES class_page.mustache - enums_page.mustache + enum_page.mustache index_page.mustache ) configure_file(conf.py.in source/conf.py) diff --git a/coreapi/help/doc/sphinx/conf.py.in b/coreapi/help/doc/sphinx/conf.py.in index fcff75b1a..c94d86760 100644 --- a/coreapi/help/doc/sphinx/conf.py.in +++ b/coreapi/help/doc/sphinx/conf.py.in @@ -83,7 +83,6 @@ todo_include_todos = False # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -#html_theme = 'alabaster' html_theme = 'classic' # Theme options are theme-specific and customize the look and feel of a theme @@ -91,6 +90,7 @@ html_theme = 'classic' # documentation. # html_theme_options = { + 'sidebarwidth': '360', 'body_max_width': '100%', 'collapsiblesidebar': 'true' } @@ -108,7 +108,7 @@ html_experimental_html5_writer = True # Side bar customization html_sidebars = { - '**': ['searchbox.html'] + '**': ['searchbox.html', 'globaltoc.html'] } # -- Options for HTMLHelp output ------------------------------------------ diff --git a/coreapi/help/doc/sphinx/enum_page.mustache b/coreapi/help/doc/sphinx/enum_page.mustache index cf6ce2564..c400e96eb 100644 --- a/coreapi/help/doc/sphinx/enum_page.mustache +++ b/coreapi/help/doc/sphinx/enum_page.mustache @@ -5,8 +5,8 @@ {{/isJava}} {{/namespace}} -{{#enums}} -{{#make_section}}{{{name}}}{{/make_section}} +{{#enum}} +{{#make_chapter}}{{{name}}} enum{{/make_chapter}} .. {{#write_declarator}}enum{{/write_declarator}}:: {{{declaration}}} @@ -35,4 +35,5 @@ {{{selector}}} {{/enumerators}} -{{/enums}} + +{{/enum}} diff --git a/coreapi/help/doc/sphinx/gendoc.py b/coreapi/help/doc/sphinx/gendoc.py index 76cc77113..eecedda17 100755 --- a/coreapi/help/doc/sphinx/gendoc.py +++ b/coreapi/help/doc/sphinx/gendoc.py @@ -32,6 +32,10 @@ import metadoc class RstTools: + @staticmethod + def make_part(text): + return RstTools.make_section(text, char='#', overline=True) + @staticmethod def make_chapter(text): return RstTools.make_section(text, char='*', overline=True) @@ -170,6 +174,9 @@ class SphinxPart(object): def isNotJava(self): return not self.isJava + def make_part(self): + return lambda text: RstTools.make_part(pystache.render(text, self)) + def make_chapter(self): return lambda text: RstTools.make_chapter(pystache.render(text, self)) @@ -245,19 +252,38 @@ class SphinxPage(SphinxPart): class IndexPage(SphinxPage): - def __init__(self, lang, langs): - SphinxPage.__init__(self, lang, langs, 'index.rst') - self.tocEntries = [] - - def add_class_entry(self, _class): - self.tocEntries.append({'entryName': SphinxPage._classname_to_filename(_class.name)}) + def __init__(self, lang, filename): + SphinxPage.__init__(self, lang, None, filename) + self._entries = [] + self._sorted = True + + @property + def title(self): + return RstTools.make_chapter("{0} API".format(self.lang.displayName)) + + @property + def dir(self): + return self.lang.langCode.lower() + + @property + def entries(self): + if not self._sorted: + self._entries.sort(key=lambda x: x['filename']) + self._sorted = True + return self._entries + + def add_entry(self, filename): + self.entries.append({'filename': filename}) + self._sorted = False -class EnumsPage(SphinxPage): - def __init__(self, lang, langs, api): - SphinxPage.__init__(self, lang, langs, 'enums.rst') - self.namespace = api.namespace.name.translate(lang.nameTranslator) if lang.langCode != 'C' else None - self.enums = [EnumPart(enum, lang, langs, namespace=api.namespace) for enum in api.namespace.enums] +class EnumPage(SphinxPage): + def __init__(self, enum, lang, langs): + filename = SphinxPage._classname_to_filename(enum.name) + SphinxPage.__init__(self, lang, langs, filename) + namespace = enum.find_first_ancestor_by_type(abstractapi.Namespace) + self.namespace = namespace.name.translate(lang.nameTranslator) if lang.langCode != 'C' else None + self.enum = EnumPart(enum, lang, langs, namespace=namespace) class ClassPage(SphinxPage): @@ -376,20 +402,19 @@ class DocGenerator: def generate(self, outputdir): for lang in self.languages: + indexPage = IndexPage(lang, 'index.rst') subdirectory = lang.langCode.lower() directory = os.path.join(args.outputdir, subdirectory) if not os.path.exists(directory): os.mkdir(directory) - - enumsPage = EnumsPage(lang, self.languages, self.api) - enumsPage.write(directory) - - indexPage = IndexPage(lang, self.languages) - for _class in self.api.namespace.classes: - page = ClassPage(_class, lang, self.languages) + for enum in self.api.namespace.enums: + page = EnumPage(enum, lang, self.languages) page.write(directory) - indexPage.add_class_entry(_class) - + indexPage.add_entry(page.filename) + for class_ in self.api.namespace.classes: + page = ClassPage(class_, lang, self.languages) + page.write(directory) + indexPage.add_entry(page.filename) indexPage.write(directory) diff --git a/coreapi/help/doc/sphinx/index.rst b/coreapi/help/doc/sphinx/index.rst index 93d7d0a30..5a34626a7 100644 --- a/coreapi/help/doc/sphinx/index.rst +++ b/coreapi/help/doc/sphinx/index.rst @@ -7,19 +7,10 @@ Welcome to Linphone API's documentation! ======================================== .. toctree:: - :maxdepth: 1 + :maxdepth: 2 :caption: Contents: c/index.rst cpp/index.rst java/index.rst csharp/index.rst - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - diff --git a/coreapi/help/doc/sphinx/index_page.mustache b/coreapi/help/doc/sphinx/index_page.mustache index 2fa38ec83..f494d825e 100644 --- a/coreapi/help/doc/sphinx/index_page.mustache +++ b/coreapi/help/doc/sphinx/index_page.mustache @@ -1,19 +1,8 @@ -{{#make_section}}{{{language}}} API{{/make_section}} - -Index of classes ----------------- +{{{title}}} .. toctree:: :maxdepth: 1 - - {{#tocEntries}} - {{{entryName}}} - {{/tocEntries}} -Index of enums --------------- - -.. toctree:: - :maxdepth 1 - - enums.rst + {{#entries}} + {{{filename}}} + {{/entries}} From 853f44269423bd4a4f65d95b2a5ca2c9ac4d5c02 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 30 Mar 2018 16:54:23 +0200 Subject: [PATCH 030/121] fix NULL reason header & missed call when timeout --- src/conference/session/call-session.cpp | 5 +++-- src/sal/call-op.cpp | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/conference/session/call-session.cpp b/src/conference/session/call-session.cpp index a11a4ed1d..c2244a569 100644 --- a/src/conference/session/call-session.cpp +++ b/src/conference/session/call-session.cpp @@ -92,7 +92,8 @@ void CallSessionPrivate::setState (CallSession::State newState, const string &me case CallSession::State::Error: switch (linphone_error_info_get_reason(q->getErrorInfo())) { case LinphoneReasonDeclined: - log->status = LinphoneCallDeclined; + if(log->status == LinphoneCallSuccess) // Do not re-change the status of a call if it's already set + log->status = LinphoneCallDeclined; break; case LinphoneReasonNotAnswered: if (log->dir == LinphoneCallIncoming) @@ -470,7 +471,7 @@ void CallSessionPrivate::updatedByRemote () { if (deferUpdate || deferUpdateInternal) { if (state == CallSession::State::UpdatedByRemote && !deferUpdateInternal){ lInfo() << "CallSession [" << q << "]: UpdatedByRemoted was signaled but defered. LinphoneCore expects the application to call linphone_call_accept_update() later"; - } + } } else { if (state == CallSession::State::UpdatedByRemote) q->acceptUpdate(nullptr); diff --git a/src/sal/call-op.cpp b/src/sal/call-op.cpp index 238e6d255..ade2d214b 100644 --- a/src/sal/call-op.cpp +++ b/src/sal/call-op.cpp @@ -1037,7 +1037,7 @@ int SalCallOp::decline(SalReason reason, const char *redirection /*optional*/){ } belle_sip_header_reason_t *SalCallOp::make_reason_header( const SalErrorInfo *info){ - if (info != NULL){ + if (info && info->reason != SalReasonNone) { belle_sip_header_reason_t* reason = BELLE_SIP_HEADER_REASON(belle_sip_header_reason_new()); belle_sip_header_reason_set_text(reason, info->status_string); belle_sip_header_reason_set_protocol(reason,info->protocol); @@ -1123,12 +1123,12 @@ int SalCallOp::update(const char *subject, bool_t no_user_consent) { int SalCallOp::cancel_invite_with_info(const SalErrorInfo *info) { belle_sip_request_t* cancel; ms_message("Cancelling INVITE request from [%s] to [%s] ",get_from(), get_to()); - + if (this->pending_client_trans == NULL){ ms_warning("There is no transaction to cancel."); return -1; } - + cancel = belle_sip_client_transaction_create_cancel(this->pending_client_trans); if (cancel){ if (info != NULL){ From 91f5e64e5c3e40de4247930fe84ec8b251635737 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 30 Mar 2018 16:56:50 +0200 Subject: [PATCH 031/121] do not crash on null reason header --- src/sal/call-op.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/sal/call-op.cpp b/src/sal/call-op.cpp index ade2d214b..a900ab5d8 100644 --- a/src/sal/call-op.cpp +++ b/src/sal/call-op.cpp @@ -1124,24 +1124,24 @@ int SalCallOp::cancel_invite_with_info(const SalErrorInfo *info) { belle_sip_request_t* cancel; ms_message("Cancelling INVITE request from [%s] to [%s] ",get_from(), get_to()); - if (this->pending_client_trans == NULL){ + if (this->pending_client_trans == NULL) { ms_warning("There is no transaction to cancel."); return -1; } cancel = belle_sip_client_transaction_create_cancel(this->pending_client_trans); - if (cancel){ - if (info != NULL){ + if (cancel) { + if (info && info->reason != SalReasonNone) { belle_sip_header_reason_t* reason = make_reason_header(info); belle_sip_message_add_header(BELLE_SIP_MESSAGE(cancel),BELLE_SIP_HEADER(reason)); } send_request(cancel); return 0; - }else if (this->dialog){ + } else if (this->dialog) { belle_sip_dialog_state_t state = belle_sip_dialog_get_state(this->dialog);; /*case where the response received is invalid (could not establish a dialog), but the transaction is not cancellable * because already terminated*/ - switch(state){ + switch(state) { case BELLE_SIP_DIALOG_EARLY: case BELLE_SIP_DIALOG_NULL: /*force kill the dialog*/ @@ -1303,7 +1303,7 @@ int SalCallOp::terminate_with_error(const SalErrorInfo *info) { int ret = 0; memset(&sei, 0, sizeof(sei)); - if (info == NULL && dialog_state != BELLE_SIP_DIALOG_CONFIRMED && this->dir == Dir::Incoming){ + if (info == NULL && dialog_state != BELLE_SIP_DIALOG_CONFIRMED && this->dir == Dir::Incoming) { /*the purpose of this line is to set a default SalErrorInfo for declining an incoming call (not yet established of course) */ sal_error_info_set(&sei,SalReasonDeclined, "SIP", 0, NULL, NULL); p_sei = &sei; @@ -1318,7 +1318,7 @@ int SalCallOp::terminate_with_error(const SalErrorInfo *info) { switch(dialog_state) { case BELLE_SIP_DIALOG_CONFIRMED: { belle_sip_request_t * req = belle_sip_dialog_create_request(this->dialog,"BYE"); - if (info != NULL){ + if (info && info->reason != SalReasonNone) { belle_sip_header_reason_t* reason = make_reason_header(info); belle_sip_message_add_header(BELLE_SIP_MESSAGE(req),BELLE_SIP_HEADER(reason)); } @@ -1334,7 +1334,7 @@ int SalCallOp::terminate_with_error(const SalErrorInfo *info) { } else if (this->pending_client_trans){ if (belle_sip_transaction_get_state(BELLE_SIP_TRANSACTION(this->pending_client_trans)) == BELLE_SIP_TRANSACTION_PROCEEDING){ cancelling_invite(p_sei); - }else{ + } else { /* Case where the CANCEL cannot be sent because no provisional response was received so far. * The Op must be kept for the time of the transaction in case a response is received later. * The state is passed to Terminating to remember to terminate later. @@ -1351,7 +1351,7 @@ int SalCallOp::terminate_with_error(const SalErrorInfo *info) { if (this->dir == Dir::Incoming) { decline_with_error_info(p_sei,NULL); this->state=State::Terminated; - } else { + } else { cancelling_invite(p_sei); } break; From e63290b4c7acffd7602baaeb2eb9f09c0e3f95d2 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 30 Mar 2018 17:00:52 +0200 Subject: [PATCH 032/121] better reason management --- src/conference/session/call-session.cpp | 2 +- tester/call_single_tester.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/conference/session/call-session.cpp b/src/conference/session/call-session.cpp index c2244a569..668f0df33 100644 --- a/src/conference/session/call-session.cpp +++ b/src/conference/session/call-session.cpp @@ -92,7 +92,7 @@ void CallSessionPrivate::setState (CallSession::State newState, const string &me case CallSession::State::Error: switch (linphone_error_info_get_reason(q->getErrorInfo())) { case LinphoneReasonDeclined: - if(log->status == LinphoneCallSuccess) // Do not re-change the status of a call if it's already set + if (log->status != LinphoneCallMissed) // Do not re-change the status of a call if it's already set log->status = LinphoneCallDeclined; break; case LinphoneReasonNotAnswered: diff --git a/tester/call_single_tester.c b/tester/call_single_tester.c index 88a6de226..c33e95e63 100644 --- a/tester/call_single_tester.c +++ b/tester/call_single_tester.c @@ -821,11 +821,11 @@ static void multiple_answers_call_with_media_relay(void) { linphone_core_remove_supported_tag(pauline->lc,"gruu"); linphone_core_remove_supported_tag(marie1->lc,"gruu"); linphone_core_remove_supported_tag(marie2->lc,"gruu"); - + linphone_core_manager_start(pauline, TRUE); linphone_core_manager_start(marie1, TRUE); linphone_core_manager_start(marie2, TRUE); - + LinphoneCall* call1, *call2; bctbx_list_t* lcs = bctbx_list_append(NULL,pauline->lc); @@ -1038,7 +1038,7 @@ static void terminate_call_with_error(void) { linphone_call_ref(out_call); ei = linphone_error_info_new(); - linphone_error_info_set(ei, NULL, LinphoneReasonNone, 200, "Call refused for security reason", NULL); + linphone_error_info_set(ei, NULL, LinphoneReasonUnknown, 200, "Call refused for security reason", NULL); BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallOutgoingInit,1)); BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr->lc, &callee_mgr->stat.number_of_LinphoneCallIncomingReceived, 1)); @@ -1093,7 +1093,7 @@ static void cancel_call_with_error(void) { linphone_call_ref(out_call); ei = linphone_error_info_new(); - linphone_error_info_set(ei, NULL, LinphoneReasonNone, 600, "Call has been cancelled", NULL); + linphone_error_info_set(ei, NULL, LinphoneReasonUnknown, 600, "Call has been cancelled", NULL); BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr->lc, &caller_mgr->stat.number_of_LinphoneCallOutgoingInit,1)); BC_ASSERT_TRUE(wait_for(caller_mgr->lc, callee_mgr->lc, &callee_mgr->stat.number_of_LinphoneCallIncomingReceived, 1)); @@ -1421,8 +1421,8 @@ static void call_declined_with_error(void) { LinphoneErrorInfo *ei = linphone_factory_create_error_info(factory); LinphoneErrorInfo *reason_ei = linphone_factory_create_error_info(factory); - linphone_error_info_set(ei, "SIP", LinphoneReasonUnknown, 603, "Decline", NULL); //ordre des arguments à vérifier - linphone_error_info_set(reason_ei, "hardware", LinphoneReasonUnknown, 66, "J'ai plus de batterie", NULL); + linphone_error_info_set(ei, "SIP", LinphoneReasonDeclined, 603, "Decline", NULL); //ordre des arguments à vérifier + linphone_error_info_set(reason_ei, "hardware", LinphoneReasonDeclined, 66, "J'ai plus de batterie", NULL); linphone_error_info_set_sub_error_info(ei, reason_ei); @@ -5908,7 +5908,7 @@ static void call_with_ice_without_stun2(void){ static void call_with_ice_stun_not_responding(void){ LinphoneCoreManager * marie = linphone_core_manager_new( "marie_rc"); LinphoneCoreManager *pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); - + /*set dummy stun servers*/ linphone_core_set_stun_server(marie->lc, "belledonne-communications.com:443"); linphone_core_set_stun_server(pauline->lc, "belledonne-communications.com:443"); From fd91311ace8091f945f0fee59970e66a66d27113 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Wed, 27 Sep 2017 15:04:31 +0200 Subject: [PATCH 033/121] avoid crash in case audio resources (mainly on macosx) take to much time to start --- tester/call_single_tester.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/tester/call_single_tester.c b/tester/call_single_tester.c index c33e95e63..08be21bf9 100644 --- a/tester/call_single_tester.c +++ b/tester/call_single_tester.c @@ -3153,22 +3153,25 @@ static void early_media_call_with_ringing_base(bool_t network_change){ _linphone_call_add_local_desc_changed_flag(marie_call, SAL_MEDIA_DESCRIPTION_NETWORK_CHANGED); } - linphone_call_accept(linphone_core_get_current_call(pauline->lc)); - - BC_ASSERT_TRUE(wait_for_list(lcs, &marie->stat.number_of_LinphoneCallConnected, 1,1000)); - connected_time=ms_get_cur_time_ms(); - BC_ASSERT_TRUE(wait_for_list(lcs, &marie->stat.number_of_LinphoneCallStreamsRunning, 1,1000)); - - BC_ASSERT_PTR_EQUAL(marie_call, linphone_core_get_current_call(marie->lc)); - BC_ASSERT_FALSE(linphone_call_get_all_muted(marie_call)); - - liblinphone_tester_check_rtcp(marie, pauline); - /*just to have a call duration !=0*/ - wait_for_list(lcs,&dummy,1,2000); - - end_call(pauline, marie); - ended_time=ms_get_cur_time_ms(); - BC_ASSERT_LOWER( labs((long)((linphone_call_log_get_duration(marie_call_log)*1000) - (int64_t)(ended_time - connected_time))), 1000, long, "%ld"); + if (linphone_core_get_current_call(pauline->lc) + && linphone_call_get_state(linphone_core_get_current_call(pauline->lc)) == LinphoneCallIncomingEarlyMedia) { + linphone_call_accept(linphone_core_get_current_call(pauline->lc)); + + BC_ASSERT_TRUE(wait_for_list(lcs, &marie->stat.number_of_LinphoneCallConnected, 1,1000)); + connected_time=ms_get_cur_time_ms(); + BC_ASSERT_TRUE(wait_for_list(lcs, &marie->stat.number_of_LinphoneCallStreamsRunning, 1,1000)); + + BC_ASSERT_PTR_EQUAL(marie_call, linphone_core_get_current_call(marie->lc)); + BC_ASSERT_FALSE(linphone_call_get_all_muted(marie_call)); + + liblinphone_tester_check_rtcp(marie, pauline); + /*just to have a call duration !=0*/ + wait_for_list(lcs,&dummy,1,2000); + + end_call(pauline, marie); + ended_time=ms_get_cur_time_ms(); + BC_ASSERT_LOWER( labs((long)((linphone_call_log_get_duration(marie_call_log)*1000) - (int64_t)(ended_time - connected_time))), 1000, long, "%ld"); + } bctbx_list_free(lcs); } From 220ccbac9a16ed4ac2ac6012e05595b53292ea4e Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Wed, 27 Sep 2017 17:05:59 +0200 Subject: [PATCH 034/121] make sure local sip ports used by testers are always random --- tester/rcfiles/laure_call_logs_rc | 6 +++--- tester/rcfiles/laure_rc_udp | 6 +++--- tester/rcfiles/laure_tcp_rc | 6 +++--- tester/rcfiles/multi_account_rc | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tester/rcfiles/laure_call_logs_rc b/tester/rcfiles/laure_call_logs_rc index bbeafabeb..e5a964f72 100644 --- a/tester/rcfiles/laure_call_logs_rc +++ b/tester/rcfiles/laure_call_logs_rc @@ -1,7 +1,7 @@ [sip] -sip_port=5092 -sip_tcp_port=5092 -sip_tls_port=5093 +sip_port=-1 +sip_tcp_port=-1 +sip_tls_port=-1 default_proxy=0 ping_with_options=0 diff --git a/tester/rcfiles/laure_rc_udp b/tester/rcfiles/laure_rc_udp index c4016c4fa..e221c248a 100644 --- a/tester/rcfiles/laure_rc_udp +++ b/tester/rcfiles/laure_rc_udp @@ -1,7 +1,7 @@ [sip] -sip_port=5092 -sip_tcp_port=5092 -sip_tls_port=5093 +sip_port=-1 +sip_tcp_port=-1 +sip_tls_port=-1 default_proxy=0 ping_with_options=0 diff --git a/tester/rcfiles/laure_tcp_rc b/tester/rcfiles/laure_tcp_rc index 8ed5de984..912db8271 100644 --- a/tester/rcfiles/laure_tcp_rc +++ b/tester/rcfiles/laure_tcp_rc @@ -1,7 +1,7 @@ [sip] -sip_port=5092 -sip_tcp_port=5092 -sip_tls_port=5093 +sip_port=-1 +sip_tcp_port=-1 +sip_tls_port=-1 default_proxy=0 ping_with_options=0 diff --git a/tester/rcfiles/multi_account_rc b/tester/rcfiles/multi_account_rc index 8aefbfcaf..3c1e52020 100644 --- a/tester/rcfiles/multi_account_rc +++ b/tester/rcfiles/multi_account_rc @@ -1,7 +1,7 @@ [sip] -sip_port=5072 -sip_tcp_port=5072 -sip_tls_port=5073 +sip_port=-1 +sip_tcp_port=-1 +sip_tls_port=-1 default_proxy=0 [auth_info_0] From 4b2c1ef133df64cee9b90978b51859b14d81e43b Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Wed, 27 Sep 2017 17:18:59 +0200 Subject: [PATCH 035/121] Init bctbx logger before create the core in factory --- coreapi/factory.c | 1 + 1 file changed, 1 insertion(+) diff --git a/coreapi/factory.c b/coreapi/factory.c index e316a93ba..5138534a4 100644 --- a/coreapi/factory.c +++ b/coreapi/factory.c @@ -167,6 +167,7 @@ static LinphoneCore *_linphone_factory_create_core ( LpConfig *config = lp_config_new_with_factory(config_path, factory_config_path); LinphoneCore *lc = _linphone_core_new_with_config(cbs, config, user_data, system_context, automatically_start); lp_config_unref(config); + bctbx_uninit_logger(); return lc; } From 6784ece6197e432e123d15d0da1f50a6c079f46c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 3 Apr 2018 14:38:30 +0200 Subject: [PATCH 036/121] Optimizes generation of the API's documentaition --- coreapi/help/doc/sphinx/CMakeLists.txt | 17 +------- coreapi/help/doc/sphinx/gendoc.py | 57 ++++++++++++++++++++++---- 2 files changed, 51 insertions(+), 23 deletions(-) diff --git a/coreapi/help/doc/sphinx/CMakeLists.txt b/coreapi/help/doc/sphinx/CMakeLists.txt index 052e33ea3..05d7159a2 100644 --- a/coreapi/help/doc/sphinx/CMakeLists.txt +++ b/coreapi/help/doc/sphinx/CMakeLists.txt @@ -42,20 +42,7 @@ if (ENABLE_SPHINX_DOC) configure_file(conf.py.in source/conf.py) configure_file(index.rst source/index.rst COPYONLY) configure_file(logo.png source/logo.png COPYONLY) - add_custom_command(OUTPUT ${GENERATED_SPHINX_SOURCES} - COMMAND ${CMAKE_COMMAND} -E remove -f ${DOCUMENTATION_DIRS} - COMMAND ${PYTHON_EXECUTABLE} '${CMAKE_CURRENT_SOURCE_DIR}/gendoc.py' '${LINPHONE_DOXYGEN_XML_DIR}' -o 'source' - DEPENDS ${PYTHON_SCRIPTS} - ${MUSTACHE_TEMPLATES} - ${LINPHONE_DOXYGEN_XML_DIR}/index.xml - linphone-doc - ) - add_custom_command(OUTPUT build/html/index.html - COMMAND ${CMAKE_COMMAND} -E remove_directory build + add_custom_target(sphinx-doc ALL ${PYTHON_EXECUTABLE} '${CMAKE_CURRENT_SOURCE_DIR}/gendoc.py' '${LINPHONE_DOXYGEN_XML_DIR}' -o 'source' COMMAND ${PYTHON_EXECUTABLE} -msphinx -M html 'source' 'build' - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/source/conf.py - ${CMAKE_CURRENT_BINARY_DIR}/source/index.rst - ${GENERATED_SPHINX_SOURCES} - ) - add_custom_target(sphinx-doc ALL DEPENDS build/html/index.html) + DEPENDS linphone-doc) endif() diff --git a/coreapi/help/doc/sphinx/gendoc.py b/coreapi/help/doc/sphinx/gendoc.py index eecedda17..252f68d09 100755 --- a/coreapi/help/doc/sphinx/gendoc.py +++ b/coreapi/help/doc/sphinx/gendoc.py @@ -19,6 +19,7 @@ import argparse +import hashlib import logging import os import pystache @@ -31,6 +32,13 @@ import metaname import metadoc +def md5sum(file): + hasher = hashlib.md5() + with open(file, mode='rb') as f: + hasher.update(f.read()) + return hasher.hexdigest() + + class RstTools: @staticmethod def make_part(text): @@ -140,6 +148,10 @@ class LangInfo: def displayName(self): return LangInfo._displayNames[self.langCode] + @property + def directory(self): + return self.langCode.lower() + _displayNames = { 'C' : 'C', 'Cpp' : 'C++', @@ -239,9 +251,15 @@ class SphinxPage(SphinxPart): def write(self, directory): r = pystache.Renderer() filepath = os.path.join(directory, self.filename) - with open(filepath, mode='w') as f: + tmpFilepath = filepath + '.tmp' + with open(tmpFilepath, mode='w') as f: f.write(r.render(self)) - + if os.path.exists(filepath) and md5sum(filepath) == md5sum(tmpFilepath): + os.remove(tmpFilepath) + else: + os.rename(tmpFilepath, filepath) + return filepath + def _get_translated_namespace(self, obj): namespace = obj.find_first_ancestor_by_type(abstractapi.Namespace) return namespace.name.translate(self.lang.nameTranslator, recursive=True) @@ -263,7 +281,7 @@ class IndexPage(SphinxPage): @property def dir(self): - return self.lang.langCode.lower() + return self.lang.directory @property def entries(self): @@ -390,6 +408,25 @@ class ClassPage(SphinxPage): return table +class OldFilesCleaner: + def __init__(self, rootDirectory): + self._filesToKeep = set() + self.root = rootDirectory + + def add_directory(self, directory): + self._filesToKeep.add(directory) + + def clean(self): + self._clean(self.root) + + def _clean(self, dir_): + if os.path.isdir(dir_): + for filename in os.listdir(dir_): + self._clean(os.path.join(dir_, filename)) + elif dir_ not in self._filesToKeep: + os.remove(dir_) + + class DocGenerator: def __init__(self, api): self.api = api @@ -402,20 +439,24 @@ class DocGenerator: def generate(self, outputdir): for lang in self.languages: + directory = os.path.join(args.outputdir, lang.directory) + cleaner = OldFilesCleaner(directory) indexPage = IndexPage(lang, 'index.rst') - subdirectory = lang.langCode.lower() - directory = os.path.join(args.outputdir, subdirectory) if not os.path.exists(directory): os.mkdir(directory) for enum in self.api.namespace.enums: page = EnumPage(enum, lang, self.languages) - page.write(directory) + filepath = page.write(directory) indexPage.add_entry(page.filename) + cleaner.add_directory(filepath) for class_ in self.api.namespace.classes: page = ClassPage(class_, lang, self.languages) - page.write(directory) + filepath = page.write(directory) indexPage.add_entry(page.filename) - indexPage.write(directory) + cleaner.add_directory(filepath) + filepath = indexPage.write(directory) + cleaner.add_directory(filepath) + cleaner.clean() if __name__ == '__main__': From 3976181afaa8996154ce5438607618025bd86ed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Turnel?= Date: Tue, 3 Apr 2018 14:47:46 +0200 Subject: [PATCH 037/121] Removed default bitrate limitation. (retrofit of commit 0d38a7) --- src/conference/session/media-session.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/conference/session/media-session.cpp b/src/conference/session/media-session.cpp index a124200cf..853d6ffc4 100644 --- a/src/conference/session/media-session.cpp +++ b/src/conference/session/media-session.cpp @@ -1920,8 +1920,7 @@ int MediaSessionPrivate::getVideoBandwidth (const SalMediaDescription *md, const else if (md->bandwidth > 0) { /* Case where b=AS is given globally, not per stream */ remoteBandwidth = PayloadTypeHandler::getRemainingBandwidthForVideo(md->bandwidth, audioBandwidth); - } else - remoteBandwidth = lp_config_get_int(linphone_core_get_config(q->getCore()->getCCore()), "net", "default_max_bandwidth", 1500); + } return PayloadTypeHandler::getMinBandwidth(PayloadTypeHandler::getRemainingBandwidthForVideo(linphone_core_get_upload_bandwidth(q->getCore()->getCCore()), audioBandwidth), remoteBandwidth); } From b2f43b06de2521c1cfd3d95a25d4800546a0571a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Turnel?= Date: Tue, 3 Apr 2018 14:53:51 +0200 Subject: [PATCH 038/121] Add unit tests for fps in video calls. (retrofit of commit cc6b6b) --- tester/call_video_tester.c | 96 +++++++++++++++++++++++++++++++++++++- 1 file changed, 95 insertions(+), 1 deletion(-) diff --git a/tester/call_video_tester.c b/tester/call_video_tester.c index d74fbd2f8..fe85820a3 100644 --- a/tester/call_video_tester.c +++ b/tester/call_video_tester.c @@ -2072,6 +2072,97 @@ static void video_call_with_high_bandwidth_available(void) { linphone_core_manager_destroy(pauline); } +static void video_call_expected_fps_for_specified_bandwidth(int bandwidth, int fps, const char *resolution) { + LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_rc"); + LinphoneVideoPolicy pol = {0}; + OrtpNetworkSimulatorParams simparams = { 0 }; + + if (ms_factory_get_cpu_count(linphone_core_get_ms_factory(marie->lc)) >= 2) { + linphone_core_set_video_device(marie->lc, "Mire: Mire (synthetic moving picture)"); + linphone_core_enable_video_capture(marie->lc, TRUE); + linphone_core_enable_video_display(marie->lc, TRUE); + linphone_core_enable_video_capture(pauline->lc, TRUE); + linphone_core_enable_video_display(pauline->lc, TRUE); + + pol.automatically_accept = TRUE; + pol.automatically_initiate = TRUE; + linphone_core_set_video_policy(marie->lc, &pol); + linphone_core_set_video_policy(pauline->lc, &pol); + + linphone_core_set_preferred_video_size_by_name(marie->lc, resolution); + simparams.mode = OrtpNetworkSimulatorOutbound; + simparams.enabled = TRUE; + simparams.max_bandwidth = bandwidth; + simparams.max_buffer_size = (int)simparams.max_bandwidth; + simparams.latency = 60; + + linphone_core_set_network_simulator_params(marie->lc, &simparams); + + if (BC_ASSERT_TRUE(call(marie, pauline))){ + LinphoneCall *call = linphone_core_get_current_call(marie->lc); + + /*wait for the first TMMBR*/ + BC_ASSERT_TRUE(wait_for_until(marie->lc, pauline->lc, &marie->stat.last_tmmbr_value_received, 1, 10000)); + + VideoStream *vstream = (VideoStream *)linphone_call_get_stream(call, LinphoneStreamTypeVideo); + BC_ASSERT_EQUAL((int)vstream->configured_fps, fps, int, "%d"); + + end_call(marie, pauline); + } + } else { + BC_PASS("Test requires at least a dual core"); + } + + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(pauline); +} + +/* + * This test simulates a video call with a lower bandwidth than the required_bitrate of the lowest given configuration. + * The stream from pauline to marie is not under test. + * It checks that after a few seconds marie, after receiving a TMMBR, has her fps set to the lowest given configuration. + * This test requires at least a computer with 2 CPUs. + * +**/ +static void video_call_expected_fps_for_low_bandwidth(void) { +#if defined(__ANDROID__) || (TARGET_OS_IPHONE == 1) || defined(__arm__) || defined(_M_ARM) + video_call_expected_fps_for_specified_bandwidth(80000, 10, "qvga"); +#else + video_call_expected_fps_for_specified_bandwidth(250000, 15, "vga"); +#endif +} + +/* + * This test simulates a video call with a regular bandwidth that is between a given configuration. + * The stream from pauline to marie is not under test. + * It checks that after a few seconds marie, after receiving a TMMBR, has her fps set to the expected given configuration. + * This test requires at least a computer with 2 CPUs. + * +**/ +static void video_call_expected_fps_for_regular_bandwidth(void) { +#if defined(__ANDROID__) || (TARGET_OS_IPHONE == 1) || defined(__arm__) || defined(_M_ARM) + video_call_expected_fps_for_specified_bandwidth(400000, 12, "vga"); +#else + video_call_expected_fps_for_specified_bandwidth(450000, 25, "vga"); +#endif +} + +/* + * This test simulates a video call with a higher bandwidth than the bitrate_limit of the highest given configuration. + * The stream from pauline to marie is not under test. + * It checks that after a few seconds marie, after receiving a TMMBR, has her fps set to the highest given configuration. + * This test requires at least a computer with 2 CPUs. + * +**/ +static void video_call_expected_fps_for_high_bandwidth(void) { +#if defined(__ANDROID__) || (TARGET_OS_IPHONE == 1) || defined(__arm__) || defined(_M_ARM) + video_call_expected_fps_for_specified_bandwidth(400000, 12, "qcif"); +#else + video_call_expected_fps_for_specified_bandwidth(5000000, 30, "vga"); +#endif +} + test_t call_video_tests[] = { #ifdef VIDEO_ENABLED TEST_NO_TAG("Call paused resumed with video", call_paused_resumed_with_video), @@ -2140,7 +2231,10 @@ test_t call_video_tests[] = { TEST_NO_TAG("Video call with no audio and no video codec", video_call_with_no_audio_and_no_video_codec), TEST_NO_TAG("Call with early media and no SDP in 200 Ok with video", call_with_early_media_and_no_sdp_in_200_with_video), TEST_NO_TAG("Video call with thin congestion", video_call_with_thin_congestion), - TEST_NO_TAG("Video call with high bandwidth available", video_call_with_high_bandwidth_available) + TEST_NO_TAG("Video call with high bandwidth available", video_call_with_high_bandwidth_available), + TEST_NO_TAG("Video call expected FPS for low bandwidth", video_call_expected_fps_for_low_bandwidth), + TEST_NO_TAG("Video call expected FPS for regular bandwidth", video_call_expected_fps_for_regular_bandwidth), + TEST_NO_TAG("Video call expected FPS for high bandwidth", video_call_expected_fps_for_high_bandwidth) #endif }; From 47415adf2aa216a45ae6163271af64f333688273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 3 Apr 2018 15:36:11 +0200 Subject: [PATCH 039/121] Removes duplicate CMake command --- coreapi/help/doc/doxygen/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/coreapi/help/doc/doxygen/CMakeLists.txt b/coreapi/help/doc/doxygen/CMakeLists.txt index ef96a784f..91c62458d 100644 --- a/coreapi/help/doc/doxygen/CMakeLists.txt +++ b/coreapi/help/doc/doxygen/CMakeLists.txt @@ -39,7 +39,6 @@ if (ENABLE_DOC OR ENABLE_CXX_WRAPPER OR ENABLE_CSHARP_WRAPPER OR ENABLE_JAVA_WRA set(XML_DIR "${CMAKE_CURRENT_BINARY_DIR}/xml") set(LINPHONE_DOXYGEN_XML_DIR ${XML_DIR} PARENT_SCOPE) add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/html/index.html" "${XML_DIR}/index.xml" - COMMAND ${CMAKE_COMMAND} -E remove -f html/* xml/* COMMAND ${CMAKE_COMMAND} -E remove -f html/* xml/* COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile DEPENDS ${DOC_INPUT_FILES} From 4f805973aef4d50dfab099e264b1e7b40cd9a020 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Tue, 3 Apr 2018 16:17:10 +0200 Subject: [PATCH 040/121] Blacklist linphone_call_set_audio_route --- include/linphone/api/c-call.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linphone/api/c-call.h b/include/linphone/api/c-call.h index 272e67b1d..464436945 100644 --- a/include/linphone/api/c-call.h +++ b/include/linphone/api/c-call.h @@ -338,6 +338,7 @@ LINPHONE_PUBLIC LinphoneConference *linphone_call_get_conference (const Linphone * Change the playback output device (currently only used for blackberry) * @param call * @param route the wanted audio route (earpiece, speaker, ...) + * @donotwrap **/ LINPHONE_PUBLIC void linphone_call_set_audio_route (LinphoneCall *call, LinphoneAudioRoute route); From 490c4bf913e741e9e0799fa4b9cdc6d26104adf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Turnel?= Date: Tue, 3 Apr 2018 16:58:13 +0200 Subject: [PATCH 041/121] Update fps tests according to VP8 conf table changes. (retrofit of commit fb465e) --- tester/call_video_tester.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tester/call_video_tester.c b/tester/call_video_tester.c index fe85820a3..3189fe3c2 100644 --- a/tester/call_video_tester.c +++ b/tester/call_video_tester.c @@ -2142,7 +2142,7 @@ static void video_call_expected_fps_for_low_bandwidth(void) { **/ static void video_call_expected_fps_for_regular_bandwidth(void) { #if defined(__ANDROID__) || (TARGET_OS_IPHONE == 1) || defined(__arm__) || defined(_M_ARM) - video_call_expected_fps_for_specified_bandwidth(400000, 12, "vga"); + video_call_expected_fps_for_specified_bandwidth(500000, 12, "vga"); #else video_call_expected_fps_for_specified_bandwidth(450000, 25, "vga"); #endif From 13a398462c1befcecd83d135922f1189577747ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Turnel?= Date: Tue, 3 Apr 2018 16:58:56 +0200 Subject: [PATCH 042/121] Fix implicit cast for windows. (retrofit of commit 1dfa27) --- tester/call_video_tester.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tester/call_video_tester.c b/tester/call_video_tester.c index 3189fe3c2..4b4efb5ad 100644 --- a/tester/call_video_tester.c +++ b/tester/call_video_tester.c @@ -2093,8 +2093,8 @@ static void video_call_expected_fps_for_specified_bandwidth(int bandwidth, int f linphone_core_set_preferred_video_size_by_name(marie->lc, resolution); simparams.mode = OrtpNetworkSimulatorOutbound; simparams.enabled = TRUE; - simparams.max_bandwidth = bandwidth; - simparams.max_buffer_size = (int)simparams.max_bandwidth; + simparams.max_bandwidth = (float)bandwidth; + simparams.max_buffer_size = bandwidth; simparams.latency = 60; linphone_core_set_network_simulator_params(marie->lc, &simparams); From 5e98347b313a5703a88d2c1fb12537565d426c1a Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 3 Apr 2018 17:05:02 +0200 Subject: [PATCH 043/121] Add log when we cannot find the selected valid ICE pair in the case where it should be there (retrofit of commit 452234d4). --- src/nat/ice-agent.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nat/ice-agent.cpp b/src/nat/ice-agent.cpp index 726312f9f..cbc74cd4a 100644 --- a/src/nat/ice-agent.cpp +++ b/src/nat/ice-agent.cpp @@ -317,10 +317,12 @@ void IceAgent::updateLocalMediaDescriptionFromIce (SalMediaDescription *desc) { } if (firstCl) result = !!ice_check_list_selected_valid_local_candidate(firstCl, &rtpCandidate, nullptr); - if (result) + if (result) { strncpy(desc->addr, rtpCandidate->taddr.ip, sizeof(desc->addr)); - else + } else { lWarning() << "If ICE has completed successfully, rtp_candidate should be set!"; + ice_dump_valid_list(firstCl); + } } strncpy(desc->ice_pwd, ice_session_local_pwd(iceSession), sizeof(desc->ice_pwd)); From d0dfd9be6ae8cebd132964d777a174415e5218f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 3 Apr 2018 17:47:24 +0200 Subject: [PATCH 044/121] Adds the static documentation --- coreapi/help/doc/sphinx/CMakeLists.txt | 22 +++++- coreapi/help/doc/sphinx/authentication.rst | 4 + coreapi/help/doc/sphinx/buddy_list.rst | 57 ++++++++++++++ coreapi/help/doc/sphinx/call_control.rst | 9 +++ coreapi/help/doc/sphinx/call_logs.rst | 2 + coreapi/help/doc/sphinx/call_misc.rst | 4 + coreapi/help/doc/sphinx/chatroom.rst | 28 +++++++ coreapi/help/doc/sphinx/conferencing.rst | 21 +++++ coreapi/help/doc/sphinx/event_api.rst | 4 + coreapi/help/doc/sphinx/index.rst | 62 +++++++++++++-- coreapi/help/doc/sphinx/initializing.rst | 4 + coreapi/help/doc/sphinx/linphone_address.rst | 4 + coreapi/help/doc/sphinx/media_parameters.rst | 11 +++ coreapi/help/doc/sphinx/misc.rst | 3 + .../help/doc/sphinx/network_parameters.rst | 2 + coreapi/help/doc/sphinx/proxies.rst | 76 +++++++++++++++++++ 16 files changed, 305 insertions(+), 8 deletions(-) create mode 100644 coreapi/help/doc/sphinx/authentication.rst create mode 100644 coreapi/help/doc/sphinx/buddy_list.rst create mode 100644 coreapi/help/doc/sphinx/call_control.rst create mode 100644 coreapi/help/doc/sphinx/call_logs.rst create mode 100644 coreapi/help/doc/sphinx/call_misc.rst create mode 100644 coreapi/help/doc/sphinx/chatroom.rst create mode 100644 coreapi/help/doc/sphinx/conferencing.rst create mode 100644 coreapi/help/doc/sphinx/event_api.rst create mode 100644 coreapi/help/doc/sphinx/initializing.rst create mode 100644 coreapi/help/doc/sphinx/linphone_address.rst create mode 100644 coreapi/help/doc/sphinx/media_parameters.rst create mode 100644 coreapi/help/doc/sphinx/misc.rst create mode 100644 coreapi/help/doc/sphinx/network_parameters.rst create mode 100644 coreapi/help/doc/sphinx/proxies.rst diff --git a/coreapi/help/doc/sphinx/CMakeLists.txt b/coreapi/help/doc/sphinx/CMakeLists.txt index 05d7159a2..78727b5d5 100644 --- a/coreapi/help/doc/sphinx/CMakeLists.txt +++ b/coreapi/help/doc/sphinx/CMakeLists.txt @@ -39,9 +39,27 @@ if (ENABLE_SPHINX_DOC) enum_page.mustache index_page.mustache ) + set(STATIC_DOCUMENTATION_FILES authentication.rst + buddy_list.rst + call_control.rst + call_logs.rst + call_misc.rst + chatroom.rst + conferencing.rst + event_api.rst + index.rst + initializing.rst + linphone_address.rst + logo.png + media_parameters.rst + misc.rst + network_parameters.rst + proxies.rst + ) configure_file(conf.py.in source/conf.py) - configure_file(index.rst source/index.rst COPYONLY) - configure_file(logo.png source/logo.png COPYONLY) + foreach(file ${STATIC_DOCUMENTATION_FILES}) + configure_file(${file} source/${files} COPYONLY) + endforeach(file) add_custom_target(sphinx-doc ALL ${PYTHON_EXECUTABLE} '${CMAKE_CURRENT_SOURCE_DIR}/gendoc.py' '${LINPHONE_DOXYGEN_XML_DIR}' -o 'source' COMMAND ${PYTHON_EXECUTABLE} -msphinx -M html 'source' 'build' DEPENDS linphone-doc) diff --git a/coreapi/help/doc/sphinx/authentication.rst b/coreapi/help/doc/sphinx/authentication.rst new file mode 100644 index 000000000..464997164 --- /dev/null +++ b/coreapi/help/doc/sphinx/authentication.rst @@ -0,0 +1,4 @@ +Managing authentication: userid and passwords +============================================= + + diff --git a/coreapi/help/doc/sphinx/buddy_list.rst b/coreapi/help/doc/sphinx/buddy_list.rst new file mode 100644 index 000000000..c0a0591c5 --- /dev/null +++ b/coreapi/help/doc/sphinx/buddy_list.rst @@ -0,0 +1,57 @@ +Managing Buddies and buddy list and presence +============================================ +Buddies and buddy list +---------------------- + +Each buddy is represented by a :cpp:type:`LinphoneFriend` object created by function :cpp:func:`linphone_friend_new`. + +Buddy configuration parameters like :cpp:func:`sip uri ` or :cpp:func:`status publication ` policy for +this :cpp:type:`friend ` are configurable for each buddy. + +Here under a typical buddy creation: + +.. code-block:: c + + LinphoneFriend* my_friend=linphone_friend_new_with_addr("sip:joe@sip.linphone.org"); /*creates friend object for buddy joe*/ + linphone_friend_enable_subscribes(my_friend,TRUE); /*configure this friend to emit SUBSCRIBE message after being added to LinphoneCore*/ + linphone_friend_set_inc_subscribe_policy(my_friend,LinphoneSPAccept); /* accept Incoming subscription request for this friend*/ + +:cpp:type:`Friends ` status changes are reported by callback LinphoneCoreVTable.notify_presence_recv + +.. code-block:: c + + static void notify_presence_recv_updated (struct _LinphoneCore *lc, LinphoneFriend *friend) { + const LinphoneAddress* friend_address = linphone_friend_get_address(friend); + printf("New state state [%s] for user id [%s] \n" + ,linphone_online_status_to_string(linphone_friend_get_status(friend)) + ,linphone_address_as_string (friend_address)); + } + +Once created a buddy can be added to the buddy list using function :cpp:func:`linphone_core_add_friend`. Added friends will be notified +about :cpp:func:`local status changes `. + +Any subsequente modifications to :cpp:type:`LinphoneFriend` must be first started by a call to function :cpp:func:`linphone_friend_edit` and validated by function :cpp:func:`linphone_friend_done`. + +.. code-block:: c + + linphone_friend_edit(my_friend); /* start editing friend */ + linphone_friend_enable_subscribes(my_friend,FALSE); /*disable subscription for this friend*/ + linphone_friend_done(my_friend); /*commit changes triggering an UNSUBSCRIBE message*/ + + +Publishing presence status +-------------------------- + +Local presence status can be changed using function :cpp:func:`linphone_core_set_presence_model`. New status is propagated to all +friends :cpp:func:`previously added ` to :cpp:type:`LinphoneCore`. + + +Handling incoming subscription request +-------------------------------------- + +New incoming subscription requests are process according to :cpp:func:`the incoming subscription policy state ` for subscription +initiated by :cpp:func:`members of the buddy list `. + +For incoming request comming from an unknown buddy, the call back LinphoneCoreVTable.new_subscription_request is invoked. + +A complete tutorial can be found at : \ref buddy_tutorials "Registration tutorial" diff --git a/coreapi/help/doc/sphinx/call_control.rst b/coreapi/help/doc/sphinx/call_control.rst new file mode 100644 index 000000000..81567befa --- /dev/null +++ b/coreapi/help/doc/sphinx/call_control.rst @@ -0,0 +1,9 @@ +Placing and receiving calls +=========================== + +The :cpp:type:`LinphoneCall` object represents an incoming or outgoing call managed by the :cpp:type:`LinphoneCore`. + +Outgoing calls can be created using :cpp:func:`linphone_core_invite` or :cpp:func:`linphone_core_invite_address`, while incoming calls are notified to the application +through the LinphoneCoreVTable::call_state_changed callback. + +See the basic call \ref basic_call_tutorials "tutorial". diff --git a/coreapi/help/doc/sphinx/call_logs.rst b/coreapi/help/doc/sphinx/call_logs.rst new file mode 100644 index 000000000..cf68f06fe --- /dev/null +++ b/coreapi/help/doc/sphinx/call_logs.rst @@ -0,0 +1,2 @@ +Managing call logs +================== diff --git a/coreapi/help/doc/sphinx/call_misc.rst b/coreapi/help/doc/sphinx/call_misc.rst new file mode 100644 index 000000000..d77b63b60 --- /dev/null +++ b/coreapi/help/doc/sphinx/call_misc.rst @@ -0,0 +1,4 @@ +Obtaining information about a running call: sound volumes, quality indicators +============================================================================= + +When a call is running, it is possible to retrieve in real time current measured volumes and quality indicator. diff --git a/coreapi/help/doc/sphinx/chatroom.rst b/coreapi/help/doc/sphinx/chatroom.rst new file mode 100644 index 000000000..e8ccb2399 --- /dev/null +++ b/coreapi/help/doc/sphinx/chatroom.rst @@ -0,0 +1,28 @@ +Chat room and messaging +======================= +Exchanging text messages +------------------------ + +Messages are sent using :cpp:type:`LinphoneChatRoom` object. First step is to create a :cpp:func:`chat room ` +from a peer sip uri. + +.. code-block:: c + + LinphoneChatRoom* chat_room = linphone_core_get_chat_room(lc,"sip:joe@sip.linphone.org"); + +Once created, messages are sent using function :cpp:func:`linphone_chat_room_send_message`. + +.. code-block:: c + + linphone_chat_room_send_message(chat_room,"Hello world"); /*sending message*/ + +Incoming message are received from call back LinphoneCoreVTable.text_received + +.. code-block:: c + + void text_received(LinphoneCore *lc, LinphoneChatRoom *room, const LinphoneAddress *from, const char *message) { + printf(" Message [%s] received from [%s] \n",message,linphone_address_as_string (from)); + } + +A complete tutorial can be found at : \ref chatroom_tuto "Chat room tutorial" + diff --git a/coreapi/help/doc/sphinx/conferencing.rst b/coreapi/help/doc/sphinx/conferencing.rst new file mode 100644 index 000000000..e89b2e3f7 --- /dev/null +++ b/coreapi/help/doc/sphinx/conferencing.rst @@ -0,0 +1,21 @@ +Making an audio conference +========================== + +This API allows to create a conference entirely managed by the client. No server capabilities are required. + +The way such conference is created is by doing the following: + +#. The application shall makes "normal" calls to several destinations (using :cpp:func:`linphone_core_invite`), one after another. +#. While initiating the second call, the first one is automatically paused. +#. Then, once the second call is established, the application has the possibility to merge the two calls to form a conference where each participant + (the local participant, the remote destination of the first call, the remote destination of the second call) can talk together. + This must be done by adding the two calls to the conference using :cpp:func:`linphone_core_add_to_conference`. + +Once merged into a conference the :cpp:type:`LinphoneCall` objects representing the calls that were established remain unchanged, except that +they are tagged as part of the conference (see :cpp:func:`linphone_call_is_in_conference`). The calls in a conference are in the :cpp:enumerator:`LinphoneCallStreamsRunning` state. + +Only a single conference can be created: the purpose of this feature is to allow the local user to create, take part and manage the conference. +This API is not designed to create a conference server application. + +Up to 10 calls can be merged into the conference, however depending on the CPU usage required for doing the encoding/decoding of the streams of each participants, +the effective limit can be lower. diff --git a/coreapi/help/doc/sphinx/event_api.rst b/coreapi/help/doc/sphinx/event_api.rst new file mode 100644 index 000000000..b45f77fca --- /dev/null +++ b/coreapi/help/doc/sphinx/event_api.rst @@ -0,0 +1,4 @@ +Managing generic subscriptions and publishes +============================================ + +The :cpp:type:`LinphoneEvent` api allows application to control subscriptions, receive notifications and make publish to peers, in a generic manner. diff --git a/coreapi/help/doc/sphinx/index.rst b/coreapi/help/doc/sphinx/index.rst index 5a34626a7..2ae1a83e8 100644 --- a/coreapi/help/doc/sphinx/index.rst +++ b/coreapi/help/doc/sphinx/index.rst @@ -5,12 +5,62 @@ Welcome to Linphone API's documentation! ======================================== +What is liblinphone +------------------- + +Liblinphone is a high level library for bringing SIP video call functionnality +into an application. It aims at making easy the integration of the SIP +video calls into any applications. All variants of linphone are directly based +on it: + +* linphone (gtk interface) +* linphonec (console interface) +* linphone for iOS +* linphone for Android + +Liblinphone is GPL (see COPYING file). Please understand the licencing details +before using it! + +For any use of this library beyond the rights granted to you by the +GPL license, please contact Belledonne Communications +(contact@belledonne-communications.com). + + +Beginners' guides +----------------- .. toctree:: - :maxdepth: 2 - :caption: Contents: + :maxdepth: 1 + + initializing + call_control + call_misc + media_parameters + proxies + network_parameters + authentication + buddy_list + chatroom + call_logs + linphone_address + conferencing + event_api + misc + + +Code samples +------------ + + + + +API's reference documentation +----------------------------- + +.. toctree:: + :maxdepth: 1 - c/index.rst - cpp/index.rst - java/index.rst - csharp/index.rst + c/index + cpp/index + java/index + csharp/index diff --git a/coreapi/help/doc/sphinx/initializing.rst b/coreapi/help/doc/sphinx/initializing.rst new file mode 100644 index 000000000..c0e46073d --- /dev/null +++ b/coreapi/help/doc/sphinx/initializing.rst @@ -0,0 +1,4 @@ +Initializing liblinphone +======================== + + diff --git a/coreapi/help/doc/sphinx/linphone_address.rst b/coreapi/help/doc/sphinx/linphone_address.rst new file mode 100644 index 000000000..8dacb147e --- /dev/null +++ b/coreapi/help/doc/sphinx/linphone_address.rst @@ -0,0 +1,4 @@ +SIP address parser API +====================== + +This api is useful for manipulating SIP addresses ('from' or 'to' headers). diff --git a/coreapi/help/doc/sphinx/media_parameters.rst b/coreapi/help/doc/sphinx/media_parameters.rst new file mode 100644 index 000000000..9a9318a66 --- /dev/null +++ b/coreapi/help/doc/sphinx/media_parameters.rst @@ -0,0 +1,11 @@ +Controlling media parameters +============================ + +Multicast +--------- + +Call using rtp multicast addresses are supported for both audio and video with some limitations. Limitations are, no stun, no ice, no encryption. + +* Incoming call with multicast address are automatically accepted. The called party switches in a media receive only mode. +* Outgoing call willing to send media to a multicast address can activate multicast using :cpp:func:`linphone_core_enable_video_multicast` + or :cpp:func:`linphone_core_enable_audio_multicast`. The calling party switches in a media listen send only mode. diff --git a/coreapi/help/doc/sphinx/misc.rst b/coreapi/help/doc/sphinx/misc.rst new file mode 100644 index 000000000..292840e05 --- /dev/null +++ b/coreapi/help/doc/sphinx/misc.rst @@ -0,0 +1,3 @@ +Miscenalleous: logs, version strings, config storage +==================================================== + diff --git a/coreapi/help/doc/sphinx/network_parameters.rst b/coreapi/help/doc/sphinx/network_parameters.rst new file mode 100644 index 000000000..86faebce6 --- /dev/null +++ b/coreapi/help/doc/sphinx/network_parameters.rst @@ -0,0 +1,2 @@ +Controlling network parameters (ports, mtu…) +============================================ diff --git a/coreapi/help/doc/sphinx/proxies.rst b/coreapi/help/doc/sphinx/proxies.rst new file mode 100644 index 000000000..b41734b90 --- /dev/null +++ b/coreapi/help/doc/sphinx/proxies.rst @@ -0,0 +1,76 @@ +Managing proxies +================ + +User registration is controled by :cpp:type:`LinphoneProxyConfig` settings. + +Each :cpp:type:`LinphoneProxyConfig` object can be configured with registration informations like :cpp:func:`proxy address `, +:cpp:func:`user id `, :cpp:func:`refresh period `, and so on. + +A created proxy config using :cpp:func:`linphone_proxy_config_new`, once configured, must be added to :cpp:type:`LinphoneCore` using function :cpp:func:`linphone_core_add_proxy_config`. + +It is recommended to set a default :cpp:type:`proxy config ` using function :cpp:func:`linphone_core_set_default_proxy`. Once done, +if :cpp:type:`proxy config ` has been configured with attribute :cpp:func:`enable register `, +next call to :cpp:func:`linphone_core_iterate` triggers SIP register. + +Registration status is reported by LinphoneCoreRegistrationStateChangedCb. + +This pseudo code demonstrates basic registration operations: + +.. code-block:: c + + LinphoneProxyConfig* proxy_cfg; + /*create proxy config*/ + proxy_cfg = linphone_proxy_config_new(); + /*parse identity*/ + LinphoneAddress *from = linphone_address_new("sip:toto@sip.titi.com"); + LinphoneAuthInfo *info; + if (password!=NULL){ + info=linphone_auth_info_new(linphone_address_get_username(from),NULL,"secret",NULL,NULL); /*create authentication structure from identity*/ + linphone_core_add_auth_info(lc,info); /*add authentication info to LinphoneCore*/ + } + // configure proxy entries + linphone_proxy_config_set_identity(proxy_cfg,identity); /*set identity with user name and domain*/ + const char* server_addr = linphone_address_get_domain(from); /*extract domain address from identity*/ + linphone_proxy_config_set_server_addr(proxy_cfg,server_addr); /* we assume domain = proxy server address*/ + linphone_proxy_config_enable_register(proxy_cfg,TRUE); /*activate registration for this proxy config*/ + linphone_address_destroy(from); /*release resource*/ + + linphone_core_add_proxy_config(lc,proxy_cfg); /*add proxy config to linphone core*/ + linphone_core_set_default_proxy(lc,proxy_cfg); /*set to default proxy*/ + +Registration sate call back: + +.. code-block:: c + + static void registration_state_changed(struct _LinphoneCore *lc, LinphoneProxyConfig *cfg, LinphoneRegistrationState cstate, const char *message){ + printf("New registration state %s for user id [%s] at proxy [%s]\n" + ,linphone_registration_state_to_string(cstate) + ,linphone_proxy_config_get_identity(cfg) + ,linphone_proxy_config_get_addr(cfg)); + } + +Authentication +-------------- + +Most of the time, registration requires :doc:`authentication ` to succeed. :cpp:type:`LinphoneAuthInfo` info must be either added +to :cpp:type:`LinphoneCore` using function :cpp:func:`linphone_core_add_auth_info` before :cpp:type:`LinphoneProxyConfig` is added to Linphone core, or on demand +from call back #LinphoneCoreAuthInfoRequestedCb. + +Unregistration +-------------- + +Unregistration or any changes to :cpp:type:`LinphoneProxyConfig` must be first started by a call to function :cpp:func:`linphone_proxy_config_edit` and validated by +function :cpp:func:`linphone_proxy_config_done`. + +This pseudo code shows how to unregister a user associated to a #LinphoneProxyConfig: + +.. code-block:: c + + LinphoneProxyConfig* proxy_cfg; + linphone_core_get_default_proxy(lc,&proxy_cfg); /* get default proxy config*/ + linphone_proxy_config_edit(proxy_cfg); /*start editing proxy configuration*/ + linphone_proxy_config_enable_register(proxy_cfg,FALSE); /*de-activate registration for this proxy config*/ + linphone_proxy_config_done(proxy_cfg); /*initiate REGISTER with expire = 0*/ + +A complete tutorial can be found at : \ref registration_tutorials "Registration tutorial" + From facab07c405225cbb99f8c8a4b94ec7a43f48367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 10 Oct 2017 14:31:58 +0200 Subject: [PATCH 045/121] Creates a new singleton object for logging features in the API of Liblinphone (cherry picked from commit d61a62de91483a5ba6029153c224adec9ef68622) --- coreapi/CMakeLists.txt | 1 + coreapi/linphonecore.c | 39 ++--- coreapi/logging-private.h | 61 ++++++++ coreapi/logging.c | 256 +++++++++++++++++++++++++++++++ include/CMakeLists.txt | 1 + include/linphone/core.h | 23 ++- include/linphone/logging.h | 178 +++++++++++++++++++++ src/c-wrapper/c-wrapper.h | 2 + tester/tester.c | 4 +- wrappers/cpp/class_impl.mustache | 1 + 10 files changed, 527 insertions(+), 39 deletions(-) create mode 100644 coreapi/logging-private.h create mode 100644 coreapi/logging.c create mode 100644 include/linphone/logging.h diff --git a/coreapi/CMakeLists.txt b/coreapi/CMakeLists.txt index 03600de80..85e13205c 100644 --- a/coreapi/CMakeLists.txt +++ b/coreapi/CMakeLists.txt @@ -84,6 +84,7 @@ set(LINPHONE_SOURCE_FILES_C linphonecore.c linphone_tunnel_config.c localplayer.c + logging.c lpc2xml.c lpconfig.c lsd.c diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index c6af072cf..b0a4347fe 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -21,7 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "linphone/core.h" #include "linphone/sipsetup.h" #include "linphone/lpconfig.h" +#include "linphone/logging.h" #include "private.h" +#include "logging-private.h" #include "quality_reporting.h" #include "lime.h" #include "conference_private.h" @@ -500,40 +502,17 @@ void linphone_core_set_log_file(FILE *file) { } void linphone_core_set_log_level(OrtpLogLevel loglevel) { - unsigned int mask = loglevel; - switch (loglevel) { - case ORTP_TRACE: - case ORTP_DEBUG: - mask |= ORTP_DEBUG; - BCTBX_NO_BREAK; - case ORTP_MESSAGE: - mask |= ORTP_MESSAGE; - BCTBX_NO_BREAK; - case ORTP_WARNING: - mask |= ORTP_WARNING; - BCTBX_NO_BREAK; - case ORTP_ERROR: - mask |= ORTP_ERROR; - BCTBX_NO_BREAK; - case ORTP_FATAL: - mask |= ORTP_FATAL; - break; - case ORTP_LOGLEV_END: - break; - } - linphone_core_set_log_level_mask(mask); + LinphoneLoggingService *log_service = linphone_logging_service_get(); + linphone_logging_service_set_log_level(log_service, _bctbx_log_level_to_linphone_log_level(loglevel)); } -void linphone_core_set_log_level_mask(unsigned int loglevel) { - bctbx_set_log_level_mask("bctbx", (int)loglevel); - bctbx_set_log_level_mask("ortp", (int)loglevel); - bctbx_set_log_level_mask("mediastreamer", (int)loglevel); - bctbx_set_log_level_mask("bzrtp", (int)loglevel); /*need something to set log level for all domains*/ - bctbx_set_log_level_mask("linphone", (int)loglevel); - sal_set_log_level((OrtpLogLevel)loglevel); +void linphone_core_set_log_level_mask(unsigned int mask) { + LinphoneLoggingService *log_service = linphone_logging_service_get(); + linphone_logging_service_set_log_level_mask(log_service, _bctbx_log_mask_to_linphone_log_mask(mask)); } unsigned int linphone_core_get_log_level_mask(void) { - return bctbx_get_log_level_mask(ORTP_LOG_DOMAIN); + LinphoneLoggingService *log_service = linphone_logging_service_get(); + return linphone_logging_service_get_log_level_mask(log_service); } static int _open_log_collection_file_with_idx(int idx) { struct stat statbuf; diff --git a/coreapi/logging-private.h b/coreapi/logging-private.h new file mode 100644 index 000000000..e9b54b990 --- /dev/null +++ b/coreapi/logging-private.h @@ -0,0 +1,61 @@ +/* +logging-private.h +Copyright (C) 2017 Belledonne Communications SARL + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#ifndef _LOGGING_PRIVATE_H_ +#define _LOGGING_PRIVATE_H_ + +#include +#include "linphone/logging.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Converts a #BctbxLogLevel into #LinphoneLogLevel. + */ +LinphoneLogLevel _bctbx_log_level_to_linphone_log_level(BctbxLogLevel level); + +/** + * @brief Converts a mask of #BctbxLogLevel into a mask of #LinphoneLogLevel. + */ +unsigned int _bctbx_log_mask_to_linphone_log_mask(unsigned int mask); + +/** + * @brief Converts a #LinphoneLogLevel into #BctbxLogLevel. + */ +BctbxLogLevel _linphone_log_level_to_bctbx_log_level(LinphoneLogLevel level); + +/** + * @brief Converts a mask of #LinphoneLogLevel into a mask of #BctbxLogLevel. + */ +unsigned int _linphone_log_mask_to_bctbx_log_mask(unsigned int mask); + +/** + * @brief Releases the instance pointer of the singleton. + * @note You should not need to call this function since it is automatically done + * at process ending. + */ +void _linphone_logging_service_clean(void); + +#ifdef __cplusplus +} +#endif + +#endif // _LOGGING_PRIVATE_H_ diff --git a/coreapi/logging.c b/coreapi/logging.c new file mode 100644 index 000000000..e39ae0012 --- /dev/null +++ b/coreapi/logging.c @@ -0,0 +1,256 @@ +/* +log.c +Copyright (C) 2017 Belledonne Communications SARL + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include "linphone/logging.h" + +#include "c-wrapper/c-wrapper.h" +#include "logging-private.h" + + +struct _LinphoneLoggingService { + belle_sip_object_t base; + LinphoneLoggingServiceCbs *cbs; + bctbx_log_handler_t *log_handler; +}; + +BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneLoggingService); +BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneLoggingService); + +struct _LinphoneLoggingServiceCbs { + belle_sip_object_t base; + void *user_data; + LinphoneLoggingServiceCbsLogMessageWrittenCb message_event_cb; +}; + +BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneLoggingServiceCbs); +BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneLoggingServiceCbs); + +static LinphoneLoggingServiceCbs *_linphone_logging_service_cbs_new(void); + + + + + +static LinphoneLoggingService *_linphone_logging_service_instance = NULL; + +static std::map _linphone_log_level_to_bctbx_log_level_map = { + { LinphoneLogLevelDebug , BCTBX_LOG_DEBUG }, + { LinphoneLogLevelTrace , BCTBX_LOG_TRACE }, + { LinphoneLogLevelMessage , BCTBX_LOG_MESSAGE }, + { LinphoneLogLevelWarning , BCTBX_LOG_WARNING }, + { LinphoneLogLevelError , BCTBX_LOG_ERROR }, + { LinphoneLogLevelFatal , BCTBX_LOG_FATAL } +}; + +LinphoneLogLevel _bctbx_log_level_to_linphone_log_level(BctbxLogLevel level) { + auto &tmap = _linphone_log_level_to_bctbx_log_level_map; + auto predicate = [level](const std::pair &tuple)->bool{return tuple.second==level;}; + auto response = std::find_if(tmap.cbegin(), tmap.cend(), predicate); + if (response != tmap.cend()) { + return response->first; + } else { + ms_fatal("%s(): invalid argurement [%d]", __FUNCTION__, level); + return LinphoneLogLevelDebug; + } +} + +unsigned int _bctbx_log_mask_to_linphone_log_mask(unsigned int mask) { + unsigned int res = 0; + auto &tmap = _linphone_log_level_to_bctbx_log_level_map; + for (auto it=tmap.cbegin(); it!=tmap.cend(); it++) { + if (mask & it->second) { + mask&=~it->second; + res|=it->first; + } + } + if (mask != 0) { + ms_fatal("%s(): invalid flag set in mask [%x]", __FUNCTION__, mask); + } + return res; +} + +BctbxLogLevel _linphone_log_level_to_bctbx_log_level(LinphoneLogLevel level) { + try { + return _linphone_log_level_to_bctbx_log_level_map.at(level); + } catch (const std::out_of_range &e) { + ms_fatal("%s(): invalid argument [%d]", __FUNCTION__, level); + return BCTBX_LOG_LOGLEV_END; + } +} + +unsigned int _linphone_log_mask_to_bctbx_log_mask(unsigned int mask) { + unsigned int res = 0; + auto &tmap = _linphone_log_level_to_bctbx_log_level_map; + for (auto it=tmap.cbegin(); it!=tmap.cend(); it++) { + if (mask & it->first) { + mask&=~it->first; + res|=it->second; + } + } + if (mask != 0) { + ms_fatal("%s(): invalid flag set in mask [%x]", __FUNCTION__, mask); + } + return res; +} + +static void _log_handler_on_message_written_cb(void *info,const char *domain, BctbxLogLevel lev, const char *fmt, va_list args) { + LinphoneLoggingService *service = (LinphoneLoggingService *)info; + if (service->cbs->message_event_cb) { + char *message = bctbx_strdup_vprintf(fmt, args); + service->cbs->message_event_cb(service, domain, _bctbx_log_level_to_linphone_log_level(lev), message); + bctbx_free(message); + } +} + +static void _log_handler_destroy_cb(bctbx_log_handler_t *handler) { + LinphoneLoggingService *service = (LinphoneLoggingService *)bctbx_log_handler_get_user_data(handler); + service->log_handler = NULL; +} + +static LinphoneLoggingService *_linphone_logging_service_new(void) { + LinphoneLoggingService *service = belle_sip_object_new(LinphoneLoggingService); + service->log_handler = bctbx_create_log_handler(_log_handler_on_message_written_cb, _log_handler_destroy_cb, service); + service->cbs = _linphone_logging_service_cbs_new(); + bctbx_add_log_handler(service->log_handler); + return service; +} + +LinphoneLoggingService *linphone_logging_service_get(void) { + if (_linphone_logging_service_instance == NULL) { + _linphone_logging_service_instance = _linphone_logging_service_new(); + atexit(_linphone_logging_service_clean); + } + return _linphone_logging_service_instance; +} + +void _linphone_logging_service_clean(void) { + if (_linphone_logging_service_instance) { + linphone_logging_service_unref(_linphone_logging_service_instance); + _linphone_logging_service_instance = NULL; + } +} + +LinphoneLoggingService *linphone_logging_service_ref(LinphoneLoggingService *service) { + return (LinphoneLoggingService *)belle_sip_object_ref(service); +} + +void linphone_logging_service_unref(LinphoneLoggingService *service) { + belle_sip_object_ref(service); +} + +static void _linphone_logging_service_uninit(LinphoneLoggingService *log_service) { + if (log_service->log_handler) bctbx_remove_log_handler(log_service->log_handler); + linphone_logging_service_cbs_unref(log_service->cbs); +} + +void linphone_logging_service_release_instance(void) { + if (_linphone_logging_service_instance) { + belle_sip_object_unref(BELLE_SIP_OBJECT(_linphone_logging_service_instance)); + } + _linphone_logging_service_instance = NULL; +} + +LinphoneLoggingServiceCbs *linphone_logging_service_get_callbacks(const LinphoneLoggingService *log_service) { + return log_service->cbs; +} + +static const char *_linphone_logging_service_log_domains[] = { + "bctbx", + "ortp", + "mediastreamer", + "bzrtp", + "linphone", + NULL +}; + +void linphone_logging_service_set_log_level(LinphoneLoggingService *log_service, LinphoneLogLevel loglevel) { + const char **domain; + for (domain=_linphone_logging_service_log_domains; *domain; domain++) { + bctbx_set_log_level(*domain, _linphone_log_level_to_bctbx_log_level(loglevel)); + } +} + +void linphone_logging_service_set_log_level_mask(LinphoneLoggingService *log_service, unsigned int mask) { + const char **domain; + for (domain=_linphone_logging_service_log_domains; *domain; domain++) { + bctbx_set_log_level_mask(*domain, _linphone_log_mask_to_bctbx_log_mask(mask)); + } +} + +unsigned int linphone_logging_service_get_log_level_mask(const LinphoneLoggingService *log_service) { + return _bctbx_log_mask_to_linphone_log_mask(bctbx_get_log_level_mask(ORTP_LOG_DOMAIN)); +} + +void linphone_logging_service_set_log_file(const LinphoneLoggingService *service, const char *dir, const char *filename, size_t max_size) { + bctbx_log_handler_t *log_handler = bctbx_create_file_log_handler((uint64_t)max_size, dir, filename, NULL); + bctbx_add_log_handler(log_handler); +} + +BELLE_SIP_INSTANCIATE_VPTR(LinphoneLoggingService, belle_sip_object_t, + _linphone_logging_service_uninit, // uninit + NULL, // clone + NULL, // marshal + FALSE // unown +); + + + + + + + + + +static LinphoneLoggingServiceCbs *_linphone_logging_service_cbs_new(void) { + return belle_sip_object_new(LinphoneLoggingServiceCbs); +} + +LinphoneLoggingServiceCbs *linphone_logging_service_cbs_ref(LinphoneLoggingServiceCbs *cbs) { + return (LinphoneLoggingServiceCbs *)belle_sip_object_ref(cbs); +} + +void linphone_logging_service_cbs_unref(LinphoneLoggingServiceCbs *cbs) { + belle_sip_object_unref(cbs); +} + +void linphone_logging_service_cbs_set_log_message_written(LinphoneLoggingServiceCbs *cbs, LinphoneLoggingServiceCbsLogMessageWrittenCb cb) { + cbs->message_event_cb = cb; +} + +LinphoneLoggingServiceCbsLogMessageWrittenCb linphone_logging_service_cbs_get_log_message_written(const LinphoneLoggingServiceCbs *cbs) { + return cbs->message_event_cb; +} + +void linphone_logging_service_cbs_set_user_data(LinphoneLoggingServiceCbs *cbs, void *user_data) { + cbs->user_data = user_data; +} + +BELLE_SIP_INSTANCIATE_VPTR(LinphoneLoggingServiceCbs, belle_sip_object_t, + NULL, // uninit + NULL, // clone + NULL, // marshal + FALSE // unown +); diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 92593391a..2e09af5eb 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -48,6 +48,7 @@ set(ROOT_HEADER_FILES im_notif_policy.h info_message.h ldapprovider.h + logging.h lpconfig.h misc.h nat_policy.h diff --git a/include/linphone/core.h b/include/linphone/core.h index 7ee26c5d0..ce0e774e0 100644 --- a/include/linphone/core.h +++ b/include/linphone/core.h @@ -800,25 +800,28 @@ LINPHONE_PUBLIC void linphone_core_reset_log_collection(void); /** * @bref Define a log handler. * @param logfunc The function pointer of the log handler. + * @deprecated Use #linphone_log_service_set_log_handler() instead. Deprecated since 2017-10-10. * @donotwrap */ -LINPHONE_PUBLIC void linphone_core_set_log_handler(OrtpLogFunc logfunc); +LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_set_log_handler(OrtpLogFunc logfunc); /** * @brief Define a log file. * * If the file pointer passed as an argument is NULL, stdout is used instead. * @param file A pointer to the FILE structure of the file to write to. + * @deprecated Use #linphone_log_service_set_file() instead. Deprecated since 2017-10-10. * @donotwrap */ -LINPHONE_PUBLIC void linphone_core_set_log_file(FILE *file); +LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_set_log_file(FILE *file); /** * @brief Define the minimum level for logging. * @param loglevel Minimum level for logging messages. + * @deprecated Use #linphone_logging_service_set_log_level() instead. Deprecated since 2017-10-10. * @donotwrap **/ -LINPHONE_PUBLIC void linphone_core_set_log_level(OrtpLogLevel loglevel); +LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_set_log_level(OrtpLogLevel loglevel); /** * Define the log level using mask. @@ -826,22 +829,25 @@ LINPHONE_PUBLIC void linphone_core_set_log_level(OrtpLogLevel loglevel); * The loglevel parameter is a bitmask parameter. Therefore to enable only warning and error * messages, use ORTP_WARNING | ORTP_ERROR. To disable logs, simply set loglevel to 0. * - * @param loglevel A bitmask of the log levels to set. + * @param mask A bitmask of the log levels to set. + * @deprecated Use #linphone_logging_service_set_log_level() instead. Deprecated since 2017-10-10. */ -LINPHONE_PUBLIC void linphone_core_set_log_level_mask(unsigned int loglevel); +LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_set_log_level_mask(unsigned int mask); /** * Get defined log level mask. * * @return The loglevel parameter is a bitmask parameter. Therefore to enable only warning and error * messages, use ORTP_WARNING | ORTP_ERROR. To disable logs, simply set loglevel to 0. + * @deprecated Use #linphone_logging_service_get_log_level_mask() instead. Deprecated since 2017-10-10. */ -LINPHONE_PUBLIC unsigned int linphone_core_get_log_level_mask(void); +LINPHONE_PUBLIC LINPHONE_DEPRECATED unsigned int linphone_core_get_log_level_mask(void); /** * Enable logs in supplied FILE*. * @param file a C FILE* where to fprintf logs. If null stdout is used. - * @deprecated Use #linphone_core_set_log_file and #linphone_core_set_log_level instead. + * @deprecated Use #linphone_core_set_log_file and #linphone_core_set_log_level() instead. + * Deprecated since 2017-01-12. * @donotwrap **/ LINPHONE_DEPRECATED LINPHONE_PUBLIC void linphone_core_enable_logs(FILE *file); @@ -851,13 +857,14 @@ LINPHONE_DEPRECATED LINPHONE_PUBLIC void linphone_core_enable_logs(FILE *file); * @param logfunc The address of a OrtpLogFunc callback whose protoype is * typedef void (*OrtpLogFunc)(OrtpLogLevel lev, const char *fmt, va_list args); * @deprecated Use #linphone_core_set_log_handler and #linphone_core_set_log_level instead. + * Deprecated since 2017-01-12. * @donotwrap **/ LINPHONE_DEPRECATED LINPHONE_PUBLIC void linphone_core_enable_logs_with_cb(OrtpLogFunc logfunc); /** * Entirely disable logging. - * @deprecated Use #linphone_core_set_log_level instead. + * @deprecated Use #linphone_core_set_log_level() instead. Deprecated since 2017-01-12. * @donotwrap **/ LINPHONE_DEPRECATED LINPHONE_PUBLIC void linphone_core_disable_logs(void); diff --git a/include/linphone/logging.h b/include/linphone/logging.h new file mode 100644 index 000000000..e54d0702f --- /dev/null +++ b/include/linphone/logging.h @@ -0,0 +1,178 @@ +/* +logging.h +Copyright (C) 2017 Belledonne Communications SARL + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#ifndef _LINPHONE_LOG_H_ +#define _LINPHONE_LOG_H_ + +#include "types.h" +#include "defs.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @addtogroup logging + * @{ + */ + +/** + * @brief Singleton class giving access to logging features. + */ +typedef struct _LinphoneLoggingService LinphoneLoggingService; + +/** + * @brief Listener for #LinphoneLoggingService. + */ +typedef struct _LinphoneLoggingServiceCbs LinphoneLoggingServiceCbs; + +/** + * @brief Verbosity levels of log messages. + */ +typedef enum _LinphoneLogLevel { + LinphoneLogLevelDebug = 1, /**< @brief Level for debug messages. */ + LinphoneLogLevelTrace = 1<<1, /**< @brief Level for traces. */ + LinphoneLogLevelMessage = 1<<2, /**< @brief Level for information messages. */ + LinphoneLogLevelWarning = 1<<3, /**< @brief Level for warning messages. */ + LinphoneLogLevelError = 1<<4, /**< @brief Level for error messages. */ + LinphoneLogLevelFatal = 1<<5 /**< @brief Level for fatal error messages. */ +} LinphoneLogLevel; + +/** + * @brief Type of callbacks called each time liblinphone write a log message. + * + * @param log_service A pointer on the logging service singleton. + * @param domain A string describing which sub-library of liblinphone the message is coming from. + * @param lev Verbosity level of the message. + * @param message Content of the message. + */ +typedef void (*LinphoneLoggingServiceCbsLogMessageWrittenCb)(LinphoneLoggingService *log_service, const char *domain, LinphoneLogLevel lev, const char *message); + + + + + +/** + * @brief Gets the singleton logging service object. + * + * The singleton is automatically instantiated if it hasn't + * been done yet. + * + * @return A pointer on the singleton. + */ +LINPHONE_PUBLIC LinphoneLoggingService *linphone_logging_service_get(void); + +/** + * @brief Increases the reference counter. + */ +LINPHONE_PUBLIC LinphoneLoggingService *linphone_logging_service_ref(LinphoneLoggingService *service); + +/** + * @brief Decreases the reference counter and destroy the object + * if the counter reaches 0. + */ +LINPHONE_PUBLIC void linphone_logging_service_unref(LinphoneLoggingService *service); + +/** + * @brief Gets the logging service listener. + */ +LINPHONE_PUBLIC LinphoneLoggingServiceCbs *linphone_logging_service_get_callbacks(const LinphoneLoggingService *log_service); + +/** + * @brief Set the verbosity of the log. + * + * For instance, a level of #LinphoneLogLevelMessage will let pass fatal, error, warning and message-typed messages + * whereas trace and debug messages will be dumped out. + */ +LINPHONE_PUBLIC void linphone_logging_service_set_log_level(LinphoneLoggingService *log_service, LinphoneLogLevel level); + +/** + * @brief Sets the types of messages that will be authorized to be written in the log. + * @param log_service The logging service singleton. + * @param mask Example: #LinphoneLogLevelMessage|#LinphoneLogLevelError will ONLY let pass message-typed and error messages. + * @note Calling that function reset the log level that has been specified by #linphone_logging_service_set_log_level(). + */ +LINPHONE_PUBLIC void linphone_logging_service_set_log_level_mask(LinphoneLoggingService *log_service, unsigned int mask); + +/** + * @brief Gets the log level mask. + */ +LINPHONE_PUBLIC unsigned int linphone_logging_service_get_log_level_mask(const LinphoneLoggingService *log_service); + +/** + * @brief Enables logging in a file. + * + * That function enables an internal log handler that writes log messages in + * log-rotated files. + * + * @param dir Directory where to create the distinct parts of the log. + * @param filename Name of the log file. + * @param max_size The maximal size of each part of the log. The log rotating is triggered + * each time the currently opened log part reach that limit. + */ +LINPHONE_PUBLIC void linphone_logging_service_set_log_file(const LinphoneLoggingService *service, const char *dir, const char *filename, size_t max_size); + + + + + +/** + * @brief Increases the reference counter. + */ +LINPHONE_PUBLIC LinphoneLoggingServiceCbs *linphone_logging_service_cbs_ref(LinphoneLoggingServiceCbs *cbs); + +/** + * @brief Decreases the reference counter. + * + * The object is automatically destroyed once the counter reach 0. + */ +LINPHONE_PUBLIC void linphone_logging_service_cbs_unref(LinphoneLoggingServiceCbs *cbs); + +/** + * @brief Sets the callback to call each time liblinphone writes a log message. + */ +LINPHONE_PUBLIC void linphone_logging_service_cbs_set_log_message_written(LinphoneLoggingServiceCbs *cbs, LinphoneLoggingServiceCbsLogMessageWrittenCb cb); + +/** + * @brief Gets the value of the message event callback. + */ +LINPHONE_PUBLIC LinphoneLoggingServiceCbsLogMessageWrittenCb linphone_logging_service_cbs_get_log_message_written(const LinphoneLoggingServiceCbs *cbs); + +/** + * @brief Pass a pointer on a custom object. + * + * That pointer can be get back by callbacks by using #linphone_logging_service_get_cbs() and #linphone_logging_service_cbs_get_user_data(). + */ +LINPHONE_PUBLIC void linphone_logging_service_cbs_set_user_data(LinphoneLoggingServiceCbs *cbs, void *user_data); + +/** + * @brief Gets the user_data pointer back. + */ +LINPHONE_PUBLIC void *linphone_logging_service_cbs_get_user_data(const LinphoneLoggingServiceCbs *cbs); + + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif // _LINPHONE_LOG_H_ diff --git a/src/c-wrapper/c-wrapper.h b/src/c-wrapper/c-wrapper.h index 9ebb30f72..e0109ce7c 100644 --- a/src/c-wrapper/c-wrapper.h +++ b/src/c-wrapper/c-wrapper.h @@ -100,6 +100,8 @@ BELLE_SIP_TYPE_ID(LinphoneImNotifPolicy), BELLE_SIP_TYPE_ID(LinphoneInfoMessage), BELLE_SIP_TYPE_ID(LinphoneLDAPContactProvider), BELLE_SIP_TYPE_ID(LinphoneLDAPContactSearch), +BELLE_SIP_TYPE_ID(LinphoneLoggingService), +BELLE_SIP_TYPE_ID(LinphoneLoggingServiceCbs), BELLE_SIP_TYPE_ID(LinphoneNatPolicy), BELLE_SIP_TYPE_ID(LinphonePayloadType), BELLE_SIP_TYPE_ID(LinphonePlayer), diff --git a/tester/tester.c b/tester/tester.c index c47cff87f..6eaafeab9 100644 --- a/tester/tester.c +++ b/tester/tester.c @@ -19,6 +19,8 @@ #include #include #include "linphone/core.h" +#include "linphone/logging.h" +#include "logging-private.h" #include "liblinphone_tester.h" #include #include "tester_utils.h" @@ -503,7 +505,7 @@ void linphone_core_manager_uninit(LinphoneCoreManager *mgr) { linphone_core_cbs_unref(mgr->cbs); manager_count--; - linphone_core_set_log_level(old_log_level); + linphone_core_set_log_level_mask(old_log_level); } void linphone_core_manager_wait_for_stun_resolution(LinphoneCoreManager *mgr) { diff --git a/wrappers/cpp/class_impl.mustache b/wrappers/cpp/class_impl.mustache index 3002c3c9c..f780ed6e5 100644 --- a/wrappers/cpp/class_impl.mustache +++ b/wrappers/cpp/class_impl.mustache @@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include #include +#include #include "linphone++/linphone.hh" #include "tools.hh" From e6158d8da50eefcbe0625fc32651962871f75313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 10 Oct 2017 17:55:16 +0200 Subject: [PATCH 046/121] Add the deprecation date on some deprecated functions (cherry picked from commit f56f27fb2c6f25356ac22db059ed653ad1ad57ab) --- include/linphone/core.h | 112 +++++++++++++++++++++++----------------- 1 file changed, 65 insertions(+), 47 deletions(-) diff --git a/include/linphone/core.h b/include/linphone/core.h index ce0e774e0..ded8e3949 100644 --- a/include/linphone/core.h +++ b/include/linphone/core.h @@ -165,7 +165,8 @@ typedef struct _LinphoneCoreVTable{ LinphoneCoreNotifyPresenceReceivedCb notify_presence_received; /**< Notify received presence events*/ LinphoneCoreNotifyPresenceReceivedForUriOrTelCb notify_presence_received_for_uri_or_tel; /**< Notify received presence events*/ LinphoneCoreNewSubscriptionRequestedCb new_subscription_requested; /**< Notify about pending presence subscription request */ - LINPHONE_DEPRECATED LinphoneCoreAuthInfoRequestedCb auth_info_requested; /**< @deprecated Use authentication_requested instead. Ask the application some authentication information */ + LINPHONE_DEPRECATED LinphoneCoreAuthInfoRequestedCb auth_info_requested; /** @brief Ask the application some authentication information. + @deprecated Use authentication_requested instead. Deprecated since 2016-09-21 */ LinphoneCoreAuthenticationRequestedCb authentication_requested; /**< Ask the application some authentication information */ LinphoneCoreCallLogUpdatedCb call_log_updated; /**< Notifies that call log list has been updated */ LinphoneCoreMessageReceivedCb message_received; /**< a message is received, can be text or external body*/ @@ -181,11 +182,16 @@ typedef struct _LinphoneCoreVTable{ LinphoneCoreSubscriptionStateChangedCb subscription_state_changed; /** A text message has been received */ - LINPHONE_DEPRECATED LinphoneCoreFileTransferRecvCb file_transfer_recv; /**< @deprecated Callback to store file received attached to a #LinphoneChatMessage */ - LINPHONE_DEPRECATED LinphoneCoreFileTransferSendCb file_transfer_send; /**< @deprecated Callback to collect file chunk to be sent for a #LinphoneChatMessage */ - LINPHONE_DEPRECATED LinphoneCoreFileTransferProgressIndicationCb file_transfer_progress_indication; /**< @deprecated Callback to indicate file transfer progress */ + LinphoneCoreConfiguringStatusCb configuring_status; /**< Notifies configuring status changes + @deprecated Deprecated since 2015-11-19. */ + LINPHONE_DEPRECATED LinphoneCoreTextMessageReceivedCb text_received; /**< @brief A text message has been received. + @deprecated Use #message_received instead. Deprecated since 2015-11-19. */ + LINPHONE_DEPRECATED LinphoneCoreFileTransferRecvCb file_transfer_recv; /**< @brief Callback to store file received attached to a #LinphoneChatMessage. + @deprecated Deprecated since 2015-11-19. */ + LINPHONE_DEPRECATED LinphoneCoreFileTransferSendCb file_transfer_send; /**< @brief Callback to collect file chunk to be sent for a #LinphoneChatMessage. + @deprecated Deprecated since 2015-11-19. */ + LINPHONE_DEPRECATED LinphoneCoreFileTransferProgressIndicationCb file_transfer_progress_indication; /**< @brief Callback to indicate file transfer progress. + @deprecated Deprecated since 2015-11-19. */ LinphoneCoreNetworkReachableCb network_reachable; /**< Callback to report IP network status (I.E up/down )*/ LinphoneCoreLogCollectionUploadStateChangedCb log_collection_upload_state_changed; /**< Callback to upload collected logs */ LinphoneCoreLogCollectionUploadProgressIndicationCb log_collection_upload_progress_indication; /**< Callback to indicate log collection upload progress */ @@ -886,13 +892,15 @@ LINPHONE_PUBLIC const char *linphone_core_get_version(void); LINPHONE_PUBLIC const char *linphone_core_get_user_agent(LinphoneCore *lc); /** - * @deprecated 2016-12-20: Use #linphone_core_get_user_agent instead. + * @deprecated Use #linphone_core_get_user_agent() instead. + * Deprecated since 2015-11-19. * @donotwrap **/ LINPHONE_PUBLIC LINPHONE_DEPRECATED const char *linphone_core_get_user_agent_name(void); /** - * @deprecated 2016-12-20: Use #linphone_core_get_user_agent instead. + * @deprecated Use #linphone_core_get_user_agent instead. + * Deprecated since 2015-11-19. * @donotwrap **/ LINPHONE_PUBLIC LINPHONE_DEPRECATED const char *linphone_core_get_user_agent_version(void); @@ -910,8 +918,8 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED const char *linphone_core_get_user_agent_ver * @param vtable a LinphoneCoreVTable structure holding your application callbacks * @param config_path a path to a config file. If it does not exists it will be created. * The config file is used to store all settings, call logs, friends, proxies... so that all these settings - * become persistent over the life of the LinphoneCore object. - * It is allowed to set a NULL config file. In that case LinphoneCore will not store any settings. + * become persistent over the life of the LinphoneCore object. + * It is allowed to set a NULL config file. In that case LinphoneCore will not store any settings. * @param factory_config_path a path to a read-only config file that can be used to * to store hard-coded preference such as proxy settings or internal preferences. * The settings in this factory file always override the one in the normal config file. @@ -919,7 +927,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED const char *linphone_core_get_user_agent_ver * @param userdata an opaque user pointer that can be retrieved at any time (for example in * callbacks) using linphone_core_get_user_data(). * @see linphone_core_new_with_config - * @deprecated 2017-01-12: Use linphone_factory_create_core() instead. + * @deprecated Use #linphone_factory_create_core() instead. Deprecated since 2017-01-12. * @donotwrap **/ LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneCore *linphone_core_new(const LinphoneCoreVTable *vtable, @@ -936,7 +944,7 @@ LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneCore *linphone_core_new(const Linpho * @param userdata an opaque user pointer that can be retrieved at any time (for example in * callbacks) using linphone_core_get_user_data(). * @see linphone_core_new - * @deprecated 2017-01-12: Use linphone_factory_create_core_with_config() instead. + * @deprecated Use #linphone_factory_create_core_with_config() instead. Deprecated since 2017-01-12. * @donotwrap **/ LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneCore *linphone_core_new_with_config(const LinphoneCoreVTable *vtable, LpConfig *config, void *userdata); @@ -987,7 +995,7 @@ LINPHONE_PUBLIC void linphone_core_iterate(LinphoneCore *lc); * add a listener to be notified of linphone core events. Once events are received, registered vtable are invoked in order. * @param vtable a LinphoneCoreVTable structure holding your application callbacks. Object is owned by linphone core until linphone_core_remove_listener. * @param lc object - * @deprecated Use linphone_core_add_callbacks() instead. + * @deprecated Use linphone_core_add_callbacks() instead. Deprecated since 2017-01-12. * @donotwrap */ LINPHONE_DEPRECATED LINPHONE_PUBLIC void linphone_core_add_listener(LinphoneCore *lc, LinphoneCoreVTable *vtable); @@ -1006,7 +1014,7 @@ LINPHONE_PUBLIC void linphone_core_add_callbacks(LinphoneCore *lc, LinphoneCoreC * remove a listener registred by linphone_core_add_listener. * @param lc object * @param vtable a LinphoneCoreVTable structure holding your application callbacks. - * @deprecated Use linphone_core_remove_callbacks() instead. + * @deprecated Use linphone_core_remove_callbacks() instead. Deprecated since 2017-01-12. * @donotwrap */ LINPHONE_DEPRECATED LINPHONE_PUBLIC void linphone_core_remove_listener(LinphoneCore *lc, const LinphoneCoreVTable *vtable); @@ -1086,7 +1094,8 @@ LINPHONE_PUBLIC LinphoneCall * linphone_core_invite_with_params(LinphoneCore *lc LINPHONE_PUBLIC LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const LinphoneAddress *addr, const LinphoneCallParams *params); /** - * Performs a simple call transfer to the specified destination. + * @brief Performs a simple call transfer to the specified destination. + * * The remote endpoint is expected to issue a new call to the specified destination. * The current call remains active and thus can be later paused or terminated. * It is possible to follow the progress of the transfer provided that transferee sends notification about it. @@ -1097,12 +1106,13 @@ LINPHONE_PUBLIC LinphoneCall * linphone_core_invite_address_with_params(Linphone * @param[in] refer_to The destination the call is to be refered to * @return 0 on success, -1 on failure * @ingroup call_control - * @deprecated Use linphone_call_transfer() instead + * @deprecated Use #linphone_call_transfer() instead. Deprecated since 2017-02-13. **/ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_transfer_call(LinphoneCore *lc, LinphoneCall *call, const char *refer_to); /** - * Transfers a call to destination of another running call. This is used for "attended transfer" scenarios. + * @brief Transfers a call to destination of another running call. This is used for "attended transfer" scenarios. + * * The transfered call is supposed to be in paused state, so that it is able to accept the transfer immediately. * The destination call is a call previously established to introduce the transfered person. * This method will send a transfer request to the transfered person. The phone of the transfered is then @@ -1116,12 +1126,13 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_transfer_call(L * @param[in] dest A running call whose remote person will receive the transfer * @return 0 on success, -1 on failure * @ingroup call_control - * @deprecated Use linphone_call_transfer_to_another() instead + * @deprecated Use #linphone_call_transfer_to_another() instead. Deprecated since 2017-02-13. **/ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_transfer_call_to_another(LinphoneCore *lc, LinphoneCall *call, LinphoneCall *dest); /** - * Start a new call as a consequence of a transfer request received from a call. + * @brief Start a new call as a consequence of a transfer request received from a call. + * * This function is for advanced usage: the execution of transfers is automatically managed by the LinphoneCore. However if an application * wants to have control over the call parameters for the new call, it should call this function immediately during the LinphoneCallRefered notification. * @see LinphoneCoreVTable::call_state_changed @@ -1136,7 +1147,8 @@ LINPHONE_PUBLIC LinphoneCall * linphone_core_start_refered_call(LinphoneCore *lc #define linphone_core_inc_invite_pending(lc) linphone_core_is_incoming_invite_pending(lc) /** - * Tells whether there is an incoming invite pending. + * @brief Tells whether there is an incoming invite pending. + * * @ingroup call_control * @param[in] lc LinphoneCore object * @return A boolean telling whether an incoming invite is pending or not. @@ -1160,7 +1172,7 @@ LINPHONE_PUBLIC bool_t linphone_core_in_call(const LinphoneCore *lc); LINPHONE_PUBLIC LinphoneCall *linphone_core_get_current_call(const LinphoneCore *lc); /** - * Accept an incoming call. + * @brief Accept an incoming call. * * Basically the application is notified of incoming calls within the * call_state_changed callback of the #LinphoneCoreVTable structure, where it will receive @@ -1170,12 +1182,12 @@ LINPHONE_PUBLIC LinphoneCall *linphone_core_get_current_call(const LinphoneCore * @param[in] call The LinphoneCall object representing the call to be answered * @return 0 on success, -1 on failure * @ingroup call_control - * @deprecated Use linphone_call_accept() instead + * @deprecated Use #linphone_call_accept() instead. Deprecated since 2017-02-13. **/ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_accept_call(LinphoneCore *lc, LinphoneCall *call); /** - * Accept an incoming call, with parameters. + * @brief Accept an incoming call, with parameters. * * Basically the application is notified of incoming calls within the * call_state_changed callback of the #LinphoneCoreVTable structure, where it will receive @@ -1187,12 +1199,13 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_accept_call(Lin * @param[in] params The specific parameters for this call, for example whether video is accepted or not. Use NULL to use default parameters * @return 0 on success, -1 on failure * @ingroup call_control - * @deprecated Use linphone_call_accept_with_params() instead + * @deprecated Use #linphone_call_accept_with_params() instead. Deprecated since 2017-02-13. **/ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_accept_call_with_params(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params); /** - * When receiving an incoming, accept to start a media session as early-media. + * @brief When receiving an incoming, accept to start a media session as early-media. + * * This means the call is not accepted but audio & video streams can be established if the remote party supports early media. * However, unlike after call acceptance, mic and camera input are not sent during early-media, though received audio & video are played normally. * The call can then later be fully accepted using linphone_core_accept_call() or linphone_core_accept_call_with_params(). @@ -1201,29 +1214,31 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_accept_call_wit * @param[in] params The call parameters to use (can be NULL) * @return 0 if successful, -1 otherwise * @ingroup call_control - * @deprecated Use linphone_call_accept_early_media_with_params() instead + * @deprecated Use linphone_call_accept_early_media_with_params() instead. **/ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_accept_early_media_with_params(LinphoneCore* lc, LinphoneCall* call, const LinphoneCallParams* params); /** - * Accept an early media session for an incoming call. + * @brief Accept an early media session for an incoming call. + * * This is identical as calling linphone_core_accept_early_media_with_params() with NULL call parameters. * @param[in] lc LinphoneCore object * @param[in] call The incoming call to accept * @return 0 if successful, -1 otherwise * @ingroup call_control * @see linphone_core_accept_early_media_with_params() - * @deprecated Use linphone_call_accept_early_media() instead + * @deprecated Use #linphone_call_accept_early_media() instead. Deprecated since 2017-02-13. **/ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_accept_early_media(LinphoneCore* lc, LinphoneCall* call); /** - * Terminates a call. + * @brief Terminates a call. + * * @param[in] lc LinphoneCore object * @param[in] call The LinphoneCall object representing the call to be terminated * @return 0 on success, -1 on failure * @ingroup call_control - * @deprecated Use linphone_call_terminate() instead + * @deprecated Use #linphone_call_terminate() instead. Deprecated since 2017-02-13. **/ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_terminate_call(LinphoneCore *lc, LinphoneCall *call); @@ -1234,18 +1249,18 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_terminate_call( * @param[in] redirect_uri The URI to redirect the call to * @return 0 if successful, -1 on error. * @ingroup call_control - * @deprecated Use linphone_call_redirect() instead + * @deprecated Use #linphone_call_redirect() instead. Deprecated since 2017-02-13. */ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_redirect_call(LinphoneCore *lc, LinphoneCall *call, const char *redirect_uri); /** - * Decline a pending incoming call, with a reason. - * @param[in] lc LinphoneCore object - * @param[in] call The LinphoneCall to decline, must be in the IncomingReceived state - * @param[in] reason The reason for rejecting the call: LinphoneReasonDeclined or LinphoneReasonBusy + * @brief Decline a pending incoming call, with a reason. + * @param[in] lc #LinphoneCore object + * @param[in] call The #LinphoneCall to decline, must be in the IncomingReceived state + * @param[in] reason The reason for rejecting the call: #LinphoneReasonDeclined or #LinphoneReasonBusy * @return 0 on success, -1 on failure * @ingroup call_control - * @deprecated Use linphone_call_decline() instead + * @deprecated Use #linphone_call_decline() instead. Deprecated since 2017-02-13. **/ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_decline_call(LinphoneCore *lc, LinphoneCall * call, LinphoneReason reason); @@ -1258,15 +1273,16 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_decline_call(Li LINPHONE_PUBLIC LinphoneStatus linphone_core_terminate_all_calls(LinphoneCore *lc); /** - * Pauses the call. If a music file has been setup using linphone_core_set_play_file(), + * @biref Pauses the call. If a music file has been setup using linphone_core_set_play_file(), * this file will be played to the remote user. + * * The only way to resume a paused call is to call linphone_core_resume_call(). * @param[in] lc LinphoneCore object * @param[in] call The call to pause * @return 0 on success, -1 on failure * @ingroup call_control * @see linphone_core_resume_call() - * @deprecated Use linphone_call_pause() instead + * @deprecated Use #linphone_call_pause() instead. Deprecated since 2017-02-13. **/ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_pause_call(LinphoneCore *lc, LinphoneCall *call); @@ -1279,19 +1295,21 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_pause_call(Linp LINPHONE_PUBLIC LinphoneStatus linphone_core_pause_all_calls(LinphoneCore *lc); /** - * Resumes a call. + * @brief Resumes a call. + * * The call needs to have been paused previously with linphone_core_pause_call(). * @param[in] lc LinphoneCore object * @param[in] call The call to resume * @return 0 on success, -1 on failure * @ingroup call_control * @see linphone_core_pause_call() - * @deprecated Use linphone_call_resume() instead + * @deprecated Use #linphone_call_resume() instead. Deprecated since 2017-02-13. **/ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_resume_call(LinphoneCore *lc, LinphoneCall *call); /** - * Updates a running call according to supplied call parameters or parameters changed in the LinphoneCore. + * @brief Updates a running call according to supplied call parameters or parameters changed in the LinphoneCore. + * * In this version this is limited to the following use cases: * - setting up/down the video stream according to the video parameter of the LinphoneCallParams (see linphone_call_params_enable_video() ). * - changing the size of the transmitted video after calling linphone_core_set_preferred_video_size() @@ -1304,7 +1322,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_resume_call(Lin * @param[in] params The new call parameters to use (may be NULL) * @return 0 if successful, -1 otherwise. * @ingroup call_control - * @deprecated Use linphone_call_update() instead + * @deprecated Use #linphone_call_update() instead. Deprecated since 2017-02-13. **/ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params); @@ -1333,7 +1351,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_update_call(Lin LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_defer_call_update(LinphoneCore *lc, LinphoneCall *call); /** - * Accept call modifications initiated by other end. + * @brief Accept call modifications initiated by other end. * * This call may be performed in response to a #LinphoneCallUpdatedByRemote state notification. * When such notification arrives, the application can decide to call linphone_core_defer_update_call() so that it can @@ -1350,7 +1368,7 @@ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_defer_call_upda * @param[in] params A LinphoneCallParams object describing the call parameters to accept * @return 0 if successful, -1 otherwise (actually when this function call is performed outside ot #LinphoneCallUpdatedByRemote state) * @ingroup call_control - * @deprecated Use linphone_call_accept_update() instead + * @deprecated Use #linphone_call_accept_update() instead. Deprecated since 2017-02-13. **/ LINPHONE_PUBLIC LINPHONE_DEPRECATED LinphoneStatus linphone_core_accept_call_update(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params); @@ -1386,13 +1404,13 @@ LINPHONE_PUBLIC LinphoneCall *linphone_core_get_call_by_remote_address2(const Li /** - * Send the specified dtmf. + * @brief Send the specified dtmf. * - * @ingroup media_parameters - * @deprecated Use #linphone_call_send_dtmf instead. * This function only works during calls. The dtmf is automatically played to the user. * @param lc The LinphoneCore object * @param dtmf The dtmf name specified as a char, such as '0', '#' etc... + * @deprecated Use #linphone_call_send_dtmf instead. Deprecated since 2015-11-23. + * @ingroup media_parameters * @donotwrap **/ LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_send_dtmf(LinphoneCore *lc, char dtmf); From 660eba2209e00a117205892c00167745c25614ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Wed, 4 Apr 2018 15:34:05 +0200 Subject: [PATCH 047/121] Documentation: adds "iOS portability page" --- coreapi/help/doc/sphinx/CMakeLists.txt | 1 + coreapi/help/doc/sphinx/index.rst | 1 + coreapi/help/doc/sphinx/ios_portability.rst | 285 ++++++++++++++++++++ 3 files changed, 287 insertions(+) create mode 100644 coreapi/help/doc/sphinx/ios_portability.rst diff --git a/coreapi/help/doc/sphinx/CMakeLists.txt b/coreapi/help/doc/sphinx/CMakeLists.txt index 78727b5d5..830bcd284 100644 --- a/coreapi/help/doc/sphinx/CMakeLists.txt +++ b/coreapi/help/doc/sphinx/CMakeLists.txt @@ -49,6 +49,7 @@ if (ENABLE_SPHINX_DOC) event_api.rst index.rst initializing.rst + ios_portability.rst linphone_address.rst logo.png media_parameters.rst diff --git a/coreapi/help/doc/sphinx/index.rst b/coreapi/help/doc/sphinx/index.rst index 2ae1a83e8..24fa3502f 100644 --- a/coreapi/help/doc/sphinx/index.rst +++ b/coreapi/help/doc/sphinx/index.rst @@ -46,6 +46,7 @@ Beginners' guides conferencing event_api misc + ios_portability Code samples diff --git a/coreapi/help/doc/sphinx/ios_portability.rst b/coreapi/help/doc/sphinx/ios_portability.rst new file mode 100644 index 000000000..84d8160d9 --- /dev/null +++ b/coreapi/help/doc/sphinx/ios_portability.rst @@ -0,0 +1,285 @@ +iOS portability +=============== +Multitasking +------------ + +Liblinphone for IOS natively supports multitasking assuming application follows multitasking guides provided by Apple. + +First step is to declare application as multitasked. It means adding background mode for both audio and voip to Info.plist file. + +.. code-block:: xml + + UIBackgroundModes + + voip + audio + + + +SIP socket +^^^^^^^^^^ + +Recommended mode is SIP over TCP, because UDP usually requires frequent keep alives for maintaining NAT association at the IP router level. This can +be as frequent as one UDP packet every 15 seconds to maintain the NAT association accross NAT routers. Doing such drains the battery very fast, and +furthermore the iOS keep-alive designed by Apple to handle this task can only be called with a minimum of 10 minutes interval. + +For TCP, liblinphone automatically configures SIP socket for voip (I.E kCFStreamNetworkServiceType set to kCFStreamNetworkServiceTypeVoIP). + +.. note:: + + Since IOS > 4.1 Apple disabled voip mode for UDP sockets. + + +Entering background mode +^^^^^^^^^^^^^^^^^^^^^^^^ + +Before entering in background mode (through ``- (void)applicationDidEnterBackground:(UIApplication *)application``), the application must first refresh +sip registration using function :cpp:func:`linphone_core_refresh_registers` and register a keep-alive handler for periodically refreshing the registration. +The speudo code below shows how to register a keep alive handler: + +.. code-block:: objective-c + + //First refresh registration + linphone_core_refresh_registers(theLinphoneCore); + //wait for registration answer + int i=0; + while (!linphone_proxy_config_is_registered(proxyCfg) && i++<40 ) { + linphone_core_iterate(theLinphoneCore); + usleep(100000); + } + //register keepalive handler + [[UIApplication sharedApplication] setKeepAliveTimeout:600/*minimal interval is 600 s*/ + handler:^{ + //refresh sip registration + linphone_core_refresh_registers(theLinphoneCore); + //make sure sip REGISTER is sent + linphone_core_iterate(theLinphoneCore); + }]; + + +Incoming call notification while in background mode +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Assuming application using liblinphone is well configured for multitasking, incoming calls arriving while liblinphone is in background mode will simply wakeup +liblinphone thread but not resume GUI. To wakeup GUI, it is recommended to send a Local Notification to the user from the #LinphoneCoreCallStateChangedCb. Here +under a speudo code for this operation: + +.. code-block:: objective-c + + if ([UIApplication sharedApplication].applicationState != UIApplicationStateActive) { + // Create a new notification + UILocalNotification* notif = [[[UILocalNotification alloc] init] autorelease]; + if (notif) { + notif.repeatInterval = 0; + notif.alertBody =@"New incoming call"; + notif.alertAction = @"Answer"; + notif.soundName = @"oldphone-mono-30s.caf"; + + [[UIApplication sharedApplication] presentLocalNotificationNow:notif]; + } + + +Networking +---------- +WWAN connection +^^^^^^^^^^^^^^^ + +Liblinphone relies on iOS's standard BSD socket layer for sip/rtp networking. On IOS, WWAN connection is supposed to automatically bring up on any networking +resquest issued by an application. At least on iPhone OS 3.x, BSD sockets do not implement this behavior. So it is recomended to add a special code to make sure +the WWAN connection is properly setup. Pseudo code below describes a way to force WWAN connection by setting up a dummy TCP connection. + +.. code-block:: objective-c + + /*start a new thread to avoid blocking the main ui in case of peer host failure*/ + [NSThread detachNewThreadSelector:@selector(runNetworkConnection) toTarget:self withObject:nil]; + -(void) runNetworkConnection { + CFWriteStreamRef writeStream; + //create a dummy socket + CFStreamCreatePairWithSocketToHost(NULL, (CFStringRef)@"192.168.0.200", 15000, nil, &writeStream); + CFWriteStreamOpen (writeStream); + const char* buff="hello"; + //try to write on this socket + CFWriteStreamWrite (writeStream,(const UInt8*)buff,strlen(buff)); + CFWriteStreamClose (writeStream); + } + +It is recommanded to perform this task each time the application is woken up, including keep alive handler. + + +Managing IP connection state +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Liblinphone for IOS relies on the application to be informed of network connectivity changes. Network state changes when the IP connection moves from DOWN to UP, +or from WIFI to WWAN. Applications using liblinphone must inform libliblinphone of this changes using function :cpp:func:`linphone_core_set_network_reachable`. +Usually this method is called from the IOS NetworkReachability callback. Here under a sample code: + +.. code-block:: c + + //typical reachability callback + void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void * info) { + if ((flags == 0) | (flags & (kSCNetworkReachabilityFlagsConnectionRequired |kSCNetworkReachabilityFlagsConnectionOnTraffic))) { + //network state is off + linphone_core_set_network_reachable(lc,false); + ((LinphoneManager*)info).connectivity = none; + } else { + Connectivity newConnectivity = flags & kSCNetworkReachabilityFlagsIsWWAN ? wwan:wifi; + if (lLinphoneMgr.connectivity == none) { + //notify new network state + linphone_core_set_network_reachable(lc,true); + } else if (lLinphoneMgr.connectivity != newConnectivity) { + // connectivity has changed + linphone_core_set_network_reachable(lc,false); + linphone_core_set_network_reachable(lc,true); + } + //store new connectivity status + lLinphoneMgr.connectivity=newConnectivity; + } + } + + +Sound cards +----------- + +Since IOS 5.0, liblinphone supports 2 sound cards. *AU: Audio Unit Receiver* based on IO units for voice calls plus *AQ: Audio Queue Device* dedicated to rings. +Here under the recommended settings (I.E default one) + +.. code-block:: c + + linphone_core_set_playback_device(lc, "AU: Audio Unit Receiver"); + linphone_core_set_ringer_device(lc, "AQ: Audio Queue Device"); + linphone_core_set_capture_device(lc, "AU: Audio Unit Receiver"); + + +GSM call interaction +-------------------- + +To ensure gentle interaction with GSM calls, it is recommended to register an AudioSession delegate. This allows the application to be notified when its audio +session is interrupted/resumed (presumably by a GSM call). + +.. code-block:: objective-c + + // declare a class handling the AVAudioSessionDelegate protocol + @interface MyClass : NSObject { [...] } + // implement 2 methods : here's an example implementation + -(void) beginInterruption { + LinphoneCall* c = linphone_core_get_current_call(theLinphoneCore); + ms_message("Sound interruption detected!"); + if (c) { + linphone_core_pause_call(theLinphoneCore, c); + } + } + + -(void) endInterruption { + ms_message("Sound interruption ended!"); + const MSList* c = linphone_core_get_calls(theLinphoneCore); + + if (c) { + ms_message("Auto resuming call"); + linphone_core_resume_call(theLinphoneCore, (LinphoneCall*) c->data); + } + } + +.. seealso:: http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVAudioSessionDelegate_ProtocolReference/Reference/Reference.html + +Declare an instance of your class as AudioSession's delegate : + +.. code-block:: objective-c + + [audioSession setDelegate:myClassInstance]; + +.. seealso:: http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVAudioSession_ClassReference/Reference/Reference.html + + +Video +----- + +Since 3.5 video support has been added to liblinphone for IOS. It requires the application to provide liblinphone with pointers to IOS's views hosting video +display and video previous. These two UIView objects must be passed to the core using functions :cpp:func:`linphone_core_set_native_video_window_id` and +:cpp:func:`linphone_core_set_native_preview_window_id`. Here under pseudo code: + +.. code-block:: objective-c + + UIView* display = [[UIView alloc] init]; + UIView* preview = [[UIView alloc] init]; + linphone_core_set_native_video_window_id(lc,(unsigned long)display); + linphone_core_set_native_preview_window_id(lc,(unsigned long)preview); + +Screen rotations are also handled by liblinphone. Two positions are currently supported, namely *UIInterfaceOrientationPortrait* and *UIInterfaceOrientationLandscapeRight*. +Applications may invoke :cpp:func:`linphone_core_set_device_rotation` followed by :cpp:func:`linphone_core_update_call` to notify liblinphone of an orientation +change. Here under a speudo code to handle orientation changes + +.. code-block:: c + + -(void) configureOrientation:(UIInterfaceOrientation) oritentation { + int oldLinphoneOrientation = linphone_core_get_device_rotation(lc); + if (oritentation == UIInterfaceOrientationPortrait ) { + linphone_core_set_native_video_window_id(lc,(unsigned long)display-portrait); + linphone_core_set_native_preview_window_id(lc,(unsigned long)preview-portrait); + linphone_core_set_device_rotation(lc, 0); + + } else if (oritentation == UIInterfaceOrientationLandscapeRight ) { + linphone_core_set_native_video_window_id(lc,(unsigned long)display-landscape); + linphone_core_set_native_preview_window_id(lc,(unsigned long)preview-landscape); + linphone_core_set_device_rotation(lc, 270); + } + + if ((oldLinphoneOrientation != linphone_core_get_device_rotation(lc)) + && linphone_core_get_current_call(lc)) { + //Orientation has changed, must call update call + linphone_core_update_call(lc, linphone_core_get_current_call(lc), NULL); + } + } + + +DTMF feedbacks +-------------- + +Liblinphone provides functions :cpp:func:`to play dtmf ` to the local user. Usually this is used to play a sound when the user +presses a digit, inside or outside of any call. On IOS, libLinphone relies on AudioUnits for interfacing with the audio system. Unfortunately the Audio Unit +initialization is a quite long operation that may trigger a bad user experience if performed each time a DTMF is played, the sound being delayed half a +second after the press. To solve this issue and thus insure real-time precision, liblinphone introduces two functions for :cpp:func:`preloading ` +and :cpp:func:`unloading ` the underlying audio graph responsible for playing DTMFs. + +For an application using function :cpp:func:`linphone_core_play_dtmf`, it is recommanded to call :cpp:func:`linphone_core_start_dtmf_stream` when entering +in foreground and #linphone_core_stop_dtmf_stream() upon entering background mode. + + +Plugins +------- + +On iOS, plugins are built as static libraries so Liblinphone will not be able to load them at runtime dynamically. Instead, you should declare their prototypes: + +.. code-block:: c + + extern void libmsamr_init(MSFactory *factory); + extern void libmsx264_init(MSFactory *factory); + extern void libmsopenh264_init(MSFactory *factory); + extern void libmssilk_init(MSFactory *factory); + extern void libmsbcg729_init(MSFactory *factory); + extern void libmswebrtc_init(MSFactory *factory); + + +Then you should register them after the instantiation of :cpp:type:`LinphoneCore`: + +.. code-block:: c + + theLinphoneCore = linphone_core_new_with_config(/* options ... */); + + // Load plugins if available in the linphone SDK - otherwise these calls will do nothing + MSFactory *f = linphone_core_get_ms_factory(theLinphoneCore); + libmssilk_init(f); + libmsamr_init(f); + libmsx264_init(f); + libmsopenh264_init(f); + libmsbcg729_init(f); + libmswebrtc_init(f); + linphone_core_reload_ms_plugins(theLinphoneCore, NULL); + + +If the plugin has not been enabled at compilation time, a stubbed library will be generated with only libplugin_init method declared, doing nothing. You should +see these trace in logs, if plugin is stubbed: + +.. code-block:: none + + I/lib/Could not find encoder for SILK + I/lib/Could not find decoder for SILK From f6f3557d88aafa74190d2a3c2b5d0a225c2440fe Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 4 Apr 2018 15:42:31 +0200 Subject: [PATCH 048/121] Fixed an issue in CPIM tester --- tester/cpim-tester.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tester/cpim-tester.cpp b/tester/cpim-tester.cpp index 74eb70524..66cc661d8 100644 --- a/tester/cpim-tester.cpp +++ b/tester/cpim-tester.cpp @@ -428,7 +428,7 @@ static void cpim_chat_message_modifier_base(bool_t use_multipart) { marieMessage->send(); BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneMessageReceived,1)); - BC_ASSERT_STRING_EQUAL(marieMessage->getInternalContent().getContentType().asString().c_str(), ""); // Internal content is cleaned after message is sent or received + BC_ASSERT_TRUE(marieMessage->getInternalContent().getContentType().isEmpty()); // Internal content is cleaned after message is sent or received BC_ASSERT_PTR_NOT_NULL(pauline->stat.last_received_chat_message); if (pauline->stat.last_received_chat_message != NULL) { From 797d7e3f64e88c2562c2134dde0df85aa5339ae8 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 4 Apr 2018 15:51:47 +0200 Subject: [PATCH 049/121] Fixed another CPIM issue --- src/chat/cpim/message/cpim-message.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/chat/cpim/message/cpim-message.cpp b/src/chat/cpim/message/cpim-message.cpp index 84753f4ef..123ef6c66 100644 --- a/src/chat/cpim/message/cpim-message.cpp +++ b/src/chat/cpim/message/cpim-message.cpp @@ -149,9 +149,11 @@ string Cpim::Message::asString () const { string output; // TODO: Remove cpimHeaders - for (const auto &cpimHeader : *d->cpimHeaders) - output += cpimHeader->asString(); - output += "\r\n"; + if (d->cpimHeaders->size() > 0) { + for (const auto &cpimHeader : *d->cpimHeaders) + output += cpimHeader->asString(); + output += "\r\n"; + } // TODO Remove cpimHeaders if (d->messageHeaders->size() > 0) { From 3761d1a5d90bdaa2e0bd5bca3e763badedfa9c99 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 4 Apr 2018 16:52:51 +0200 Subject: [PATCH 050/121] Fixed compil --- coreapi/logging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/logging.c b/coreapi/logging.c index e39ae0012..8a87b8264 100644 --- a/coreapi/logging.c +++ b/coreapi/logging.c @@ -196,7 +196,7 @@ void linphone_logging_service_set_log_level(LinphoneLoggingService *log_service, void linphone_logging_service_set_log_level_mask(LinphoneLoggingService *log_service, unsigned int mask) { const char **domain; for (domain=_linphone_logging_service_log_domains; *domain; domain++) { - bctbx_set_log_level_mask(*domain, _linphone_log_mask_to_bctbx_log_mask(mask)); + bctbx_set_log_level_mask(*domain, (int)_linphone_log_mask_to_bctbx_log_mask(mask)); } } From 3739f576e8a71b622f1ce3aa5c7cedf9ba07446a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Wed, 4 Apr 2018 16:56:42 +0200 Subject: [PATCH 051/121] Fixes the docstring of a function. --- include/linphone/proxy_config.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linphone/proxy_config.h b/include/linphone/proxy_config.h index 127b4b0d4..7214b5aa0 100644 --- a/include/linphone/proxy_config.h +++ b/include/linphone/proxy_config.h @@ -143,11 +143,11 @@ LINPHONE_PUBLIC void linphone_proxy_config_edit(LinphoneProxyConfig *cfg); LINPHONE_PUBLIC LinphoneStatus linphone_proxy_config_done(LinphoneProxyConfig *cfg); /** - * Indicates either or not, PUBLISH must be issued for this #LinphoneProxyConfig . - *
In case this #LinphoneProxyConfig has been added to #LinphoneCore, follows the linphone_proxy_config_edit() rule. - * @param[in] cfg #LinphoneProxyConfig object. - * @param val if true, publish will be engaged + * @brief Indicates either or not, PUBLISH must be issued for this #LinphoneProxyConfig. * + * In case this #LinphoneProxyConfig has been added to #LinphoneCore, follows the #linphone_proxy_config_edit() rule. + * @param[in] cfg #LinphoneProxyConfig object. + * @param val if TRUE, publish will be engaged */ LINPHONE_PUBLIC void linphone_proxy_config_enable_publish(LinphoneProxyConfig *cfg, bool_t val); From 7cea4d435eac511a3856f61041e4758bdf47b162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Wed, 4 Apr 2018 17:19:43 +0200 Subject: [PATCH 052/121] Adds a TOC virtual document --- coreapi/help/doc/sphinx/CMakeLists.txt | 1 + coreapi/help/doc/sphinx/conf.py.in | 2 +- coreapi/help/doc/sphinx/toc.rst | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 coreapi/help/doc/sphinx/toc.rst diff --git a/coreapi/help/doc/sphinx/CMakeLists.txt b/coreapi/help/doc/sphinx/CMakeLists.txt index 830bcd284..ba42f25b5 100644 --- a/coreapi/help/doc/sphinx/CMakeLists.txt +++ b/coreapi/help/doc/sphinx/CMakeLists.txt @@ -56,6 +56,7 @@ if (ENABLE_SPHINX_DOC) misc.rst network_parameters.rst proxies.rst + toc.rst ) configure_file(conf.py.in source/conf.py) foreach(file ${STATIC_DOCUMENTATION_FILES}) diff --git a/coreapi/help/doc/sphinx/conf.py.in b/coreapi/help/doc/sphinx/conf.py.in index c94d86760..492fd8e43 100644 --- a/coreapi/help/doc/sphinx/conf.py.in +++ b/coreapi/help/doc/sphinx/conf.py.in @@ -43,7 +43,7 @@ templates_path = ['_templates'] source_suffix = '.rst' # The master toctree document. -master_doc = 'index' +master_doc = 'toc' # General information about the project. project = 'Linphone Core API' diff --git a/coreapi/help/doc/sphinx/toc.rst b/coreapi/help/doc/sphinx/toc.rst new file mode 100644 index 000000000..c775b0af9 --- /dev/null +++ b/coreapi/help/doc/sphinx/toc.rst @@ -0,0 +1,3 @@ +.. toctree:: + + index From c2805aebdc58795ca599755627789f59a4ce60aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Thu, 5 Apr 2018 11:31:44 +0200 Subject: [PATCH 053/121] [doc] Gathers all guiding page inside a directory --- coreapi/help/doc/sphinx/CMakeLists.txt | 33 ++++++++++--------- .../sphinx/{ => guides}/authentication.rst | 0 .../doc/sphinx/{ => guides}/buddy_list.rst | 0 .../doc/sphinx/{ => guides}/call_control.rst | 0 .../doc/sphinx/{ => guides}/call_logs.rst | 0 .../doc/sphinx/{ => guides}/call_misc.rst | 0 .../help/doc/sphinx/{ => guides}/chatroom.rst | 0 .../doc/sphinx/{ => guides}/conferencing.rst | 0 .../doc/sphinx/{ => guides}/event_api.rst | 0 .../doc/sphinx/{ => guides}/initializing.rst | 0 .../sphinx/{ => guides}/ios_portability.rst | 0 .../sphinx/{ => guides}/linphone_address.rst | 0 .../sphinx/{ => guides}/media_parameters.rst | 0 coreapi/help/doc/sphinx/{ => guides}/misc.rst | 0 .../{ => guides}/network_parameters.rst | 0 .../help/doc/sphinx/{ => guides}/proxies.rst | 0 coreapi/help/doc/sphinx/index.rst | 30 ++++++++--------- 17 files changed, 32 insertions(+), 31 deletions(-) rename coreapi/help/doc/sphinx/{ => guides}/authentication.rst (100%) rename coreapi/help/doc/sphinx/{ => guides}/buddy_list.rst (100%) rename coreapi/help/doc/sphinx/{ => guides}/call_control.rst (100%) rename coreapi/help/doc/sphinx/{ => guides}/call_logs.rst (100%) rename coreapi/help/doc/sphinx/{ => guides}/call_misc.rst (100%) rename coreapi/help/doc/sphinx/{ => guides}/chatroom.rst (100%) rename coreapi/help/doc/sphinx/{ => guides}/conferencing.rst (100%) rename coreapi/help/doc/sphinx/{ => guides}/event_api.rst (100%) rename coreapi/help/doc/sphinx/{ => guides}/initializing.rst (100%) rename coreapi/help/doc/sphinx/{ => guides}/ios_portability.rst (100%) rename coreapi/help/doc/sphinx/{ => guides}/linphone_address.rst (100%) rename coreapi/help/doc/sphinx/{ => guides}/media_parameters.rst (100%) rename coreapi/help/doc/sphinx/{ => guides}/misc.rst (100%) rename coreapi/help/doc/sphinx/{ => guides}/network_parameters.rst (100%) rename coreapi/help/doc/sphinx/{ => guides}/proxies.rst (100%) diff --git a/coreapi/help/doc/sphinx/CMakeLists.txt b/coreapi/help/doc/sphinx/CMakeLists.txt index ba42f25b5..df0cee4e7 100644 --- a/coreapi/help/doc/sphinx/CMakeLists.txt +++ b/coreapi/help/doc/sphinx/CMakeLists.txt @@ -39,28 +39,29 @@ if (ENABLE_SPHINX_DOC) enum_page.mustache index_page.mustache ) - set(STATIC_DOCUMENTATION_FILES authentication.rst - buddy_list.rst - call_control.rst - call_logs.rst - call_misc.rst - chatroom.rst - conferencing.rst - event_api.rst + set(STATIC_DOCUMENTATION_FILES + guides/authentication.rst + guides/buddy_list.rst + guides/call_control.rst + guides/call_logs.rst + guides/call_misc.rst + guides/chatroom.rst + guides/conferencing.rst + guides/event_api.rst + guides/initializing.rst + guides/ios_portability.rst + guides/linphone_address.rst + guides/media_parameters.rst + guides/misc.rst + guides/network_parameters.rst + guides/proxies.rst index.rst - initializing.rst - ios_portability.rst - linphone_address.rst logo.png - media_parameters.rst - misc.rst - network_parameters.rst - proxies.rst toc.rst ) configure_file(conf.py.in source/conf.py) foreach(file ${STATIC_DOCUMENTATION_FILES}) - configure_file(${file} source/${files} COPYONLY) + configure_file(${file} source/${file} COPYONLY) endforeach(file) add_custom_target(sphinx-doc ALL ${PYTHON_EXECUTABLE} '${CMAKE_CURRENT_SOURCE_DIR}/gendoc.py' '${LINPHONE_DOXYGEN_XML_DIR}' -o 'source' COMMAND ${PYTHON_EXECUTABLE} -msphinx -M html 'source' 'build' diff --git a/coreapi/help/doc/sphinx/authentication.rst b/coreapi/help/doc/sphinx/guides/authentication.rst similarity index 100% rename from coreapi/help/doc/sphinx/authentication.rst rename to coreapi/help/doc/sphinx/guides/authentication.rst diff --git a/coreapi/help/doc/sphinx/buddy_list.rst b/coreapi/help/doc/sphinx/guides/buddy_list.rst similarity index 100% rename from coreapi/help/doc/sphinx/buddy_list.rst rename to coreapi/help/doc/sphinx/guides/buddy_list.rst diff --git a/coreapi/help/doc/sphinx/call_control.rst b/coreapi/help/doc/sphinx/guides/call_control.rst similarity index 100% rename from coreapi/help/doc/sphinx/call_control.rst rename to coreapi/help/doc/sphinx/guides/call_control.rst diff --git a/coreapi/help/doc/sphinx/call_logs.rst b/coreapi/help/doc/sphinx/guides/call_logs.rst similarity index 100% rename from coreapi/help/doc/sphinx/call_logs.rst rename to coreapi/help/doc/sphinx/guides/call_logs.rst diff --git a/coreapi/help/doc/sphinx/call_misc.rst b/coreapi/help/doc/sphinx/guides/call_misc.rst similarity index 100% rename from coreapi/help/doc/sphinx/call_misc.rst rename to coreapi/help/doc/sphinx/guides/call_misc.rst diff --git a/coreapi/help/doc/sphinx/chatroom.rst b/coreapi/help/doc/sphinx/guides/chatroom.rst similarity index 100% rename from coreapi/help/doc/sphinx/chatroom.rst rename to coreapi/help/doc/sphinx/guides/chatroom.rst diff --git a/coreapi/help/doc/sphinx/conferencing.rst b/coreapi/help/doc/sphinx/guides/conferencing.rst similarity index 100% rename from coreapi/help/doc/sphinx/conferencing.rst rename to coreapi/help/doc/sphinx/guides/conferencing.rst diff --git a/coreapi/help/doc/sphinx/event_api.rst b/coreapi/help/doc/sphinx/guides/event_api.rst similarity index 100% rename from coreapi/help/doc/sphinx/event_api.rst rename to coreapi/help/doc/sphinx/guides/event_api.rst diff --git a/coreapi/help/doc/sphinx/initializing.rst b/coreapi/help/doc/sphinx/guides/initializing.rst similarity index 100% rename from coreapi/help/doc/sphinx/initializing.rst rename to coreapi/help/doc/sphinx/guides/initializing.rst diff --git a/coreapi/help/doc/sphinx/ios_portability.rst b/coreapi/help/doc/sphinx/guides/ios_portability.rst similarity index 100% rename from coreapi/help/doc/sphinx/ios_portability.rst rename to coreapi/help/doc/sphinx/guides/ios_portability.rst diff --git a/coreapi/help/doc/sphinx/linphone_address.rst b/coreapi/help/doc/sphinx/guides/linphone_address.rst similarity index 100% rename from coreapi/help/doc/sphinx/linphone_address.rst rename to coreapi/help/doc/sphinx/guides/linphone_address.rst diff --git a/coreapi/help/doc/sphinx/media_parameters.rst b/coreapi/help/doc/sphinx/guides/media_parameters.rst similarity index 100% rename from coreapi/help/doc/sphinx/media_parameters.rst rename to coreapi/help/doc/sphinx/guides/media_parameters.rst diff --git a/coreapi/help/doc/sphinx/misc.rst b/coreapi/help/doc/sphinx/guides/misc.rst similarity index 100% rename from coreapi/help/doc/sphinx/misc.rst rename to coreapi/help/doc/sphinx/guides/misc.rst diff --git a/coreapi/help/doc/sphinx/network_parameters.rst b/coreapi/help/doc/sphinx/guides/network_parameters.rst similarity index 100% rename from coreapi/help/doc/sphinx/network_parameters.rst rename to coreapi/help/doc/sphinx/guides/network_parameters.rst diff --git a/coreapi/help/doc/sphinx/proxies.rst b/coreapi/help/doc/sphinx/guides/proxies.rst similarity index 100% rename from coreapi/help/doc/sphinx/proxies.rst rename to coreapi/help/doc/sphinx/guides/proxies.rst diff --git a/coreapi/help/doc/sphinx/index.rst b/coreapi/help/doc/sphinx/index.rst index 24fa3502f..c036cd442 100644 --- a/coreapi/help/doc/sphinx/index.rst +++ b/coreapi/help/doc/sphinx/index.rst @@ -32,21 +32,21 @@ Beginners' guides .. toctree:: :maxdepth: 1 - initializing - call_control - call_misc - media_parameters - proxies - network_parameters - authentication - buddy_list - chatroom - call_logs - linphone_address - conferencing - event_api - misc - ios_portability + guides/initializing + guides/call_control + guides/call_misc + guides/media_parameters + guides/proxies + guides/network_parameters + guides/authentication + guides/buddy_list + guides/chatroom + guides/call_logs + guides/linphone_address + guides/conferencing + guides/event_api + guides/misc + guides/ios_portability Code samples From 2686dca63a47a21ee075d23b5b2179ee6fc2e92f Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 5 Apr 2018 12:08:44 +0200 Subject: [PATCH 054/121] Revert "Merge branch 'dev_content_cpp' into dev_refactor_cpp" This reverts commit d7890dbe7407993e665c3b5868fbb960c758b139, reversing changes made to e6158d8da50eefcbe0625fc32651962871f75313. --- coreapi/CMakeLists.txt | 1 + coreapi/Makefile.am | 1 + coreapi/bellesip_sal/sal_impl.c | 32 -- coreapi/callbacks.c | 3 +- coreapi/content.c | 243 +++++++++++++ coreapi/friendlist.c | 3 +- coreapi/info.c | 1 - coreapi/lime.c | 9 +- coreapi/linphonecore.c | 4 +- coreapi/private_structs.h | 11 + coreapi/proxy.c | 1 - coreapi/quality_reporting.c | 2 - include/CMakeLists.txt | 2 +- include/linphone/Makefile.am | 1 + include/linphone/api/c-api.h | 7 +- include/linphone/api/c-chat-room.h | 2 +- include/linphone/api/c-types.h | 6 - .../linphone/{api/c-content.h => content.h} | 64 ++-- include/linphone/core.h | 1 + include/linphone/types.h | 6 + src/CMakeLists.txt | 6 - src/c-wrapper/api/c-chat-message.cpp | 7 +- src/c-wrapper/api/c-chat-room.cpp | 4 +- src/c-wrapper/api/c-content.cpp | 331 ------------------ src/c-wrapper/c-wrapper.h | 2 +- src/c-wrapper/internal/c-sal.h | 5 - src/chat/chat-message/chat-message-p.h | 8 +- src/chat/chat-message/chat-message.cpp | 77 ++-- src/chat/chat-message/chat-message.h | 6 +- src/chat/chat-room/abstract-chat-room.h | 3 +- src/chat/chat-room/chat-room.cpp | 6 +- src/chat/chat-room/chat-room.h | 3 +- src/chat/chat-room/proxy-chat-room.cpp | 2 +- src/chat/chat-room/proxy-chat-room.h | 3 +- src/chat/cpim/message/cpim-message.cpp | 8 +- .../modifier/cpim-chat-message-modifier.cpp | 2 +- .../file-transfer-chat-message-modifier.cpp | 77 ++-- .../multipart-chat-message-modifier.cpp | 102 ++++-- .../local-conference-event-handler.cpp | 5 +- src/conference/session/call-session.cpp | 7 +- src/content/content-manager.cpp | 101 ++++-- src/content/content-manager.h | 2 +- src/content/content-p.h | 4 +- src/content/content-type.cpp | 76 ++-- src/content/content-type.h | 12 +- src/content/content.cpp | 38 +- src/content/content.h | 11 +- src/content/file-content.cpp | 30 +- src/content/file-content.h | 7 +- src/content/file-transfer-content.cpp | 35 +- src/content/file-transfer-content.h | 11 +- src/content/header/header-p.h | 43 --- src/content/header/header-param.cpp | 108 ------ src/content/header/header-param.h | 61 ---- src/content/header/header.cpp | 183 ---------- src/content/header/header.h | 74 ---- src/db/main-db.cpp | 2 +- src/sal/op.cpp | 8 +- tester/CMakeLists.txt | 2 +- ...-tester.cpp => content-manager-tester.cpp} | 172 +-------- tester/cpim-tester.cpp | 4 +- tester/eventapi_tester.c | 2 +- tester/liblinphone_tester.h | 2 +- tester/message_tester.c | 8 +- tester/multipart-tester.cpp | 27 +- tester/presence_server_tester.c | 9 +- tester/tester.c | 2 +- 67 files changed, 687 insertions(+), 1411 deletions(-) create mode 100644 coreapi/content.c rename include/linphone/{api/c-content.h => content.h} (83%) delete mode 100644 src/c-wrapper/api/c-content.cpp delete mode 100644 src/content/header/header-p.h delete mode 100644 src/content/header/header-param.cpp delete mode 100644 src/content/header/header-param.h delete mode 100644 src/content/header/header.cpp delete mode 100644 src/content/header/header.h rename tester/{contents-tester.cpp => content-manager-tester.cpp} (62%) diff --git a/coreapi/CMakeLists.txt b/coreapi/CMakeLists.txt index 2effcf5ec..85e13205c 100644 --- a/coreapi/CMakeLists.txt +++ b/coreapi/CMakeLists.txt @@ -64,6 +64,7 @@ set(LINPHONE_SOURCE_FILES_C carddav.c chat.c contactprovider.c + content.c dial_plan.c dict.c ec-calibrator.c diff --git a/coreapi/Makefile.am b/coreapi/Makefile.am index c2b2ee53b..4e63d8879 100644 --- a/coreapi/Makefile.am +++ b/coreapi/Makefile.am @@ -39,6 +39,7 @@ liblinphone_la_SOURCES=\ chat_file_transfer.c \ conference.cc conference_private.h \ contactprovider.c contact_providers_priv.h \ + content.c \ dial_plan.c \ dict.c \ ec-calibrator.c \ diff --git a/coreapi/bellesip_sal/sal_impl.c b/coreapi/bellesip_sal/sal_impl.c index bdf3683dd..ad11525fb 100644 --- a/coreapi/bellesip_sal/sal_impl.c +++ b/coreapi/bellesip_sal/sal_impl.c @@ -348,29 +348,6 @@ void sal_body_handler_set_subtype(SalBodyHandler *body_handler, const char *subt belle_sip_header_content_type_set_subtype(content_type, subtype); } -const belle_sip_list_t * sal_body_handler_get_content_type_parameters_names(const SalBodyHandler *body_handler) { - belle_sip_header_content_type_t *content_type = BELLE_SIP_HEADER_CONTENT_TYPE(sal_body_handler_find_header(body_handler, "Content-Type")); - if (content_type != NULL) { - return belle_sip_parameters_get_parameter_names(BELLE_SIP_PARAMETERS(content_type)); - } - return NULL; -} - -const char * sal_body_handler_get_content_type_parameter(const SalBodyHandler *body_handler, const char *name) { - belle_sip_header_content_type_t *content_type = BELLE_SIP_HEADER_CONTENT_TYPE(sal_body_handler_find_header(body_handler, "Content-Type")); - if (content_type != NULL) { - return belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type), name); - } - return NULL; -} - -void sal_body_handler_set_content_type_parameter(SalBodyHandler *body_handler, const char *paramName, const char *paramValue) { - belle_sip_header_content_type_t *content_type = BELLE_SIP_HEADER_CONTENT_TYPE(sal_body_handler_find_header(body_handler, "Content-Type")); - if (content_type != NULL) { - belle_sip_parameters_set_parameter(BELLE_SIP_PARAMETERS(content_type), paramName, paramValue); - } -} - const char * sal_body_handler_get_encoding(const SalBodyHandler *body_handler) { belle_sip_header_t *content_encoding = sal_body_handler_find_header(body_handler, "Content-Encoding"); if (content_encoding != NULL) { @@ -419,11 +396,6 @@ SalBodyHandler * sal_body_handler_get_part(const SalBodyHandler *body_handler, i return (SalBodyHandler *)belle_sip_list_nth_data(l, idx); } -const belle_sip_list_t * sal_body_handler_get_parts(const SalBodyHandler *body_handler) { - if (!sal_body_handler_is_multipart(body_handler)) return NULL; - return belle_sip_multipart_body_handler_get_parts(BELLE_SIP_MULTIPART_BODY_HANDLER(body_handler)); -} - SalBodyHandler * sal_body_handler_find_part_by_header(const SalBodyHandler *body_handler, const char *header_name, const char *header_value) { const belle_sip_list_t *l = belle_sip_multipart_body_handler_get_parts(BELLE_SIP_MULTIPART_BODY_HANDLER(body_handler)); for (; l != NULL; l = l->next) { @@ -446,7 +418,3 @@ const char * sal_body_handler_get_header(const SalBodyHandler *body_handler, con } return NULL; } - -const belle_sip_list_t* sal_body_handler_get_headers(const SalBodyHandler *body_handler) { - return belle_sip_body_handler_get_headers(BELLE_SIP_BODY_HANDLER(body_handler)); -} diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 126cb41d2..da809bc05 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -17,15 +17,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + #include "c-wrapper/internal/c-sal.h" #include "sal/call-op.h" #include "sal/message-op.h" #include "sal/refer-op.h" -#include "linphone/api/c-content.h" #include "linphone/core.h" #include "linphone/utils/utils.h" - #include "private.h" #include "mediastreamer2/mediastream.h" #include "linphone/lpconfig.h" diff --git a/coreapi/content.c b/coreapi/content.c new file mode 100644 index 000000000..8d20964bd --- /dev/null +++ b/coreapi/content.c @@ -0,0 +1,243 @@ +/* +linphone +Copyright (C) 2010-2014 Belledonne Communications SARL + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#include "linphone/core.h" + +#include "c-wrapper/c-wrapper.h" + +// TODO: From coreapi. Remove me later. +#include "private.h" + +static void linphone_content_set_sal_body_handler(LinphoneContent *content, SalBodyHandler *body_handler) { + if (content->body_handler != NULL) { + sal_body_handler_unref(content->body_handler); + content->body_handler = NULL; + } + content->body_handler = sal_body_handler_ref(body_handler); +} + +static LinphoneContent * linphone_content_new_with_body_handler(SalBodyHandler *body_handler) { + LinphoneContent *content = belle_sip_object_new(LinphoneContent); + belle_sip_object_ref(content); + content->owned_fields = TRUE; + content->cryptoContext = NULL; /* this field is managed externally by encryption/decryption functions so be careful to initialise it to NULL */ + if (body_handler == NULL) { + linphone_content_set_sal_body_handler(content, sal_body_handler_new()); + } else { + linphone_content_set_sal_body_handler(content, body_handler); + } + return content; +} + +static void linphone_content_destroy(LinphoneContent *content) { + if (content->owned_fields == TRUE) { + if (content->body_handler) sal_body_handler_unref(content->body_handler); + if (content->name) belle_sip_free(content->name); + if (content->key) belle_sip_free(content->key); + /* note : crypto context is allocated/destroyed by the encryption function */ + } +} + +static void linphone_content_clone(LinphoneContent *obj, const LinphoneContent *ref) { + obj->owned_fields = TRUE; + linphone_content_set_sal_body_handler(obj, sal_body_handler_new()); + if ((linphone_content_get_type(ref) != NULL) || (linphone_content_get_subtype(ref) != NULL)) { + linphone_content_set_type(obj, linphone_content_get_type(ref)); + linphone_content_set_subtype(obj, linphone_content_get_subtype(ref)); + } + if (linphone_content_get_encoding(ref) != NULL) { + linphone_content_set_encoding(obj, linphone_content_get_encoding(ref)); + } + linphone_content_set_name(obj, linphone_content_get_name(ref)); + linphone_content_set_key(obj, linphone_content_get_key(ref), linphone_content_get_key_size(ref)); + if (linphone_content_get_buffer(ref) != NULL) { + linphone_content_set_buffer(obj, linphone_content_get_buffer(ref), linphone_content_get_size(ref)); + } else { + linphone_content_set_size(obj, linphone_content_get_size(ref)); + } +} + + +BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneContent); + +BELLE_SIP_INSTANCIATE_VPTR(LinphoneContent, belle_sip_object_t, + (belle_sip_object_destroy_t)linphone_content_destroy, + (belle_sip_object_clone_t)linphone_content_clone, + NULL, // marshal + TRUE +); + + +LinphoneContent * linphone_core_create_content(LinphoneCore *lc) { + return linphone_content_new(); +} + +LinphoneContent * linphone_content_ref(LinphoneContent *content) { + belle_sip_object_ref(content); + return content; +} + +void linphone_content_unref(LinphoneContent *content) { + belle_sip_object_unref(content); +} + +void *linphone_content_get_user_data(const LinphoneContent *content) { + return content->user_data; +} + +void linphone_content_set_user_data(LinphoneContent *content, void *ud) { + content->user_data = ud; +} + +const char * linphone_content_get_type(const LinphoneContent *content) { + return sal_body_handler_get_type(content->body_handler); +} + +void linphone_content_set_type(LinphoneContent *content, const char *type) { + sal_body_handler_set_type(content->body_handler, type); +} + +const char * linphone_content_get_subtype(const LinphoneContent *content) { + return sal_body_handler_get_subtype(content->body_handler); +} + +void linphone_content_set_subtype(LinphoneContent *content, const char *subtype) { + sal_body_handler_set_subtype(content->body_handler, subtype); +} + +uint8_t * linphone_content_get_buffer(const LinphoneContent *content) { + return (uint8_t *)sal_body_handler_get_data(content->body_handler); +} + +void linphone_content_set_buffer(LinphoneContent *content, const uint8_t *buffer, size_t size) { + void *data; + sal_body_handler_set_size(content->body_handler, size); + data = belle_sip_malloc(size + 1); + memcpy(data, buffer, size); + ((char *)data)[size] = '\0'; + sal_body_handler_set_data(content->body_handler, data); +} + +const char * linphone_content_get_string_buffer(const LinphoneContent *content) { + return (const char *)linphone_content_get_buffer(content); +} + +void linphone_content_set_string_buffer(LinphoneContent *content, const char *buffer) { + sal_body_handler_set_size(content->body_handler, strlen(buffer)); + sal_body_handler_set_data(content->body_handler, belle_sip_strdup(buffer)); +} + +size_t linphone_content_get_size(const LinphoneContent *content) { + return sal_body_handler_get_size(content->body_handler); +} + +void linphone_content_set_size(LinphoneContent *content, size_t size) { + sal_body_handler_set_size(content->body_handler, size); +} + +const char * linphone_content_get_encoding(const LinphoneContent *content) { + return sal_body_handler_get_encoding(content->body_handler); +} + +void linphone_content_set_encoding(LinphoneContent *content, const char *encoding) { + sal_body_handler_set_encoding(content->body_handler, encoding); +} + +const char * linphone_content_get_name(const LinphoneContent *content) { + return content->name; +} + +void linphone_content_set_name(LinphoneContent *content, const char *name) { + if (content->name != NULL) { + belle_sip_free(content->name); + content->name = NULL; + } + if (name != NULL) { + content->name = belle_sip_strdup(name); + } +} + +size_t linphone_content_get_key_size(const LinphoneContent *content) { + return content->keyLength; +} + +const char * linphone_content_get_key(const LinphoneContent *content) { + return content->key; +} + +void linphone_content_set_key(LinphoneContent *content, const char *key, const size_t keyLength) { + if (content->key != NULL) { + belle_sip_free(content->key); + content->key = NULL; + } + if (key != NULL) { + content->key = reinterpret_cast(belle_sip_malloc(keyLength + 1)); + memcpy(content->key, key, keyLength); + content->key[keyLength] = '\0'; + content->keyLength = keyLength; + } +} + +/* crypto context is managed(allocated/freed) by the encryption function, so provide the address of field in the private structure */ +void ** linphone_content_get_cryptoContext_address(LinphoneContent *content) { + return &(content->cryptoContext); +} + +bool_t linphone_content_is_multipart(const LinphoneContent *content) { + return sal_body_handler_is_multipart(content->body_handler); +} + +LinphoneContent * linphone_content_get_part(const LinphoneContent *content, int idx) { + SalBodyHandler *part_body_handler; + if (!linphone_content_is_multipart(content)) return NULL; + part_body_handler = sal_body_handler_get_part(content->body_handler, idx); + return linphone_content_from_sal_body_handler(part_body_handler); +} + +LinphoneContent * linphone_content_find_part_by_header(const LinphoneContent *content, const char *header_name, const char *header_value) { + SalBodyHandler *part_body_handler; + if (!linphone_content_is_multipart(content)) return NULL; + part_body_handler = sal_body_handler_find_part_by_header(content->body_handler, header_name, header_value); + return linphone_content_from_sal_body_handler(part_body_handler); +} + +const char * linphone_content_get_custom_header(const LinphoneContent *content, const char *header_name) { + return sal_body_handler_get_header(content->body_handler, header_name); +} + + +LinphoneContent * linphone_content_new(void) { + return linphone_content_new_with_body_handler(NULL); +} + +LinphoneContent * linphone_content_copy(const LinphoneContent *ref) { + return (LinphoneContent *)belle_sip_object_ref(belle_sip_object_clone(BELLE_SIP_OBJECT(ref))); +} + +LinphoneContent * linphone_content_from_sal_body_handler(SalBodyHandler *body_handler) { + if (body_handler) { + return linphone_content_new_with_body_handler(body_handler); + } + return NULL; +} + +SalBodyHandler * sal_body_handler_from_content(const LinphoneContent *content) { + if (content == NULL) return NULL; + return content->body_handler; +} diff --git a/coreapi/friendlist.c b/coreapi/friendlist.c index 6f196721e..5e9ca2abf 100644 --- a/coreapi/friendlist.c +++ b/coreapi/friendlist.c @@ -19,7 +19,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include -#include "linphone/api/c-content.h" #include "linphone/core.h" #include "c-wrapper/c-wrapper.h" @@ -962,7 +961,7 @@ void linphone_friend_list_notify_presence_received(LinphoneFriendList *list, Lin const char *subtype = linphone_content_get_subtype(body); if ((strcmp(type, "multipart") != 0) || (strcmp(subtype, "related") != 0)) { - ms_warning("multipart presence notified but it is not 'multipart/related', instead is '%s/%s'", type, subtype); + ms_warning("multipart presence notified but it is not 'multipart/related'"); return; } diff --git a/coreapi/info.c b/coreapi/info.c index f68bb4522..5b12089bb 100644 --- a/coreapi/info.c +++ b/coreapi/info.c @@ -23,7 +23,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "linphone/api/c-content.h" #include "linphone/core.h" #include "linphone/lpconfig.h" diff --git a/coreapi/lime.c b/coreapi/lime.c index cdf697b95..4270f9d2a 100644 --- a/coreapi/lime.c +++ b/coreapi/lime.c @@ -17,8 +17,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "linphone/api/c-content.h" - #include "lime.h" #ifdef HAVE_CONFIG_H #include "config.h" @@ -421,8 +419,6 @@ int lime_encryptFile(void **cryptoContext, unsigned char *key, size_t length, ch int lime_decryptFile(void **cryptoContext, unsigned char *key, size_t length, char *plain, char *cipher) { bctbx_aes_gcm_context_t *gcmContext; - if (key == NULL) return -1; - if (*cryptoContext == NULL) { /* first call to the function, allocate a crypto context and initialise it */ /* key contains 192bits of key || 64 bits of Initialisation Vector, no additional data */ gcmContext = bctbx_aes_gcm_context_new(key, 24, NULL, 0, key+24, 8, BCTBX_GCM_DECRYPT); @@ -791,8 +787,8 @@ int lime_im_encryption_engine_process_incoming_message_cb(LinphoneImEncryptionEn LinphoneCore *lc = linphone_im_encryption_engine_get_core(engine); int errcode = -1; /* check if we have a xml/cipher message to be decrypted */ - if (linphone_chat_message_get_content_type(msg) && - (strcmp("xml/cipher", linphone_chat_message_get_content_type(msg)) == 0 || + if (linphone_chat_message_get_content_type(msg) && + (strcmp("xml/cipher", linphone_chat_message_get_content_type(msg)) == 0 || strcmp("application/cipher.vnd.gsma.rcs-ft-http+xml", linphone_chat_message_get_content_type(msg)) == 0)) { errcode = 0; int retval; @@ -897,7 +893,6 @@ int lime_im_encryption_engine_process_downloading_file_cb(LinphoneImEncryptionEn LinphoneContent *content = linphone_chat_message_get_file_transfer_information(msg); if (!content) return -1; - if (!linphone_content_get_key(content)) { linphone_content_unref(content); return -1; diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 4a052feca..b0a4347fe 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -18,12 +18,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "linphone/api/c-content.h" #include "linphone/core.h" +#include "linphone/sipsetup.h" #include "linphone/lpconfig.h" #include "linphone/logging.h" -#include "linphone/sipsetup.h" - #include "private.h" #include "logging-private.h" #include "quality_reporting.h" diff --git a/coreapi/private_structs.h b/coreapi/private_structs.h index 6b6486ab8..3bcfc4d78 100644 --- a/coreapi/private_structs.h +++ b/coreapi/private_structs.h @@ -449,6 +449,17 @@ struct _EchoTester { unsigned int rate; }; +struct _LinphoneContent { + belle_sip_object_t base; + void *user_data; + SalBodyHandler *body_handler; + char *name; /**< used by RCS File transfer messages to store the original filename of the file to be downloaded from server */ + char *key; /**< used by RCS File transfer messages to store the key to encrypt file if needed */ + size_t keyLength; /**< Length of key in bytes */ + void *cryptoContext; /**< crypto context used to encrypt file for RCS file transfer */ + bool_t owned_fields; +}; + BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneContent); struct _LinphoneBuffer { diff --git a/coreapi/proxy.c b/coreapi/proxy.c index b797e1d0b..03213da1e 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -25,7 +25,6 @@ Copyright (C) 2000 Simon MORLAT (simon.morlat@linphone.org) #include "linphone/core.h" #include "linphone/lpconfig.h" #include "linphone/sipsetup.h" - #include "mediastreamer2/mediastream.h" #include "enum.h" diff --git a/coreapi/quality_reporting.c b/coreapi/quality_reporting.c index a20b03b8e..571a8faa0 100644 --- a/coreapi/quality_reporting.c +++ b/coreapi/quality_reporting.c @@ -21,9 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "config.h" #endif -#include "linphone/api/c-content.h" #include "linphone/core.h" - #include "private.h" #include "c-wrapper/internal/c-sal.h" #include "sal/sal.h" diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 04aee8ddd..2e09af5eb 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -33,6 +33,7 @@ set(ROOT_HEADER_FILES chat.h conference.h contactprovider.h + content.h core_utils.h core.h defs.h @@ -84,7 +85,6 @@ set(C_API_HEADER_FILES c-chat-message.h c-chat-room-cbs.h c-chat-room.h - c-content.h c-dial-plan.h c-event-log.h c-magic-search.h diff --git a/include/linphone/Makefile.am b/include/linphone/Makefile.am index 56c2c3dda..dc9488e0b 100644 --- a/include/linphone/Makefile.am +++ b/include/linphone/Makefile.am @@ -14,6 +14,7 @@ linphone_include_HEADERS=\ chat.h \ conference.h \ contactprovider.h \ + content.h \ core.h \ core_utils.h \ defs.h \ diff --git a/include/linphone/api/c-api.h b/include/linphone/api/c-api.h index 7044bed6a..039b55246 100644 --- a/include/linphone/api/c-api.h +++ b/include/linphone/api/c-api.h @@ -23,15 +23,14 @@ #include "linphone/utils/general.h" #include "linphone/api/c-address.h" +#include "linphone/api/c-call.h" #include "linphone/api/c-call-cbs.h" #include "linphone/api/c-call-stats.h" -#include "linphone/api/c-call.h" #include "linphone/api/c-callbacks.h" -#include "linphone/api/c-chat-message-cbs.h" #include "linphone/api/c-chat-message.h" -#include "linphone/api/c-chat-room-cbs.h" +#include "linphone/api/c-chat-message-cbs.h" #include "linphone/api/c-chat-room.h" -#include "linphone/api/c-content.h" +#include "linphone/api/c-chat-room-cbs.h" #include "linphone/api/c-dial-plan.h" #include "linphone/api/c-event-log.h" #include "linphone/api/c-participant.h" diff --git a/include/linphone/api/c-chat-room.h b/include/linphone/api/c-chat-room.h index 312a6fc6f..41f3c669e 100644 --- a/include/linphone/api/c-chat-room.h +++ b/include/linphone/api/c-chat-room.h @@ -90,7 +90,7 @@ LINPHONE_PUBLIC LinphoneChatMessage* linphone_chat_room_create_message_2(Linphon * @param initial_content #LinphoneContent initial content. #LinphoneCoreVTable.file_transfer_send is invoked later to notify file transfer progress and collect next chunk of the message if LinphoneContent.data is NULL. * @return a new #LinphoneChatMessage */ -LINPHONE_PUBLIC LinphoneChatMessage* linphone_chat_room_create_file_transfer_message(LinphoneChatRoom *cr, LinphoneContent* initial_content); +LINPHONE_PUBLIC LinphoneChatMessage* linphone_chat_room_create_file_transfer_message(LinphoneChatRoom *cr, const LinphoneContent* initial_content); /** * get peer address \link linphone_core_get_chat_room() associated to \endlink this #LinphoneChatRoom diff --git a/include/linphone/api/c-types.h b/include/linphone/api/c-types.h index b4f629101..f587b77f8 100644 --- a/include/linphone/api/c-types.h +++ b/include/linphone/api/c-types.h @@ -162,12 +162,6 @@ typedef struct _LinphoneMagicSearch LinphoneMagicSearch; **/ typedef struct _LinphoneParticipant LinphoneParticipant; -/** - * The LinphoneContent object holds data that can be embedded in a signaling message. - * @ingroup misc -**/ -typedef struct _LinphoneContent LinphoneContent; - /** * The LinphoneSearchResult object represents a result of a search * @ingroup misc diff --git a/include/linphone/api/c-content.h b/include/linphone/content.h similarity index 83% rename from include/linphone/api/c-content.h rename to include/linphone/content.h index 5cdd27663..78ebc3114 100644 --- a/include/linphone/api/c-content.h +++ b/include/linphone/content.h @@ -1,32 +1,33 @@ /* - * c-content.h - * Copyright (C) 2010-2018 Belledonne Communications SARL - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ +content.h +Copyright (C) 2010-2014 Belledonne Communications SARL -#ifndef _L_C_CONTENT_H_ -#define _L_C_CONTENT_H_ +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. -#include "linphone/api/c-types.h" +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#ifndef LINPHONE_CONTENT_H_ +#define LINPHONE_CONTENT_H_ + + +#include "linphone/types.h" -// ============================================================================= #ifdef __cplusplus - extern "C" { -#endif // ifdef __cplusplus +extern "C" { +#endif + /** * @addtogroup misc @@ -88,14 +89,6 @@ LINPHONE_PUBLIC const char * linphone_content_get_subtype(const LinphoneContent */ LINPHONE_PUBLIC void linphone_content_set_subtype(LinphoneContent *content, const char *subtype); -/** - * Adds a parameter to the ContentType header. - * @param[in] content LinphoneContent object. - * @param[in] name the name of the parameter to add. - * @param[in] value the value of the parameter to add. - */ -LINPHONE_PUBLIC void linphone_content_add_content_type_parameter(LinphoneContent *content, const char *name, const char *value); - /** * Get the content data buffer, usually a string. * @param[in] content LinphoneContent object. @@ -225,8 +218,9 @@ LINPHONE_PUBLIC void linphone_content_set_key(LinphoneContent *content, const ch * @} */ -#ifdef __cplusplus - } -#endif // ifdef __cplusplus -#endif // ifndef _L_C_CONTENT_H_ \ No newline at end of file +#ifdef __cplusplus +} +#endif + +#endif /* LINPHONE_CONTENT_H_ */ diff --git a/include/linphone/core.h b/include/linphone/core.h index ff15192e9..ded8e3949 100644 --- a/include/linphone/core.h +++ b/include/linphone/core.h @@ -42,6 +42,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "linphone/call_stats.h" #include "linphone/chat.h" #include "linphone/conference.h" +#include "linphone/content.h" #include "linphone/dictionary.h" #include "linphone/error_info.h" #include "linphone/event.h" diff --git a/include/linphone/types.h b/include/linphone/types.h index 32384b498..9a8ba46c9 100644 --- a/include/linphone/types.h +++ b/include/linphone/types.h @@ -367,6 +367,12 @@ typedef unsigned int LinphoneContactSearchID; */ LINPHONE_DEPRECATED typedef LinphoneContactSearchID ContactSearchID; +/** + * The LinphoneContent object holds data that can be embedded in a signaling message. + * @ingroup misc +**/ +typedef struct _LinphoneContent LinphoneContent; + /** * Linphone core main object created by function linphone_core_new() . * @ingroup initializing diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b7c47abf8..ca182139f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -99,9 +99,6 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES content/content.h content/file-content.h content/file-transfer-content.h - content/header/header.h - content/header/header-p.h - content/header/header-param.h core/core-accessor.h core/core-listener.h core/core-p.h @@ -176,7 +173,6 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES c-wrapper/api/c-chat-room-cbs.cpp c-wrapper/api/c-chat-room.cpp c-wrapper/api/c-core.cpp - c-wrapper/api/c-content.cpp c-wrapper/api/c-dial-plan.cpp c-wrapper/api/c-event-log.cpp c-wrapper/api/c-magic-search.cpp @@ -226,8 +222,6 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES content/content.cpp content/file-content.cpp content/file-transfer-content.cpp - content/header/header.cpp - content/header/header-param.cpp core/core-accessor.cpp core/core-call.cpp core/core-chat-room.cpp diff --git a/src/c-wrapper/api/c-chat-message.cpp b/src/c-wrapper/api/c-chat-message.cpp index 76916ca2b..a616a9659 100644 --- a/src/c-wrapper/api/c-chat-message.cpp +++ b/src/c-wrapper/api/c-chat-message.cpp @@ -18,7 +18,6 @@ */ #include "linphone/api/c-chat-message.h" -#include "linphone/api/c-content.h" #include "linphone/utils/utils.h" #include "linphone/wrapper_utils.h" @@ -229,7 +228,7 @@ void linphone_chat_message_add_text_content(LinphoneChatMessage *msg, const char LinphonePrivate::ContentType contentType = LinphonePrivate::ContentType::PlainText; content->setContentType(contentType); content->setBody(L_C_TO_STRING(c_content)); - L_GET_CPP_PTR_FROM_C_OBJECT(msg)->addContent(content); + L_GET_CPP_PTR_FROM_C_OBJECT(msg)->addContent(*content); } bool_t linphone_chat_message_has_text_content(const LinphoneChatMessage *msg) { @@ -295,9 +294,7 @@ int linphone_chat_message_set_text(LinphoneChatMessage *msg, const char* text) { } LinphoneContent *linphone_chat_message_get_file_transfer_information(LinphoneChatMessage *msg) { - const LinphonePrivate::Content *content = L_GET_PRIVATE_FROM_C_OBJECT(msg)->getFileTransferInformation(); - if (content) return L_GET_C_BACK_PTR(content); - return NULL; + return L_GET_PRIVATE_FROM_C_OBJECT(msg)->getFileTransferInformation(); } // ============================================================================= diff --git a/src/c-wrapper/api/c-chat-room.cpp b/src/c-wrapper/api/c-chat-room.cpp index b8fa75567..e549964e0 100644 --- a/src/c-wrapper/api/c-chat-room.cpp +++ b/src/c-wrapper/api/c-chat-room.cpp @@ -355,8 +355,8 @@ const bctbx_list_t *linphone_chat_room_get_composing_addresses (LinphoneChatRoom return cr->composingAddresses; } -LinphoneChatMessage *linphone_chat_room_create_file_transfer_message(LinphoneChatRoom *cr, LinphoneContent *initial_content) { - shared_ptr cppPtr = L_GET_CPP_PTR_FROM_C_OBJECT(cr)->createFileTransferMessage(L_GET_CPP_PTR_FROM_C_OBJECT(initial_content)); +LinphoneChatMessage *linphone_chat_room_create_file_transfer_message(LinphoneChatRoom *cr, const LinphoneContent *initial_content) { + shared_ptr cppPtr = L_GET_CPP_PTR_FROM_C_OBJECT(cr)->createFileTransferMessage(initial_content); LinphoneChatMessage *object = L_INIT(ChatMessage); L_SET_CPP_PTR_FROM_C_OBJECT(object, cppPtr); return object; diff --git a/src/c-wrapper/api/c-content.cpp b/src/c-wrapper/api/c-content.cpp deleted file mode 100644 index 580c78ca3..000000000 --- a/src/c-wrapper/api/c-content.cpp +++ /dev/null @@ -1,331 +0,0 @@ -/* - * c-content.cpp - * Copyright (C) 2010-2018 Belledonne Communications SARL - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "linphone/api/c-content.h" -#include "linphone/wrapper_utils.h" - -#include "c-wrapper/c-wrapper.h" - -#include "content/content.h" -#include "content/content-type.h" -#include "content/header/header-param.h" -#include "content/header/header.h" -#include "content/content-manager.h" -#include "content/file-content.h" -#include "content/file-transfer-content.h" - -// ============================================================================= - -using namespace std; - -L_DECLARE_C_CLONABLE_OBJECT_IMPL(Content, - void *cryptoContext; /**< crypto context used to encrypt file for RCS file transfer */ - mutable char *name; - mutable char *type; - mutable char *subtype; - mutable char *body; - mutable size_t size; - mutable char *encoding; - mutable char *key; -) - -// ============================================================================= -// Reference and user data handling functions. -// ============================================================================= - -LinphoneContent * linphone_content_ref(LinphoneContent *content) { - belle_sip_object_ref(content); - return content; -} - -void linphone_content_unref(LinphoneContent *content) { - belle_sip_object_unref(content); -} - -void *linphone_content_get_user_data(const LinphoneContent *content) { - return L_GET_USER_DATA_FROM_C_OBJECT(content); -} - -void linphone_content_set_user_data(LinphoneContent *content, void *ud) { - return L_SET_USER_DATA_FROM_C_OBJECT(content, ud); -} - -// ============================================================================= - -const char * linphone_content_get_type(const LinphoneContent *content) { - if (content->type) ms_free(content->type); - content->type = ms_strdup(L_STRING_TO_C(L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType().getType())); - return content->type; -} - -void linphone_content_set_type(LinphoneContent *content, const char *type) { - LinphonePrivate::ContentType ct = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType(); - ct.setType(L_C_TO_STRING(type)); - L_GET_CPP_PTR_FROM_C_OBJECT(content)->setContentType(ct); -} - -const char * linphone_content_get_subtype(const LinphoneContent *content) { - if (content->subtype) ms_free(content->subtype); - content->subtype = ms_strdup(L_STRING_TO_C(L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType().getSubType())); - return content->subtype; -} - -void linphone_content_set_subtype(LinphoneContent *content, const char *subtype) { - LinphonePrivate::ContentType ct = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType(); - ct.setSubType(L_C_TO_STRING(subtype)); - L_GET_CPP_PTR_FROM_C_OBJECT(content)->setContentType(ct); -} - -void linphone_content_add_content_type_parameter(LinphoneContent *content, const char *name, const char *value) { - LinphonePrivate::ContentType ct = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType(); - ct.addParameter(L_C_TO_STRING(name), L_C_TO_STRING(value)); - L_GET_CPP_PTR_FROM_C_OBJECT(content)->setContentType(ct); -} - -uint8_t * linphone_content_get_buffer(const LinphoneContent *content) { - return (uint8_t *)linphone_content_get_string_buffer(content); -} - -void linphone_content_set_buffer(LinphoneContent *content, const uint8_t *buffer, size_t size) { - L_GET_CPP_PTR_FROM_C_OBJECT(content)->setBody(buffer, size); -} - -const char * linphone_content_get_string_buffer(const LinphoneContent *content) { - if (content->body) ms_free(content->body); - content->body = ms_strdup(L_GET_CPP_PTR_FROM_C_OBJECT(content)->getBodyAsUtf8String().c_str()); - return content->body; -} - -void linphone_content_set_string_buffer(LinphoneContent *content, const char *buffer) { - L_GET_CPP_PTR_FROM_C_OBJECT(content)->setBodyFromUtf8(L_C_TO_STRING(buffer)); -} - -size_t linphone_content_get_size(const LinphoneContent *content) { - size_t size = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getSize(); - if (size == 0) { - size = content->size; - } - return size; -} - -void linphone_content_set_size(LinphoneContent *content, size_t size) { - content->size = size; -} - -const char * linphone_content_get_encoding(const LinphoneContent *content) { - return content->encoding; -} - -void linphone_content_set_encoding(LinphoneContent *content, const char *encoding) { - if (content->encoding) ms_free(content->encoding); - content->encoding = ms_strdup(encoding); -} - -const char * linphone_content_get_name(const LinphoneContent *content) { - const LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content); - if (c->isFile()) { - const LinphonePrivate::FileContent *fc = static_cast(c); - if (content->name) ms_free(content->name); - content->name = ms_strdup(L_STRING_TO_C(fc->getFileName())); - } else if (c->isFileTransfer()) { - const LinphonePrivate::FileTransferContent *ftc = static_cast(c); - if (content->name) ms_free(content->name); - content->name = ms_strdup(L_STRING_TO_C(ftc->getFileName())); - } - return content->name; -} - -void linphone_content_set_name(LinphoneContent *content, const char *name) { - if (content->name) ms_free(content->name); - - LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content); - if (c->isFile()) { - LinphonePrivate::FileContent *fc = static_cast(c); - fc->setFileName(L_C_TO_STRING(name)); - } else if (c->isFileTransfer()) { - LinphonePrivate::FileTransferContent *ftc = static_cast(c); - ftc->setFileName(L_C_TO_STRING(name)); - } - - content->name = ms_strdup(name); -} - -bool_t linphone_content_is_multipart(const LinphoneContent *content) { - return L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType().isMultipart(); -} - -LinphoneContent * linphone_content_get_part(const LinphoneContent *content, int idx) { - SalBodyHandler *part_body_handler; - SalBodyHandler *body_handler = sal_body_handler_from_content(content); - if (!sal_body_handler_is_multipart(body_handler)) { - sal_body_handler_unref(body_handler); - return NULL; - } - part_body_handler = sal_body_handler_get_part(body_handler, idx); - LinphoneContent *result = linphone_content_from_sal_body_handler(part_body_handler); - sal_body_handler_unref(body_handler); - return result; -} - -LinphoneContent * linphone_content_find_part_by_header(const LinphoneContent *content, const char *header_name, const char *header_value) { - SalBodyHandler *part_body_handler; - SalBodyHandler *body_handler = sal_body_handler_from_content(content); - if (!sal_body_handler_is_multipart(body_handler)) { - sal_body_handler_unref(body_handler); - return NULL; - } - part_body_handler = sal_body_handler_find_part_by_header(body_handler, header_name, header_value); - LinphoneContent *result = linphone_content_from_sal_body_handler(part_body_handler); - sal_body_handler_unref(body_handler); - return result; -} - -const char * linphone_content_get_custom_header(const LinphoneContent *content, const char *header_name) { - SalBodyHandler *body_handler = sal_body_handler_from_content(content); - const char *header = sal_body_handler_get_header(body_handler, header_name); - sal_body_handler_unref(body_handler); - return header; -} - -const char *linphone_content_get_key(const LinphoneContent *content) { - if (content->key) ms_free(content->key); - - const LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content); - if (c->isFileTransfer()) { - const LinphonePrivate::FileTransferContent *ftc = static_cast(c); - content->key = ms_strdup(ftc->getFileKeyAsString()); - } - - return content->key; -} - -size_t linphone_content_get_key_size(const LinphoneContent *content) { - const LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content); - if (c->isFileTransfer()) { - const LinphonePrivate::FileTransferContent *ftc = static_cast(c); - return ftc->getFileKeySize(); - } - return 0; -} - -void linphone_content_set_key(LinphoneContent *content, const char *key, const size_t keyLength) { - LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content); - if (c->isFileTransfer()) { - LinphonePrivate::FileTransferContent *ftc = static_cast(c); - ftc->setFileKey(key, keyLength); - } -} - -// ============================================================================= -// Private functions. -// ============================================================================= - -static LinphoneContent * linphone_content_new_with_body_handler(SalBodyHandler *body_handler) { - LinphoneContent *content = L_INIT(Content); - content->cryptoContext = NULL; - LinphonePrivate::Content *c = new LinphonePrivate::Content(); - L_SET_CPP_PTR_FROM_C_OBJECT(content, c); - - if (body_handler != NULL) { - linphone_content_set_type(content, sal_body_handler_get_type(body_handler)); - linphone_content_set_subtype(content, sal_body_handler_get_subtype(body_handler)); - for (const belle_sip_list_t *params = sal_body_handler_get_content_type_parameters_names(body_handler); params; params = params->next) { - const char *paramName = (const char *)(params->data); - const char *paramValue = sal_body_handler_get_content_type_parameter(body_handler, paramName); - linphone_content_add_content_type_parameter(content, paramName, paramValue); - } - - if (!linphone_content_is_multipart(content)) { - linphone_content_set_string_buffer(content, (char *)sal_body_handler_get_data(body_handler)); - } else { - belle_sip_multipart_body_handler_t *mpbh = BELLE_SIP_MULTIPART_BODY_HANDLER(body_handler); - char *body = belle_sip_object_to_string(mpbh); - linphone_content_set_string_buffer(content, body); - belle_sip_free(body); - } - - belle_sip_list_t *headers = (belle_sip_list_t *)sal_body_handler_get_headers(body_handler); - while (headers) { - belle_sip_header_t *cHeader = BELLE_SIP_HEADER(headers->data); - LinphonePrivate::Header header = LinphonePrivate::Header(belle_sip_header_get_name(cHeader), belle_sip_header_get_unparsed_value(cHeader)); - L_GET_CPP_PTR_FROM_C_OBJECT(content)->addHeader(header); - headers = headers->next; - } - if (sal_body_handler_get_encoding(body_handler)) linphone_content_set_encoding(content, sal_body_handler_get_encoding(body_handler)); - } - - return content; -} - -LinphoneContent * linphone_content_new(void) { - return linphone_content_new_with_body_handler(NULL); -} - -LinphoneContent * linphone_content_copy(const LinphoneContent *ref) { - return (LinphoneContent *)(belle_sip_object_clone(BELLE_SIP_OBJECT(ref))); -} - -LinphoneContent * linphone_core_create_content(LinphoneCore *lc) { - return linphone_content_new(); -} - -/* crypto context is managed(allocated/freed) by the encryption function, so provide the address of field in the private structure */ -void ** linphone_content_get_cryptoContext_address(LinphoneContent *content) { - return &(content->cryptoContext); -} - -LinphoneContent * linphone_content_from_sal_body_handler(SalBodyHandler *body_handler) { - if (body_handler) { - return linphone_content_new_with_body_handler(body_handler); - } - return NULL; -} - -SalBodyHandler * sal_body_handler_from_content(const LinphoneContent *content) { - if (content == NULL) return NULL; - - SalBodyHandler *body_handler; - LinphonePrivate::ContentType contentType = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType(); - - if (contentType.isMultipart()) { - size_t size = linphone_content_get_size(content); - char *buffer = ms_strdup(L_GET_CPP_PTR_FROM_C_OBJECT(content)->getBodyAsUtf8String().c_str()); - const char *boundary = L_STRING_TO_C(contentType.getParameter("boundary").getValue()); - belle_sip_multipart_body_handler_t *bh = belle_sip_multipart_body_handler_new_from_buffer(buffer, size, boundary); - body_handler = (SalBodyHandler *)BELLE_SIP_BODY_HANDLER(bh); - } else { - body_handler = sal_body_handler_new(); - sal_body_handler_set_data(body_handler, belle_sip_strdup(linphone_content_get_string_buffer(content))); - } - - for (const auto &header : L_GET_CPP_PTR_FROM_C_OBJECT(content)->getHeaders()) { - belle_sip_header_t *additionalHeader = belle_sip_header_parse(header.asString().c_str()); - belle_sip_body_handler_add_header(BELLE_SIP_BODY_HANDLER(body_handler), additionalHeader); - } - - sal_body_handler_set_type(body_handler, contentType.getType().c_str()); - sal_body_handler_set_subtype(body_handler, contentType.getSubType().c_str()); - sal_body_handler_set_size(body_handler, linphone_content_get_size(content)); - for (const auto ¶m : contentType.getParameters()) { - sal_body_handler_set_content_type_parameter(body_handler, param.getName().c_str(), param.getValue().c_str()); - } - if (content->encoding) sal_body_handler_set_encoding(body_handler, linphone_content_get_encoding(content)); - - return body_handler; -} diff --git a/src/c-wrapper/c-wrapper.h b/src/c-wrapper/c-wrapper.h index c6382b809..e0109ce7c 100644 --- a/src/c-wrapper/c-wrapper.h +++ b/src/c-wrapper/c-wrapper.h @@ -37,7 +37,6 @@ F(ChatMessage, ChatMessage) \ F(AbstractChatRoom, ChatRoom) \ F(Core, Core) \ - F(Content, Content) \ F(DialPlan, DialPlan) \ F(EventLog, EventLog) \ F(MagicSearch, MagicSearch) \ @@ -86,6 +85,7 @@ BELLE_SIP_TYPE_ID(LinphoneConferenceParams), BELLE_SIP_TYPE_ID(LinphoneConfig), BELLE_SIP_TYPE_ID(LinphoneContactProvider), BELLE_SIP_TYPE_ID(LinphoneContactSearch), +BELLE_SIP_TYPE_ID(LinphoneContent), BELLE_SIP_TYPE_ID(LinphoneCoreCbs), BELLE_SIP_TYPE_ID(LinphoneErrorInfo), BELLE_SIP_TYPE_ID(LinphoneEvent), diff --git a/src/c-wrapper/internal/c-sal.h b/src/c-wrapper/internal/c-sal.h index f34c4ee5f..4aeca0042 100644 --- a/src/c-wrapper/internal/c-sal.h +++ b/src/c-wrapper/internal/c-sal.h @@ -636,9 +636,6 @@ const char * sal_body_handler_get_type(const SalBodyHandler *body_handler); void sal_body_handler_set_type(SalBodyHandler *body_handler, const char *type); const char * sal_body_handler_get_subtype(const SalBodyHandler *body_handler); void sal_body_handler_set_subtype(SalBodyHandler *body_handler, const char *subtype); -const belle_sip_list_t * sal_body_handler_get_content_type_parameters_names(const SalBodyHandler *body_handler); -const char * sal_body_handler_get_content_type_parameter(const SalBodyHandler *body_handler, const char *name); -void sal_body_handler_set_content_type_parameter(SalBodyHandler *body_handler, const char *paramName, const char *paramValue); const char * sal_body_handler_get_encoding(const SalBodyHandler *body_handler); void sal_body_handler_set_encoding(SalBodyHandler *body_handler, const char *encoding); void * sal_body_handler_get_data(const SalBodyHandler *body_handler); @@ -647,10 +644,8 @@ size_t sal_body_handler_get_size(const SalBodyHandler *body_handler); void sal_body_handler_set_size(SalBodyHandler *body_handler, size_t size); bool_t sal_body_handler_is_multipart(const SalBodyHandler *body_handler); SalBodyHandler * sal_body_handler_get_part(const SalBodyHandler *body_handler, int idx); -const belle_sip_list_t * sal_body_handler_get_parts(const SalBodyHandler *body_handler); SalBodyHandler * sal_body_handler_find_part_by_header(const SalBodyHandler *body_handler, const char *header_name, const char *header_value); const char * sal_body_handler_get_header(const SalBodyHandler *body_handler, const char *header_name); -const belle_sip_list_t* sal_body_handler_get_headers(const SalBodyHandler *body_handler); /*this function parses a document with key=value pairs separated by new lines, and extracts the value for a given key*/ int sal_lines_get_value(const char *data, const char *key, char *value, size_t value_size); diff --git a/src/chat/chat-message/chat-message-p.h b/src/chat/chat-message/chat-message-p.h index 0e17afc88..4c957ed71 100644 --- a/src/chat/chat-message/chat-message-p.h +++ b/src/chat/chat-message/chat-message-p.h @@ -137,11 +137,11 @@ public: bool hasFileTransferContent () const; const Content* getFileTransferContent () const; - const Content* getFileTransferInformation () const; - void setFileTransferInformation (Content *content); + LinphoneContent *getFileTransferInformation () const; + void setFileTransferInformation (const LinphoneContent *content); - void addContent (Content *content); - void removeContent (Content *content); + void addContent (Content &content); + void removeContent (const Content &content); bool downloadFile (); diff --git a/src/chat/chat-message/chat-message.cpp b/src/chat/chat-message/chat-message.cpp index 81efcd2ec..0fcde7521 100644 --- a/src/chat/chat-message/chat-message.cpp +++ b/src/chat/chat-message/chat-message.cpp @@ -19,7 +19,6 @@ #include "object/object-p.h" -#include "linphone/api/c-content.h" #include "linphone/core.h" #include "linphone/lpconfig.h" #include "linphone/utils/utils.h" @@ -37,7 +36,6 @@ #include "chat/modifier/multipart-chat-message-modifier.h" #include "conference/participant.h" #include "content/file-content.h" -#include "content/header/header-param.h" #include "content/content.h" #include "core/core.h" #include "core/core-p.h" @@ -241,8 +239,8 @@ const Content* ChatMessagePrivate::getTextContent() const { } bool ChatMessagePrivate::hasFileTransferContent() const { - for (const Content *c : contents) { - if (c->isFileTransfer()) { + for (const Content *c : getContents()) { + if (c->getContentType() == ContentType::FileTransfer) { return true; } } @@ -250,8 +248,8 @@ bool ChatMessagePrivate::hasFileTransferContent() const { } const Content* ChatMessagePrivate::getFileTransferContent() const { - for (const Content *c : contents) { - if (c->isFileTransfer()) { + for (const Content *c : getContents()) { + if (c->getContentType() == ContentType::FileTransfer) { return c; } } @@ -376,54 +374,51 @@ void ChatMessagePrivate::setText (const string &text) { } } -const Content *ChatMessagePrivate::getFileTransferInformation () const { +LinphoneContent *ChatMessagePrivate::getFileTransferInformation () const { if (hasFileTransferContent()) { - return getFileTransferContent(); + return getFileTransferContent()->toLinphoneContent(); } for (const Content *c : getContents()) { if (c->isFile()) { FileContent *fileContent = (FileContent *)c; - return fileContent; + return fileContent->toLinphoneContent(); } } return nullptr; } -void ChatMessagePrivate::setFileTransferInformation (Content *content) { +void ChatMessagePrivate::setFileTransferInformation (const LinphoneContent *c_content) { L_Q(); - if (content->isFile()) { - q->addContent(content); - } else { - // This scenario is more likely to happen because the caller is using the C API - LinphoneContent *c_content = L_GET_C_BACK_PTR(content); - FileContent *fileContent = new FileContent(); - fileContent->setContentType(content->getContentType()); - fileContent->setFileSize(linphone_content_get_size(c_content)); // This information is only available from C Content if it was created from C API - fileContent->setFileName(linphone_content_get_name(c_content)); // This information is only available from C Content if it was created from C API - if (!content->isEmpty()) { - fileContent->setBody(content->getBody()); - } - q->addContent(fileContent); + // Create a FileContent, it will create the FileTransferContent at upload time + FileContent *fileContent = new FileContent(); + ContentType contentType(linphone_content_get_type(c_content), linphone_content_get_subtype(c_content)); + fileContent->setContentType(contentType); + fileContent->setFileSize(linphone_content_get_size(c_content)); + fileContent->setFileName(linphone_content_get_name(c_content)); + if (linphone_content_get_string_buffer(c_content)) { + fileContent->setBody(linphone_content_get_string_buffer(c_content)); } + + q->addContent(*fileContent); } bool ChatMessagePrivate::downloadFile () { L_Q(); for (auto &content : getContents()) - if (content->isFileTransfer()) - return q->downloadFile(static_cast(content)); + if (content->getContentType() == ContentType::FileTransfer) + return q->downloadFile(*static_cast(content)); return false; } -void ChatMessagePrivate::addContent (Content *content) { - getContents().push_back(content); +void ChatMessagePrivate::addContent (Content &content) { + getContents().push_back(&content); } -void ChatMessagePrivate::removeContent (Content *content) { - getContents().remove(content); +void ChatMessagePrivate::removeContent (const Content &content) { + getContents().remove(&const_cast(content)); } void ChatMessagePrivate::loadFileTransferUrlFromBodyToContent() { @@ -458,7 +453,7 @@ void ChatMessagePrivate::sendImdn (Imdn::Type imdnType, LinphoneReason reason) { Content *content = new Content(); content->setContentType(ContentType::Imdn); content->setBody(Imdn::createXml(imdnId, time, imdnType, reason)); - msg->addContent(content); + msg->addContent(*content); if (reason != LinphoneReasonNone) msg->getPrivate()->setEncryptionPrevented(true); @@ -475,7 +470,7 @@ static void forceUtf8Content (Content &content) { if (contentType != ContentType::PlainText) return; - string charset = contentType.getParameter("charset").getValue(); + string charset = contentType.getParameter(); if (charset.empty()) return; @@ -494,7 +489,7 @@ static void forceUtf8Content (Content &content) { if (!utf8Body.empty()) { // TODO: use move operator if possible in the future! content.setBodyFromUtf8(utf8Body); - contentType.addParameter("charset", "UTF-8"); + contentType.setParameter(string(contentType.getParameter()).replace(begin, end - begin, "UTF-8")); content.setContentType(contentType); } } @@ -606,7 +601,7 @@ LinphoneReason ChatMessagePrivate::receive () { foundSupportContentType = true; break; } else - lError() << "Unsupported content-type: " << c->getContentType(); + lError() << "Unsupported content-type: " << c->getContentType().asString(); } if (!foundSupportContentType) { @@ -765,7 +760,7 @@ void ChatMessagePrivate::send () { auto msgOp = dynamic_cast(op); if (!externalBodyUrl.empty()) { - char *content_type = ms_strdup_printf("message/external-body;access-type=URL;URL=\"%s\"", externalBodyUrl.c_str()); + char *content_type = ms_strdup_printf("message/external-body; access-type=URL; URL=\"%s\"", externalBodyUrl.c_str()); msgOp->send_message(content_type, NULL); ms_free(content_type); } else if (internalContent.getContentType().isValid()) { @@ -778,10 +773,10 @@ void ChatMessagePrivate::send () { list::iterator it = contents.begin(); while (it != contents.end()) { Content *content = *it; - if (content->isFileTransfer()) { - FileTransferContent *fileTransferContent = static_cast(content); + if (content->getContentType() == ContentType::FileTransfer) { + FileTransferContent *fileTransferContent = (FileTransferContent *)content; it = contents.erase(it); - addContent(fileTransferContent->getFileContent()); + addContent(*fileTransferContent->getFileContent()); delete fileTransferContent; } else { it++; @@ -1019,13 +1014,13 @@ const list &ChatMessage::getContents () const { return d->getContents(); } -void ChatMessage::addContent (Content *content) { +void ChatMessage::addContent (Content &content) { L_D(); if (!d->isReadOnly) d->addContent(content); } -void ChatMessage::removeContent (Content *content) { +void ChatMessage::removeContent (const Content &content) { L_D(); if (!d->isReadOnly) d->removeContent(content); @@ -1095,9 +1090,9 @@ void ChatMessage::sendDisplayNotification () { d->sendImdn(Imdn::Type::Display, LinphoneReasonNone); } -bool ChatMessage::downloadFile(FileTransferContent *fileTransferContent) { +bool ChatMessage::downloadFile(FileTransferContent &fileTransferContent) { L_D(); - return d->fileTransferChatMessageModifier.downloadFile(getSharedFromThis(), fileTransferContent); + return d->fileTransferChatMessageModifier.downloadFile(getSharedFromThis(), &fileTransferContent); } bool ChatMessage::isFileTransferInProgress() { diff --git a/src/chat/chat-message/chat-message.h b/src/chat/chat-message/chat-message.h index ea1cffedd..2b53bda7d 100644 --- a/src/chat/chat-message/chat-message.h +++ b/src/chat/chat-message/chat-message.h @@ -95,8 +95,8 @@ public: void setToBeStored (bool value); const std::list &getContents () const; - void addContent (Content *content); - void removeContent (Content *content); + void addContent (Content &content); + void removeContent (const Content &content); const Content &getInternalContent () const; void setInternalContent (const Content &content); @@ -106,7 +106,7 @@ public: void addCustomHeader (const std::string &headerName, const std::string &headerValue); void removeCustomHeader (const std::string &headerName); - bool downloadFile (FileTransferContent *content); + bool downloadFile (FileTransferContent &content); bool isFileTransferInProgress(); private: diff --git a/src/chat/chat-room/abstract-chat-room.h b/src/chat/chat-room/abstract-chat-room.h index 8a259466f..9662f89b9 100644 --- a/src/chat/chat-room/abstract-chat-room.h +++ b/src/chat/chat-room/abstract-chat-room.h @@ -89,7 +89,8 @@ public: virtual std::shared_ptr createChatMessage () = 0; virtual std::shared_ptr createChatMessage (const std::string &text) = 0; - virtual std::shared_ptr createFileTransferMessage (Content *initialContent) = 0; + // TODO: Remove LinphoneContent by LinphonePrivate::Content. + virtual std::shared_ptr createFileTransferMessage (const LinphoneContent *initialContent) = 0; virtual std::shared_ptr findChatMessage (const std::string &messageId) const = 0; virtual std::shared_ptr findChatMessage ( diff --git a/src/chat/chat-room/chat-room.cpp b/src/chat/chat-room/chat-room.cpp index b0b86553f..28106b50d 100644 --- a/src/chat/chat-room/chat-room.cpp +++ b/src/chat/chat-room/chat-room.cpp @@ -86,7 +86,7 @@ void ChatRoomPrivate::sendIsComposingNotification () { shared_ptr chatMessage = createChatMessage(ChatMessage::Direction::Outgoing); chatMessage->setToBeStored(false); - chatMessage->addContent(content); + chatMessage->addContent(*content); chatMessage->getPrivate()->addSalCustomHeader(PriorityHeader::HeaderName, PriorityHeader::NonUrgent); chatMessage->getPrivate()->addSalCustomHeader("Expires", "0"); @@ -414,11 +414,11 @@ shared_ptr ChatRoom::createChatMessage (const string &text) { Content *content = new Content(); content->setContentType(ContentType::PlainText); content->setBody(text); - chatMessage->addContent(content); + chatMessage->addContent(*content); return chatMessage; } -shared_ptr ChatRoom::createFileTransferMessage (Content *initialContent) { +shared_ptr ChatRoom::createFileTransferMessage (const LinphoneContent *initialContent) { shared_ptr chatMessage = createChatMessage(); chatMessage->getPrivate()->setFileTransferInformation(initialContent); return chatMessage; diff --git a/src/chat/chat-room/chat-room.h b/src/chat/chat-room/chat-room.h index c63e70c7d..40cad5ae3 100644 --- a/src/chat/chat-room/chat-room.h +++ b/src/chat/chat-room/chat-room.h @@ -65,7 +65,8 @@ public: std::shared_ptr createChatMessage () override; std::shared_ptr createChatMessage (const std::string &text) override; - std::shared_ptr createFileTransferMessage (Content *initialContent) override; + // TODO: Remove LinphoneContent by LinphonePrivate::Content. + std::shared_ptr createFileTransferMessage (const LinphoneContent *initialContent) override; std::shared_ptr findChatMessage (const std::string &messageId) const override; std::shared_ptr findChatMessage ( diff --git a/src/chat/chat-room/proxy-chat-room.cpp b/src/chat/chat-room/proxy-chat-room.cpp index 2e64bae01..6ddcb4f74 100644 --- a/src/chat/chat-room/proxy-chat-room.cpp +++ b/src/chat/chat-room/proxy-chat-room.cpp @@ -173,7 +173,7 @@ shared_ptr ProxyChatRoom::createChatMessage (const string &text) { return d->chatRoom->createChatMessage(text); } -shared_ptr ProxyChatRoom::createFileTransferMessage (Content *initialContent) { +shared_ptr ProxyChatRoom::createFileTransferMessage (const LinphoneContent *initialContent) { L_D(); return d->chatRoom->createFileTransferMessage(initialContent); } diff --git a/src/chat/chat-room/proxy-chat-room.h b/src/chat/chat-room/proxy-chat-room.h index 68ff37e5c..5e4c68d11 100644 --- a/src/chat/chat-room/proxy-chat-room.h +++ b/src/chat/chat-room/proxy-chat-room.h @@ -66,7 +66,8 @@ public: std::shared_ptr createChatMessage () override; std::shared_ptr createChatMessage (const std::string &text) override; - std::shared_ptr createFileTransferMessage (Content *initialContent) override; + // TODO: Remove LinphoneContent by LinphonePrivate::Content. + std::shared_ptr createFileTransferMessage (const LinphoneContent *initialContent) override; std::shared_ptr findChatMessage (const std::string &messageId) const override; std::shared_ptr findChatMessage ( diff --git a/src/chat/cpim/message/cpim-message.cpp b/src/chat/cpim/message/cpim-message.cpp index 123ef6c66..84753f4ef 100644 --- a/src/chat/cpim/message/cpim-message.cpp +++ b/src/chat/cpim/message/cpim-message.cpp @@ -149,11 +149,9 @@ string Cpim::Message::asString () const { string output; // TODO: Remove cpimHeaders - if (d->cpimHeaders->size() > 0) { - for (const auto &cpimHeader : *d->cpimHeaders) - output += cpimHeader->asString(); - output += "\r\n"; - } + for (const auto &cpimHeader : *d->cpimHeaders) + output += cpimHeader->asString(); + output += "\r\n"; // TODO Remove cpimHeaders if (d->messageHeaders->size() > 0) { diff --git a/src/chat/modifier/cpim-chat-message-modifier.cpp b/src/chat/modifier/cpim-chat-message-modifier.cpp index 03c35fed0..8958c0f82 100644 --- a/src/chat/modifier/cpim-chat-message-modifier.cpp +++ b/src/chat/modifier/cpim-chat-message-modifier.cpp @@ -98,7 +98,7 @@ ChatMessageModifier::Result CpimChatMessageModifier::decode (const shared_ptrgetContents().front(); if (content->getContentType() != ContentType::Cpim) { - lError() << "[CPIM] Message is not CPIM but " << content->getContentType(); + lError() << "[CPIM] Message is not CPIM but " << content->getContentType().asString(); return ChatMessageModifier::Result::Skipped; } diff --git a/src/chat/modifier/file-transfer-chat-message-modifier.cpp b/src/chat/modifier/file-transfer-chat-message-modifier.cpp index 6bebbfa0b..d9d0767b2 100644 --- a/src/chat/modifier/file-transfer-chat-message-modifier.cpp +++ b/src/chat/modifier/file-transfer-chat-message-modifier.cpp @@ -17,17 +17,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "linphone/api/c-content.h" - -#include "address/address.h" -#include "bctoolbox/crypto.h" #include "c-wrapper/c-wrapper.h" +#include "address/address.h" #include "chat/chat-message/chat-message-p.h" -#include "chat/chat-room/chat-room-p.h" #include "content/content-type.h" #include "content/content.h" +#include "chat/chat-room/chat-room-p.h" #include "core/core.h" #include "logger/logger.h" +#include "bctoolbox/crypto.h" #include "file-transfer-chat-message-modifier.h" @@ -109,7 +107,7 @@ void FileTransferChatMessageModifier::fileTransferOnProgress ( LinphoneChatMessage *msg = L_GET_C_BACK_PTR(message); LinphoneChatMessageCbs *cbs = linphone_chat_message_get_callbacks(msg); - LinphoneContent *content = L_GET_C_BACK_PTR((Content *)currentFileContentToTransfer); + LinphoneContent *content = currentFileContentToTransfer->toLinphoneContent(); if (linphone_chat_message_cbs_get_file_transfer_progress_indication(cbs)) { linphone_chat_message_cbs_get_file_transfer_progress_indication(cbs)(msg, content, offset, total); } else { @@ -159,7 +157,7 @@ int FileTransferChatMessageModifier::onSendBody ( LinphoneChatMessageCbs *cbs = linphone_chat_message_get_callbacks(msg); LinphoneChatMessageCbsFileTransferSendCb file_transfer_send_cb = linphone_chat_message_cbs_get_file_transfer_send(cbs); - LinphoneContent *content = L_GET_C_BACK_PTR((Content *)currentFileContentToTransfer); + LinphoneContent *content = currentFileContentToTransfer->toLinphoneContent(); if (file_transfer_send_cb) { LinphoneBuffer *lb = file_transfer_send_cb(msg, content, offset, *size); if (lb) { @@ -255,6 +253,12 @@ void FileTransferChatMessageModifier::processResponseFromPostFile (const belle_h } // shall we encrypt the file if (is_file_encryption_enabled && message->getChatRoom()) { + LinphoneImEncryptionEngineCbs *imee_cbs = linphone_im_encryption_engine_get_callbacks(imee); + LinphoneImEncryptionEngineCbsGenerateFileTransferKeyCb generate_file_transfer_key_cb = + linphone_im_encryption_engine_cbs_get_generate_file_transfer_key(imee_cbs); + if (generate_file_transfer_key_cb) { + generate_file_transfer_key_cb(imee, L_GET_C_BACK_PTR(message->getChatRoom()), L_GET_C_BACK_PTR(message)); + } // temporary storage for the Content-disposition header value : use a generic filename to not leak it // Actual filename stored in msg->file_transfer_information->name will be set in encrypted msg // sended to the @@ -297,31 +301,9 @@ void FileTransferChatMessageModifier::processResponseFromPostFile (const belle_h const char *body = belle_sip_message_get_body((belle_sip_message_t *)event->response); if (body && strlen(body) > 0) { FileTransferContent *fileTransferContent = new FileTransferContent(); - fileTransferContent->setContentType(ContentType::FileTransfer); - - LinphoneImEncryptionEngine *imee = linphone_core_get_im_encryption_engine(message->getCore()->getCCore()); - bool_t is_file_encryption_enabled = FALSE; - if (imee && message->getChatRoom()) { - LinphoneImEncryptionEngineCbs *imee_cbs = linphone_im_encryption_engine_get_callbacks(imee); - LinphoneImEncryptionEngineCbsIsEncryptionEnabledForFileTransferCb is_encryption_enabled_for_file_transfer_cb = - linphone_im_encryption_engine_cbs_get_is_encryption_enabled_for_file_transfer(imee_cbs); - if (is_encryption_enabled_for_file_transfer_cb) { - is_file_encryption_enabled = is_encryption_enabled_for_file_transfer_cb(imee, L_GET_C_BACK_PTR(message->getChatRoom())); - } - } - if (is_file_encryption_enabled && message->getChatRoom()) { - LinphoneImEncryptionEngineCbs *imee_cbs = linphone_im_encryption_engine_get_callbacks(imee); - LinphoneImEncryptionEngineCbsGenerateFileTransferKeyCb generate_file_transfer_key_cb = - linphone_im_encryption_engine_cbs_get_generate_file_transfer_key(imee_cbs); - if (generate_file_transfer_key_cb) { - generate_file_transfer_key_cb(imee, L_GET_C_BACK_PTR(message->getChatRoom()), L_GET_C_BACK_PTR(message)); - } - } - // if we have an encryption key for the file, we must insert it into the msg and restore the correct filename - const char *content_key = fileTransferContent->getFileKeyAsString(); - size_t content_key_size = fileTransferContent->getFileKey().size(); - if (content_key_size > 0) { + string content_key = currentFileContentToTransfer->getFileKey(); + if (!content_key.empty()) { // parse the msg body xmlDocPtr xmlMessageBody = xmlParseDoc((const xmlChar *)body); @@ -334,15 +316,16 @@ void FileTransferChatMessageModifier::processResponseFromPostFile (const belle_h xmlChar *typeAttribute = xmlGetProp(cur, (const xmlChar *)"type"); // this is the node we are looking for : add a file-key children node if (!xmlStrcmp(typeAttribute, (const xmlChar *)"file")) { + size_t content_key_size = content_key.length(); // need to parse the children node to update the file-name one xmlNodePtr fileInfoNodeChildren = cur->xmlChildrenNode; // convert key to base64 size_t b64Size; - bctbx_base64_encode(nullptr, &b64Size, (unsigned char *)content_key, content_key_size); + bctbx_base64_encode(nullptr, &b64Size, (unsigned char *)content_key.c_str(), content_key_size); unsigned char *keyb64 = (unsigned char *)ms_malloc0(b64Size + 1); int xmlStringLength; - bctbx_base64_encode(keyb64, &b64Size, (unsigned char *)content_key, content_key_size); + bctbx_base64_encode(keyb64, &b64Size, (unsigned char *)content_key.c_str(), content_key_size); keyb64[b64Size] = '\0'; // libxml need a null terminated string // add the node containing the key to the file-info node @@ -378,10 +361,11 @@ void FileTransferChatMessageModifier::processResponseFromPostFile (const belle_h } FileContent *fileContent = currentFileContentToTransfer; + fileTransferContent->setContentType(ContentType::FileTransfer); fileTransferContent->setFileContent(fileContent); - message->getPrivate()->removeContent(fileContent); - message->getPrivate()->addContent(fileTransferContent); + message->getPrivate()->removeContent(*fileContent); + message->getPrivate()->addContent(*fileTransferContent); message->getPrivate()->setState(ChatMessage::State::FileTransferDone); releaseHttpRequest(); @@ -575,13 +559,13 @@ ChatMessageModifier::Result FileTransferChatMessageModifier::decode (const share fileTransferContent->setContentType(internalContent.getContentType()); fileTransferContent->setBody(internalContent.getBody()); fillFileTransferContentInformationsFromVndGsmaRcsFtHttpXml(fileTransferContent); - message->addContent(fileTransferContent); + message->addContent(*fileTransferContent); return ChatMessageModifier::Result::Done; } for (Content *content : message->getContents()) { - if (content->isFileTransfer()) { - FileTransferContent *fileTransferContent = static_cast(content); + if (content->getContentType() == ContentType::FileTransfer) { + FileTransferContent *fileTransferContent = (FileTransferContent *)content; fillFileTransferContentInformationsFromVndGsmaRcsFtHttpXml(fileTransferContent); } } @@ -650,7 +634,8 @@ static void createFileTransferInformationsFromVndGsmaRcsFtHttpXml (FileTransferC uint8_t *keyBuffer = (uint8_t *)malloc(keyLength); // decode the key into local key buffer bctbx_base64_decode(keyBuffer, &keyLength, (unsigned char *)keyb64, strlen((const char *)keyb64)); - fileTransferContent->setFileKey((const char *)keyBuffer, keyLength); + string key = string((const char *)keyBuffer); + fileContent->setFileKey(key); // duplicate key value into the linphone content private structure xmlFree(keyb64); free(keyBuffer); @@ -714,7 +699,7 @@ void FileTransferChatMessageModifier::onRecvBody (belle_sip_user_body_handler_t if (currentFileContentToTransfer->getFilePath().empty()) { LinphoneChatMessage *msg = L_GET_C_BACK_PTR(message); LinphoneChatMessageCbs *cbs = linphone_chat_message_get_callbacks(msg); - LinphoneContent *content = L_GET_C_BACK_PTR((Content *)currentFileContentToTransfer); + LinphoneContent *content = currentFileContentToTransfer->toLinphoneContent(); if (linphone_chat_message_cbs_get_file_transfer_recv(cbs)) { LinphoneBuffer *lb = linphone_buffer_new_from_data(buffer, size); linphone_chat_message_cbs_get_file_transfer_recv(cbs)(msg, content, lb); @@ -755,7 +740,7 @@ void FileTransferChatMessageModifier::onRecvEnd (belle_sip_user_body_handler_t * if (currentFileContentToTransfer->getFilePath().empty()) { LinphoneChatMessage *msg = L_GET_C_BACK_PTR(message); LinphoneChatMessageCbs *cbs = linphone_chat_message_get_callbacks(msg); - LinphoneContent *content = L_GET_C_BACK_PTR((Content *)currentFileContentToTransfer); + LinphoneContent *content = currentFileContentToTransfer->toLinphoneContent(); if (linphone_chat_message_cbs_get_file_transfer_recv(cbs)) { LinphoneBuffer *lb = linphone_buffer_new(); linphone_chat_message_cbs_get_file_transfer_recv(cbs)(msg, content, lb); @@ -771,12 +756,12 @@ void FileTransferChatMessageModifier::onRecvEnd (belle_sip_user_body_handler_t * if (retval <= 0 && message->getState() != ChatMessage::State::FileTransferError) { // Remove the FileTransferContent from the message and store the FileContent FileContent *fileContent = currentFileContentToTransfer; - message->getPrivate()->addContent(fileContent); + message->getPrivate()->addContent(*fileContent); for (Content *content : message->getContents()) { - if (content->isFileTransfer()) { - FileTransferContent *fileTransferContent = static_cast(content); + if (content->getContentType() == ContentType::FileTransfer) { + FileTransferContent *fileTransferContent = (FileTransferContent*)content; if (fileTransferContent->getFileContent() == fileContent) { - message->getPrivate()->removeContent(content); + message->getPrivate()->removeContent(*content); delete fileTransferContent; break; } @@ -829,7 +814,7 @@ void FileTransferChatMessageModifier::processResponseHeadersFromGetFile (const b } else { lWarning() << "No file transfer information for msg [" << this << "]: creating..."; FileContent *content = createFileTransferInformationFromHeaders(response); - message->addContent(content); + message->addContent(*content); } size_t body_size = 0; diff --git a/src/chat/modifier/multipart-chat-message-modifier.cpp b/src/chat/modifier/multipart-chat-message-modifier.cpp index 8ed8312d9..243cb32e1 100644 --- a/src/chat/modifier/multipart-chat-message-modifier.cpp +++ b/src/chat/modifier/multipart-chat-message-modifier.cpp @@ -20,11 +20,13 @@ // TODO: Remove me later. #include "private.h" +#include "address/address.h" #include "chat/chat-message/chat-message.h" +#include "chat/chat-room/chat-room.h" #include "content/content-type.h" -#include "content/header/header.h" -#include "content/content-manager.h" #include "content/file-transfer-content.h" +#include "logger/logger.h" +#include "core/core.h" #include "multipart-chat-message-modifier.h" @@ -41,30 +43,90 @@ ChatMessageModifier::Result MultipartChatMessageModifier::encode ( if (message->getContents().size() <= 1) return ChatMessageModifier::Result::Skipped; - Content content = ContentManager::contentListToMultipart(message->getContents()); - message->setInternalContent(content); + LinphoneCore *lc = message->getChatRoom()->getCore()->getCCore(); + char tmp[64]; + lc->sal->create_uuid(tmp, sizeof(tmp)); + string boundary = tmp; + stringstream multipartMessage; + + multipartMessage << "--" << boundary; + for (Content *content : message->getContents()) { + multipartMessage << "\r\n"; + multipartMessage << "Content-Type: " << content->getContentType().asString() << "\r\n\r\n"; + multipartMessage << content->getBodyAsString() << "\r\n\r\n"; + multipartMessage << "--" << boundary; + } + multipartMessage << "--"; + + Content newContent; + ContentType newContentType(ContentType::Multipart); + newContentType.setParameter("boundary=" + boundary); + newContent.setContentType(newContentType); + newContent.setBody(multipartMessage.str()); + message->setInternalContent(newContent); return ChatMessageModifier::Result::Done; } ChatMessageModifier::Result MultipartChatMessageModifier::decode (const shared_ptr &message, int &errorCode) { - if (message->getInternalContent().getContentType().isMultipart()) { - for (Content &c : ContentManager::multipartToContentList(message->getInternalContent())) { - Content *content; - if (c.getContentType() == ContentType::FileTransfer) { - content = new FileTransferContent(); - content->setContentType(c.getContentType()); - content->setContentDisposition(c.getContentDisposition()); - content->setContentEncoding(c.getContentEncoding()); - for (const Header &header : c.getHeaders()) { - content->addHeader(header); - } - content->setBodyFromUtf8(c.getBodyAsUtf8String()); - } else { - content = new Content(c); - } - message->addContent(content); + if (message->getInternalContent().getContentType().getType() == "multipart") { + string boundary = message->getInternalContent().getContentType().getParameter(); + if (boundary.empty()) { + lError() << "Boundary parameter of content-type not found: " << message->getInternalContent().getContentType().asString(); + return ChatMessageModifier::Result::Error; } + + size_t pos = boundary.find("="); + if (pos == string::npos) { + lError() << "Parameter seems invalid: " << boundary; + return ChatMessageModifier::Result::Error; + } + boundary = "--" + boundary.substr(pos + 1); + lInfo() << "Multipart boundary is " << boundary; + + const vector body = message->getInternalContent().getBody(); + string contentsString(body.begin(), body.end()); + + pos = contentsString.find(boundary); + if (pos == string::npos) { + lError() << "Boundary not found in body !"; + return ChatMessageModifier::Result::Error; + } + + size_t start = pos + boundary.length() + 2; // 2 is the size of \r\n + size_t end; + do { + end = contentsString.find(boundary, start); + if (end != string::npos) { + string contentString = contentsString.substr(start, end - start); + + size_t contentTypePos = contentString.find(": ") + 2; // 2 is the size of : + size_t endOfLinePos = contentString.find("\r\n"); + if (contentTypePos >= endOfLinePos) { + lError() << "Content should start by a 'Content-Type: ' line !"; + continue; + } + string contentTypeString = contentString.substr(contentTypePos, endOfLinePos - contentTypePos); + ContentType contentType(contentTypeString); + + endOfLinePos += 4; // 4 is two time the size of \r\n + string contentBody = contentString.substr(endOfLinePos, contentString.length() - (endOfLinePos + 4)); // 4 is two time the size of \r\n + + Content *content; + if (contentType == ContentType::FileTransfer) { + content = new FileTransferContent(); + } else { + content = new Content(); + } + content->setContentType(contentType); + content->setBody(contentBody); + message->addContent(*content); + + lInfo() << "Parsed and added content with type " << contentType.asString(); + } + start = end + boundary.length() + 2; // 2 is the size of \r\n + } while (end != string::npos); + return ChatMessageModifier::Result::Done; } return ChatMessageModifier::Result::Skipped; diff --git a/src/conference/handlers/local-conference-event-handler.cpp b/src/conference/handlers/local-conference-event-handler.cpp index 8f56e74e5..9847a93e9 100644 --- a/src/conference/handlers/local-conference-event-handler.cpp +++ b/src/conference/handlers/local-conference-event-handler.cpp @@ -19,7 +19,6 @@ #include -#include "linphone/api/c-content.h" #include "linphone/utils/utils.h" #include "conference/local-conference.h" @@ -107,7 +106,7 @@ string LocalConferenceEventHandlerPrivate::createNotifyMultipart (int notifyId) static_cast(notifyId) ); - list contents; + list contents; for (const auto &eventLog : events) { Content content; content.setContentType(ContentType("application","conference-info")); @@ -181,7 +180,7 @@ string LocalConferenceEventHandlerPrivate::createNotifyMultipart (int notifyId) continue; } content.setBody(body); - contents.push_back(&content); + contents.push_back(content); } if (contents.empty()) diff --git a/src/conference/session/call-session.cpp b/src/conference/session/call-session.cpp index ea125826e..668f0df33 100644 --- a/src/conference/session/call-session.cpp +++ b/src/conference/session/call-session.cpp @@ -19,18 +19,19 @@ #include -#include "linphone/api/c-content.h" -#include "linphone/core.h" +#include "c-wrapper/c-wrapper.h" #include "address/address-p.h" -#include "c-wrapper/c-wrapper.h" #include "call/call-p.h" #include "conference/params/call-session-params-p.h" #include "conference/session/call-session-p.h" #include "conference/session/call-session.h" #include "core/core-p.h" + #include "logger/logger.h" +#include "linphone/core.h" + #include "private.h" using namespace std; diff --git a/src/content/content-manager.cpp b/src/content/content-manager.cpp index ff341bcf2..94ee69ce9 100644 --- a/src/content/content-manager.cpp +++ b/src/content/content-manager.cpp @@ -19,68 +19,101 @@ #include -#include "c-wrapper/c-wrapper.h" - -#include "linphone/api/c-content.h" - #include "content-manager.h" #include "content-type.h" #include "content/content.h" // ============================================================================= -namespace { - constexpr const char MultipartBoundary[] = "---------------------------14737809831466499882746641449"; -} - using namespace std; LINPHONE_BEGIN_NAMESPACE +namespace { + constexpr const char MultipartBoundary[] = "---------------------------14737809831466499882746641449"; +} + // ----------------------------------------------------------------------------- list ContentManager::multipartToContentList (const Content &content) { - LinphoneContent *cContent = L_GET_C_BACK_PTR(&content); - SalBodyHandler *sbh = sal_body_handler_ref(sal_body_handler_from_content(cContent)); + const string body = content.getBodyAsString(); + belle_sip_multipart_body_handler_t *mpbh = belle_sip_multipart_body_handler_new_from_buffer( + body.c_str(), body.length(), MultipartBoundary + ); + belle_sip_object_ref(mpbh); list contents; - for (const belle_sip_list_t *parts = sal_body_handler_get_parts(sbh); parts; parts = parts->next) { - SalBodyHandler *part = (SalBodyHandler *)parts->data; - LinphoneContent *cContent = linphone_content_from_sal_body_handler(part); - Content *cppContent = L_GET_CPP_PTR_FROM_C_OBJECT(cContent); - contents.push_back(*cppContent); - linphone_content_unref(cContent); + for (const belle_sip_list_t *parts = belle_sip_multipart_body_handler_get_parts(mpbh); parts; parts = parts->next) { + belle_sip_body_handler_t *part = BELLE_SIP_BODY_HANDLER(parts->data); + belle_sip_header_content_type_t *partContentType = nullptr; + for (const belle_sip_list_t *it = belle_sip_body_handler_get_headers(part); it; it = it->next) { + belle_sip_header_t *header = BELLE_SIP_HEADER(it->data); + if (strcasecmp("Content-Type", belle_sip_header_get_name(header)) == 0) { + partContentType = BELLE_SIP_HEADER_CONTENT_TYPE(header); + break; + } + } + + Content content; + content.setBody(static_cast( + belle_sip_memory_body_handler_get_buffer(BELLE_SIP_MEMORY_BODY_HANDLER(part)) + )); + content.setContentType(ContentType( + belle_sip_header_content_type_get_type(partContentType), + belle_sip_header_content_type_get_subtype(partContentType) + )); + contents.push_back(move(content)); } - sal_body_handler_unref(sbh); - linphone_content_unref(cContent); + belle_sip_object_unref(mpbh); return contents; } -Content ContentManager::contentListToMultipart (const list &contents) { +Content ContentManager::contentListToMultipart (const list &contents) { belle_sip_multipart_body_handler_t *mpbh = belle_sip_multipart_body_handler_new( nullptr, nullptr, nullptr, MultipartBoundary ); - mpbh = (belle_sip_multipart_body_handler_t *)belle_sip_object_ref(mpbh); + belle_sip_object_ref(mpbh); - for (Content *content : contents) { - LinphoneContent *cContent = L_GET_C_BACK_PTR(content); - SalBodyHandler *sbh = sal_body_handler_from_content(cContent); - belle_sip_multipart_body_handler_add_part(mpbh, BELLE_SIP_BODY_HANDLER(sbh)); - linphone_content_unref(cContent); + for (const auto &content : contents) { + const ContentType &contentType = content.getContentType(); + belle_sip_header_t *cContentType = BELLE_SIP_HEADER( + belle_sip_header_content_type_create( + contentType.getType().c_str(), + string(contentType.getSubType() + "; charset=\"UTF-8\"").c_str() + ) + ); + + const string body = content.getBodyAsString(); + belle_sip_memory_body_handler_t *mbh = belle_sip_memory_body_handler_new_copy_from_buffer( + body.c_str(), body.length(), nullptr, nullptr + ); + belle_sip_body_handler_add_header(BELLE_SIP_BODY_HANDLER(mbh), cContentType); + + for (const auto &header : content.getHeaders()) { + belle_sip_header_t *additionalHeader = BELLE_SIP_HEADER( + belle_sip_header_create( + header.first.c_str(), + header.second.c_str() + ) + ); + belle_sip_body_handler_add_header(BELLE_SIP_BODY_HANDLER(mbh), additionalHeader); + } + + belle_sip_multipart_body_handler_add_part(mpbh, BELLE_SIP_BODY_HANDLER(mbh)); } - SalBodyHandler *sbh = (SalBodyHandler *)mpbh; - sal_body_handler_set_type(sbh, ContentType::Multipart.getType().c_str()); - sal_body_handler_set_subtype(sbh, ContentType::Multipart.getSubType().c_str()); - sal_body_handler_set_content_type_parameter(sbh, "boundary", MultipartBoundary); - LinphoneContent *cContent = linphone_content_from_sal_body_handler(sbh); - Content *content = L_GET_CPP_PTR_FROM_C_OBJECT(cContent); - Content returnContent = *content; - linphone_content_unref(cContent); + char *desc = belle_sip_object_to_string(mpbh); + Content content; + content.setBody(desc); + belle_sip_free(desc); belle_sip_object_unref(mpbh); - return returnContent; + ContentType contentType = ContentType::Multipart; + contentType.setParameter("boundary=" + string(MultipartBoundary)); + content.setContentType(contentType); + + return content; } LINPHONE_END_NAMESPACE diff --git a/src/content/content-manager.h b/src/content/content-manager.h index 4d19076f0..8251d3c3b 100644 --- a/src/content/content-manager.h +++ b/src/content/content-manager.h @@ -32,7 +32,7 @@ class Content; namespace ContentManager { std::list multipartToContentList (const Content &content); - Content contentListToMultipart (const std::list &contents); + Content contentListToMultipart (const std::list &contents); } LINPHONE_END_NAMESPACE diff --git a/src/content/content-p.h b/src/content/content-p.h index 9dc4e1d31..167712313 100644 --- a/src/content/content-p.h +++ b/src/content/content-p.h @@ -29,15 +29,13 @@ LINPHONE_BEGIN_NAMESPACE -class Header; - class ContentPrivate : public ClonableObjectPrivate { private: std::vector body; ContentType contentType; ContentDisposition contentDisposition; std::string contentEncoding; - std::list
headers; + std::list> headers; L_DECLARE_PUBLIC(Content); }; diff --git a/src/content/content-type.cpp b/src/content/content-type.cpp index 7aee05247..78c356af6 100644 --- a/src/content/content-type.cpp +++ b/src/content/content-type.cpp @@ -20,8 +20,7 @@ #include "linphone/utils/utils.h" #include "content-type.h" -#include "header/header-p.h" -#include "header/header-param.h" +#include "object/clonable-object-p.h" // ============================================================================= @@ -31,10 +30,11 @@ LINPHONE_BEGIN_NAMESPACE // ----------------------------------------------------------------------------- -class ContentTypePrivate : public HeaderPrivate { +class ContentTypePrivate : public ClonableObjectPrivate { public: string type; string subType; + string parameter; }; // ----------------------------------------------------------------------------- @@ -52,7 +52,7 @@ const ContentType ContentType::Sdp("application/sdp"); // ----------------------------------------------------------------------------- -ContentType::ContentType (const string &contentType) : Header(*new ContentTypePrivate) { +ContentType::ContentType (const string &contentType) : ClonableObject(*new ContentTypePrivate) { L_D(); size_t pos = contentType.find('/'); @@ -68,23 +68,11 @@ ContentType::ContentType (const string &contentType) : Header(*new ContentTypePr d->type.clear(); } - if (posParam != string::npos) { - string params = contentType.substr(posParam + 1); - string token; - do { - posParam = params.find(";"); - if (posParam == string::npos) { - token = params; - } else { - token = params.substr(0, posParam); - } - addParameter(HeaderParam(token)); - params.erase(0, posParam + 1); - } while (posParam != std::string::npos); - } + if (posParam != string::npos) + setParameter(Utils::trim(contentType.substr(posParam + 1))); } -ContentType::ContentType (const string &type, const string &subType) : Header(*new ContentTypePrivate) { +ContentType::ContentType (const string &type, const string &subType) : ClonableObject(*new ContentTypePrivate) { L_D(); if (setType(type) && !setSubType(subType)) @@ -94,35 +82,22 @@ ContentType::ContentType (const string &type, const string &subType) : Header(*n ContentType::ContentType ( const string &type, const string &subType, - const HeaderParam ¶meter -) : Header(*new ContentTypePrivate) { + const string ¶meter +) : ClonableObject(*new ContentTypePrivate) { L_D(); if (setType(type) && !setSubType(subType)) d->type.clear(); - addParameter(parameter); + setParameter(parameter); } -ContentType::ContentType ( - const string &type, - const string &subType, - const std::list ¶meters -) : Header(*new ContentTypePrivate) { - L_D(); - - if (setType(type) && !setSubType(subType)) - d->type.clear(); - addParameters(parameters); -} - -ContentType::ContentType (const ContentType &other) : ContentType(other.getType(), other.getSubType(), other.getParameters()) {} +ContentType::ContentType (const ContentType &other) : ContentType(other.getType(), other.getSubType(), other.getParameter()) {} ContentType &ContentType::operator= (const ContentType &other) { if (this != &other) { setType(other.getType()); setSubType(other.getSubType()); - cleanParameters(); - addParameters(other.getParameters()); + setParameter(other.getParameter()); } return *this; @@ -130,7 +105,8 @@ ContentType &ContentType::operator= (const ContentType &other) { bool ContentType::operator== (const ContentType &other) const { return getType() == other.getType() && - getSubType() == other.getSubType(); + getSubType() == other.getSubType() && + getParameter() == other.getParameter(); } bool ContentType::operator!= (const ContentType &other) const { @@ -146,7 +122,6 @@ bool ContentType::setType (const string &type) { L_D(); if (type.find('/') == string::npos) { d->type = Utils::stringToLower(type); - setValue(d->type + "/" + d->subType); return true; } return false; @@ -161,12 +136,21 @@ bool ContentType::setSubType (const string &subType) { L_D(); if (subType.find('/') == string::npos) { d->subType = Utils::stringToLower(subType); - setValue(d->type + "/" + d->subType); return true; } return false; } +const string &ContentType::getParameter () const { + L_D(); + return d->parameter; +} + +void ContentType::setParameter (const string ¶meter) { + L_D(); + d->parameter = parameter; +} + bool ContentType::isEmpty () const { L_D(); return d->type.empty() && d->subType.empty(); @@ -177,10 +161,18 @@ bool ContentType::isValid () const { return !d->type.empty() && !d->subType.empty(); } -bool ContentType::isMultipart() const { - return getType() == "multipart"; +string ContentType::asString () const { + L_D(); + if (isValid()) { + string asString = d->type + "/" + d->subType; + if (!d->parameter.empty()) + asString += "; " + d->parameter; + return asString; + } + return ""; } + bool ContentType::isFile () const { // TODO Remove when not needed anymore in step 2.1 of maindb return isFile(*this); diff --git a/src/content/content-type.h b/src/content/content-type.h index c9aa7af77..b13063115 100644 --- a/src/content/content-type.h +++ b/src/content/content-type.h @@ -21,21 +21,18 @@ #define _L_CONTENT_TYPE_H_ #include "object/clonable-object.h" -#include "header/header.h" // ============================================================================= LINPHONE_BEGIN_NAMESPACE class ContentTypePrivate; -class HeaderParam; -class LINPHONE_PUBLIC ContentType : public Header { +class LINPHONE_PUBLIC ContentType : public ClonableObject { public: explicit ContentType (const std::string &contentType = ""); ContentType (const std::string &type, const std::string &subType); - ContentType (const std::string &type, const std::string &subType, const HeaderParam ¶meter); - ContentType (const std::string &type, const std::string &subType, const std::list ¶meters); + ContentType (const std::string &type, const std::string &subType, const std::string ¶meter); ContentType (const ContentType &other); ContentType &operator= (const ContentType &other); @@ -58,7 +55,10 @@ public: const std::string &getSubType () const; bool setSubType (const std::string &subType); - bool isMultipart() const; + const std::string &getParameter () const; + void setParameter (const std::string ¶meter); + + std::string asString () const; static bool isFile (const ContentType &contentType); diff --git a/src/content/content.cpp b/src/content/content.cpp index ad74de27f..aa30503d4 100644 --- a/src/content/content.cpp +++ b/src/content/content.cpp @@ -25,7 +25,6 @@ #include "content-p.h" #include "content-type.h" -#include "header/header.h" // ============================================================================= @@ -191,37 +190,17 @@ bool Content::isFile () const { return false; } -bool Content::isFileTransfer () const { - return false; -} - void Content::addHeader (const string &headerName, const string &headerValue) { L_D(); removeHeader(headerName); - Header header = Header(headerName, headerValue); - d->headers.push_back(header); + d->headers.push_back(make_pair(headerName, headerValue)); } -void Content::addHeader (const Header &header) { - L_D(); - removeHeader(header.getName()); - d->headers.push_back(header); -} - -const list
&Content::getHeaders () const { +const list> &Content::getHeaders () const { L_D(); return d->headers; } -const Header &Content::getHeader (const string &headerName) const { - L_D(); - list
::const_iterator it = findHeader(headerName); - if (it != d->headers.cend()) { - return *it; - } - return Utils::getEmptyConstRefObject
(); -} - void Content::removeHeader (const string &headerName) { L_D(); auto it = findHeader(headerName); @@ -229,11 +208,18 @@ void Content::removeHeader (const string &headerName) { d->headers.remove(*it); } -list
::const_iterator Content::findHeader (const string &headerName) const { +list>::const_iterator Content::findHeader (const string &headerName) const { L_D(); - return findIf(d->headers, [&headerName](const Header &header) { - return header.getName() == headerName; + return findIf(d->headers, [&headerName](const pair &pair) { + return pair.first == headerName; }); } +LinphoneContent *Content::toLinphoneContent () const { + LinphoneContent *content = linphone_core_create_content(nullptr); + linphone_content_set_type(content, getContentType().getType().c_str()); + linphone_content_set_subtype(content, getContentType().getSubType().c_str()); + return content; +} + LINPHONE_END_NAMESPACE diff --git a/src/content/content.h b/src/content/content.h index 3c29d3a1a..c570670c5 100644 --- a/src/content/content.h +++ b/src/content/content.h @@ -35,7 +35,6 @@ LINPHONE_BEGIN_NAMESPACE class ContentDisposition; class ContentType; class ContentPrivate; -class Header; class LINPHONE_PUBLIC Content : public ClonableObject, public AppDataContainer { public: @@ -75,14 +74,14 @@ public: bool isEmpty () const; virtual bool isFile () const; - virtual bool isFileTransfer () const; - const std::list
&getHeaders () const; - const Header &getHeader (const std::string &headerName) const; + const std::list> &getHeaders () const; void addHeader (const std::string &headerName, const std::string &headerValue); - void addHeader (const Header &header); void removeHeader (const std::string &headerName); - std::list
::const_iterator findHeader (const std::string &headerName) const; + std::list>::const_iterator findHeader (const std::string &headerName) const; + + // TODO: Remove me later. + virtual LinphoneContent *toLinphoneContent () const; protected: explicit Content (ContentPrivate &p); diff --git a/src/content/file-content.cpp b/src/content/file-content.cpp index b4a0ef0fb..851d935d3 100644 --- a/src/content/file-content.cpp +++ b/src/content/file-content.cpp @@ -36,6 +36,7 @@ public: string fileName; string filePath; size_t fileSize = 0; + string fileKey; }; // ----------------------------------------------------------------------------- @@ -47,6 +48,7 @@ FileContent::FileContent (const FileContent &other) : Content(*new FileContentPr d->fileName = other.getFileName(); d->filePath = other.getFilePath(); d->fileSize = other.getFileSize(); + d->fileKey = other.getFileKey(); } FileContent::FileContent (FileContent &&other) : Content(*new FileContentPrivate) { @@ -54,14 +56,18 @@ FileContent::FileContent (FileContent &&other) : Content(*new FileContentPrivate d->fileName = move(other.getPrivate()->fileName); d->filePath = move(other.getPrivate()->filePath); d->fileSize = move(other.getPrivate()->fileSize); + d->fileKey = move(other.getPrivate()->fileKey); } FileContent &FileContent::operator= (const FileContent &other) { L_D(); + if (this != &other) { Content::operator=(other); d->fileName = other.getFileName(); d->filePath = other.getFilePath(); d->fileSize = other.getFileSize(); + d->fileKey = other.getFileKey(); + } return *this; } @@ -72,6 +78,7 @@ FileContent &FileContent::operator= (FileContent &&other) { d->fileName = move(other.getPrivate()->fileName); d->filePath = move(other.getPrivate()->filePath); d->fileSize = move(other.getPrivate()->fileSize); + d->fileKey = move(other.getPrivate()->fileKey); return *this; } @@ -80,7 +87,8 @@ bool FileContent::operator== (const FileContent &other) const { return Content::operator==(other) && d->fileName == other.getFileName() && d->filePath == other.getFilePath() && - d->fileSize == other.getFileSize(); + d->fileSize == other.getFileSize() && + d->fileKey == other.getFileKey(); } void FileContent::setFileSize (size_t size) { @@ -113,12 +121,28 @@ const string &FileContent::getFilePath () const { return d->filePath; } +void FileContent::setFileKey (const string &key) { + L_D(); + d->fileKey = key; +} + +const string &FileContent::getFileKey () const { + L_D(); + return d->fileKey; +} + bool FileContent::isFile () const { return true; } -bool FileContent::isFileTransfer () const { - return false; +LinphoneContent *FileContent::toLinphoneContent () const { + LinphoneContent *content = linphone_core_create_content(nullptr); + linphone_content_set_type(content, getContentType().getType().c_str()); + linphone_content_set_subtype(content, getContentType().getSubType().c_str()); + linphone_content_set_name(content, getFileName().c_str()); + linphone_content_set_size(content, getFileSize()); + linphone_content_set_key(content, getFileKey().c_str(), getFileKey().size()); + return content; } LINPHONE_END_NAMESPACE diff --git a/src/content/file-content.h b/src/content/file-content.h index 081a5898a..645fc6312 100644 --- a/src/content/file-content.h +++ b/src/content/file-content.h @@ -48,8 +48,13 @@ public: void setFilePath (const std::string &path); const std::string &getFilePath () const; + void setFileKey (const std::string &key); + const std::string &getFileKey () const; + bool isFile () const override; - bool isFileTransfer () const override; + + // TODO: Remove me later. + LinphoneContent *toLinphoneContent () const override; private: L_DECLARE_PRIVATE(FileContent); diff --git a/src/content/file-transfer-content.cpp b/src/content/file-transfer-content.cpp index e2fe5ab4f..4bc5ed691 100644 --- a/src/content/file-transfer-content.cpp +++ b/src/content/file-transfer-content.cpp @@ -38,7 +38,6 @@ public: string filePath; FileContent *fileContent = nullptr; size_t fileSize = 0; - std::vector fileKey; }; // ----------------------------------------------------------------------------- @@ -52,7 +51,6 @@ FileTransferContent::FileTransferContent (const FileTransferContent &other) : Co d->filePath = other.getFilePath(); d->fileContent = other.getFileContent(); d->fileSize = other.getFileSize(); - d->fileKey = other.getFileKey(); } FileTransferContent::FileTransferContent (FileTransferContent &&other) : Content(*new FileTransferContentPrivate) { @@ -62,7 +60,6 @@ FileTransferContent::FileTransferContent (FileTransferContent &&other) : Content d->filePath = move(other.getPrivate()->filePath); d->fileContent = move(other.getPrivate()->fileContent); d->fileSize = move(other.getPrivate()->fileSize); - d->fileKey = move(other.getPrivate()->fileKey); } FileTransferContent &FileTransferContent::operator= (const FileTransferContent &other) { @@ -74,7 +71,6 @@ FileTransferContent &FileTransferContent::operator= (const FileTransferContent & d->filePath = other.getFilePath(); d->fileContent = other.getFileContent(); d->fileSize = other.getFileSize(); - d->fileKey = other.getFileKey(); } return *this; @@ -88,8 +84,6 @@ FileTransferContent &FileTransferContent::operator= (FileTransferContent &&other d->filePath = move(other.getPrivate()->filePath); d->fileContent = move(other.getPrivate()->fileContent); d->fileSize = move(other.getPrivate()->fileSize); - d->fileKey = move(other.getPrivate()->fileKey); - return *this; } @@ -152,32 +146,17 @@ size_t FileTransferContent::getFileSize () const { return d->fileSize; } -void FileTransferContent::setFileKey (const char *key, size_t size) { - L_D(); - d->fileKey = vector(key, key + size); -} - -const vector &FileTransferContent::getFileKey () const { - L_D(); - return d->fileKey; -} - -const char *FileTransferContent::getFileKeyAsString() const { - L_D(); - return d->fileKey.data(); -} - -size_t FileTransferContent::getFileKeySize() const { - L_D(); - return d->fileKey.size(); +LinphoneContent *FileTransferContent::toLinphoneContent () const { + LinphoneContent *content = linphone_core_create_content(nullptr); + linphone_content_set_type(content, getContentType().getType().c_str()); + linphone_content_set_subtype(content, getContentType().getSubType().c_str()); + linphone_content_set_name(content, getFileName().c_str()); + linphone_content_set_size(content, getFileSize()); + return content; } bool FileTransferContent::isFile () const { return false; } -bool FileTransferContent::isFileTransfer () const { - return true; -} - LINPHONE_END_NAMESPACE diff --git a/src/content/file-transfer-content.h b/src/content/file-transfer-content.h index 1904e11c5..59b4cc125 100644 --- a/src/content/file-transfer-content.h +++ b/src/content/file-transfer-content.h @@ -20,8 +20,6 @@ #ifndef _L_FILE_TRANSFER_CONTENT_H_ #define _L_FILE_TRANSFER_CONTENT_H_ -#include - #include "content.h" // ============================================================================= @@ -57,13 +55,10 @@ public: void setFileSize (size_t size); size_t getFileSize () const; - void setFileKey (const char *key, size_t size); - const std::vector &getFileKey () const; - const char *getFileKeyAsString () const; - size_t getFileKeySize() const; - bool isFile () const override; - bool isFileTransfer () const override; + + // TODO: Remove me later. + LinphoneContent *toLinphoneContent () const override; private: L_DECLARE_PRIVATE(FileTransferContent); diff --git a/src/content/header/header-p.h b/src/content/header/header-p.h deleted file mode 100644 index fd4663efe..000000000 --- a/src/content/header/header-p.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * header-p.h - * Copyright (C) 2010-2018 Belledonne Communications SARL - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef _L_HEADER_P_H_ -#define _L_HEADER_P_H_ - -#include - -#include "object/clonable-object-p.h" - -#include "header.h" - -// ============================================================================= - -LINPHONE_BEGIN_NAMESPACE - -class HeaderPrivate : public ClonableObjectPrivate { -private: - std::string name; - std::string value; - std::list parameters; - L_DECLARE_PUBLIC(Header); -}; - -LINPHONE_END_NAMESPACE - -#endif // ifndef _L_HEADER_P_H_ \ No newline at end of file diff --git a/src/content/header/header-param.cpp b/src/content/header/header-param.cpp deleted file mode 100644 index 9605a2f84..000000000 --- a/src/content/header/header-param.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - * header-param.cpp - * Copyright (C) 2010-2018 Belledonne Communications SARL - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include "linphone/utils/utils.h" - -#include "header-param.h" -#include "object/clonable-object-p.h" - -// ============================================================================= - -using namespace std; - -LINPHONE_BEGIN_NAMESPACE - -// ----------------------------------------------------------------------------- - -class HeaderParamPrivate : public ClonableObjectPrivate { -public: - string name; - string value; -}; - -// ----------------------------------------------------------------------------- - -HeaderParam::HeaderParam (const string ¶m) : ClonableObject(*new HeaderParamPrivate) { - size_t pos = param.find("="); - size_t end = param.length(); - - if (pos == string::npos) { - setName(param); - } else { - setName(param.substr(0, pos)); - setValue(param.substr(pos + 1, end - (pos + 1))); - } -} - -HeaderParam::HeaderParam (const string &name, const string &value) : ClonableObject(*new HeaderParamPrivate) { - setName(name); - setValue(value); -} - -HeaderParam::HeaderParam (const HeaderParam &other) : HeaderParam(other.getName(), other.getValue()) {} - -HeaderParam &HeaderParam::operator= (const HeaderParam &other) { - if (this != &other) { - setName(other.getName()); - setValue(other.getValue()); - } - - return *this; -} - -bool HeaderParam::operator== (const HeaderParam &other) const { - return getName() == other.getName() && - getValue() == other.getValue(); -} - -bool HeaderParam::operator!= (const HeaderParam &other) const { - return !(*this == other); -} - -const string &HeaderParam::getName () const { - L_D(); - return d->name; -} - -bool HeaderParam::setName (const string &name) { - L_D(); - d->name = name; - return true; -} - -const string &HeaderParam::getValue () const { - L_D(); - return d->value; -} - -bool HeaderParam::setValue (const string &value) { - L_D(); - d->value = value; - return true; -} - -string HeaderParam::asString () const { - L_D(); - string asString = ";" + d->name; - if (!d->value.empty()) - asString += "=" + d->value; - return asString; -} - -LINPHONE_END_NAMESPACE diff --git a/src/content/header/header-param.h b/src/content/header/header-param.h deleted file mode 100644 index a9471b486..000000000 --- a/src/content/header/header-param.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * header-param.h - * Copyright (C) 2010-2018 Belledonne Communications SARL - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef _L_HEADER_PARAM_H_ -#define _L_HEADER_PARAM_H_ - -#include "object/clonable-object.h" - -// ============================================================================= - -LINPHONE_BEGIN_NAMESPACE - -class HeaderParamPrivate; - -class LINPHONE_PUBLIC HeaderParam : public ClonableObject { -public: - explicit HeaderParam (const std::string &header = ""); - HeaderParam (const std::string &name, const std::string &value); - HeaderParam (const HeaderParam &other); - - HeaderParam &operator= (const HeaderParam &other); - - bool operator== (const HeaderParam &other) const; - bool operator!= (const HeaderParam &other) const; - - // Delete these operators to prevent putting complicated content-type strings - // in the code. Instead define static const HeaderParam objects below. - bool operator== (const std::string &other) const = delete; - bool operator!= (const std::string &other) const = delete; - - const std::string &getName () const; - bool setName (const std::string &name); - - const std::string &getValue () const; - bool setValue (const std::string &value); - - std::string asString () const; - -private: - L_DECLARE_PRIVATE(HeaderParam); -}; - -LINPHONE_END_NAMESPACE - -#endif // ifndef _L_HEADER_PARAM_H_ diff --git a/src/content/header/header.cpp b/src/content/header/header.cpp deleted file mode 100644 index 5924cdf5b..000000000 --- a/src/content/header/header.cpp +++ /dev/null @@ -1,183 +0,0 @@ -/* - * header.cpp - * Copyright (C) 2010-2018 Belledonne Communications SARL - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#include - -#include "linphone/utils/utils.h" -#include "linphone/utils/algorithm.h" - -#include "header-p.h" -#include "header-param.h" - -// ============================================================================= - -using namespace std; - -LINPHONE_BEGIN_NAMESPACE - -// ----------------------------------------------------------------------------- - -Header::Header(HeaderPrivate &p) : ClonableObject(p) {} - -Header::Header() : ClonableObject(*new HeaderPrivate) {} - -Header::Header (const string &name, const string &value) : ClonableObject(*new HeaderPrivate) { - setName(name); - - size_t posParam = value.find(";"); - if (posParam == string::npos) { - setValue(value); - return; - } - - string parsedValue = value.substr(0, posParam); - string params = value.substr(posParam + 1); - string token; - do { - posParam = params.find(";"); - if (posParam == string::npos) { - token = params; - } else { - token = params.substr(0, posParam); - } - addParameter(HeaderParam(token)); - params.erase(0, posParam + 1); - } while (posParam != std::string::npos); - - setValue(parsedValue); -} - -Header::Header (const string &name, const string &value, const list ¶ms) : Header(name, value) { - addParameters(params); -} - -Header::Header (const Header &other) : Header(other.getName(), other.getValue(), other.getParameters()) {} - -Header &Header::operator= (const Header &other) { - if (this != &other) { - setName(other.getName()); - setValue(other.getValue()); - cleanParameters(); - addParameters(other.getParameters()); - } - - return *this; -} - -bool Header::operator== (const Header &other) const { - return getName() == other.getName() && - getValue() == other.getValue(); -} - -bool Header::operator!= (const Header &other) const { - return !(*this == other); -} - -void Header::setName (const string &name) { - L_D(); - d->name = name; -} - -string Header::getName () const { - L_D(); - return d->name; -} - -void Header::setValue (const string &value) { - L_D(); - d->value = value; -} - -string Header::getValue () const { - L_D(); - return d->value; -} - -void Header::cleanParameters () { - L_D(); - d->parameters.clear(); -} - -const list &Header::getParameters () const { - L_D(); - return d->parameters; -} - -void Header::addParameter (const string ¶mName, const string ¶mValue) { - addParameter(HeaderParam(paramName, paramValue)); -} - -void Header::addParameter (const HeaderParam ¶m) { - L_D(); - removeParameter(param); - d->parameters.push_back(param); -} - -void Header::addParameters(const list ¶ms) { - for (auto it = std::begin(params); it!=std::end(params); ++it) { - HeaderParam param = *it; - addParameter(param.getName(), param.getValue()); - } -} - -void Header::removeParameter (const string ¶mName) { - L_D(); - auto it = findParameter(paramName); - if (it != d->parameters.cend()) - d->parameters.remove(*it); -} - -void Header::removeParameter (const HeaderParam ¶m) { - removeParameter(param.getName()); -} - -list::const_iterator Header::findParameter (const string ¶mName) const { - L_D(); - return findIf(d->parameters, [¶mName](const HeaderParam ¶m) { - return param.getName() == paramName; - }); -} - -const HeaderParam &Header::getParameter (const string ¶mName) const { - L_D(); - list::const_iterator it = findParameter(paramName); - if (it != d->parameters.cend()) { - return *it; - } - return Utils::getEmptyConstRefObject(); -} - -string Header::asString () const { - stringstream asString; - if (!getName().empty()) { - asString << getName() << ":"; - } - asString << getValue(); - for (const auto ¶m : getParameters()) { - asString << param.asString(); - } - return asString.str(); -} - -ostream &operator<<(ostream& stream, const Header& header) { - stream << header.asString(); - return stream; -} - -LINPHONE_END_NAMESPACE \ No newline at end of file diff --git a/src/content/header/header.h b/src/content/header/header.h deleted file mode 100644 index 583572523..000000000 --- a/src/content/header/header.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * header.h - * Copyright (C) 2010-2018 Belledonne Communications SARL - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef _L_HEADER_H_ -#define _L_HEADER_H_ - -#include - -#include "object/clonable-object.h" - -// ============================================================================= - -LINPHONE_BEGIN_NAMESPACE - -class HeaderPrivate; -class HeaderParam; - -class LINPHONE_PUBLIC Header : public ClonableObject { -public: - Header (); - Header (const std::string &name, const std::string &value); - Header (const std::string &name, const std::string &value, const std::list ¶ms); - Header (const Header &other); - - Header &operator= (const Header &other); - - bool operator== (const Header &other) const; - bool operator!= (const Header &other) const; - - void setName (const std::string &name); - std::string getName () const; - - void setValue (const std::string &value); - std::string getValue () const; - - void cleanParameters (); - const std::list &getParameters () const; - void addParameter (const std::string ¶mName, const std::string ¶mValue); - void addParameter (const HeaderParam ¶m); - void addParameters(const std::list ¶ms); - void removeParameter (const std::string ¶mName); - void removeParameter (const HeaderParam ¶m); - std::list::const_iterator findParameter (const std::string ¶mName) const; - const HeaderParam &getParameter (const std::string ¶mName) const; - - std::string asString () const; - friend std::ostream &operator<<(std::ostream&, const Header&); - -protected: - explicit Header (HeaderPrivate &p); - -private: - L_DECLARE_PRIVATE(Header); -}; - -LINPHONE_END_NAMESPACE - -#endif // ifndef _L_HEADER_H_ diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp index ac26bff98..e6cfd375d 100644 --- a/src/db/main-db.cpp +++ b/src/db/main-db.cpp @@ -2226,7 +2226,7 @@ void MainDb::loadChatMessageContents (const shared_ptr &chatMessage string data; fetchContentAppData(session, *content, contentId, data); } - chatMessage->addContent(content); + chatMessage->addContent(*content); } // 2 - Load external body url from body into FileTransferContent if needed. diff --git a/src/sal/op.cpp b/src/sal/op.cpp index 497a7a99b..e5e211f3b 100644 --- a/src/sal/op.cpp +++ b/src/sal/op.cpp @@ -1029,18 +1029,12 @@ void SalOp::process_incoming_message(const belle_sip_request_event_t *event) { /* if we just deciphered a message, use the deciphered part(which can be a rcs xml body pointing to the file to retreive from server)*/ salmsg.text=(!external_body)?belle_sip_message_get_body(BELLE_SIP_MESSAGE(req)):NULL; salmsg.url=NULL; - - char buffer[1024]; - size_t offset = 0; - belle_sip_parameters_marshal(BELLE_SIP_PARAMETERS(content_type), buffer, 1024, &offset); - buffer[offset] = '\0'; - salmsg.content_type = ms_strdup_printf("%s/%s%s", belle_sip_header_content_type_get_type(content_type), belle_sip_header_content_type_get_subtype(content_type), buffer); + salmsg.content_type = ms_strdup_printf("%s/%s", belle_sip_header_content_type_get_type(content_type), belle_sip_header_content_type_get_subtype(content_type)); if (external_body && belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type),"URL")) { size_t url_length=strlen(belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type),"URL")); salmsg.url = ms_strdup(belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type),"URL")+1); /* skip first "*/ ((char*)salmsg.url)[url_length-2]='\0'; /*remove trailing "*/ } - salmsg.message_id=message_id; salmsg.time=date ? belle_sip_header_date_get_time(date) : time(NULL); this->root->callbacks.message_received(this,&salmsg); diff --git a/tester/CMakeLists.txt b/tester/CMakeLists.txt index e07217934..b14e28572 100644 --- a/tester/CMakeLists.txt +++ b/tester/CMakeLists.txt @@ -199,7 +199,7 @@ set(SOURCE_FILES_C set(SOURCE_FILES_CXX clonable-object-tester.cpp conference-event-tester.cpp - contents-tester.cpp + content-manager-tester.cpp cpim-tester.cpp main-db-tester.cpp multipart-tester.cpp diff --git a/tester/contents-tester.cpp b/tester/content-manager-tester.cpp similarity index 62% rename from tester/contents-tester.cpp rename to tester/content-manager-tester.cpp index 99ecee08d..e21cc6399 100644 --- a/tester/contents-tester.cpp +++ b/tester/content-manager-tester.cpp @@ -21,15 +21,13 @@ #include "content/content-manager.h" #include "content/content-type.h" #include "content/content.h" -#include "content/header/header-param.h" #include "liblinphone_tester.h" #include "tester_utils.h" -#include "logger/logger.h" using namespace LinphonePrivate; using namespace std; -static const char* source_multipart = \ +static const char* multipart = \ "-----------------------------14737809831466499882746641449\r\n" \ "Content-Type: application/rlmi+xml;charset=\"UTF-8\"\r\n\r\n" \ "" \ @@ -62,7 +60,6 @@ static const char* source_multipart = \ " " \ "" \ "-----------------------------14737809831466499882746641449\r\n" \ -"Content-Encoding: b64\r\n" \ "Content-Type: application/pidf+xml;charset=\"UTF-8\"\r\n\r\n" \ "" \ "" \ @@ -80,7 +77,6 @@ static const char* source_multipart = \ " " \ "" \ "-----------------------------14737809831466499882746641449\r\n" \ -"Content-Id: toto;param1=value1;param2;param3=value3\r\n" \ "Content-Type: application/pidf+xml;charset=\"UTF-8\"\r\n\r\n" \ "" \ "" \ @@ -99,80 +95,6 @@ static const char* source_multipart = \ "" \ "-----------------------------14737809831466499882746641449--\r\n"; -static const char* generated_multipart = \ -"-----------------------------14737809831466499882746641449\r\n" \ -"Content-Type: application/rlmi+xml;charset=\"UTF-8\"\r\n" \ -"Content-Length:582\r\n\r\n" \ -"" \ -"" \ -" " \ -" " \ -" " \ -" " \ -" " \ -" " \ -" " \ -" " \ -" " \ -"" \ -"-----------------------------14737809831466499882746641449\r\n" \ -"Content-Type: application/pidf+xml;charset=\"UTF-8\"\r\n" \ -"Content-Length:561\r\n\r\n" \ -"" \ -"" \ -" " \ -" " \ -" open" \ -" " \ -" sip:+YYYYYYYYYY@sip.linphone.org;user=phone" \ -" 2017-10-25T13:18:26" \ -" " \ -" " \ -" " \ -" " \ -" " \ -" " \ -"" \ -"-----------------------------14737809831466499882746641449\r\n" \ -"Content-Encoding:b64\r\n" \ -"Content-Type: application/pidf+xml;charset=\"UTF-8\"\r\n" \ -"Content-Length:561\r\n\r\n" \ -"" \ -"" \ -" " \ -" " \ -" open" \ -" " \ -" sip:+XXXXXXXXXX@sip.linphone.org;user=phone" \ -" 2017-10-25T13:18:26" \ -" " \ -" " \ -" " \ -" " \ -" " \ -" " \ -"" \ -"-----------------------------14737809831466499882746641449\r\n" \ -"Content-Id:toto;param1=value1;param2;param3=value3\r\n" \ -"Content-Type: application/pidf+xml;charset=\"UTF-8\"\r\n" \ -"Content-Length:546\r\n\r\n" \ -"" \ -"" \ -" " \ -" " \ -" open" \ -" " \ -" sip:someone@sip.linphone.org" \ -" 2017-10-25T13:18:26" \ -" " \ -" " \ -" " \ -" " \ -" " \ -" " \ -"" \ -"-----------------------------14737809831466499882746641449--\r\n"; - static const char* part1 = \ "" \ "" \ @@ -240,7 +162,7 @@ static const char* part4 = \ void multipart_to_list () { Content multipartContent; - multipartContent.setBody(source_multipart); + multipartContent.setBody(multipart); multipartContent.setContentType(ContentType("multipart", "related")); list contents = ContentManager::multipartToContentList(multipartContent); @@ -298,7 +220,6 @@ void multipart_to_list () { ms_message("\n\n----- Original part 3 -----"); ms_message("%s", originalStr3.c_str()); BC_ASSERT_TRUE(originalStr3 == generatedStr3); - BC_ASSERT_TRUE(content3.getHeader("Content-Encoding").getValue() == "b64"); Content content4 = contents.front(); contents.pop_front(); @@ -313,43 +234,29 @@ void multipart_to_list () { generatedStr4.erase(std::remove(generatedStr4.begin(), generatedStr4.end(), '\r'), generatedStr4.end()); generatedStr4.erase(std::remove(generatedStr4.begin(), generatedStr4.end(), '\n'), generatedStr4.end()); ms_message("\n\n----- Generated part 4 -----"); - ms_message("%s", generatedStr4.c_str()); + ms_message("%s", generatedStr3.c_str()); ms_message("\n\n----- Original part 4 -----"); ms_message("%s", originalStr4.c_str()); BC_ASSERT_TRUE(originalStr4 == generatedStr4); - BC_ASSERT_TRUE(content4.getHeader("Content-Id").getValue() == "toto"); - BC_ASSERT_TRUE(content4.getHeader("Content-Id").getParameter("param1").getValue() == "value1"); - BC_ASSERT_TRUE(content4.getHeader("Content-Id").getParameter("param2").getValue().empty()); - BC_ASSERT_TRUE(content4.getHeader("Content-Id").getParameter("param3").getValue() == "value3"); } void list_to_multipart () { - ContentType contentType = ContentType("application", "rlmi+xml"); - contentType.addParameter("charset", "\"UTF-8\""); Content content1; content1.setBody(part1); - content1.setContentType(contentType); - contentType = ContentType("application", "pidf+xml"); - contentType.addParameter("charset", "\"UTF-8\""); + content1.setContentType(ContentType("application", "rlmi+xml")); Content content2; content2.setBody(part2); - content2.setContentType(contentType); + content2.setContentType(ContentType("application", "pidf+xml")); Content content3; content3.setBody(part3); - content3.addHeader("Content-Encoding", "b64"); - content3.setContentType(contentType); + content3.setContentType(ContentType("application", "pidf+xml")); Content content4; - Header header = Header("Content-Id", "toto"); - header.addParameter("param1", "value1"); - header.addParameter("param2", ""); - header.addParameter("param3", "value3"); - content4.addHeader(header); content4.setBody(part4); - content4.setContentType(contentType); - list contents = {&content1, &content2, &content3, &content4}; + content4.setContentType(ContentType("application", "pidf+xml")); + list contents = {content1, content2, content3, content4}; Content multipartContent = ContentManager::contentListToMultipart(contents); - string originalStr(generated_multipart); + string originalStr(multipart); originalStr.erase(std::remove(originalStr.begin(), originalStr.end(), ' '), originalStr.end()); originalStr.erase(std::remove(originalStr.begin(), originalStr.end(), '\t'), originalStr.end()); originalStr.erase(std::remove(originalStr.begin(), originalStr.end(), '\r'), originalStr.end()); @@ -369,67 +276,16 @@ void list_to_multipart () { BC_ASSERT_TRUE(originalStr == generatedStr); } -static void content_type_parsing(void) { - string type = "message/external-body;access-type=URL;URL=\"https://www.linphone.org/img/linphone-open-source-voip-projectX2.png\""; - ContentType contentType = ContentType(type); - BC_ASSERT_STRING_EQUAL("message", contentType.getType().c_str()); - BC_ASSERT_STRING_EQUAL("external-body", contentType.getSubType().c_str()); - BC_ASSERT_STRING_EQUAL("URL", contentType.getParameter("access-type").getValue().c_str()); - BC_ASSERT_STRING_EQUAL("\"https://www.linphone.org/img/linphone-open-source-voip-projectX2.png\"", contentType.getParameter("URL").getValue().c_str()); - BC_ASSERT_STRING_EQUAL("", contentType.getParameter("boundary").getValue().c_str()); - BC_ASSERT_EQUAL(2, contentType.getParameters().size(), int, "%d"); - lInfo() << "Content-Type is " << contentType; - BC_ASSERT_TRUE(type == contentType.asString()); - - type = "multipart/mixed;boundary=-----------------------------14737809831466499882746641450"; - contentType = ContentType(type); - BC_ASSERT_STRING_EQUAL("multipart", contentType.getType().c_str()); - BC_ASSERT_STRING_EQUAL("mixed", contentType.getSubType().c_str()); - BC_ASSERT_STRING_EQUAL("-----------------------------14737809831466499882746641450", contentType.getParameter("boundary").getValue().c_str()); - BC_ASSERT_STRING_EQUAL("", contentType.getParameter("access-type").getValue().c_str()); - BC_ASSERT_EQUAL(1, contentType.getParameters().size(), int, "%d"); - lInfo() << "Content-Type is " << contentType; - BC_ASSERT_TRUE(type == contentType.asString()); - - type = "plain/text"; - contentType = ContentType(type); - BC_ASSERT_STRING_EQUAL("plain", contentType.getType().c_str()); - BC_ASSERT_STRING_EQUAL("text", contentType.getSubType().c_str()); - BC_ASSERT_STRING_EQUAL("", contentType.getParameter("boundary").getValue().c_str()); - BC_ASSERT_EQUAL(0, contentType.getParameters().size(), int, "%d"); - lInfo() << "Content-Type is " << contentType; - BC_ASSERT_TRUE(type == contentType.asString()); -} - -static void content_header_parsing(void) { - string value = "toto;param1=value1;param2;param3=value3"; - Header header = Header("Content-Id", value); - BC_ASSERT_TRUE(header.getValue() == "toto"); - BC_ASSERT_TRUE(header.getParameter("param1").getValue() == "value1"); - BC_ASSERT_TRUE(header.getParameter("param2").getValue().empty()); - BC_ASSERT_TRUE(header.getParameter("param3").getValue() == "value3"); - BC_ASSERT_EQUAL(3, header.getParameters().size(), int, "%d"); - BC_ASSERT_STRING_EQUAL("", header.getParameter("encoding").getValue().c_str()); - - value = "b64"; - header = Header("Content-Encoding", value); - BC_ASSERT_TRUE(header.getValue() == value); - BC_ASSERT_EQUAL(0, header.getParameters().size(), int, "%d"); - BC_ASSERT_STRING_EQUAL("", header.getParameter("access-type").getValue().c_str()); -} - -test_t contents_tests[] = { +test_t content_manager_tests[] = { TEST_NO_TAG("Multipart to list", multipart_to_list), - TEST_NO_TAG("List to multipart", list_to_multipart), - TEST_NO_TAG("Content type parsing", content_type_parsing), - TEST_NO_TAG("Content header parsing", content_header_parsing) + TEST_NO_TAG("List to multipart", list_to_multipart) }; -test_suite_t contents_test_suite = { - "Contents", +test_suite_t content_manager_test_suite = { + "Content manager", nullptr, nullptr, liblinphone_tester_before_each, liblinphone_tester_after_each, - sizeof(contents_tests) / sizeof(contents_tests[0]), contents_tests + sizeof(content_manager_tests) / sizeof(content_manager_tests[0]), content_manager_tests }; diff --git a/tester/cpim-tester.cpp b/tester/cpim-tester.cpp index 66cc661d8..e803ae33a 100644 --- a/tester/cpim-tester.cpp +++ b/tester/cpim-tester.cpp @@ -423,12 +423,12 @@ static void cpim_chat_message_modifier_base(bool_t use_multipart) { Content *content = new Content(); content->setContentType(ContentType::PlainText); content->setBody("Hello Part 2"); - marieMessage->addContent(content); + marieMessage->addContent(*content); } marieMessage->send(); BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneMessageReceived,1)); - BC_ASSERT_TRUE(marieMessage->getInternalContent().getContentType().isEmpty()); // Internal content is cleaned after message is sent or received + BC_ASSERT_STRING_EQUAL(marieMessage->getInternalContent().getContentType().asString().c_str(), ""); // Internal content is cleaned after message is sent or received BC_ASSERT_PTR_NOT_NULL(pauline->stat.last_received_chat_message); if (pauline->stat.last_received_chat_message != NULL) { diff --git a/tester/eventapi_tester.c b/tester/eventapi_tester.c index 66ae0f165..2119f3500 100644 --- a/tester/eventapi_tester.c +++ b/tester/eventapi_tester.c @@ -41,7 +41,7 @@ void linphone_notify_received(LinphoneCore *lc, LinphoneEvent *lev, const char * if (!BC_ASSERT_PTR_NOT_NULL(content)) return; if (!linphone_content_is_multipart(content) && (!ua || !strstr(ua, "flexisip"))) { /*disable check for full presence server support*/ /*hack to disable content checking for list notify */ - BC_ASSERT_STRING_EQUAL((const char*)linphone_content_get_buffer(content),notify_content); + BC_ASSERT_STRING_EQUAL(notify_content,(const char*)linphone_content_get_buffer(content)); } mgr=get_manager(lc); mgr->stat.number_of_NotifyReceived++; diff --git a/tester/liblinphone_tester.h b/tester/liblinphone_tester.h index c96be9ed4..9824c2084 100644 --- a/tester/liblinphone_tester.h +++ b/tester/liblinphone_tester.h @@ -45,7 +45,7 @@ extern test_suite_t call_video_test_suite; extern test_suite_t clonable_object_test_suite; extern test_suite_t conference_event_test_suite; extern test_suite_t conference_test_suite; -extern test_suite_t contents_test_suite; +extern test_suite_t content_manager_test_suite; extern test_suite_t cpim_test_suite; extern test_suite_t dtmf_test_suite; extern test_suite_t event_test_suite; diff --git a/tester/message_tester.c b/tester/message_tester.c index 8922adf20..396f4b9c4 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -2294,19 +2294,15 @@ void text_message_with_custom_content_type_and_lime(void) { static int im_encryption_engine_process_incoming_message_cb(LinphoneImEncryptionEngine *engine, LinphoneChatRoom *room, LinphoneChatMessage *msg) { - ms_debug("IM encryption process incoming message with content type %s", linphone_chat_message_get_content_type(msg)); if (linphone_chat_message_get_content_type(msg)) { if (strcmp(linphone_chat_message_get_content_type(msg), "cipher/b64") == 0) { size_t b64Size = 0; unsigned char *output; - const char *data = linphone_chat_message_get_text(msg); - ms_debug("IM encryption process incoming message crypted message is %s", data); - bctbx_base64_decode(NULL, &b64Size, (unsigned char *)data, strlen(data)); + bctbx_base64_decode(NULL, &b64Size, (unsigned char *)linphone_chat_message_get_text(msg), strlen(linphone_chat_message_get_text(msg))); output = (unsigned char *)ms_malloc(b64Size+1), - bctbx_base64_decode(output, &b64Size, (unsigned char *)data, strlen(data)); + bctbx_base64_decode(output, &b64Size, (unsigned char *)linphone_chat_message_get_text(msg), strlen(linphone_chat_message_get_text(msg))); output[b64Size] = '\0'; linphone_chat_message_set_text(msg, (char *)output); - ms_debug("IM encryption process incoming message decrypted message is %s", output); ms_free(output); linphone_chat_message_set_content_type(msg, "text/plain"); return 0; diff --git a/tester/multipart-tester.cpp b/tester/multipart-tester.cpp index c94dc9a2e..3fdd9073a 100644 --- a/tester/multipart-tester.cpp +++ b/tester/multipart-tester.cpp @@ -53,13 +53,13 @@ static void chat_message_multipart_modifier_base(bool first_file_transfer, bool content->setContentType(ContentType("video/mkv")); content->setFilePath(send_filepath); content->setFileName("sintel_trailer_opus_h264.mkv"); - marieMessage->addContent(content); + marieMessage->addContent(*content); bc_free(send_filepath); } else { Content *content = new Content(); content->setContentType(ContentType::PlainText); - content->setBody("Hello part 1"); - marieMessage->addContent(content); + content->setBody("Hello Part 1"); + marieMessage->addContent(*content); } if (second_file_transfer) { @@ -68,13 +68,13 @@ static void chat_message_multipart_modifier_base(bool first_file_transfer, bool content->setContentType(ContentType("file/vcf")); content->setFilePath(send_filepath); content->setFileName("vcards.vcf"); - marieMessage->addContent(content); + marieMessage->addContent(*content); bc_free(send_filepath); } else { Content *content = new Content(); content->setContentType(ContentType::PlainText); - content->setBody("Hello part 2"); - marieMessage->addContent(content); + content->setBody("Hello Part 2"); + marieMessage->addContent(*content); } linphone_core_set_file_transfer_server(marie->lc,"https://www.linphone.org:444/lft.php"); @@ -82,20 +82,7 @@ static void chat_message_multipart_modifier_base(bool first_file_transfer, bool BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneMessageReceived,1)); BC_ASSERT_PTR_NOT_NULL(pauline->stat.last_received_chat_message); - - if (first_file_transfer || second_file_transfer) { - LinphoneContent *content = linphone_chat_message_get_file_transfer_information(pauline->stat.last_received_chat_message); - BC_ASSERT_PTR_NOT_NULL(content); - linphone_content_unref(content); - } - if (!first_file_transfer || !second_file_transfer) { - const char *content = linphone_chat_message_get_text_content(pauline->stat.last_received_chat_message); - BC_ASSERT_PTR_NOT_NULL(content); - if (!first_file_transfer) - BC_ASSERT_STRING_EQUAL(content, "Hello part 1"); - else if (!second_file_transfer) - BC_ASSERT_STRING_EQUAL(content, "Hello part 2"); - } + BC_ASSERT_STRING_EQUAL(linphone_chat_message_get_content_type(pauline->stat.last_received_chat_message), "multipart/mixed"); linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); diff --git a/tester/presence_server_tester.c b/tester/presence_server_tester.c index c0587fe7d..db3f0ca07 100644 --- a/tester/presence_server_tester.c +++ b/tester/presence_server_tester.c @@ -430,10 +430,8 @@ static void test_presence_list_base(bool_t enable_compression) { lcs = bctbx_list_append(lcs, pauline->lc); wait_for_list(lcs, &laure->stat.number_of_NotifyPresenceReceived, 2, 4000); - BC_ASSERT_GREATER(laure->stat.number_of_NotifyPresenceReceived, 2, int, "%d"); - BC_ASSERT_LOWER(laure->stat.number_of_NotifyPresenceReceived, 3, int, "%d"); - BC_ASSERT_GREATER(linphone_friend_list_get_expected_notification_version(linphone_core_get_default_friend_list(laure->lc)), 1, int, "%d"); - BC_ASSERT_LOWER(linphone_friend_list_get_expected_notification_version(linphone_core_get_default_friend_list(laure->lc)), 2, int, "%d"); + BC_ASSERT_EQUAL(laure->stat.number_of_NotifyPresenceReceived, 2, int, "%d"); + BC_ASSERT_EQUAL(linphone_friend_list_get_expected_notification_version(linphone_core_get_default_friend_list(laure->lc)), 1, int, "%d"); lf = linphone_friend_list_find_friend_by_address(linphone_core_get_default_friend_list(laure->lc), get_identity_address(marie)); if (!BC_ASSERT_PTR_NOT_NULL(lf)) goto end; BC_ASSERT_EQUAL(linphone_friend_get_status(lf), LinphoneStatusBusy, int, "%d"); @@ -487,8 +485,7 @@ static void test_presence_list_base(bool_t enable_compression) { /* The number of PresenceReceived events can be 3 or 4 here. TODO: ideally it should always be 3. */ BC_ASSERT_GREATER(laure->stat.number_of_NotifyPresenceReceived, 3, int, "%d"); BC_ASSERT_LOWER(laure->stat.number_of_NotifyPresenceReceived, 4, int, "%d"); - BC_ASSERT_GREATER(linphone_friend_list_get_expected_notification_version(linphone_core_get_default_friend_list(laure->lc)), 2, int, "%d"); - BC_ASSERT_LOWER(linphone_friend_list_get_expected_notification_version(linphone_core_get_default_friend_list(laure->lc)), 3, int, "%d"); + BC_ASSERT_EQUAL(linphone_friend_list_get_expected_notification_version(linphone_core_get_default_friend_list(laure->lc)), 2, int, "%d"); lf = linphone_friend_list_find_friend_by_address(linphone_core_get_default_friend_list(laure->lc), get_identity_address(marie)); BC_ASSERT_EQUAL(linphone_friend_get_status(lf), LinphoneStatusOnThePhone, int, "%d"); diff --git a/tester/tester.c b/tester/tester.c index cd8481381..6eaafeab9 100644 --- a/tester/tester.c +++ b/tester/tester.c @@ -606,7 +606,7 @@ void liblinphone_tester_add_suites() { bc_tester_add_suite(&stun_test_suite); bc_tester_add_suite(&event_test_suite); bc_tester_add_suite(&conference_event_test_suite); - bc_tester_add_suite(&contents_test_suite); + bc_tester_add_suite(&content_manager_test_suite); bc_tester_add_suite(&flexisip_test_suite); bc_tester_add_suite(&remote_provisioning_test_suite); bc_tester_add_suite(&quality_reporting_test_suite); From 601a3aad5a2011d1a45f203d4e2b16431d023e18 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Thu, 5 Apr 2018 12:26:23 +0200 Subject: [PATCH 055/121] Fixed issue in local-conference-event-handler related to Contents --- .../handlers/local-conference-event-handler.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/conference/handlers/local-conference-event-handler.cpp b/src/conference/handlers/local-conference-event-handler.cpp index 8f56e74e5..a9aca08b7 100644 --- a/src/conference/handlers/local-conference-event-handler.cpp +++ b/src/conference/handlers/local-conference-event-handler.cpp @@ -109,8 +109,8 @@ string LocalConferenceEventHandlerPrivate::createNotifyMultipart (int notifyId) list contents; for (const auto &eventLog : events) { - Content content; - content.setContentType(ContentType("application","conference-info")); + Content *content = new Content(); + content->setContentType(ContentType("application","conference-info")); string body; shared_ptr notifiedEvent = static_pointer_cast(eventLog); int eventNotifyId = static_cast(notifiedEvent->getNotifyId()); @@ -180,13 +180,15 @@ string LocalConferenceEventHandlerPrivate::createNotifyMultipart (int notifyId) L_ASSERT(false); continue; } - content.setBody(body); - contents.push_back(&content); + content->setBody(body); + contents.push_back(content); } if (contents.empty()) return ""; - return ContentManager::contentListToMultipart(contents).getBodyAsString(); + string multipart = ContentManager::contentListToMultipart(contents).getBodyAsString(); + contents.clear(); + return multipart; } string LocalConferenceEventHandlerPrivate::createNotifyParticipantAdded (const Address &addr, int notifyId) { From d36a324b7bd2d6246fcb230ceaf8fbb5d0725768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Thu, 5 Apr 2018 14:45:04 +0200 Subject: [PATCH 056/121] Add source code examples --- coreapi/help/doc/sphinx/CMakeLists.txt | 4 + .../help/doc/sphinx/guides/call_control.rst | 2 +- coreapi/help/doc/sphinx/guides/chatroom.rst | 2 +- coreapi/help/doc/sphinx/guides/proxies.rst | 2 +- coreapi/help/doc/sphinx/index.rst | 3 + coreapi/help/doc/sphinx/samples/samples.rst | 106 ++++++++++++++++++ coreapi/help/examples/C/CMakeLists.txt | 14 ++- 7 files changed, 128 insertions(+), 5 deletions(-) create mode 100644 coreapi/help/doc/sphinx/samples/samples.rst diff --git a/coreapi/help/doc/sphinx/CMakeLists.txt b/coreapi/help/doc/sphinx/CMakeLists.txt index df0cee4e7..e3b9a250e 100644 --- a/coreapi/help/doc/sphinx/CMakeLists.txt +++ b/coreapi/help/doc/sphinx/CMakeLists.txt @@ -57,12 +57,16 @@ if (ENABLE_SPHINX_DOC) guides/proxies.rst index.rst logo.png + samples/samples.rst toc.rst ) configure_file(conf.py.in source/conf.py) foreach(file ${STATIC_DOCUMENTATION_FILES}) configure_file(${file} source/${file} COPYONLY) endforeach(file) + foreach(source ${LINPHONE_C_EXAMPLES_SOURCE}) + configure_file(${source} source/samples/ COPYONLY) + endforeach(source) add_custom_target(sphinx-doc ALL ${PYTHON_EXECUTABLE} '${CMAKE_CURRENT_SOURCE_DIR}/gendoc.py' '${LINPHONE_DOXYGEN_XML_DIR}' -o 'source' COMMAND ${PYTHON_EXECUTABLE} -msphinx -M html 'source' 'build' DEPENDS linphone-doc) diff --git a/coreapi/help/doc/sphinx/guides/call_control.rst b/coreapi/help/doc/sphinx/guides/call_control.rst index 81567befa..e6e959348 100644 --- a/coreapi/help/doc/sphinx/guides/call_control.rst +++ b/coreapi/help/doc/sphinx/guides/call_control.rst @@ -6,4 +6,4 @@ The :cpp:type:`LinphoneCall` object represents an incoming or outgoing call mana Outgoing calls can be created using :cpp:func:`linphone_core_invite` or :cpp:func:`linphone_core_invite_address`, while incoming calls are notified to the application through the LinphoneCoreVTable::call_state_changed callback. -See the basic call \ref basic_call_tutorials "tutorial". +.. seealso:: :ref:`"Basic Call" ` source code. diff --git a/coreapi/help/doc/sphinx/guides/chatroom.rst b/coreapi/help/doc/sphinx/guides/chatroom.rst index e8ccb2399..5d391845c 100644 --- a/coreapi/help/doc/sphinx/guides/chatroom.rst +++ b/coreapi/help/doc/sphinx/guides/chatroom.rst @@ -24,5 +24,5 @@ Incoming message are received from call back LinphoneCoreVTable.text_received printf(" Message [%s] received from [%s] \n",message,linphone_address_as_string (from)); } -A complete tutorial can be found at : \ref chatroom_tuto "Chat room tutorial" +.. seealso:: A complete tutorial can be found at :ref:`"Chatroom and messaging" ` source code. diff --git a/coreapi/help/doc/sphinx/guides/proxies.rst b/coreapi/help/doc/sphinx/guides/proxies.rst index b41734b90..dd852b0b8 100644 --- a/coreapi/help/doc/sphinx/guides/proxies.rst +++ b/coreapi/help/doc/sphinx/guides/proxies.rst @@ -72,5 +72,5 @@ This pseudo code shows how to unregister a user associated to a #LinphoneProxyCo linphone_proxy_config_enable_register(proxy_cfg,FALSE); /*de-activate registration for this proxy config*/ linphone_proxy_config_done(proxy_cfg); /*initiate REGISTER with expire = 0*/ -A complete tutorial can be found at : \ref registration_tutorials "Registration tutorial" +.. seealso:: A complete tutorial can be found at: :ref:`"Basic registration" ` source code. diff --git a/coreapi/help/doc/sphinx/index.rst b/coreapi/help/doc/sphinx/index.rst index c036cd442..8b6728012 100644 --- a/coreapi/help/doc/sphinx/index.rst +++ b/coreapi/help/doc/sphinx/index.rst @@ -52,7 +52,10 @@ Beginners' guides Code samples ------------ +.. toctree:: + :maxdepth: 1 + samples/samples API's reference documentation diff --git a/coreapi/help/doc/sphinx/samples/samples.rst b/coreapi/help/doc/sphinx/samples/samples.rst new file mode 100644 index 000000000..8d4cc6024 --- /dev/null +++ b/coreapi/help/doc/sphinx/samples/samples.rst @@ -0,0 +1,106 @@ +.. _basic_call_code_sample: + +Basic call +========== + +This program is a *very* simple usage example of liblinphone. It just takes a sip-uri as first argument and attempts to call it + +.. literalinclude:: helloworld.c + :language: c + + +.. _basic_registration_code_sample: + +Basic registration +================== + +This program is a *very* simple usage example of liblinphone, desmonstrating how to initiate a SIP registration from a sip uri identity +passed from the command line. First argument must be like sip:jehan@sip.linphone.org , second must be *password* . Registration is cleared +on *SIGINT*. + +Example: ``registration sip:jehan@sip.linphone.org secret`` + +.. literalinclude:: registration.c + :language: c + + +.. _subscribe_notify_code_sample: + +Generic subscribe/notify example +================================ + +This program is a *very* simple usage example of liblinphone. It demonstrates how to listen to a SIP subscription. +It then sends notify requests back periodically. First argument must be like sip:jehan@sip.linphone.org , second must be *password*. +Registration is cleared on *SIGINT*. + +Example: ``registration sip:jehan@sip.linphone.org secret`` + +.. literalinclude:: registration.c + :language: c + + + +.. _buddy_status_notification_code_sample: + +Basic buddy status notification +=============================== + +This program is a *very* simple usage example of liblinphone, demonstrating how to initiate SIP subscriptions and receive +notifications from a sip uri identity passed from the command line. Argument must be like sip:jehan@sip.linphone.org . +Subscription is cleared on *SIGINT* signal. + +Example: ``budy_list sip:jehan@sip.linphone.org`` + +.. literalinclude:: buddy_status.c + :language: c + + +.. _chatroom_code_sample: + +Chat room and messaging +======================= + +This program is a *very* simple usage example of liblinphone, desmonstrating how to send/receive SIP MESSAGE from a sip uri +identity passed from the command line. Argument must be like sip:jehan@sip.linphone.org . + +Example: ``chatroom sip:jehan@sip.linphone.org`` + +.. literalinclude:: chatroom.c + :language: c + + +.. _file_transfer_code_sample: + +File transfer +============= + +.. literalinclude:: filetransfer.c + :language: c + + + +.. _RT text receiver_code_sample: + +Real Time Text Receiver +======================= + +This program is able to receive chat message in real time on port 5060. Use realtimetext_sender to generate chat message + +Example: ``./realtimetext_receiver`` + +.. literalinclude:: realtimetext_sender.c + :language: c + + +.. _RT_text_sender_code_sample: + +Real Time Text Sender +===================== + +This program just send chat message in real time to dest uri. Use realtimetext_receiver to receive message. + +Example: ``./realtimetext_sender sip:localhost:5060`` + +.. literalinclude:: realtimetext_sender.c + :language: c + diff --git a/coreapi/help/examples/C/CMakeLists.txt b/coreapi/help/examples/C/CMakeLists.txt index e89cde8db..cc0ef95a4 100644 --- a/coreapi/help/examples/C/CMakeLists.txt +++ b/coreapi/help/examples/C/CMakeLists.txt @@ -24,8 +24,18 @@ if (ENABLE_TOOLS) if (IOS) set(USE_BUNDLE MACOSX_BUNDLE) endif() - file(GLOB EXECUTABLES_SOURCE RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c") - foreach(EXECUTABLE ${EXECUTABLES_SOURCE}) + set(LINPHONE_C_EXAMPLES_SOURCE + ${CMAKE_CURRENT_SOURCE_DIR}/buddy_status.c + ${CMAKE_CURRENT_SOURCE_DIR}/chatroom.c + ${CMAKE_CURRENT_SOURCE_DIR}/filetransfer.c + ${CMAKE_CURRENT_SOURCE_DIR}/helloworld.c + ${CMAKE_CURRENT_SOURCE_DIR}/notify.c + ${CMAKE_CURRENT_SOURCE_DIR}/realtimetext_receiver.c + ${CMAKE_CURRENT_SOURCE_DIR}/realtimetext_sender.c + ${CMAKE_CURRENT_SOURCE_DIR}/registration.c + PARENT_SCOPE + ) + foreach(EXECUTABLE ${LINPHONE_C_EXAMPLES_SOURCE}) string(REPLACE ".c" "" EXECUTABLE_NAME ${EXECUTABLE}) bc_apply_compile_flags(${EXECUTABLE} STRICT_OPTIONS_CPP STRICT_OPTIONS_C) add_executable(${EXECUTABLE_NAME} ${USE_BUNDLE} ${EXECUTABLE}) From bf1334a74aba47f938cac5f964d27919dcd5bc0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Thu, 5 Apr 2018 14:59:14 +0200 Subject: [PATCH 057/121] Cleans CMakeLists in sphinx directory --- coreapi/help/doc/sphinx/CMakeLists.txt | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/coreapi/help/doc/sphinx/CMakeLists.txt b/coreapi/help/doc/sphinx/CMakeLists.txt index e3b9a250e..797ee3f1c 100644 --- a/coreapi/help/doc/sphinx/CMakeLists.txt +++ b/coreapi/help/doc/sphinx/CMakeLists.txt @@ -21,24 +21,6 @@ ############################################################################ if (ENABLE_SPHINX_DOC) - set(GENERATED_LANGUAGES c cpp csharp) - set(DOCUMENTATION_DIRS ) - set(GENERATED_SPHINX_SOURCES ) - foreach(LANGUAGE_ ${GENERATED_LANGUAGES}) - set(DOCUMENTATION_DIR ${CMAKE_CURRENT_BINARY_DIR}/source/${LANGUAGE_}) - list(APPEND DOCUMENTATION_DIRS ${DOCUMENTATION_DIR}) - list(APPEND GENERATED_SPHINX_SOURCES ${DOCUMENTATION_DIR}/index.rst) - endforeach(LANGUAGE_) - set(PYTHON_SCRIPTS gendoc.py - ${linphone_SOURCE_DIR}/tools/abstractapi.py - ${linphone_SOURCE_DIR}/tools/genapixml.py - ${linphone_SOURCE_DIR}/tools/metadoc.py - ${linphone_SOURCE_DIR}/tools/metaname.py - ) - set(MUSTACHE_TEMPLATES class_page.mustache - enum_page.mustache - index_page.mustache - ) set(STATIC_DOCUMENTATION_FILES guides/authentication.rst guides/buddy_list.rst @@ -67,6 +49,7 @@ if (ENABLE_SPHINX_DOC) foreach(source ${LINPHONE_C_EXAMPLES_SOURCE}) configure_file(${source} source/samples/ COPYONLY) endforeach(source) + execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/source/_static) add_custom_target(sphinx-doc ALL ${PYTHON_EXECUTABLE} '${CMAKE_CURRENT_SOURCE_DIR}/gendoc.py' '${LINPHONE_DOXYGEN_XML_DIR}' -o 'source' COMMAND ${PYTHON_EXECUTABLE} -msphinx -M html 'source' 'build' DEPENDS linphone-doc) From d1a68a0e5ca48d5faab6cc6d5899110e00663b47 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 5 Apr 2018 14:59:17 +0200 Subject: [PATCH 058/121] Activate belle-sip logs. --- coreapi/logging.c | 1 + 1 file changed, 1 insertion(+) diff --git a/coreapi/logging.c b/coreapi/logging.c index 8a87b8264..6a5182113 100644 --- a/coreapi/logging.c +++ b/coreapi/logging.c @@ -179,6 +179,7 @@ LinphoneLoggingServiceCbs *linphone_logging_service_get_callbacks(const Linphone static const char *_linphone_logging_service_log_domains[] = { "bctbx", + "belle-sip", "ortp", "mediastreamer", "bzrtp", From 5fb8f9686a059fffeda3c8931013c10b4e3658f7 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 16 Mar 2018 14:45:54 +0100 Subject: [PATCH 059/121] Handle incoming INVITE from conference server to create ClientGroupChatRoom. --- coreapi/callbacks.c | 121 +++++++++++++----- coreapi/misc.c | 7 +- coreapi/private_functions.h | 1 + include/linphone/api/c-callbacks.h | 6 + include/linphone/api/c-chat-room-cbs.h | 14 ++ src/c-wrapper/api/c-chat-room-cbs.cpp | 9 ++ src/c-wrapper/api/c-chat-room.cpp | 4 + src/chat/chat-room/basic-chat-room.cpp | 2 +- src/chat/chat-room/basic-chat-room.h | 2 +- .../basic-to-client-group-chat-room.cpp | 2 +- src/chat/chat-room/client-group-chat-room-p.h | 7 +- src/chat/chat-room/client-group-chat-room.cpp | 97 ++++++++++---- src/chat/chat-room/client-group-chat-room.h | 5 +- src/chat/chat-room/proxy-chat-room.cpp | 2 +- src/chat/chat-room/proxy-chat-room.h | 2 +- src/chat/chat-room/server-group-chat-room-p.h | 3 +- .../chat-room/server-group-chat-room-stub.cpp | 6 +- src/chat/chat-room/server-group-chat-room.h | 2 +- src/conference/conference-interface.h | 2 +- src/conference/conference.cpp | 50 +++++++- src/conference/conference.h | 6 +- src/conference/local-conference.cpp | 27 +--- src/conference/local-conference.h | 5 +- src/conference/participant-device.cpp | 2 +- src/conference/participant-device.h | 6 +- src/conference/remote-conference.cpp | 18 +-- src/conference/remote-conference.h | 4 +- src/content/content-disposition.cpp | 9 +- src/content/content-disposition.h | 1 + src/content/content-type.cpp | 8 +- src/content/content-type.h | 1 + src/core/core-chat-room.cpp | 4 +- src/core/core-p.h | 2 +- src/sal/call-op.cpp | 17 ++- src/utils/background-task.cpp | 4 +- src/utils/background-task.h | 16 +-- tester/group_chat_tester.c | 64 ++++++--- tester/liblinphone_tester.h | 1 + 38 files changed, 365 insertions(+), 174 deletions(-) diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index da809bc05..4a835b704 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -41,6 +41,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "call/call-p.h" #include "chat/chat-message/chat-message-p.h" #include "chat/chat-room/chat-room.h" +#include "chat/chat-room/client-group-chat-room-p.h" #include "chat/chat-room/server-group-chat-room-p.h" #include "conference/participant.h" #include "conference/session/call-session-p.h" @@ -56,8 +57,14 @@ using namespace LinphonePrivate; static void register_failure(SalOp *op); static void call_received(SalCallOp *h) { - /* Look if this INVITE is for a call that has already been notified but broken because of network failure */ LinphoneCore *lc = reinterpret_cast(h->get_sal()->get_user_pointer()); + + if (linphone_core_get_global_state(lc) != LinphoneGlobalOn) { + h->decline(SalReasonServiceUnavailable, nullptr); + return; + } + + /* Look if this INVITE is for a call that has already been notified but broken because of network failure */ if (L_GET_PRIVATE_FROM_C_OBJECT(lc)->inviteReplacesABrokenCall(h)) return; @@ -107,16 +114,28 @@ static void call_received(SalCallOp *h) { // TODO: handle media conference creation if the "text" feature tag is not present return; } else if (sal_address_has_param(h->get_remote_contact_address(), "text")) { - shared_ptr chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom( - ChatRoomId(IdentityAddress(h->get_to()), IdentityAddress(h->get_to())) - ); - if (chatRoom) { - L_GET_PRIVATE(static_pointer_cast(chatRoom))->confirmJoining(h); - linphone_address_unref(toAddr); - linphone_address_unref(fromAddr); + linphone_address_unref(toAddr); + linphone_address_unref(fromAddr); + if (linphone_core_conference_server_enabled(lc)) { + shared_ptr chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom( + ChatRoomId(IdentityAddress(h->get_to()), IdentityAddress(h->get_to())) + ); + if (chatRoom) { + L_GET_PRIVATE(static_pointer_cast(chatRoom))->confirmJoining(h); + } else { + //invite is for an unknown chatroom + h->decline(SalReasonNotFound, nullptr); + } } else { - //invite is for an unknown chatroom - h->decline(SalReasonNotFound, nullptr); + shared_ptr chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom( + ChatRoomId(IdentityAddress(h->get_from()), IdentityAddress(h->get_to())) + ); + if (!chatRoom) { + chatRoom = L_GET_PRIVATE_FROM_C_OBJECT(lc)->createClientGroupChatRoom( + L_C_TO_STRING(h->get_subject()), h->get_remote_contact(), h->get_remote_body(), false + ); + } + L_GET_PRIVATE(static_pointer_cast(chatRoom))->confirmJoining(h); } return; } else { @@ -201,7 +220,8 @@ static void call_rejected(SalCallOp *h){ static void call_ringing(SalOp *h) { LinphonePrivate::CallSession *session = reinterpret_cast(h->get_user_pointer()); if (!session) return; - L_GET_PRIVATE(session)->remoteRinging(); + auto sessionRef = session->getSharedFromThis(); + L_GET_PRIVATE(sessionRef)->remoteRinging(); } /* @@ -215,7 +235,8 @@ static void call_accepted(SalOp *op) { ms_warning("call_accepted: CallSession no longer exists"); return; } - L_GET_PRIVATE(session)->accepted(); + auto sessionRef = session->getSharedFromThis(); + L_GET_PRIVATE(sessionRef)->accepted(); } /* this callback is called when an incoming re-INVITE/ SIP UPDATE modifies the session*/ @@ -225,7 +246,8 @@ static void call_updating(SalOp *op, bool_t is_update) { ms_warning("call_updating: CallSession no longer exists"); return; } - L_GET_PRIVATE(session)->updating(!!is_update); + auto sessionRef = session->getSharedFromThis(); + L_GET_PRIVATE(sessionRef)->updating(!!is_update); } @@ -235,7 +257,8 @@ static void call_ack_received(SalOp *op, SalCustomHeader *ack) { ms_warning("call_ack_received(): no CallSession for which an ack is expected"); return; } - L_GET_PRIVATE(session)->ackReceived(reinterpret_cast(ack)); + auto sessionRef = session->getSharedFromThis(); + L_GET_PRIVATE(sessionRef)->ackReceived(reinterpret_cast(ack)); } @@ -245,25 +268,26 @@ static void call_ack_being_sent(SalOp *op, SalCustomHeader *ack) { ms_warning("call_ack_being_sent(): no CallSession for which an ack is supposed to be sent"); return; } - L_GET_PRIVATE(session)->ackBeingSent(reinterpret_cast(ack)); + auto sessionRef = session->getSharedFromThis(); + L_GET_PRIVATE(sessionRef)->ackBeingSent(reinterpret_cast(ack)); } static void call_terminated(SalOp *op, const char *from) { LinphonePrivate::CallSession *session = reinterpret_cast(op->get_user_pointer()); if (!session) return; - L_GET_PRIVATE(session)->terminated(); + auto sessionRef = session->getSharedFromThis(); + L_GET_PRIVATE(sessionRef)->terminated(); } static void call_failure(SalOp *op) { - shared_ptr session; - if (op->get_user_pointer()) - session = reinterpret_cast(op->get_user_pointer())->getSharedFromThis(); + LinphonePrivate::CallSession *session = reinterpret_cast(op->get_user_pointer()); if (!session) { ms_warning("Failure reported on already terminated CallSession"); return; } - L_GET_PRIVATE(session)->failure(); + auto sessionRef = session->getSharedFromThis(); + L_GET_PRIVATE(sessionRef)->failure(); } static void call_released(SalOp *op) { @@ -273,7 +297,8 @@ static void call_released(SalOp *op) { * when declining an incoming call with busy because maximum number of calls is reached. */ return; } - L_GET_PRIVATE(session)->setState(LinphonePrivate::CallSession::State::Released, "Call released"); + auto sessionRef = session->getSharedFromThis(); + L_GET_PRIVATE(sessionRef)->setState(LinphonePrivate::CallSession::State::Released, "Call released"); } static void call_cancel_done(SalOp *op) { @@ -282,7 +307,8 @@ static void call_cancel_done(SalOp *op) { ms_warning("Cancel done reported on already terminated CallSession"); return; } - L_GET_PRIVATE(session)->cancelDone(); + auto sessionRef = session->getSharedFromThis(); + L_GET_PRIVATE(sessionRef)->cancelDone(); } static void auth_failure(SalOp *op, SalAuthInfo* info) { @@ -344,24 +370,26 @@ static void vfu_request(SalOp *op) { LinphonePrivate::CallSession *session = reinterpret_cast(op->get_user_pointer()); if (!session) return; - LinphonePrivate::MediaSession *mediaSession = dynamic_cast(session); - if (!mediaSession) { + auto sessionRef = session->getSharedFromThis(); + auto mediaSessionRef = dynamic_pointer_cast(sessionRef); + if (!mediaSessionRef) { ms_warning("VFU request but no MediaSession!"); return; } - L_GET_PRIVATE(mediaSession)->sendVfu(); + L_GET_PRIVATE(mediaSessionRef)->sendVfu(); } static void dtmf_received(SalOp *op, char dtmf) { LinphonePrivate::CallSession *session = reinterpret_cast(op->get_user_pointer()); if (!session) return; - LinphonePrivate::MediaSession *mediaSession = dynamic_cast(session); - if (!mediaSession) { + auto sessionRef = session->getSharedFromThis(); + auto mediaSessionRef = dynamic_pointer_cast(sessionRef); + if (!mediaSessionRef) { ms_warning("DTMF received but no MediaSession!"); return; } - L_GET_PRIVATE(mediaSession)->dtmfReceived(dtmf); + L_GET_PRIVATE(mediaSessionRef)->dtmfReceived(dtmf); } static void call_refer_received(SalOp *op, const SalAddress *referTo) { @@ -372,7 +400,8 @@ static void call_refer_received(SalOp *op, const SalAddress *referTo) { if (referToAddr.isValid()) method = referToAddr.getMethodParam(); if (session && (method.empty() || (method == "INVITE"))) { - L_GET_PRIVATE(session)->referred(referToAddr); + auto sessionRef = session->getSharedFromThis(); + L_GET_PRIVATE(sessionRef)->referred(referToAddr); } else { LinphoneCore *lc = reinterpret_cast(op->get_sal()->get_user_pointer()); linphone_core_notify_refer_received(lc, addrStr); @@ -382,6 +411,12 @@ static void call_refer_received(SalOp *op, const SalAddress *referTo) { static void message_received(SalOp *op, const SalMessage *msg){ LinphoneCore *lc=(LinphoneCore *)op->get_sal()->get_user_pointer(); + + if (linphone_core_get_global_state(lc) != LinphoneGlobalOn) { + static_cast(op)->reply(SalReasonServiceUnavailable); + return; + } + LinphoneCall *call=(LinphoneCall*)op->get_user_pointer(); LinphoneReason reason = lc->chat_deny_code; if (reason == LinphoneReasonNone) { @@ -414,6 +449,10 @@ static void notify_presence(SalOp *op, SalSubscribeStatus ss, SalPresenceModel * static void subscribe_presence_received(SalPresenceOp *op, const char *from){ LinphoneCore *lc=(LinphoneCore *)op->get_sal()->get_user_pointer(); + if (linphone_core_get_global_state(lc) != LinphoneGlobalOn) { + op->decline(SalReasonServiceUnavailable); + return; + } linphone_subscription_new(lc,op,from); } @@ -428,7 +467,8 @@ static void ping_reply(SalOp *op) { ms_warning("Ping reply without CallSession attached..."); return; } - L_GET_PRIVATE(session)->pingReply(); + auto sessionRef = session->getSharedFromThis(); + L_GET_PRIVATE(sessionRef)->pingReply(); } static bool_t fill_auth_info_with_client_certificate(LinphoneCore *lc, SalAuthInfo* sai) { @@ -531,6 +571,7 @@ static void notify_refer(SalOp *op, SalReferStatus status) { ms_warning("Receiving notify_refer for unknown CallSession"); return; } + auto sessionRef = session->getSharedFromThis(); LinphonePrivate::CallSession::State cstate; switch (status) { case SalReferTrying: @@ -544,9 +585,9 @@ static void notify_refer(SalOp *op, SalReferStatus status) { cstate = LinphonePrivate::CallSession::State::Error; break; } - L_GET_PRIVATE(session)->setTransferState(cstate); + L_GET_PRIVATE(sessionRef)->setTransferState(cstate); if (cstate == LinphonePrivate::CallSession::State::Connected) - session->terminate(); // Automatically terminate the call as the transfer is complete + sessionRef->terminate(); // Automatically terminate the call as the transfer is complete } static LinphoneChatMessageState chatStatusSal2Linphone(SalMessageDeliveryStatus status){ @@ -575,7 +616,8 @@ static void info_received(SalOp *op, SalBodyHandler *body_handler) { LinphonePrivate::CallSession *session = reinterpret_cast(op->get_user_pointer()); if (!session) return; - L_GET_PRIVATE(session)->infoReceived(body_handler); + auto sessionRef = session->getSharedFromThis(); + L_GET_PRIVATE(sessionRef)->infoReceived(body_handler); } static void subscribe_response(SalOp *op, SalSubscribeStatus status, int will_retry){ @@ -622,6 +664,11 @@ static void subscribe_received(SalSubscribeOp *op, const char *eventname, const LinphoneEvent *lev=(LinphoneEvent*)op->get_user_pointer(); LinphoneCore *lc=(LinphoneCore *)op->get_sal()->get_user_pointer(); + if (linphone_core_get_global_state(lc) != LinphoneGlobalOn) { + op->decline(SalReasonServiceUnavailable); + return; + } + if (lev==NULL) { lev=linphone_event_new_with_op(lc,op,LinphoneSubscriptionIncoming,eventname); linphone_event_set_state(lev,LinphoneSubscriptionIncomingReceived); @@ -700,6 +747,12 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){ bctbx_free(refer_uri); if (addr.isValid()) { LinphoneCore *lc = reinterpret_cast(op->get_sal()->get_user_pointer()); + + if (linphone_core_get_global_state(lc) != LinphoneGlobalOn) { + static_cast(op)->reply(SalReasonDeclined); + return; + } + if (addr.hasUriParam("method") && (addr.getUriParamValue("method") == "BYE")) { if (linphone_core_conference_server_enabled(lc)) { // Removal of a participant at the server side @@ -754,7 +807,7 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){ ChatRoomId(addr, IdentityAddress(op->get_to())) ); if (!chatRoom) - chatRoom = L_GET_PRIVATE_FROM_C_OBJECT(lc)->createClientGroupChatRoom("", addr.asString(), false); + chatRoom = L_GET_PRIVATE_FROM_C_OBJECT(lc)->createClientGroupChatRoom("", addr.asString(), Content(), false); chatRoom->join(); static_cast(op)->reply(SalReasonNone); return; diff --git a/coreapi/misc.c b/coreapi/misc.c index 3e255a354..f0e225112 100644 --- a/coreapi/misc.c +++ b/coreapi/misc.c @@ -919,8 +919,11 @@ void linphone_core_report_call_log(LinphoneCore *lc, LinphoneCallLog *call_log){ } linphone_address_unref(conference_factory_addr); } - const char *username = linphone_address_get_username(call_log->to); - if (username && (strstr(username, "chatroom-") == username)) + const char *usernameFrom = linphone_address_get_username(call_log->from); + const char *usernameTo = linphone_address_get_username(call_log->to); + if ((usernameFrom && (strstr(usernameFrom, "chatroom-") == usernameFrom)) + || (usernameTo && (strstr(usernameTo, "chatroom-") == usernameTo)) + ) return; // End of workaround diff --git a/coreapi/private_functions.h b/coreapi/private_functions.h index e6a27fbe0..35d16b492 100644 --- a/coreapi/private_functions.h +++ b/coreapi/private_functions.h @@ -288,6 +288,7 @@ void _linphone_chat_room_notify_participant_device_removed(LinphoneChatRoom *cr, void _linphone_chat_room_notify_participant_admin_status_changed(LinphoneChatRoom *cr, const LinphoneEventLog *event_log); void _linphone_chat_room_notify_state_changed(LinphoneChatRoom *cr, LinphoneChatRoomState newState); void _linphone_chat_room_notify_subject_changed(LinphoneChatRoom *cr, const LinphoneEventLog *event_log); +void _linphone_chat_room_notify_all_information_received(LinphoneChatRoom *cr); void _linphone_chat_room_notify_undecryptable_message_received(LinphoneChatRoom *cr, LinphoneChatMessage *msg); void _linphone_chat_room_notify_chat_message_received(LinphoneChatRoom *cr, const LinphoneEventLog *event_log); void _linphone_chat_room_notify_chat_message_sent(LinphoneChatRoom *cr, const LinphoneEventLog *event_log); diff --git a/include/linphone/api/c-callbacks.h b/include/linphone/api/c-callbacks.h index 339963691..273e86fac 100644 --- a/include/linphone/api/c-callbacks.h +++ b/include/linphone/api/c-callbacks.h @@ -235,6 +235,12 @@ typedef void (*LinphoneChatRoomCbsParticipantDeviceAddedCb) (LinphoneChatRoom *c */ typedef void (*LinphoneChatRoomCbsParticipantDeviceRemovedCb) (LinphoneChatRoom *cr, const LinphoneEventLog *event_log); +/** + * Callback used to notify a chat room has received all its information. + * @param[in] cr #LinphoneChatRoom object + */ +typedef void (*LinphoneChatRoomCbsAllInformationReceivedCb) (LinphoneChatRoom *cr); + /** * Callback used when a group chat room is created server-side to generate the address of the chat room. * The function linphone_chat_room_set_conference_address() needs to be called by this callback. diff --git a/include/linphone/api/c-chat-room-cbs.h b/include/linphone/api/c-chat-room-cbs.h index 6cbf7bd91..5ec319582 100644 --- a/include/linphone/api/c-chat-room-cbs.h +++ b/include/linphone/api/c-chat-room-cbs.h @@ -229,6 +229,20 @@ LINPHONE_PUBLIC LinphoneChatRoomCbsParticipantDeviceRemovedCb linphone_chat_room */ LINPHONE_PUBLIC void linphone_chat_room_cbs_set_participant_device_removed (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsParticipantDeviceRemovedCb cb); +/** + * Get the all information received callback. + * @param[in] cbs LinphoneChatRoomCbs object. + * @return The current all information received callback. + */ +LINPHONE_PUBLIC LinphoneChatRoomCbsAllInformationReceivedCb linphone_chat_room_cbs_get_all_information_received (const LinphoneChatRoomCbs *cbs); + +/** + * Set the all information received callback. + * @param[in] cbs LinphoneChatRoomCbs object. + * @param[in] cb The all information received callback to be used. + */ +LINPHONE_PUBLIC void linphone_chat_room_cbs_set_all_information_received (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsAllInformationReceivedCb cb); + /** * Get the conference address generation callback. * @param[in] cbs LinphoneChatRoomCbs object diff --git a/src/c-wrapper/api/c-chat-room-cbs.cpp b/src/c-wrapper/api/c-chat-room-cbs.cpp index 1d3d4d8d6..afec92128 100644 --- a/src/c-wrapper/api/c-chat-room-cbs.cpp +++ b/src/c-wrapper/api/c-chat-room-cbs.cpp @@ -35,6 +35,7 @@ struct _LinphoneChatRoomCbs { LinphoneChatRoomCbsParticipantAdminStatusChangedCb participantAdminStatusChangedCb; LinphoneChatRoomCbsStateChangedCb stateChangedCb; LinphoneChatRoomCbsSubjectChangedCb subjectChangedCb; + LinphoneChatRoomCbsAllInformationReceivedCb allInformationReceivedCb; LinphoneChatRoomCbsUndecryptableMessageReceivedCb undecryptableMessageReceivedCb; LinphoneChatRoomCbsChatMessageReceivedCb chatMessageReceivedCb; LinphoneChatRoomCbsChatMessageSentCb chatMessageSentCb; @@ -176,6 +177,14 @@ void linphone_chat_room_cbs_set_participant_device_removed (LinphoneChatRoomCbs cbs->participantDeviceRemovedCb = cb; } +LinphoneChatRoomCbsAllInformationReceivedCb linphone_chat_room_cbs_get_all_information_received (const LinphoneChatRoomCbs *cbs) { + return cbs->allInformationReceivedCb; +} + +void linphone_chat_room_cbs_set_all_information_received (LinphoneChatRoomCbs *cbs, LinphoneChatRoomCbsAllInformationReceivedCb cb) { + cbs->allInformationReceivedCb = cb; +} + LinphoneChatRoomCbsConferenceAddressGenerationCb linphone_chat_room_cbs_get_conference_address_generation (const LinphoneChatRoomCbs *cbs) { return cbs->conferenceAddressGenerationCb; } diff --git a/src/c-wrapper/api/c-chat-room.cpp b/src/c-wrapper/api/c-chat-room.cpp index e549964e0..3e3f7bb4c 100644 --- a/src/c-wrapper/api/c-chat-room.cpp +++ b/src/c-wrapper/api/c-chat-room.cpp @@ -480,6 +480,10 @@ void _linphone_chat_room_notify_subject_changed(LinphoneChatRoom *cr, const Linp NOTIFY_IF_EXIST(SubjectChanged, subject_changed, cr, event_log) } +void _linphone_chat_room_notify_all_information_received(LinphoneChatRoom *cr) { + NOTIFY_IF_EXIST(AllInformationReceived, all_information_received, cr) +} + void _linphone_chat_room_notify_undecryptable_message_received(LinphoneChatRoom *cr, LinphoneChatMessage *msg) { NOTIFY_IF_EXIST(UndecryptableMessageReceived, undecryptable_message_received, cr, msg) } diff --git a/src/chat/chat-room/basic-chat-room.cpp b/src/chat/chat-room/basic-chat-room.cpp index 619b52dc7..c3752755f 100644 --- a/src/chat/chat-room/basic-chat-room.cpp +++ b/src/chat/chat-room/basic-chat-room.cpp @@ -88,7 +88,7 @@ void BasicChatRoom::addParticipants (const list &, const CallSe lError() << "addParticipants() is not allowed on a BasicChatRoom"; } -void BasicChatRoom::removeParticipant (const shared_ptr &) { +void BasicChatRoom::removeParticipant (const shared_ptr &) { lError() << "removeParticipant() is not allowed on a BasicChatRoom"; } diff --git a/src/chat/chat-room/basic-chat-room.h b/src/chat/chat-room/basic-chat-room.h index e66aceba0..767ebaa35 100644 --- a/src/chat/chat-room/basic-chat-room.h +++ b/src/chat/chat-room/basic-chat-room.h @@ -48,7 +48,7 @@ public: void addParticipant (const IdentityAddress &addr, const CallSessionParams *params, bool hasMedia) override; void addParticipants (const std::list &addresses, const CallSessionParams *params, bool hasMedia) override; - void removeParticipant (const std::shared_ptr &participant) override; + void removeParticipant (const std::shared_ptr &participant) override; void removeParticipants (const std::list> &participants) override; std::shared_ptr findParticipant (const IdentityAddress &addr) const override; diff --git a/src/chat/chat-room/basic-to-client-group-chat-room.cpp b/src/chat/chat-room/basic-to-client-group-chat-room.cpp index 67f9ea2fc..960067b14 100644 --- a/src/chat/chat-room/basic-to-client-group-chat-room.cpp +++ b/src/chat/chat-room/basic-to-client-group-chat-room.cpp @@ -78,7 +78,7 @@ public: } migrationRealTime = currentRealTime; clientGroupChatRoom = static_pointer_cast( - chatRoom->getCore()->getPrivate()->createClientGroupChatRoom(chatRoom->getSubject(), "", false) + chatRoom->getCore()->getPrivate()->createClientGroupChatRoom(chatRoom->getSubject(), "", Content(), false) ); clientGroupChatRoom->getPrivate()->setCallSessionListener(this); clientGroupChatRoom->getPrivate()->setChatRoomListener(this); diff --git a/src/chat/chat-room/client-group-chat-room-p.h b/src/chat/chat-room/client-group-chat-room-p.h index e617b517d..f5fbc97b5 100644 --- a/src/chat/chat-room/client-group-chat-room-p.h +++ b/src/chat/chat-room/client-group-chat-room-p.h @@ -35,6 +35,7 @@ public: void notifyReceived (const std::string &body); void multipartNotifyReceived (const std::string &body); + void confirmJoining (SalCallOp *op); void setCallSessionListener (CallSessionListener *listener); void setChatRoomListener (ChatRoomListener *listener) { chatRoomListener = listener; } @@ -47,12 +48,16 @@ public: void onCallSessionSetReleased (const std::shared_ptr &session) override; void onCallSessionStateChanged (const std::shared_ptr &session, CallSession::State state, const std::string &message) override; + void onChatRoomCreated (const Address &remoteContact); + private: + void acceptSession (const std::shared_ptr &session); + CallSessionListener *callSessionListener = this; ChatRoomListener *chatRoomListener = this; ClientGroupChatRoom::CapabilitiesMask capabilities = ClientGroupChatRoom::Capabilities::Conference; bool deletionOnTerminationEnabled = false; - BackgroundTask bgTask; + BackgroundTask bgTask { "Subscribe/notify of full state conference" }; L_DECLARE_PUBLIC(ClientGroupChatRoom); }; diff --git a/src/chat/chat-room/client-group-chat-room.cpp b/src/chat/chat-room/client-group-chat-room.cpp index 29c872d30..5a9639621 100644 --- a/src/chat/chat-room/client-group-chat-room.cpp +++ b/src/chat/chat-room/client-group-chat-room.cpp @@ -101,6 +101,31 @@ void ClientGroupChatRoomPrivate::setCallSessionListener (CallSessionListener *li } } +void ClientGroupChatRoomPrivate::confirmJoining (SalCallOp *op) { + L_Q(); + L_Q_T(RemoteConference, qConference); + + auto focus = qConference->getPrivate()->focus; + bool previousSession = (focus->getPrivate()->getSession() != nullptr); + auto session = focus->getPrivate()->createSession(*q, nullptr, false, this); + session->configure(LinphoneCallIncoming, nullptr, op, Address(op->get_from()), Address(op->get_to())); + session->startIncomingNotification(false); + + if (!previousSession) { + setState(ClientGroupChatRoom::State::CreationPending); + // Handle participants addition + list identAddresses = ClientGroupChatRoom::parseResourceLists(op->get_remote_body()); + for (const auto &addr : identAddresses) { + auto participant = q->findParticipant(addr); + if (!participant) { + participant = make_shared(addr); + qConference->getPrivate()->participants.push_back(participant); + } + } + } + acceptSession(session); +} + // ----------------------------------------------------------------------------- void ClientGroupChatRoomPrivate::onChatRoomInsertRequested (const shared_ptr &chatRoom) { @@ -139,14 +164,11 @@ void ClientGroupChatRoomPrivate::onCallSessionStateChanged ( if (newState == CallSession::State::Connected) { if (q->getState() == ChatRoom::State::CreationPending) { - IdentityAddress addr(session->getRemoteContactAddress()->asStringUriOnly()); - q->onConferenceCreated(addr); - if (session->getRemoteContactAddress()->hasParam("isfocus")) { - bgTask.start(q->getCore(), 32); // It will be stopped when receiving the first notify - qConference->getPrivate()->eventHandler->subscribe(q->getChatRoomId()); - } + onChatRoomCreated(*session->getRemoteContactAddress()); } else if (q->getState() == ChatRoom::State::TerminationPending) qConference->getPrivate()->focus->getPrivate()->getSession()->terminate(); + } else if (newState == CallSession::State::End) { + q->onConferenceTerminated(q->getConferenceAddress()); } else if (newState == CallSession::State::Released) { if (q->getState() == ChatRoom::State::TerminationPending) { if (session->getReason() == LinphoneReasonNone) { @@ -174,23 +196,46 @@ void ClientGroupChatRoomPrivate::onCallSessionStateChanged ( } } +void ClientGroupChatRoomPrivate::onChatRoomCreated (const Address &remoteContact) { + L_Q(); + L_Q_T(RemoteConference, qConference); + + IdentityAddress addr(remoteContact); + q->onConferenceCreated(addr); + if (remoteContact.hasParam("isfocus")) { + bgTask.start(q->getCore(), 32); // It will be stopped when receiving the first notify + qConference->getPrivate()->eventHandler->subscribe(q->getChatRoomId()); + } +} + +// ----------------------------------------------------------------------------- + +void ClientGroupChatRoomPrivate::acceptSession (const shared_ptr &session) { + if (session->getState() == CallSession::State::UpdatedByRemote) + session->acceptUpdate(); + else + session->accept(); +} + // ============================================================================= ClientGroupChatRoom::ClientGroupChatRoom ( const shared_ptr &core, const string &uri, const IdentityAddress &me, - const string &subject + const string &subject, + const Content &content ) : ChatRoom(*new ClientGroupChatRoomPrivate, core, ChatRoomId(IdentityAddress(), me)), RemoteConference(core, me, nullptr) { L_D_T(RemoteConference, dConference); - L_D(); - + IdentityAddress focusAddr(uri); dConference->focus = make_shared(focusAddr); dConference->focus->getPrivate()->addDevice(focusAddr); RemoteConference::setSubject(subject); - d->bgTask.setName("Subscribe/notify of full state conference"); + list identAddresses = Conference::parseResourceLists(content); + for (const auto &addr : identAddresses) + dConference->participants.push_back(make_shared(addr)); } ClientGroupChatRoom::ClientGroupChatRoom ( @@ -251,7 +296,7 @@ ClientGroupChatRoom::CapabilitiesMask ClientGroupChatRoom::getCapabilities () co } bool ClientGroupChatRoom::hasBeenLeft () const { - return getState() != State::Created; + return (getState() != State::Created); } bool ClientGroupChatRoom::canHandleParticipants () const { @@ -328,7 +373,7 @@ void ClientGroupChatRoom::addParticipants ( } } -void ClientGroupChatRoom::removeParticipant (const shared_ptr &participant) { +void ClientGroupChatRoom::removeParticipant (const shared_ptr &participant) { LinphoneCore *cCore = getCore()->getCCore(); SalReferOp *referOp = new SalReferOp(cCore->sal); @@ -422,7 +467,8 @@ void ClientGroupChatRoom::join () { if (session) { if (getState() != ChatRoom::State::TerminationPending) session->startInvite(nullptr, "", nullptr); - d->setState(ChatRoom::State::CreationPending); + if (getState() != ChatRoom::State::Created) + d->setState(ChatRoom::State::CreationPending); } } @@ -454,6 +500,7 @@ void ClientGroupChatRoom::onConferenceCreated (const IdentityAddress &addr) { dConference->focus->getPrivate()->addDevice(addr); d->chatRoomId = ChatRoomId(addr, d->chatRoomId.getLocalAddress()); d->chatRoomListener->onChatRoomInsertRequested(getSharedFromThis()); + d->setState(ChatRoom::State::Created); } void ClientGroupChatRoom::onConferenceKeywordsChanged (const vector &keywords) { @@ -464,6 +511,7 @@ void ClientGroupChatRoom::onConferenceKeywordsChanged (const vector &key void ClientGroupChatRoom::onConferenceTerminated (const IdentityAddress &addr) { L_D(); L_D_T(RemoteConference, dConference); + dConference->eventHandler->unsubscribe(); dConference->eventHandler->resetLastNotify(); d->setState(ChatRoom::State::Terminated); d->addEvent(make_shared( @@ -479,21 +527,26 @@ void ClientGroupChatRoom::onConferenceTerminated (const IdentityAddress &addr) { void ClientGroupChatRoom::onFirstNotifyReceived (const IdentityAddress &addr) { L_D(); - d->setState(ChatRoom::State::Created); - + + bool performMigration = false; + shared_ptr chatRoom; if (getParticipantCount() == 1) { ChatRoomId id(getParticipants().front()->getAddress(), getMe()->getAddress()); - shared_ptr chatRoom = getCore()->findChatRoom(id); - if (chatRoom && (chatRoom->getCapabilities() & ChatRoom::Capabilities::Basic)) { - BasicToClientGroupChatRoom::migrate(getSharedFromThis(), chatRoom); - d->bgTask.stop(); - return; - } + chatRoom = getCore()->findChatRoom(id); + if (chatRoom && (chatRoom->getCapabilities() & ChatRoom::Capabilities::Basic)) + performMigration = true; } - d->chatRoomListener->onChatRoomInsertInDatabaseRequested(getSharedFromThis()); + if (performMigration) + BasicToClientGroupChatRoom::migrate(getSharedFromThis(), chatRoom); + else + d->chatRoomListener->onChatRoomInsertInDatabaseRequested(getSharedFromThis()); + + LinphoneChatRoom *cr = d->getCChatRoom(); + _linphone_chat_room_notify_all_information_received(cr); d->bgTask.stop(); + // TODO: Bug. Event is inserted many times. // Avoid this in the future. Deal with signals/slots system. #if 0 diff --git a/src/chat/chat-room/client-group-chat-room.h b/src/chat/chat-room/client-group-chat-room.h index 9bb13f526..5d28a2ce9 100644 --- a/src/chat/chat-room/client-group-chat-room.h +++ b/src/chat/chat-room/client-group-chat-room.h @@ -43,7 +43,8 @@ public: const std::shared_ptr &core, const std::string &factoryUri, const IdentityAddress &me, - const std::string &subject + const std::string &subject, + const Content &content ); ClientGroupChatRoom ( @@ -77,7 +78,7 @@ public: void addParticipant (const IdentityAddress &addr, const CallSessionParams *params, bool hasMedia) override; void addParticipants (const std::list &addresses, const CallSessionParams *params, bool hasMedia) override; - void removeParticipant (const std::shared_ptr &participant) override; + void removeParticipant (const std::shared_ptr &participant) override; void removeParticipants (const std::list> &participants) override; std::shared_ptr findParticipant (const IdentityAddress &addr) const override; diff --git a/src/chat/chat-room/proxy-chat-room.cpp b/src/chat/chat-room/proxy-chat-room.cpp index 6ddcb4f74..bb4239cce 100644 --- a/src/chat/chat-room/proxy-chat-room.cpp +++ b/src/chat/chat-room/proxy-chat-room.cpp @@ -248,7 +248,7 @@ void ProxyChatRoom::addParticipants ( return d->chatRoom->addParticipants(addresses, params, hasMedia); } -void ProxyChatRoom::removeParticipant (const shared_ptr &participant) { +void ProxyChatRoom::removeParticipant (const shared_ptr &participant) { L_D(); d->chatRoom->removeParticipant(participant); } diff --git a/src/chat/chat-room/proxy-chat-room.h b/src/chat/chat-room/proxy-chat-room.h index 5e4c68d11..35b7ec851 100644 --- a/src/chat/chat-room/proxy-chat-room.h +++ b/src/chat/chat-room/proxy-chat-room.h @@ -97,7 +97,7 @@ public: bool hasMedia ) override; - void removeParticipant (const std::shared_ptr &participant) override; + void removeParticipant (const std::shared_ptr &participant) override; void removeParticipants (const std::list> &participants) override; std::shared_ptr findParticipant (const IdentityAddress &participantAddress) const override; diff --git a/src/chat/chat-room/server-group-chat-room-p.h b/src/chat/chat-room/server-group-chat-room-p.h index 911f31f67..0ddcbdd48 100644 --- a/src/chat/chat-room/server-group-chat-room-p.h +++ b/src/chat/chat-room/server-group-chat-room-p.h @@ -91,6 +91,7 @@ private: static void copyMessageHeaders (const std::shared_ptr &fromMessage, const std::shared_ptr &toMessage); + void byeDevice (const std::shared_ptr &device); void designateAdmin (); void dispatchMessage (const std::shared_ptr &message, const std::string &uri); void finalizeCreation (); @@ -100,7 +101,7 @@ private: void queueMessage (const std::shared_ptr &msg, const IdentityAddress &deviceAddress); void removeNonPresentParticipants (const std::list &compatibleParticipants); - void onParticipantDeviceLeft (const std::shared_ptr &session); + void onParticipantDeviceLeft (const std::shared_ptr &device); // ChatRoomListener void onChatRoomInsertRequested (const std::shared_ptr &chatRoom) override; diff --git a/src/chat/chat-room/server-group-chat-room-stub.cpp b/src/chat/chat-room/server-group-chat-room-stub.cpp index d8204fc5b..bf29ca554 100644 --- a/src/chat/chat-room/server-group-chat-room-stub.cpp +++ b/src/chat/chat-room/server-group-chat-room-stub.cpp @@ -92,6 +92,8 @@ LinphoneReason ServerGroupChatRoomPrivate::onSipMessageReceived (SalOp *, const // ----------------------------------------------------------------------------- +void ServerGroupChatRoomPrivate::byeDevice (const shared_ptr &device) {} + void ServerGroupChatRoomPrivate::designateAdmin () {} void ServerGroupChatRoomPrivate::dispatchMessage (const shared_ptr &message, const string &uri) {} @@ -112,7 +114,7 @@ void ServerGroupChatRoomPrivate::removeNonPresentParticipants (const list &session) {} +void ServerGroupChatRoomPrivate::onParticipantDeviceLeft (const shared_ptr &device) {} // ----------------------------------------------------------------------------- @@ -187,7 +189,7 @@ void ServerGroupChatRoom::addParticipant (const IdentityAddress &, const CallSes void ServerGroupChatRoom::addParticipants (const list &, const CallSessionParams *, bool) {} -void ServerGroupChatRoom::removeParticipant (const shared_ptr &) {} +void ServerGroupChatRoom::removeParticipant (const shared_ptr &participant) {} void ServerGroupChatRoom::removeParticipants (const list> &) {} diff --git a/src/chat/chat-room/server-group-chat-room.h b/src/chat/chat-room/server-group-chat-room.h index 57d49dcfc..c31eda2c6 100644 --- a/src/chat/chat-room/server-group-chat-room.h +++ b/src/chat/chat-room/server-group-chat-room.h @@ -68,7 +68,7 @@ public: bool hasMedia ) override; - void removeParticipant (const std::shared_ptr &participant) override; + void removeParticipant (const std::shared_ptr &participant) override; void removeParticipants (const std::list> &participants) override; std::shared_ptr findParticipant (const IdentityAddress &participantAddress) const override; diff --git a/src/conference/conference-interface.h b/src/conference/conference-interface.h index aacf6bfab..cf694327a 100644 --- a/src/conference/conference-interface.h +++ b/src/conference/conference-interface.h @@ -55,7 +55,7 @@ public: virtual const std::string &getSubject () const = 0; virtual void join () = 0; virtual void leave () = 0; - virtual void removeParticipant (const std::shared_ptr &participant) = 0; + virtual void removeParticipant (const std::shared_ptr &participant) = 0; virtual void removeParticipants (const std::list> &participants) = 0; virtual void setParticipantAdminStatus (const std::shared_ptr &participant, bool isAdmin) = 0; virtual void setSubject (const std::string &subject) = 0; diff --git a/src/conference/conference.cpp b/src/conference/conference.cpp index 9e22d0207..3f362552a 100644 --- a/src/conference/conference.cpp +++ b/src/conference/conference.cpp @@ -19,8 +19,12 @@ #include "conference-p.h" #include "conference/session/call-session-p.h" +#include "content/content.h" +#include "content/content-disposition.h" +#include "content/content-type.h" #include "logger/logger.h" #include "participant-p.h" +#include "xml/resource-lists.h" // ============================================================================= @@ -97,7 +101,7 @@ void Conference::join () {} void Conference::leave () {} -void Conference::removeParticipant (const shared_ptr &participant) { +void Conference::removeParticipant (const shared_ptr &participant) { lError() << "Conference class does not handle removeParticipant() generically"; } @@ -154,6 +158,8 @@ shared_ptr Conference::findParticipantDevice (const shared_pt return nullptr; } +// ----------------------------------------------------------------------------- + bool Conference::isMe (const IdentityAddress &addr) const { L_D(); IdentityAddress cleanedAddr(addr); @@ -163,4 +169,46 @@ bool Conference::isMe (const IdentityAddress &addr) const { return cleanedMeAddr == cleanedAddr; } +// ----------------------------------------------------------------------------- + +string Conference::getResourceLists (const list &addresses) const { + Xsd::ResourceLists::ResourceLists rl = Xsd::ResourceLists::ResourceLists(); + Xsd::ResourceLists::ListType l = Xsd::ResourceLists::ListType(); + for (const auto &addr : addresses) { + Xsd::ResourceLists::EntryType entry = Xsd::ResourceLists::EntryType(addr.asString()); + l.getEntry().push_back(entry); + } + rl.getList().push_back(l); + + Xsd::XmlSchema::NamespaceInfomap map; + stringstream xmlBody; + serializeResourceLists(xmlBody, rl, map); + return xmlBody.str(); +} + +// ----------------------------------------------------------------------------- + +list Conference::parseResourceLists (const Content &content) { + if ((content.getContentType() == ContentType::ResourceLists) + && ((content.getContentDisposition().weakEqual(ContentDisposition::RecipientList)) + || (content.getContentDisposition().weakEqual(ContentDisposition::RecipientListHistory)) + ) + ) { + istringstream data(content.getBodyAsString()); + unique_ptr rl(Xsd::ResourceLists::parseResourceLists( + data, + Xsd::XmlSchema::Flags::dont_validate + )); + list addresses; + for (const auto &l : rl->getList()) { + for (const auto &entry : l.getEntry()) { + IdentityAddress addr(entry.getUri()); + addresses.push_back(move(addr)); + } + } + return addresses; + } + return list(); +} + LINPHONE_END_NAMESPACE diff --git a/src/conference/conference.h b/src/conference/conference.h index 0df0ae998..a5ee6643b 100644 --- a/src/conference/conference.h +++ b/src/conference/conference.h @@ -34,6 +34,7 @@ class CallSession; class CallSessionListener; class CallSessionPrivate; class ConferencePrivate; +class Content; class ParticipantDevice; class LINPHONE_PUBLIC Conference : @@ -62,11 +63,14 @@ public: const std::string &getSubject () const override; void join () override; void leave () override; - void removeParticipant (const std::shared_ptr &participant) override; + void removeParticipant (const std::shared_ptr &participant) override; void removeParticipants (const std::list> &participants) override; void setParticipantAdminStatus (const std::shared_ptr &participant, bool isAdmin) override; void setSubject (const std::string &subject) override; + std::string getResourceLists (const std::list &addresses) const; + static std::list parseResourceLists (const Content &content); + protected: explicit Conference ( ConferencePrivate &p, diff --git a/src/conference/local-conference.cpp b/src/conference/local-conference.cpp index 847400131..def610da1 100644 --- a/src/conference/local-conference.cpp +++ b/src/conference/local-conference.cpp @@ -17,14 +17,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "content/content.h" -#include "content/content-disposition.h" -#include "content/content-type.h" #include "handlers/local-conference-event-handler.h" #include "local-conference-p.h" #include "logger/logger.h" #include "participant-p.h" -#include "xml/resource-lists.h" // ============================================================================= @@ -59,7 +55,7 @@ void LocalConference::addParticipant (const IdentityAddress &addr, const CallSes d->activeParticipant = participant; } -void LocalConference::removeParticipant (const shared_ptr &participant) { +void LocalConference::removeParticipant (const shared_ptr &participant) { L_D(); for (const auto &p : d->participants) { if (participant->getAddress() == p->getAddress()) { @@ -69,25 +65,4 @@ void LocalConference::removeParticipant (const shared_ptr &pa } } -list LocalConference::parseResourceLists (const Content &content) { - if ((content.getContentType() == ContentType::ResourceLists) - && (content.getContentDisposition() == ContentDisposition::RecipientList) - ) { - istringstream data(content.getBodyAsString()); - unique_ptr rl(Xsd::ResourceLists::parseResourceLists( - data, - Xsd::XmlSchema::Flags::dont_validate - )); - list addresses; - for (const auto &l : rl->getList()) { - for (const auto &entry : l.getEntry()) { - IdentityAddress addr(entry.getUri()); - addresses.push_back(move(addr)); - } - } - return addresses; - } - return list(); -} - LINPHONE_END_NAMESPACE diff --git a/src/conference/local-conference.h b/src/conference/local-conference.h index 7dee773e4..d926ecf54 100644 --- a/src/conference/local-conference.h +++ b/src/conference/local-conference.h @@ -26,7 +26,6 @@ LINPHONE_BEGIN_NAMESPACE -class Content; class LocalConferencePrivate; class LocalConference : public Conference { @@ -38,9 +37,7 @@ public: /* ConferenceInterface */ void addParticipant (const IdentityAddress &addr, const CallSessionParams *params, bool hasMedia) override; - void removeParticipant (const std::shared_ptr &participant) override; - - static std::list parseResourceLists (const Content &content); + void removeParticipant (const std::shared_ptr &participant) override; private: L_DECLARE_PRIVATE(LocalConference); diff --git a/src/conference/participant-device.cpp b/src/conference/participant-device.cpp index 4c147a38d..c6cbcc197 100644 --- a/src/conference/participant-device.cpp +++ b/src/conference/participant-device.cpp @@ -29,7 +29,7 @@ LINPHONE_BEGIN_NAMESPACE ParticipantDevice::ParticipantDevice () {} -ParticipantDevice::ParticipantDevice (const Participant *participant, const IdentityAddress &gruu) +ParticipantDevice::ParticipantDevice (Participant *participant, const IdentityAddress &gruu) : mParticipant(participant), mGruu(gruu) {} ParticipantDevice::~ParticipantDevice () { diff --git a/src/conference/participant-device.h b/src/conference/participant-device.h index e10da6394..284c83917 100644 --- a/src/conference/participant-device.h +++ b/src/conference/participant-device.h @@ -44,13 +44,13 @@ public: }; ParticipantDevice (); - explicit ParticipantDevice (const Participant *participant, const IdentityAddress &gruu); + explicit ParticipantDevice (Participant *participant, const IdentityAddress &gruu); virtual ~ParticipantDevice (); bool operator== (const ParticipantDevice &device) const; inline const IdentityAddress &getAddress () const { return mGruu; } - const Participant *getParticipant () const { return mParticipant; } + Participant *getParticipant () const { return mParticipant; } inline std::shared_ptr getSession () const { return mSession; } inline void setSession (std::shared_ptr session) { mSession = session; } inline State getState () const { return mState; } @@ -63,7 +63,7 @@ public: bool isValid () const { return mGruu.isValid(); } private: - const Participant *mParticipant = nullptr; + Participant *mParticipant = nullptr; IdentityAddress mGruu; std::shared_ptr mSession; LinphoneEvent *mConferenceSubscribeEvent = nullptr; diff --git a/src/conference/remote-conference.cpp b/src/conference/remote-conference.cpp index ffdcde9ab..537832189 100644 --- a/src/conference/remote-conference.cpp +++ b/src/conference/remote-conference.cpp @@ -21,7 +21,6 @@ #include "logger/logger.h" #include "participant-p.h" #include "remote-conference-p.h" -#include "xml/resource-lists.h" // ============================================================================= @@ -59,7 +58,7 @@ void RemoteConference::addParticipant (const IdentityAddress &addr, const CallSe d->activeParticipant = participant; } -void RemoteConference::removeParticipant (const shared_ptr &participant) { +void RemoteConference::removeParticipant (const shared_ptr &participant) { L_D(); for (const auto &p : d->participants) { if (participant->getAddress() == p->getAddress()) { @@ -69,21 +68,6 @@ void RemoteConference::removeParticipant (const shared_ptr &p } } -string RemoteConference::getResourceLists (const list &addresses) const { - Xsd::ResourceLists::ResourceLists rl = Xsd::ResourceLists::ResourceLists(); - Xsd::ResourceLists::ListType l = Xsd::ResourceLists::ListType(); - for (const auto &addr : addresses) { - Xsd::ResourceLists::EntryType entry = Xsd::ResourceLists::EntryType(addr.asString()); - l.getEntry().push_back(entry); - } - rl.getList().push_back(l); - - Xsd::XmlSchema::NamespaceInfomap map; - stringstream xmlBody; - serializeResourceLists(xmlBody, rl, map); - return xmlBody.str(); -} - // ----------------------------------------------------------------------------- void RemoteConference::onConferenceCreated (const IdentityAddress &) {} diff --git a/src/conference/remote-conference.h b/src/conference/remote-conference.h index 1dd2b5931..3490113e5 100644 --- a/src/conference/remote-conference.h +++ b/src/conference/remote-conference.h @@ -38,9 +38,7 @@ public: /* ConferenceInterface */ void addParticipant (const IdentityAddress &addr, const CallSessionParams *params, bool hasMedia) override; - void removeParticipant (const std::shared_ptr &participant) override; - - std::string getResourceLists (const std::list &addresses) const; + void removeParticipant (const std::shared_ptr &participant) override; protected: /* ConferenceListener */ diff --git a/src/content/content-disposition.cpp b/src/content/content-disposition.cpp index ccaf7da15..1a14d9bd7 100644 --- a/src/content/content-disposition.cpp +++ b/src/content/content-disposition.cpp @@ -63,10 +63,13 @@ ContentDisposition &ContentDisposition::operator= (const ContentDisposition &oth return *this; } -bool ContentDisposition::operator== (const ContentDisposition &other) const { +bool ContentDisposition::weakEqual (const ContentDisposition &other) const { L_D(); - return d->disposition == other.getPrivate()->disposition - && getParameter() == other.getParameter(); + return d->disposition == other.getPrivate()->disposition; +} + +bool ContentDisposition::operator== (const ContentDisposition &other) const { + return weakEqual(other) && (getParameter() == other.getParameter()); } bool ContentDisposition::operator!= (const ContentDisposition &other) const { diff --git a/src/content/content-disposition.h b/src/content/content-disposition.h index 6f2fcc9ca..9021f0e2c 100644 --- a/src/content/content-disposition.h +++ b/src/content/content-disposition.h @@ -35,6 +35,7 @@ public: ContentDisposition &operator= (const ContentDisposition &other); + bool weakEqual (const ContentDisposition &other) const; bool operator== (const ContentDisposition &other) const; bool operator!= (const ContentDisposition &other) const; diff --git a/src/content/content-type.cpp b/src/content/content-type.cpp index 78c356af6..34ca68d0e 100644 --- a/src/content/content-type.cpp +++ b/src/content/content-type.cpp @@ -103,10 +103,12 @@ ContentType &ContentType::operator= (const ContentType &other) { return *this; } +bool ContentType::weakEqual (const ContentType &other) const { + return (getType() == other.getType()) && (getSubType() == other.getSubType()); +} + bool ContentType::operator== (const ContentType &other) const { - return getType() == other.getType() && - getSubType() == other.getSubType() && - getParameter() == other.getParameter(); + return weakEqual(other) && (getParameter() == other.getParameter()); } bool ContentType::operator!= (const ContentType &other) const { diff --git a/src/content/content-type.h b/src/content/content-type.h index b13063115..ea4fb980c 100644 --- a/src/content/content-type.h +++ b/src/content/content-type.h @@ -37,6 +37,7 @@ public: ContentType &operator= (const ContentType &other); + bool weakEqual (const ContentType &other) const; bool operator== (const ContentType &other) const; bool operator!= (const ContentType &other) const; diff --git a/src/core/core-chat-room.cpp b/src/core/core-chat-room.cpp index 291c2a600..b02d072bf 100644 --- a/src/core/core-chat-room.cpp +++ b/src/core/core-chat-room.cpp @@ -100,7 +100,7 @@ shared_ptr CorePrivate::createBasicChatRoom ( return chatRoom; } -shared_ptr CorePrivate::createClientGroupChatRoom (const string &subject, const string &uri, bool fallback) { +shared_ptr CorePrivate::createClientGroupChatRoom (const string &subject, const string &uri, const Content &content, bool fallback) { L_Q(); string usedUri; @@ -135,7 +135,7 @@ shared_ptr CorePrivate::createClientGroupChatRoom (const strin shared_ptr chatRoom; { shared_ptr clientGroupChatRoom = make_shared( - q->getSharedFromThis(), usedUri, IdentityAddress(from), subject + q->getSharedFromThis(), usedUri, IdentityAddress(from), subject, content ); ClientGroupChatRoomPrivate *dClientGroupChatRoom = clientGroupChatRoom->getPrivate(); diff --git a/src/core/core-p.h b/src/core/core-p.h index 0106dd502..cfd5e5755 100644 --- a/src/core/core-p.h +++ b/src/core/core-p.h @@ -61,7 +61,7 @@ public: void insertChatRoom (const std::shared_ptr &chatRoom); void insertChatRoomWithDb (const std::shared_ptr &chatRoom); std::shared_ptr createBasicChatRoom (const ChatRoomId &chatRoomId, AbstractChatRoom::CapabilitiesMask capabilities); - std::shared_ptr createClientGroupChatRoom (const std::string &subject, const std::string &uri = "", bool fallback = true); + std::shared_ptr createClientGroupChatRoom (const std::string &subject, const std::string &uri = "", const Content &content = Content(), bool fallback = true); void replaceChatRoom (const std::shared_ptr &replacedChatRoom, const std::shared_ptr &newChatRoom); std::unique_ptr mainDb; diff --git a/src/sal/call-op.cpp b/src/sal/call-op.cpp index a900ab5d8..f28a096fa 100644 --- a/src/sal/call-op.cpp +++ b/src/sal/call-op.cpp @@ -237,7 +237,7 @@ void SalCallOp::cancelling_invite(const SalErrorInfo *info) { Content SalCallOp::extract_body(belle_sip_message_t *message) { Content body; belle_sip_header_content_type_t *content_type = belle_sip_message_get_header_by_type(message, belle_sip_header_content_type_t); - belle_sip_header_content_disposition_t *contentDisposition = belle_sip_message_get_header_by_type(message, belle_sip_header_content_disposition_t); + belle_sip_header_content_disposition_t *contentDispositionHeader = belle_sip_message_get_header_by_type(message, belle_sip_header_content_disposition_t); belle_sip_header_content_length_t *content_length = belle_sip_message_get_header_by_type(message, belle_sip_header_content_length_t); const char *type_str = content_type ? belle_sip_header_content_type_get_type(content_type) : NULL; const char *subtype_str = content_type ? belle_sip_header_content_type_get_subtype(content_type) : NULL; @@ -245,10 +245,13 @@ Content SalCallOp::extract_body(belle_sip_message_t *message) { const char *body_str = belle_sip_message_get_body(message); if (type_str && subtype_str) body.setContentType(ContentType(type_str, subtype_str)); - if (contentDisposition) - body.setContentDisposition( - ContentDisposition(belle_sip_header_content_disposition_get_content_disposition(contentDisposition)) - ); + if (contentDispositionHeader) { + auto contentDisposition = ContentDisposition(belle_sip_header_content_disposition_get_content_disposition(contentDispositionHeader)); + if (belle_sip_parameters_has_parameter(BELLE_SIP_PARAMETERS(contentDispositionHeader), "handling")) { + contentDisposition.setParameter("handling=" + string(belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(contentDispositionHeader), "handling"))); + } + body.setContentDisposition(contentDisposition); + } if (length > 0 && body_str) body.setBody(body_str, length); return body; } @@ -497,7 +500,9 @@ void SalCallOp::process_response_cb(void *op_base, const belle_sip_response_even } break; case BELLE_SIP_DIALOG_TERMINATED: { - if (strcmp("INVITE",method)==0 && code >= 300){ + if ((code >= 300) + && ((strcmp("INVITE", method) == 0) || (strcmp("BYE", method) == 0)) + ) { op->set_error(response, TRUE); } } diff --git a/src/utils/background-task.cpp b/src/utils/background-task.cpp index 0aaeb3397..b91a10f8d 100644 --- a/src/utils/background-task.cpp +++ b/src/utils/background-task.cpp @@ -27,6 +27,8 @@ // ============================================================================= +using namespace std; + LINPHONE_BEGIN_NAMESPACE void BackgroundTask::sHandleTimeout (void *context) { @@ -43,7 +45,7 @@ void BackgroundTask::handleSalTimeout () { stop(); } -void BackgroundTask::start (const std::shared_ptr &core, int maxDurationSeconds) { +void BackgroundTask::start (const shared_ptr &core, int maxDurationSeconds) { if (mName.empty()) { lError() << "No name was set on background task"; return; diff --git a/src/utils/background-task.h b/src/utils/background-task.h index 2567a5b6d..fbf11106f 100644 --- a/src/utils/background-task.h +++ b/src/utils/background-task.h @@ -35,23 +35,17 @@ class Core; class BackgroundTask { public: BackgroundTask () {} - BackgroundTask (const std::string &name) {} - virtual ~BackgroundTask () { - stop(); - } + BackgroundTask (const std::string &name) : mName(name) {} + virtual ~BackgroundTask () { stop(); } - void setName (const std::string &name) { - mName = name; - } + void setName (const std::string &name) { mName = name; } - const std::string &getName () const { - return mName; - } + const std::string &getName () const { return mName; } /** * Start a long running task for at most max_duration_seconds, after which it is automatically terminated */ - void start (const std::shared_ptr &core, int maxDurationSeconds = 15 * 60); // 15 min by default, like on iOS + void start (const std::shared_ptr &core, int maxDurationSeconds = 15 * 60); // 15 min by default, like on iOS void stop (); protected: diff --git a/tester/group_chat_tester.c b/tester/group_chat_tester.c index 9ddfc9329..14c0ab1d0 100644 --- a/tester/group_chat_tester.c +++ b/tester/group_chat_tester.c @@ -69,6 +69,7 @@ static void chat_room_participant_device_added (LinphoneChatRoom *cr, const Linp static void chat_room_state_changed (LinphoneChatRoom *cr, LinphoneChatRoomState newState) { LinphoneCore *core = linphone_chat_room_get_core(cr); LinphoneCoreManager *manager = (LinphoneCoreManager *)linphone_core_get_user_data(core); + ms_message("ChatRoom [%p] state changed: %d", cr, newState); switch (newState) { case LinphoneChatRoomStateNone: break; @@ -105,6 +106,12 @@ static void chat_room_subject_changed (LinphoneChatRoom *cr, const LinphoneEvent manager->stat.number_of_subject_changed++; } +static void chat_room_all_information_received (LinphoneChatRoom *cr) { + LinphoneCore *core = linphone_chat_room_get_core(cr); + LinphoneCoreManager *manager = (LinphoneCoreManager *)linphone_core_get_user_data(core); + manager->stat.number_of_LinphoneChatRoomAllInformationReceived++; +} + static void core_chat_room_state_changed (LinphoneCore *core, LinphoneChatRoom *cr, LinphoneChatRoomState state) { if (state == LinphoneChatRoomStateInstantiated) { LinphoneChatRoomCbs *cbs = linphone_factory_create_chat_room_cbs(linphone_factory_get()); @@ -115,6 +122,7 @@ static void core_chat_room_state_changed (LinphoneCore *core, LinphoneChatRoom * linphone_chat_room_cbs_set_state_changed(cbs, chat_room_state_changed); linphone_chat_room_cbs_set_subject_changed(cbs, chat_room_subject_changed); linphone_chat_room_cbs_set_participant_device_added(cbs, chat_room_participant_device_added); + linphone_chat_room_cbs_set_all_information_received(cbs, chat_room_all_information_received); linphone_chat_room_add_callbacks(cr, cbs); linphone_chat_room_cbs_unref(cbs); } @@ -180,9 +188,9 @@ static void _send_file_plus_text(LinphoneChatRoom* cr, const char *sendFilepath, cbs = linphone_chat_message_get_callbacks(msg); linphone_chat_message_cbs_set_file_transfer_send(cbs, tester_file_transfer_send); - linphone_chat_message_cbs_set_msg_state_changed(cbs,liblinphone_tester_chat_message_msg_state_changed); + linphone_chat_message_cbs_set_msg_state_changed(cbs, liblinphone_tester_chat_message_msg_state_changed); linphone_chat_message_cbs_set_file_transfer_progress_indication(cbs, file_transfer_progress_indication); - linphone_chat_room_send_chat_message(cr, msg); + linphone_chat_message_send(msg); linphone_content_unref(content); linphone_chat_message_unref(msg); } @@ -255,6 +263,7 @@ static void start_core_for_conference(bctbx_list_t *coreManagerList) { static LinphoneChatRoom * check_creation_chat_room_client_side(bctbx_list_t *lcs, LinphoneCoreManager *lcm, stats *initialStats, const LinphoneAddress *confAddr, const char* subject, int participantNumber, bool_t isAdmin) { BC_ASSERT_TRUE(wait_for_list(lcs, &lcm->stat.number_of_LinphoneChatRoomStateCreationPending, initialStats->number_of_LinphoneChatRoomStateCreationPending + 1, 5000)); BC_ASSERT_TRUE(wait_for_list(lcs, &lcm->stat.number_of_LinphoneChatRoomStateCreated, initialStats->number_of_LinphoneChatRoomStateCreated + 1, 10000)); + BC_ASSERT_TRUE(wait_for_list(lcs, &lcm->stat.number_of_LinphoneChatRoomAllInformationReceived, initialStats->number_of_LinphoneChatRoomAllInformationReceived + 1, 10000)); char *deviceIdentity = linphone_core_get_device_identity(lcm->lc); LinphoneAddress *localAddr = linphone_address_new(deviceIdentity); bctbx_free(deviceIdentity); @@ -284,6 +293,7 @@ static LinphoneChatRoom * create_chat_room_client_side(bctbx_list_t *lcs, Linpho // Check that the chat room is correctly created on Marie's side and that the participants are added BC_ASSERT_TRUE(wait_for_list(lcs, &lcm->stat.number_of_LinphoneChatRoomStateCreationPending, initialStats->number_of_LinphoneChatRoomStateCreationPending + 1, 10000)); BC_ASSERT_TRUE(wait_for_list(lcs, &lcm->stat.number_of_LinphoneChatRoomStateCreated, initialStats->number_of_LinphoneChatRoomStateCreated + 1, 10000)); + BC_ASSERT_TRUE(wait_for_list(lcs, &lcm->stat.number_of_LinphoneChatRoomAllInformationReceived, initialStats->number_of_LinphoneChatRoomAllInformationReceived + 1, 10000)); BC_ASSERT_EQUAL(linphone_chat_room_get_nb_participants(chatRoom), (expectedParticipantSize >= 0) ? expectedParticipantSize : (int)bctbx_list_size(participantsAddresses), int, "%d"); @@ -1528,13 +1538,14 @@ static void group_chat_room_reinvited_after_removed_base (bool_t offline_when_re bctbx_list_t *tmpCoresManagerList = bctbx_list_append(NULL, laure); bctbx_list_t *tmpCoresList = init_core_for_conference(tmpCoresManagerList); bctbx_list_free(tmpCoresManagerList); - initialLaureStats = laure->stat; linphone_core_manager_start(laure, TRUE); coresList = bctbx_list_concat(coresList, tmpCoresList); coresManagerList = bctbx_list_append(coresManagerList, laure); } if (!offline_when_reinvited) BC_ASSERT_TRUE(wait_for_list(coresList, &laure->stat.number_of_LinphoneChatRoomStateTerminated, initialLaureStats.number_of_LinphoneChatRoomStateTerminated + 1, 3000)); + wait_for_list(coresList,0, 1, 2000); + initialLaureStats = laure->stat; // Marie adds Laure to the chat room participantsAddresses = bctbx_list_append(participantsAddresses, laureAddr); @@ -1550,16 +1561,13 @@ static void group_chat_room_reinvited_after_removed_base (bool_t offline_when_re bctbx_list_t *tmpCoresManagerList = bctbx_list_append(NULL, laure); bctbx_list_t *tmpCoresList = init_core_for_conference(tmpCoresManagerList); bctbx_list_free(tmpCoresManagerList); - initialLaureStats = laure->stat; linphone_core_manager_start(laure, TRUE); coresList = bctbx_list_concat(coresList, tmpCoresList); coresManagerList = bctbx_list_append(coresManagerList, laure); - BC_ASSERT_TRUE(wait_for_list(coresList, &laure->stat.number_of_LinphoneChatRoomStateCreationPending, initialLaureStats.number_of_LinphoneChatRoomStateCreationPending + 1, 5000)); - BC_ASSERT_TRUE(wait_for_list(coresList, &laure->stat.number_of_LinphoneChatRoomStateCreated, initialLaureStats.number_of_LinphoneChatRoomStateCreated + 2, 5000)); - } else { - BC_ASSERT_TRUE(wait_for_list(coresList, &laure->stat.number_of_LinphoneChatRoomStateCreationPending, initialLaureStats.number_of_LinphoneChatRoomStateCreationPending + 1, 5000)); - BC_ASSERT_TRUE(wait_for_list(coresList, &laure->stat.number_of_LinphoneChatRoomStateCreated, initialLaureStats.number_of_LinphoneChatRoomStateCreated + 1, 5000)); } + BC_ASSERT_TRUE(wait_for_list(coresList, &laure->stat.number_of_LinphoneChatRoomStateCreationPending, initialLaureStats.number_of_LinphoneChatRoomStateCreationPending + 1, 5000)); + BC_ASSERT_TRUE(wait_for_list(coresList, &laure->stat.number_of_LinphoneChatRoomStateCreated, initialLaureStats.number_of_LinphoneChatRoomStateCreated + 1, 5000)); + BC_ASSERT_TRUE(wait_for_list(coresList, &laure->stat.number_of_LinphoneChatRoomAllInformationReceived, initialLaureStats.number_of_LinphoneChatRoomAllInformationReceived + 1, 5000)); BC_ASSERT_EQUAL(linphone_chat_room_get_nb_participants(marieCr), 2, int, "%d"); BC_ASSERT_EQUAL(linphone_chat_room_get_nb_participants(paulineCr), 2, int, "%d"); char *laureIdentity = linphone_core_get_device_identity(laure->lc); @@ -2301,12 +2309,14 @@ static void group_chat_room_migrate_from_basic_chat_room (void) { linphone_chat_message_unref(msg); BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateCreationPending, initialMarieStats.number_of_LinphoneChatRoomStateCreationPending + 1, 10000)); BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateCreated, initialMarieStats.number_of_LinphoneChatRoomStateCreated + 1, 10000)); + BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomAllInformationReceived, initialMarieStats.number_of_LinphoneChatRoomAllInformationReceived + 1, 10000)); BC_ASSERT_TRUE(linphone_chat_room_get_capabilities(marieCr) & LinphoneChatRoomCapabilitiesConference); BC_ASSERT_EQUAL(linphone_chat_room_get_nb_participants(marieCr), 1, int, "%d"); BC_ASSERT_EQUAL(linphone_chat_room_get_history_size(marieCr), 2, int, "%d"); BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneChatRoomStateCreationPending, initialPaulineStats.number_of_LinphoneChatRoomStateCreationPending + 1, 10000)); BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneChatRoomStateCreated, initialPaulineStats.number_of_LinphoneChatRoomStateCreated + 1, 10000)); + BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneChatRoomAllInformationReceived, initialPaulineStats.number_of_LinphoneChatRoomAllInformationReceived + 1, 10000)); BC_ASSERT_TRUE(linphone_chat_room_get_capabilities(paulineCr) & LinphoneChatRoomCapabilitiesConference); BC_ASSERT_EQUAL(linphone_chat_room_get_nb_participants(paulineCr), 1, int, "%d"); BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneMessageReceived, initialPaulineStats.number_of_LinphoneMessageReceived + 1, 1000)); @@ -2440,12 +2450,14 @@ static void group_chat_room_migrate_from_basic_to_client_fail (void) { linphone_chat_message_send(msg); BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateCreationPending, initialMarieStats.number_of_LinphoneChatRoomStateCreationPending + 2, 10000)); BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateCreated, initialMarieStats.number_of_LinphoneChatRoomStateCreated + 1, 10000)); + BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomAllInformationReceived, initialMarieStats.number_of_LinphoneChatRoomAllInformationReceived + 1, 10000)); BC_ASSERT_TRUE(linphone_chat_room_get_capabilities(marieCr) & LinphoneChatRoomCapabilitiesConference); BC_ASSERT_EQUAL(linphone_chat_room_get_nb_participants(marieCr), 1, int, "%d"); BC_ASSERT_EQUAL(linphone_chat_room_get_history_size(marieCr), 5, int, "%d"); BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneChatRoomStateCreationPending, initialPaulineStats.number_of_LinphoneChatRoomStateCreationPending + 1, 10000)); BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneChatRoomStateCreated, initialPaulineStats.number_of_LinphoneChatRoomStateCreated + 1, 10000)); + BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneChatRoomAllInformationReceived, initialPaulineStats.number_of_LinphoneChatRoomAllInformationReceived + 1, 10000)); BC_ASSERT_TRUE(linphone_chat_room_get_capabilities(paulineCr) & LinphoneChatRoomCapabilitiesConference); BC_ASSERT_EQUAL(linphone_chat_room_get_nb_participants(paulineCr), 1, int, "%d"); BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneMessageReceived, initialPaulineStats.number_of_LinphoneMessageReceived + 3, 1000)); @@ -2792,10 +2804,10 @@ static void group_chat_room_unique_one_to_one_chat_room_recreated_from_message_w static void group_chat_room_unique_one_to_one_chat_room_recreated_from_message_2 (void) { LinphoneCoreManager *marie = linphone_core_manager_create("marie_rc"); LinphoneCoreManager *pauline = linphone_core_manager_create("pauline_rc"); - /*create a second device for marie, but it is inactive after registration in this test*/ + // Create a second device for Marie, but it is inactive after registration in this test LinphoneCoreManager *marie2 = linphone_core_manager_create("marie_rc"); - /*Create a seconde device for pauline, but again inactivate after registration*/ - LinphoneCoreManager *pauline2 = linphone_core_manager_create("marie_rc"); + // Create a second device for Pauline, but again inactivate it after registration + LinphoneCoreManager *pauline2 = linphone_core_manager_create("pauline_rc"); bctbx_list_t *coresManagerList = NULL; bctbx_list_t *participantsAddresses = NULL; coresManagerList = bctbx_list_append(coresManagerList, marie); @@ -2807,6 +2819,8 @@ static void group_chat_room_unique_one_to_one_chat_room_recreated_from_message_2 participantsAddresses = bctbx_list_append(participantsAddresses, linphone_address_new(linphone_core_get_identity(pauline->lc))); stats initialMarieStats = marie->stat; stats initialPaulineStats = pauline->stat; + stats initialMarie2Stats = marie2->stat; + stats initialPauline2Stats = pauline2->stat; linphone_core_set_network_reachable(marie2->lc, FALSE); linphone_core_set_network_reachable(pauline2->lc, FALSE); @@ -2852,13 +2866,22 @@ static void group_chat_room_unique_one_to_one_chat_room_recreated_from_message_2 BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneMessageReceived, initialPaulineStats.number_of_LinphoneMessageReceived + 1, 10000)); BC_ASSERT_STRING_EQUAL(linphone_chat_message_get_text(pauline->stat.last_received_chat_message), textMessage); linphone_chat_message_unref(message); - - // Clean db from chat room - linphone_core_manager_delete_chat_room(marie, marieCr, coresList); } - linphone_core_manager_delete_chat_room(pauline, paulineCr, coresList); - wait_for_list(coresList, 0, 1, 2000); + // Clean db from chat room + linphone_core_set_network_reachable(marie2->lc, TRUE); + linphone_core_set_network_reachable(pauline2->lc, TRUE); + BC_ASSERT_TRUE(wait_for_list(coresList, &marie2->stat.number_of_LinphoneChatRoomStateCreationPending, initialMarie2Stats.number_of_LinphoneChatRoomStateCreationPending + 1, 3000)); + BC_ASSERT_TRUE(wait_for_list(coresList, &marie2->stat.number_of_LinphoneChatRoomStateCreated, initialMarie2Stats.number_of_LinphoneChatRoomStateCreated + 1, 3000)); + BC_ASSERT_TRUE(wait_for_list(coresList, &pauline2->stat.number_of_LinphoneChatRoomStateCreationPending, initialPauline2Stats.number_of_LinphoneChatRoomStateCreationPending + 1, 3000)); + BC_ASSERT_TRUE(wait_for_list(coresList, &pauline2->stat.number_of_LinphoneChatRoomStateCreated, initialPauline2Stats.number_of_LinphoneChatRoomStateCreated + 1, 3000)); + linphone_core_manager_delete_chat_room(marie, marieCr, coresList); + linphone_core_manager_delete_chat_room(pauline, paulineCr, coresList); + BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateTerminated, initialMarieStats.number_of_LinphoneChatRoomStateTerminated + 1, 3000)); + BC_ASSERT_TRUE(wait_for_list(coresList, &pauline->stat.number_of_LinphoneChatRoomStateTerminated, initialPaulineStats.number_of_LinphoneChatRoomStateTerminated + 1, 3000)); + BC_ASSERT_TRUE(wait_for_list(coresList, &marie2->stat.number_of_LinphoneChatRoomStateTerminated, initialMarie2Stats.number_of_LinphoneChatRoomStateTerminated + 1, 3000)); + BC_ASSERT_TRUE(wait_for_list(coresList, &pauline2->stat.number_of_LinphoneChatRoomStateTerminated, initialPauline2Stats.number_of_LinphoneChatRoomStateTerminated + 1, 3000)); + BC_ASSERT_EQUAL(linphone_core_get_call_history_size(marie->lc), 0, int,"%i"); BC_ASSERT_EQUAL(linphone_core_get_call_history_size(pauline->lc), 0, int,"%i"); BC_ASSERT_PTR_NULL(linphone_core_get_call_logs(marie->lc)); @@ -2867,8 +2890,6 @@ static void group_chat_room_unique_one_to_one_chat_room_recreated_from_message_2 linphone_address_unref(confAddr); bctbx_list_free(coresList); bctbx_list_free(coresManagerList); - linphone_core_set_network_reachable(marie2->lc, TRUE); - linphone_core_set_network_reachable(pauline2->lc, TRUE); linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); linphone_core_manager_destroy(marie2); @@ -2947,6 +2968,9 @@ static void group_chat_room_join_one_to_one_chat_room_with_a_new_device (void) { linphone_chat_message_unref(message); // Clean db from chat room + int previousNbRegistrationOk = marie1->stat.number_of_LinphoneRegistrationOk; + linphone_core_set_network_reachable(marie1->lc, TRUE); + wait_for_until(marie1->lc, NULL, &marie1->stat.number_of_LinphoneRegistrationOk, previousNbRegistrationOk + 1, 2000); linphone_core_manager_delete_chat_room(marie2, marie2Cr, coresList); linphone_core_delete_chat_room(marie1->lc, marie1Cr); linphone_core_manager_delete_chat_room(pauline, paulineCr, coresList); @@ -3272,7 +3296,7 @@ test_t group_chat_tests[] = { TEST_NO_TAG("Unique one-to-one chatroom", group_chat_room_unique_one_to_one_chat_room), TEST_NO_TAG("Unique one-to-one chatroom recreated from message", group_chat_room_unique_one_to_one_chat_room_recreated_from_message), TEST_ONE_TAG("Unique one-to-one chatroom recreated from message with app restart", group_chat_room_unique_one_to_one_chat_room_recreated_from_message_with_app_restart, "LeaksMemory"), - TEST_NO_TAG("Join one-to-one chat room with a new device", group_chat_room_join_one_to_one_chat_room_with_a_new_device), + TEST_ONE_TAG("Join one-to-one chat room with a new device", group_chat_room_join_one_to_one_chat_room_with_a_new_device, "LeaksMemory"), TEST_NO_TAG("New unique one-to-one chatroom after both participants left", group_chat_room_new_unique_one_to_one_chat_room_after_both_participants_left), TEST_NO_TAG("Unique one-to-one chatroom re-created from the party that deleted it, with inactive devices", group_chat_room_unique_one_to_one_chat_room_recreated_from_message_2), TEST_NO_TAG("IMDN for group chat room", imdn_for_group_chat_room), diff --git a/tester/liblinphone_tester.h b/tester/liblinphone_tester.h index 9824c2084..ac42e1714 100644 --- a/tester/liblinphone_tester.h +++ b/tester/liblinphone_tester.h @@ -182,6 +182,7 @@ typedef struct _stats { int number_of_LinphoneIsComposingIdleReceived; int progress_of_LinphoneFileTransfer; + int number_of_LinphoneChatRoomAllInformationReceived; int number_of_LinphoneChatRoomStateInstantiated; int number_of_LinphoneChatRoomStateCreationPending; int number_of_LinphoneChatRoomStateCreated; From 1cf491257e1712ac5a82ee286b74dbfe1c92d849 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Thu, 5 Apr 2018 15:33:29 +0200 Subject: [PATCH 060/121] Adding missing include to core.h --- include/linphone/core.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linphone/core.h b/include/linphone/core.h index ded8e3949..24ae79627 100644 --- a/include/linphone/core.h +++ b/include/linphone/core.h @@ -52,6 +52,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "linphone/im_encryption_engine.h" #include "linphone/im_notif_policy.h" #include "linphone/info_message.h" +#include "linphone/logging.h" #include "linphone/lpconfig.h" #include "linphone/misc.h" #include "linphone/nat_policy.h" From 8ddd7ad3099e3a8875c630f1cb7f393ea2eefd51 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Thu, 5 Apr 2018 16:43:05 +0200 Subject: [PATCH 061/121] Adding missing function for LinphoneLoggingCbs --- coreapi/logging.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/coreapi/logging.c b/coreapi/logging.c index 6a5182113..6f2a216d6 100644 --- a/coreapi/logging.c +++ b/coreapi/logging.c @@ -249,6 +249,10 @@ void linphone_logging_service_cbs_set_user_data(LinphoneLoggingServiceCbs *cbs, cbs->user_data = user_data; } +void *linphone_logging_service_cbs_get_user_data(const LinphoneLoggingServiceCbs *cbs) { + return cbs->user_data; +} + BELLE_SIP_INSTANCIATE_VPTR(LinphoneLoggingServiceCbs, belle_sip_object_t, NULL, // uninit NULL, // clone From 44cbfd888996d55ed22220ae86e2b3c2e8a8c3a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Thu, 5 Apr 2018 16:46:15 +0200 Subject: [PATCH 062/121] doc: gathers reference docs inside a directory --- coreapi/help/doc/sphinx/CMakeLists.txt | 19 +++++++++++-------- coreapi/help/doc/sphinx/conf.py.in | 8 ++++---- coreapi/help/doc/sphinx/index.rst | 8 ++++---- coreapi/help/doc/sphinx/toc.rst | 3 --- 4 files changed, 19 insertions(+), 19 deletions(-) delete mode 100644 coreapi/help/doc/sphinx/toc.rst diff --git a/coreapi/help/doc/sphinx/CMakeLists.txt b/coreapi/help/doc/sphinx/CMakeLists.txt index 797ee3f1c..92699653a 100644 --- a/coreapi/help/doc/sphinx/CMakeLists.txt +++ b/coreapi/help/doc/sphinx/CMakeLists.txt @@ -21,7 +21,10 @@ ############################################################################ if (ENABLE_SPHINX_DOC) - set(STATIC_DOCUMENTATION_FILES + set(doc_source_dir ${CMAKE_CURRENT_BINARY_DIR}/source) + set(doc_output_dir ${CMAKE_CURRENT_BINARY_DIR}/build) + set(reference_doc_source_dir ${doc_source_dir}/reference) + set(static_documentation_files guides/authentication.rst guides/buddy_list.rst guides/call_control.rst @@ -42,15 +45,15 @@ if (ENABLE_SPHINX_DOC) samples/samples.rst toc.rst ) - configure_file(conf.py.in source/conf.py) - foreach(file ${STATIC_DOCUMENTATION_FILES}) - configure_file(${file} source/${file} COPYONLY) + configure_file(conf.py.in ${doc_source_dir}/conf.py) + foreach(file ${static_documentation_files}) + configure_file(${file} ${doc_source_dir}/${file} COPYONLY) endforeach(file) foreach(source ${LINPHONE_C_EXAMPLES_SOURCE}) - configure_file(${source} source/samples/ COPYONLY) + configure_file(${source} ${doc_source_dir}/samples/ COPYONLY) endforeach(source) - execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/source/_static) - add_custom_target(sphinx-doc ALL ${PYTHON_EXECUTABLE} '${CMAKE_CURRENT_SOURCE_DIR}/gendoc.py' '${LINPHONE_DOXYGEN_XML_DIR}' -o 'source' - COMMAND ${PYTHON_EXECUTABLE} -msphinx -M html 'source' 'build' + execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${doc_source_dir}/_static ${reference_doc_source_dir}) + add_custom_target(sphinx-doc ALL ${PYTHON_EXECUTABLE} '${CMAKE_CURRENT_SOURCE_DIR}/gendoc.py' '${LINPHONE_DOXYGEN_XML_DIR}' -o '${reference_doc_source_dir}' + COMMAND ${PYTHON_EXECUTABLE} -msphinx -M html '${doc_source_dir}' '${doc_output_dir}' DEPENDS linphone-doc) endif() diff --git a/coreapi/help/doc/sphinx/conf.py.in b/coreapi/help/doc/sphinx/conf.py.in index 492fd8e43..3d903aaf3 100644 --- a/coreapi/help/doc/sphinx/conf.py.in +++ b/coreapi/help/doc/sphinx/conf.py.in @@ -43,7 +43,7 @@ templates_path = ['_templates'] source_suffix = '.rst' # The master toctree document. -master_doc = 'toc' +master_doc = 'index' # General information about the project. project = 'Linphone Core API' @@ -107,9 +107,9 @@ html_logo = 'logo.png' html_experimental_html5_writer = True # Side bar customization -html_sidebars = { - '**': ['searchbox.html', 'globaltoc.html'] -} +#html_sidebars = { +# 'reference/*/*' : ['searchbox.html', 'globaltoc.html'] +#} # -- Options for HTMLHelp output ------------------------------------------ diff --git a/coreapi/help/doc/sphinx/index.rst b/coreapi/help/doc/sphinx/index.rst index 8b6728012..03500afe6 100644 --- a/coreapi/help/doc/sphinx/index.rst +++ b/coreapi/help/doc/sphinx/index.rst @@ -64,7 +64,7 @@ API's reference documentation .. toctree:: :maxdepth: 1 - c/index - cpp/index - java/index - csharp/index + reference/c/index + reference/cpp/index + reference/java/index + reference/csharp/index diff --git a/coreapi/help/doc/sphinx/toc.rst b/coreapi/help/doc/sphinx/toc.rst deleted file mode 100644 index c775b0af9..000000000 --- a/coreapi/help/doc/sphinx/toc.rst +++ /dev/null @@ -1,3 +0,0 @@ -.. toctree:: - - index From 5290d59d769c90f18f720b07495061ba6dcbbb84 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 5 Apr 2018 17:08:37 +0200 Subject: [PATCH 063/121] Various fixes regarding callbacks of chat rooms. --- coreapi/chat.c | 4 ++-- include/linphone/core.h | 5 +++-- src/c-wrapper/api/c-chat-room.cpp | 1 + src/chat/chat-message/chat-message.cpp | 2 +- src/chat/chat-room/chat-room.h | 1 + src/core/core-chat-room.cpp | 4 ++-- src/core/core.h | 2 +- tester/group_chat_tester.c | 10 +++++----- 8 files changed, 16 insertions(+), 13 deletions(-) diff --git a/coreapi/chat.c b/coreapi/chat.c index ac9c8dcf0..edc8b861b 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -84,8 +84,8 @@ LinphoneChatRoom *linphone_core_get_chat_room (LinphoneCore *lc, const LinphoneA return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->getOrCreateBasicChatRoom(*L_GET_CPP_PTR_FROM_C_OBJECT(addr))); } -LinphoneChatRoom *linphone_core_create_client_group_chat_room (LinphoneCore *lc, const char *subject) { - return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->createClientGroupChatRoom(L_C_TO_STRING(subject))); +LinphoneChatRoom *linphone_core_create_client_group_chat_room (LinphoneCore *lc, const char *subject, bool_t fallback) { + return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->createClientGroupChatRoom(L_C_TO_STRING(subject), !!fallback)); } LinphoneChatRoom *_linphone_core_create_server_group_chat_room (LinphoneCore *lc, LinphonePrivate::SalCallOp *op) { diff --git a/include/linphone/core.h b/include/linphone/core.h index 24ae79627..ce01ec878 100644 --- a/include/linphone/core.h +++ b/include/linphone/core.h @@ -4976,13 +4976,14 @@ LINPHONE_DEPRECATED LINPHONE_PUBLIC const char *linphone_core_get_chat_database_ /** * Create a client-side group chat room. When calling this function the chat room is only created - * at the client-side and is empty. Pou need to call linphone_chat_room_add_participants() to + * at the client-side and is empty. You need to call linphone_chat_room_add_participants() to * create at the server side and add participants to it. * @param[in] lc A #LinphoneCore object * @param[in] subject The subject of the group chat room + * @param[in] fallback Boolean value telling whether we should plan on being able to fallback to a basic chat room if the client-side group chat room creation fails * @return The newly created client-side group chat room. */ -LINPHONE_PUBLIC LinphoneChatRoom * linphone_core_create_client_group_chat_room(LinphoneCore *lc, const char *subject); +LINPHONE_PUBLIC LinphoneChatRoom * linphone_core_create_client_group_chat_room(LinphoneCore *lc, const char *subject, bool_t fallback); /** * Get a basic chat room whose peer is the supplied address. If it does not exist yet, it will be created. diff --git a/src/c-wrapper/api/c-chat-room.cpp b/src/c-wrapper/api/c-chat-room.cpp index 3e3f7bb4c..faf919bee 100644 --- a/src/c-wrapper/api/c-chat-room.cpp +++ b/src/c-wrapper/api/c-chat-room.cpp @@ -442,6 +442,7 @@ const bctbx_list_t *linphone_chat_room_get_callbacks_list(const LinphoneChatRoom if (cb) \ cb(__VA_ARGS__); \ } \ + linphone_chat_room_set_current_callbacks(cr, nullptr); \ bctbx_list_free(callbacksCopy); void _linphone_chat_room_notify_is_composing_received(LinphoneChatRoom *cr, const LinphoneAddress *remoteAddr, bool_t isComposing) { diff --git a/src/chat/chat-message/chat-message.cpp b/src/chat/chat-message/chat-message.cpp index 0fcde7521..90eb244c2 100644 --- a/src/chat/chat-message/chat-message.cpp +++ b/src/chat/chat-message/chat-message.cpp @@ -500,7 +500,7 @@ static void forceUtf8Content (Content &content) { void ChatMessagePrivate::notifyReceiving () { L_Q(); - LinphoneChatRoom *chatRoom = L_GET_C_BACK_PTR(q->getChatRoom()); + LinphoneChatRoom *chatRoom = static_pointer_cast(q->getChatRoom())->getPrivate()->getCChatRoom(); if ((getContentType() != ContentType::Imdn) && (getContentType() != ContentType::ImIsComposing)) { _linphone_chat_room_notify_chat_message_should_be_stored(chatRoom, L_GET_C_BACK_PTR(q->getSharedFromThis())); if (toBeStored) diff --git a/src/chat/chat-room/chat-room.h b/src/chat/chat-room/chat-room.h index 40cad5ae3..40bc7a05e 100644 --- a/src/chat/chat-room/chat-room.h +++ b/src/chat/chat-room/chat-room.h @@ -30,6 +30,7 @@ class ChatRoomPrivate; class LINPHONE_PUBLIC ChatRoom : public AbstractChatRoom { public: + friend class ChatMessagePrivate; friend class ProxyChatRoomPrivate; L_OVERRIDE_SHARED_FROM_THIS(ChatRoom); diff --git a/src/core/core-chat-room.cpp b/src/core/core-chat-room.cpp index b02d072bf..cac503c2c 100644 --- a/src/core/core-chat-room.cpp +++ b/src/core/core-chat-room.cpp @@ -265,9 +265,9 @@ shared_ptr Core::findOneToOneChatRoom ( return nullptr; } -shared_ptr Core::createClientGroupChatRoom (const string &subject) { +shared_ptr Core::createClientGroupChatRoom (const string &subject, bool fallback) { L_D(); - return d->createClientGroupChatRoom(subject); + return d->createClientGroupChatRoom(subject, "", Content(), fallback); } shared_ptr Core::getOrCreateBasicChatRoom (const ChatRoomId &chatRoomId, bool isRtt) { diff --git a/src/core/core.h b/src/core/core.h index a8a15630a..72b037003 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -101,7 +101,7 @@ public: const IdentityAddress &participantAddress ) const; - std::shared_ptr createClientGroupChatRoom (const std::string &subject); + std::shared_ptr createClientGroupChatRoom (const std::string &subject, bool fallback = true); std::shared_ptr createClientGroupChatRoom ( const std::string &subject, const IdentityAddress &localAddress diff --git a/tester/group_chat_tester.c b/tester/group_chat_tester.c index 14c0ab1d0..d1672bb10 100644 --- a/tester/group_chat_tester.c +++ b/tester/group_chat_tester.c @@ -282,7 +282,7 @@ static LinphoneChatRoom * check_creation_chat_room_client_side(bctbx_list_t *lcs } static LinphoneChatRoom * create_chat_room_client_side(bctbx_list_t *lcs, LinphoneCoreManager *lcm, stats *initialStats, bctbx_list_t *participantsAddresses, const char* initialSubject, int expectedParticipantSize) { - LinphoneChatRoom *chatRoom = linphone_core_create_client_group_chat_room(lcm->lc, initialSubject); + LinphoneChatRoom *chatRoom = linphone_core_create_client_group_chat_room(lcm->lc, initialSubject, FALSE); if (!chatRoom) return NULL; BC_ASSERT_TRUE(wait_for_list(lcs, &lcm->stat.number_of_LinphoneChatRoomStateInstantiated, initialStats->number_of_LinphoneChatRoomStateInstantiated + 1, 100)); @@ -2139,7 +2139,7 @@ static void group_chat_room_fallback_to_basic_chat_room (void) { stats initialPaulineStats = pauline->stat; // Marie creates a new group chat room - LinphoneChatRoom *marieCr = linphone_core_create_client_group_chat_room(marie->lc, "Fallback"); + LinphoneChatRoom *marieCr = linphone_core_create_client_group_chat_room(marie->lc, "Fallback", TRUE); BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateInstantiated, initialMarieStats.number_of_LinphoneChatRoomStateInstantiated + 1, 100)); // Add participants @@ -2195,13 +2195,13 @@ static void group_chat_room_creation_fails_if_invited_participants_dont_support_ stats initialMarieStats = marie->stat; // Marie creates a new group chat room - LinphoneChatRoom *marieCr = linphone_core_create_client_group_chat_room(marie->lc, "Hello there"); + LinphoneChatRoom *marieCr = linphone_core_create_client_group_chat_room(marie->lc, "Hello there", FALSE); BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateInstantiated, initialMarieStats.number_of_LinphoneChatRoomStateInstantiated + 1, 100)); // Add participants linphone_chat_room_add_participants(marieCr, participantsAddresses); - // Check that the group chat room creation fails and that a fallback to a basic chat room is done + // Check that the group chat room creation fails BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateCreationPending, initialMarieStats.number_of_LinphoneChatRoomStateCreationPending + 1, 10000)); BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateCreationFailed, initialMarieStats.number_of_LinphoneChatRoomStateCreationFailed + 1, 10000)); bctbx_list_free_with_data(participantsAddresses, (bctbx_list_free_func)linphone_address_unref); @@ -2367,7 +2367,7 @@ static void group_chat_room_migrate_from_basic_to_client_fail (void) { stats initialPaulineStats = pauline->stat; // Marie creates a new group chat room - LinphoneChatRoom *marieCr = linphone_core_create_client_group_chat_room(marie->lc, "Fallback"); + LinphoneChatRoom *marieCr = linphone_core_create_client_group_chat_room(marie->lc, "Fallback", TRUE); BC_ASSERT_TRUE(wait_for_list(coresList, &marie->stat.number_of_LinphoneChatRoomStateInstantiated, initialMarieStats.number_of_LinphoneChatRoomStateInstantiated + 1, 100)); // Add participants From 2f550cd5dff3d29fa90b1722640db9095ffb0868 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 6 Apr 2018 12:09:11 +0200 Subject: [PATCH 064/121] Added method in Java's wrapper Factory object to get LoggingService --- wrappers/java/java_class.mustache | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wrappers/java/java_class.mustache b/wrappers/java/java_class.mustache index b827684ee..3ed6787dc 100644 --- a/wrappers/java/java_class.mustache +++ b/wrappers/java/java_class.mustache @@ -127,6 +127,11 @@ public {{#isLinphoneFactory}}abstract class{{/isLinphoneFactory}}{{#isNotLinphon * Gets the object stored in this object user's data */ {{#isLinphoneFactory}}abstract {{/isLinphoneFactory}}public Object getUserData(); + + /** + * Gets the object stored in this object user's data + */ + abstract public LoggingService getLoggingService(); } class {{classImplName}} {{#isLinphoneFactory}}extends{{/isLinphoneFactory}}{{#isNotLinphoneFactory}}implements{{/isNotLinphoneFactory}} {{className}} { @@ -176,6 +181,12 @@ class {{classImplName}} {{#isLinphoneFactory}}extends{{/isLinphoneFactory}}{{#is return getCore(nativePtr, ptr); } + @Override + public LoggingService getLoggingService() { + LoggingService l = new LoggingServiceImpl(0); + return l.get(); + } + @Override public native void setDebugMode(boolean enable, String tag); {{/isLinphoneFactory}} From 0bf5362bf0b793eb21f533eeb65ae3e2804962f5 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 6 Apr 2018 12:15:14 +0200 Subject: [PATCH 065/121] Fixed issue in previous commit --- wrappers/java/java_class.mustache | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wrappers/java/java_class.mustache b/wrappers/java/java_class.mustache index 3ed6787dc..93d84e00a 100644 --- a/wrappers/java/java_class.mustache +++ b/wrappers/java/java_class.mustache @@ -95,6 +95,11 @@ public {{#isLinphoneFactory}}abstract class{{/isLinphoneFactory}}{{#isNotLinphon abstract public OpenH264DownloadHelper createOpenH264DownloadHelper(Context context); + /** + * Gets the LoggingService singleton + */ + abstract public LoggingService getLoggingService(); + abstract public void setDebugMode(boolean enable, String tag); abstract public Core getCore(long ptr); @@ -127,11 +132,6 @@ public {{#isLinphoneFactory}}abstract class{{/isLinphoneFactory}}{{#isNotLinphon * Gets the object stored in this object user's data */ {{#isLinphoneFactory}}abstract {{/isLinphoneFactory}}public Object getUserData(); - - /** - * Gets the object stored in this object user's data - */ - abstract public LoggingService getLoggingService(); } class {{classImplName}} {{#isLinphoneFactory}}extends{{/isLinphoneFactory}}{{#isNotLinphoneFactory}}implements{{/isNotLinphoneFactory}} {{className}} { From 8b5c4e0305b8a0fa5c73e4bd49710b8b43e2d973 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 6 Apr 2018 15:15:37 +0200 Subject: [PATCH 066/121] Fixed proxy chat room not being notified of Created state when we fallback to a basic chat room --- src/chat/chat-room/client-group-to-basic-chat-room.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/chat/chat-room/client-group-to-basic-chat-room.cpp b/src/chat/chat-room/client-group-to-basic-chat-room.cpp index c72f9cfec..26b6fe47d 100644 --- a/src/chat/chat-room/client-group-to-basic-chat-room.cpp +++ b/src/chat/chat-room/client-group-to-basic-chat-room.cpp @@ -79,10 +79,15 @@ public: cgcr->getPrivate()->setCallSessionListener(nullptr); cgcr->getPrivate()->setChatRoomListener(nullptr); Core::deleteChatRoom(q->getSharedFromThis()); - setupProxy(); + LinphoneChatRoom *lcr = L_GET_C_BACK_PTR(q); shared_ptr bcr = cgcr->getCore()->getOrCreateBasicChatRoom(invitedAddresses.front()); L_SET_CPP_PTR_FROM_C_OBJECT(lcr, bcr); + /* getOrCreateBasicChatRoom will automatically set the state to Instantiated and Created + * but because CPP ptr hasn't been set yet in this case the application's ChatRoom won't be notified + * that's why we set both states again here... */ + bcr->getPrivate()->setState(ChatRoom::State::Instantiated); + bcr->getPrivate()->setState(ChatRoom::State::Created); return; } cgcr->getPrivate()->onCallSessionStateChanged(session, newState, message); From 4d17bb5f54b1ff09f71fb8cfc42280b5231b00a7 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 6 Apr 2018 15:25:28 +0200 Subject: [PATCH 067/121] Allow addition of participant to a server group chat room using a REFER. --- coreapi/callbacks.c | 65 ++++++++++++------- .../chat-room/server-group-chat-room-stub.cpp | 2 + 2 files changed, 43 insertions(+), 24 deletions(-) diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 4a835b704..dd85c26a0 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -783,34 +783,51 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){ } static_cast(op)->reply(SalReasonDeclined); } - } else if (addr.hasParam("admin")) { - LinphoneChatRoom *cr = L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom( - ChatRoomId(IdentityAddress(op->get_to()), IdentityAddress(op->get_to())) - )); - if (cr) { - Address fromAddr(op->get_from()); - std::shared_ptr participant = L_GET_CPP_PTR_FROM_C_OBJECT(cr)->findParticipant(fromAddr); - if (!participant || !participant->isAdmin()) { - static_cast(op)->reply(SalReasonDeclined); - return; - } - participant = L_GET_CPP_PTR_FROM_C_OBJECT(cr)->findParticipant(addr); - if (participant) { - bool value = Utils::stob(addr.getParamValue("admin")); - L_GET_CPP_PTR_FROM_C_OBJECT(cr)->setParticipantAdminStatus(participant, value); + } else { + if (linphone_core_conference_server_enabled(lc)) { + shared_ptr chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom( + ChatRoomId(IdentityAddress(op->get_to()), IdentityAddress(op->get_to())) + ); + LinphoneChatRoom *cr = L_GET_C_BACK_PTR(chatRoom); + if (cr) { + Address fromAddr(op->get_from()); + shared_ptr participant = chatRoom->findParticipant(fromAddr); + if (!participant || !participant->isAdmin()) { + static_cast(op)->reply(SalReasonDeclined); + return; + } + if (addr.hasParam("admin")) { + participant = chatRoom->findParticipant(addr); + if (participant) { + bool value = Utils::stob(addr.getParamValue("admin")); + chatRoom->setParticipantAdminStatus(participant, value); + static_cast(op)->reply(SalReasonNone); + return; + } + } else { + participant = L_GET_PRIVATE(static_pointer_cast(chatRoom))->findFilteredParticipant(addr); + if (!participant) { + list identAddresses; + identAddresses.push_back(addr); + L_GET_PRIVATE(static_pointer_cast(chatRoom))->checkCompatibleParticipants( + IdentityAddress(op->get_remote_contact()), + identAddresses + ); + static_cast(op)->reply(SalReasonNone); + return; + } + } } + } else { + shared_ptr chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom( + ChatRoomId(addr, IdentityAddress(op->get_to())) + ); + if (!chatRoom) + chatRoom = L_GET_PRIVATE_FROM_C_OBJECT(lc)->createClientGroupChatRoom("", addr.asString(), Content(), false); + chatRoom->join(); static_cast(op)->reply(SalReasonNone); return; } - } else { - shared_ptr chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom( - ChatRoomId(addr, IdentityAddress(op->get_to())) - ); - if (!chatRoom) - chatRoom = L_GET_PRIVATE_FROM_C_OBJECT(lc)->createClientGroupChatRoom("", addr.asString(), Content(), false); - chatRoom->join(); - static_cast(op)->reply(SalReasonNone); - return; } } } diff --git a/src/chat/chat-room/server-group-chat-room-stub.cpp b/src/chat/chat-room/server-group-chat-room-stub.cpp index bf29ca554..5630256b3 100644 --- a/src/chat/chat-room/server-group-chat-room-stub.cpp +++ b/src/chat/chat-room/server-group-chat-room-stub.cpp @@ -84,6 +84,8 @@ void ServerGroupChatRoomPrivate::addParticipantDevice (const IdentityAddress &pa void ServerGroupChatRoomPrivate::addCompatibleParticipants (const IdentityAddress &deviceAddr, const list &participantCompatible) {} +void ServerGroupChatRoomPrivate::checkCompatibleParticipants (const IdentityAddress &deviceAddr, const list &addressesToCheck) {} + // ----------------------------------------------------------------------------- LinphoneReason ServerGroupChatRoomPrivate::onSipMessageReceived (SalOp *, const SalMessage *) { From ff01c92a593080e92f50daec85d7ab07cf7f4705 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 6 Apr 2018 15:26:01 +0200 Subject: [PATCH 068/121] Add timeout in group chat tester to that the server has the time to destroy a one-to-one chat room before trying to re-create it. --- tester/group_chat_tester.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tester/group_chat_tester.c b/tester/group_chat_tester.c index d1672bb10..fd6372d0f 100644 --- a/tester/group_chat_tester.c +++ b/tester/group_chat_tester.c @@ -3010,6 +3010,7 @@ static void group_chat_room_new_unique_one_to_one_chat_room_after_both_participa // Both participants delete the chat room linphone_core_manager_delete_chat_room(marie, marieCr, coresList); linphone_core_manager_delete_chat_room(pauline, paulineCr, coresList); + wait_for_list(coresList, 0, 1, 3000); // Marie re-creates a chat room with Pauline initialMarieStats = marie->stat; From 7001fea2b6af2d22b4dd508ed32cb3bcf5d94565 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 20 Nov 2017 11:26:36 +0100 Subject: [PATCH 069/121] make sure complex sip case always use ipv4 --- tester/complex_sip_case_tester.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tester/complex_sip_case_tester.c b/tester/complex_sip_case_tester.c index 60a671629..fd4f82734 100644 --- a/tester/complex_sip_case_tester.c +++ b/tester/complex_sip_case_tester.c @@ -365,12 +365,23 @@ static test_t tests[] = { }; #endif +static bool_t previous_liblinphonetester_ipv6; +static void before_each(void) { + previous_liblinphonetester_ipv6=liblinphonetester_ipv6; + liblinphonetester_ipv6=FALSE; /*sipp do not support ipv6 and remote port*/ + liblinphone_tester_before_each(); +} +static void after_each(void) { + liblinphonetester_ipv6=previous_liblinphonetester_ipv6; + liblinphone_tester_after_each(); +} + test_suite_t complex_sip_call_test_suite = { "Complex SIP Case", NULL, NULL, - liblinphone_tester_before_each, - liblinphone_tester_after_each, + before_each, + after_each, #if HAVE_SIPP sizeof(tests) / sizeof(tests[0]), tests From 7d80c636c6b91f33fda9f5191d42c1f07a28408f Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 9 Apr 2018 09:11:35 +0200 Subject: [PATCH 070/121] move jitter_buffer_max_size default value from 250 to 500 retrofit from commit: ea37289b7d8903128fe126d7f2fb7ec81094ffe2 --- src/conference/session/media-session.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/conference/session/media-session.cpp b/src/conference/session/media-session.cpp index 853d6ffc4..29beeb763 100644 --- a/src/conference/session/media-session.cpp +++ b/src/conference/session/media-session.cpp @@ -1997,7 +1997,7 @@ void MediaSessionPrivate::applyJitterBufferParams (RtpSession *session, Linphone JBParameters params; rtp_session_get_jitter_buffer_params(session, ¶ms); params.min_size = lp_config_get_int(config, "rtp", "jitter_buffer_min_size", 40); - params.max_size = lp_config_get_int(config, "rtp", "jitter_buffer_max_size", 250); + params.max_size = lp_config_get_int(config, "rtp", "jitter_buffer_max_size", 500); params.max_packets = params.max_size * 200 / 1000; /* Allow 200 packet per seconds, quite large */ const char *algo = lp_config_get_string(config, "rtp", "jitter_buffer_algorithm", "rls"); params.buffer_algorithm = jitterBufferNameToAlgo(algo ? algo : ""); From 75256337271ba9a16f00b79e4b74b8f72d074092 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Wed, 22 Nov 2017 11:05:12 +0100 Subject: [PATCH 071/121] fix sipp tests --- tester/complex_sip_case_tester.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tester/complex_sip_case_tester.c b/tester/complex_sip_case_tester.c index fd4f82734..da16a595b 100644 --- a/tester/complex_sip_case_tester.c +++ b/tester/complex_sip_case_tester.c @@ -58,15 +58,18 @@ FILE *sip_start(const char *senario, const char* dest_username, const char *pass char *dest; char *command; FILE *file; - + char local_ip[64]; if (linphone_address_get_port(dest_addres)>0) dest = ms_strdup_printf("%s:%i",linphone_address_get_domain(dest_addres),linphone_address_get_port(dest_addres)); else dest = ms_strdup_printf("%s",linphone_address_get_domain(dest_addres)); + + linphone_core_get_local_ip_for(AF_INET, linphone_address_get_domain(dest_addres), local_ip); //until errors logs are handled correctly and stop breaks output, they will be DISABLED - command = ms_strdup_printf(SIPP_COMMAND" -sf %s -s %s %s -trace_err -trace_msg -rtp_echo -m 1 -d 1000 -ap %s 2>/dev/null",senario + command = ms_strdup_printf(SIPP_COMMAND" -sf %s -s %s %s -i %s -trace_err -trace_msg -rtp_echo -m 1 -d 1000 -ap %s 2>/dev/null",senario ,dest_username ,dest + ,local_ip ,(passwd?passwd:"none")); ms_message("Starting sipp command [%s]",command); @@ -168,7 +171,7 @@ static void call_with_audio_mline_before_video_in_sdp(void) { linphone_core_iterate(mgr->lc); scen = bc_tester_res("sipp/call_with_audio_mline_before_video_in_sdp.xml"); - + sipp_out = sip_start(scen, linphone_address_get_username(mgr->identity), NULL, mgr->identity); if (sipp_out) { From b9d7e445c7da605bf7162d94c6764fd25cdcb3f1 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Wed, 22 Nov 2017 11:50:38 +0100 Subject: [PATCH 072/121] add remote provisionning file for tester --- tester/remote_provisioning/marie_xml | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 tester/remote_provisioning/marie_xml diff --git a/tester/remote_provisioning/marie_xml b/tester/remote_provisioning/marie_xml new file mode 100644 index 000000000..fe923803d --- /dev/null +++ b/tester/remote_provisioning/marie_xml @@ -0,0 +1,51 @@ + + +
+ -1 + -1 + -1 + 0 + 0 + 0 + 1 +
+
+ marie + marie + secret + + sip.example.org +
+
+ sip.example.org;transport=tcp + sip.example.org;transport=tcp;lr + sip:marie@sip.example.org + 3600 + 1 + 0 + 0 +
+
+ "Paupoche" <sip:pauline@sip.example.org> + accept + 0 +
+
+ 8070 + 9072 +
+
+ 0 + 0 + 0 + vga + 0 + 0 + 0 + 0 + StaticImage: Static picture +
+
+ 0 #to not overload cpu in case of VG +
+
From dc20729c90fb0e0dae24f11a8f718573a6f69fa7 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Wed, 22 Nov 2017 13:21:38 +0100 Subject: [PATCH 073/121] fix tester: Flexisip.Subscribe Notify with sipp publisher --- tester/complex_sip_case_tester.c | 4 ++-- tester/sipp/simple_publish.xml | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tester/complex_sip_case_tester.c b/tester/complex_sip_case_tester.c index da16a595b..fc2ad0c43 100644 --- a/tester/complex_sip_case_tester.c +++ b/tester/complex_sip_case_tester.c @@ -112,8 +112,8 @@ LinphoneAddress * linphone_core_manager_resolve(LinphoneCoreManager *mgr, const ,&addrinfo); dest=linphone_address_new(NULL); - - wait_for(mgr->lc, mgr->lc, (int*)&addrinfo, 1); + + wait_for_until(mgr->lc, mgr->lc, (int*)&addrinfo, 1,2000); err=bctbx_getnameinfo((struct sockaddr*)addrinfo->ai_addr,addrinfo->ai_addrlen,ipstring,INET6_ADDRSTRLEN,NULL,0,NI_NUMERICHOST); if (err !=0 ){ ms_error("linphone_core_manager_resolve(): getnameinfo error %s", gai_strerror(err)); diff --git a/tester/sipp/simple_publish.xml b/tester/sipp/simple_publish.xml index 4040471ce..7b0ddfda2 100644 --- a/tester/sipp/simple_publish.xml +++ b/tester/sipp/simple_publish.xml @@ -38,10 +38,11 @@ Content-Length: [len] - + open + sip:[service]@[local_ip]:[local_port] 2015-09-28T15:49:00Z @@ -74,10 +75,11 @@ Content-Length: [len] - + open + sip:[service]@[local_ip]:[local_port] 2015-09-28T15:49:00Z From 5217407b8ffcd6c1b070daf20be6b472cce3f061 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 9 Apr 2018 11:57:42 +0200 Subject: [PATCH 074/121] Remove useless code --- coreapi/linphonecore.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index b0a4347fe..3e1807df0 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2320,17 +2320,6 @@ void linphone_core_start (LinphoneCore *lc) { } } -#ifdef __ANDROID__ -static void _linphone_core_set_platform_helpers(LinphoneCore *lc, LinphonePrivate::PlatformHelpers *ph){ - if (lc->platform_helper) delete getPlatformHelpers(lc); - lc->platform_helper = ph; -} - -static void _linphone_core_set_system_context(LinphoneCore *lc, void *system_context){ - _linphone_core_set_platform_helpers(lc, LinphonePrivate::createAndroidPlatformHelpers(lc, system_context)); -} -#endif - LinphoneCore *_linphone_core_new_with_config(LinphoneCoreCbs *cbs, struct _LpConfig *config, void *userdata, void *system_context, bool_t automatically_start) { LinphoneCore *core = L_INIT(Core); Core::create(core); From 7f2bd781854da651e9a90134b9fecd6662073a36 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 9 Apr 2018 12:04:13 +0200 Subject: [PATCH 075/121] fix compilation issue --- coreapi/private_functions.h | 1 - coreapi/tester_utils.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/private_functions.h b/coreapi/private_functions.h index 35d16b492..772e89294 100644 --- a/coreapi/private_functions.h +++ b/coreapi/private_functions.h @@ -238,7 +238,6 @@ LinphoneFriend * linphone_friend_new_from_config_file(struct _LinphoneCore *lc, void linphone_proxy_config_update(LinphoneProxyConfig *cfg); LinphoneProxyConfig * linphone_core_lookup_known_proxy(LinphoneCore *lc, const LinphoneAddress *uri); const char *linphone_core_find_best_identity(LinphoneCore *lc, const LinphoneAddress *to); -int linphone_core_get_local_ip_for(int type, const char *dest, char *result); LINPHONE_PUBLIC void linphone_core_get_local_ip(LinphoneCore *lc, int af, const char *dest, char *result); LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LinphoneCore *lc, int index); diff --git a/coreapi/tester_utils.h b/coreapi/tester_utils.h index 966adccab..0dd600d72 100644 --- a/coreapi/tester_utils.h +++ b/coreapi/tester_utils.h @@ -48,6 +48,7 @@ extern "C" { LINPHONE_PUBLIC LinphoneVcardContext *linphone_core_get_vcard_context(const LinphoneCore *lc); LINPHONE_PUBLIC bool_t linphone_core_rtcp_enabled(const LinphoneCore *lc); LINPHONE_PUBLIC void linphone_core_get_local_ip(LinphoneCore *lc, int af, const char *dest, char *result); +LINPHONE_PUBLIC int linphone_core_get_local_ip_for(int type, const char *dest, char *result); LINPHONE_PUBLIC void linphone_core_enable_forced_ice_relay(LinphoneCore *lc, bool_t enable); LINPHONE_PUBLIC void linphone_core_set_zrtp_not_available_simulation(LinphoneCore *lc, bool_t enabled); LINPHONE_PUBLIC belle_http_provider_t *linphone_core_get_http_provider(const LinphoneCore *lc); From c522ec1162832ea89989e0f1089c6012123feb8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Mon, 9 Apr 2018 11:44:06 +0200 Subject: [PATCH 076/121] Makes Doxygen do not generate man and latex documentations Besides, that commit prevent the HTML documentation from being generated when ENABLE_DOC is set to NO. Only the XML docmentation would be generated in order to generate high-level languages wrappers. --- coreapi/help/doc/doxygen/CMakeLists.txt | 5 +++++ coreapi/help/doc/doxygen/Doxyfile.in | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/coreapi/help/doc/doxygen/CMakeLists.txt b/coreapi/help/doc/doxygen/CMakeLists.txt index 91c62458d..a5bf227e2 100644 --- a/coreapi/help/doc/doxygen/CMakeLists.txt +++ b/coreapi/help/doc/doxygen/CMakeLists.txt @@ -31,6 +31,11 @@ if (ENABLE_DOC OR ENABLE_CXX_WRAPPER OR ENABLE_CSHARP_WRAPPER OR ENABLE_JAVA_WRA endforeach () string(CONCAT DOXYGEN_INPUT ${DOXYGEN_INPUT} " \"${CMAKE_CURRENT_SOURCE_DIR}\"") string(CONCAT DOXYGEN_INPUT ${DOXYGEN_INPUT} " \"${PROJECT_SOURCE_DIR}/coreapi/help/examples/C\"") + if(ENABLE_DOC) + set(GENERATE_HTML "YES") + else() + set(GENERATE_HTML "NO") + endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) set(DOC_INPUT_FILES ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.dox diff --git a/coreapi/help/doc/doxygen/Doxyfile.in b/coreapi/help/doc/doxygen/Doxyfile.in index 851af4c1a..6f6724101 100644 --- a/coreapi/help/doc/doxygen/Doxyfile.in +++ b/coreapi/help/doc/doxygen/Doxyfile.in @@ -1045,7 +1045,7 @@ IGNORE_PREFIX = # If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. -GENERATE_HTML = YES +GENERATE_HTML = ${GENERATE_HTML} # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of @@ -1589,7 +1589,7 @@ EXTRA_SEARCH_MAPPINGS = # If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. # The default value is: YES. -GENERATE_LATEX = YES +GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of @@ -1825,7 +1825,7 @@ RTF_SOURCE_CODE = NO # classes and files. # The default value is: NO. -GENERATE_MAN = YES +GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of From d8cc062ce6325c8be0ceb580d8c43868c28bc50b Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 9 Apr 2018 14:22:55 +0200 Subject: [PATCH 077/121] rework of fix b607a1 from master branch. --- coreapi/linphonecore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 3e1807df0..441cc70e8 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2278,6 +2278,8 @@ static void linphone_core_init(LinphoneCore * lc, LinphoneCoreCbs *cbs, LpConfig lc->vcard_context = linphone_vcard_context_new(); linphone_core_initialize_supported_content_types(lc); lc->bw_controller = ms_bandwidth_controller_new(); + + getPlatformHelpers(lc)->setDnsServers(); LinphoneFriendList *list = linphone_core_create_friend_list(lc); linphone_friend_list_set_display_name(list, "_default"); From f75c58bbef21318b8427fb7337c714b8badd7b88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Mon, 9 Apr 2018 15:28:27 +0200 Subject: [PATCH 078/121] Fix install target when ENABLE_DOC is set to NO --- coreapi/help/doc/doxygen/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/coreapi/help/doc/doxygen/CMakeLists.txt b/coreapi/help/doc/doxygen/CMakeLists.txt index a5bf227e2..f1609051b 100644 --- a/coreapi/help/doc/doxygen/CMakeLists.txt +++ b/coreapi/help/doc/doxygen/CMakeLists.txt @@ -49,8 +49,10 @@ if (ENABLE_DOC OR ENABLE_CXX_WRAPPER OR ENABLE_CSHARP_WRAPPER OR ENABLE_JAVA_WRA DEPENDS ${DOC_INPUT_FILES} ) add_custom_target(linphone-doc ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/html/index.html" "${XML_DIR}/index.xml") - install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" "${XML_DIR}" - DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/linphone-${LINPHONE_VERSION}") + if(ENABLE_DOC) + install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/html" "${XML_DIR}" + DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/linphone-${LINPHONE_VERSION}") + endif() else() if (ENABLE_CXX_WRAPPER) message(FATAL_ERROR "The dot program is needed to generate the linphone documentation. You can get it from http://www.graphviz.org/.") From 886bfeebf45a44377abcc477591e0dcb597ff1b8 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 9 Apr 2018 16:09:53 +0200 Subject: [PATCH 079/121] update linphone_call_update() doc. Retrofit of 68cd38 from master branch. --- include/linphone/api/c-call.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/linphone/api/c-call.h b/include/linphone/api/c-call.h index 464436945..4bb51a12e 100644 --- a/include/linphone/api/c-call.h +++ b/include/linphone/api/c-call.h @@ -475,9 +475,8 @@ LINPHONE_PUBLIC LinphoneStatus linphone_call_accept_early_media_with_params (Lin /** * Updates a running call according to supplied call parameters or parameters changed in the LinphoneCore. - * In this version this is limited to the following use cases: - * - setting up/down the video stream according to the video parameter of the LinphoneCallParams (see linphone_call_params_enable_video() ). - * - changing the size of the transmitted video after calling linphone_core_set_preferred_video_size() + * It triggers a SIP reINVITE in order to perform a new offer/answer of media capabilities. + * Changing the size of the transmitted video after calling linphone_core_set_preferred_video_size() can be used by passing NULL as params argument. * In case no changes are requested through the LinphoneCallParams argument, then this argument can be omitted and set to NULL. * WARNING: Updating a call in the LinphoneCallPaused state will still result in a paused call even if the media directions set in the * params are sendrecv. To resume a paused call, you need to call linphone_call_resume(). From b345fbbe101aab2cfd93a2a0141e1ff45f34d788 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 17 Oct 2017 14:42:24 +0200 Subject: [PATCH 080/121] fix some vcard tests --- tester/vcard_tester.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tester/vcard_tester.c b/tester/vcard_tester.c index 664ed68e6..213c02fa5 100644 --- a/tester/vcard_tester.c +++ b/tester/vcard_tester.c @@ -364,8 +364,12 @@ static void friends_sqlite_store_lot_of_friends(void) { char* errmsg = NULL; int ret; char *buf; + char *friends_db = bc_tester_file("friends.db"); + + unlink(friends_db); + ret = sqlite3_open(friends_db, &db); + bc_free(friends_db); - ret = sqlite3_open(linphone_core_get_friends_database_path(lc), &db); BC_ASSERT_TRUE(ret ==SQLITE_OK); ret = sqlite3_exec(db,"BEGIN",0,0,&errmsg); BC_ASSERT_TRUE(ret ==SQLITE_OK); @@ -432,8 +436,12 @@ static void friends_sqlite_find_friend_in_lot_of_friends(void) { char *buf; bctoolboxTimeSpec t1; bctoolboxTimeSpec t2; + char *friends_db = bc_tester_file("friends.db"); + + unlink(friends_db); + ret = sqlite3_open(friends_db, &db); + bc_free(friends_db); - ret = sqlite3_open(linphone_core_get_friends_database_path(lc), &db); BC_ASSERT_TRUE(ret ==SQLITE_OK); ret = sqlite3_exec(db,"BEGIN",0,0,&errmsg); BC_ASSERT_TRUE(ret ==SQLITE_OK); From d6b37286e1fa3fccfe17b84070a926702c5e5de5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Turnel?= Date: Tue, 10 Apr 2018 11:03:17 +0200 Subject: [PATCH 081/121] Set invalid flag message from fatal to warning (retrofit of commit 40b085) --- coreapi/logging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/logging.c b/coreapi/logging.c index 6f2a216d6..5af54e5d5 100644 --- a/coreapi/logging.c +++ b/coreapi/logging.c @@ -72,7 +72,7 @@ LinphoneLogLevel _bctbx_log_level_to_linphone_log_level(BctbxLogLevel level) { if (response != tmap.cend()) { return response->first; } else { - ms_fatal("%s(): invalid argurement [%d]", __FUNCTION__, level); + ms_warning("%s(): invalid argurement [%d]", __FUNCTION__, level); return LinphoneLogLevelDebug; } } From e5ee11ec182760ad80f22ee3d26c3f3a48996528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Turnel?= Date: Tue, 10 Apr 2018 11:47:49 +0200 Subject: [PATCH 082/121] Fix missing linked library bctoolbox (retrofit of commit 6e72e8) --- console/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console/CMakeLists.txt b/console/CMakeLists.txt index 1e4de5e1d..c48c5cbab 100644 --- a/console/CMakeLists.txt +++ b/console/CMakeLists.txt @@ -53,7 +53,7 @@ if(WIN32) endif() add_executable(linphonecsh ${LINPHONECSH_SOURCE_FILES}) -target_link_libraries(linphonecsh ${LINPHONE_LIBS_FOR_TOOLS} ${ORTP_LIBRARIES}) +target_link_libraries(linphonecsh ${LINPHONE_LIBS_FOR_TOOLS} ${BCTOOLBOX_CORE_LIBRARIES} ${ORTP_LIBRARIES}) set_target_properties(linphonecsh PROPERTIES LINK_FLAGS "${LINPHONE_LDFLAGS}") set(INSTALL_TARGETS linphonec linphonecsh) From 84a8e1690d7083e36db3e3bedbf8567d63828152 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 31 Oct 2017 12:21:59 +0100 Subject: [PATCH 083/121] Fix logging facility. Liblinphone outputs in the "liblinphone" log domain, mediastreamer and ortp have now their own log domains too. --- coreapi/CMakeLists.txt | 1 + coreapi/linphonecore.c | 7 +++++-- coreapi/logging.c | 2 +- tester/liblinphone_tester.c | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/coreapi/CMakeLists.txt b/coreapi/CMakeLists.txt index 85e13205c..d1190e83a 100644 --- a/coreapi/CMakeLists.txt +++ b/coreapi/CMakeLists.txt @@ -142,6 +142,7 @@ bc_git_version(liblinphone ${PROJECT_VERSION}) add_definitions( -DUSE_BELLESIP -DLIBLINPHONE_EXPORTS + -DBCTBX_LOG_DOMAIN="liblinphone" ) set(LIBS diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 441cc70e8..8d40a9ddc 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -506,14 +506,17 @@ void linphone_core_set_log_level(OrtpLogLevel loglevel) { linphone_logging_service_set_log_level(log_service, _bctbx_log_level_to_linphone_log_level(loglevel)); } + void linphone_core_set_log_level_mask(unsigned int mask) { LinphoneLoggingService *log_service = linphone_logging_service_get(); linphone_logging_service_set_log_level_mask(log_service, _bctbx_log_mask_to_linphone_log_mask(mask)); } + unsigned int linphone_core_get_log_level_mask(void) { LinphoneLoggingService *log_service = linphone_logging_service_get(); return linphone_logging_service_get_log_level_mask(log_service); } + static int _open_log_collection_file_with_idx(int idx) { struct stat statbuf; char *log_filename; @@ -616,8 +619,8 @@ static void linphone_core_log_collection_handler(const char *domain, OrtpLogLeve } if (liblinphone_log_collection_file) { ortp_mutex_lock(&liblinphone_log_collection_mutex); - ret = fprintf(liblinphone_log_collection_file,"%i-%.2i-%.2i %.2i:%.2i:%.2i:%.3i %s %s\n", - 1900 + lt->tm_year, lt->tm_mon + 1, lt->tm_mday, lt->tm_hour, lt->tm_min, lt->tm_sec, (int)(tp.tv_usec / 1000), lname, msg); + ret = fprintf(liblinphone_log_collection_file,"%i-%.2i-%.2i %.2i:%.2i:%.2i:%.3i [%s] %s %s\n", + 1900 + lt->tm_year, lt->tm_mon + 1, lt->tm_mday, lt->tm_hour, lt->tm_min, lt->tm_sec, (int)(tp.tv_usec / 1000), domain, lname, msg); fflush(liblinphone_log_collection_file); if (ret > 0) { liblinphone_log_collection_file_size += (size_t)ret; diff --git a/coreapi/logging.c b/coreapi/logging.c index 5af54e5d5..7c7960650 100644 --- a/coreapi/logging.c +++ b/coreapi/logging.c @@ -202,7 +202,7 @@ void linphone_logging_service_set_log_level_mask(LinphoneLoggingService *log_ser } unsigned int linphone_logging_service_get_log_level_mask(const LinphoneLoggingService *log_service) { - return _bctbx_log_mask_to_linphone_log_mask(bctbx_get_log_level_mask(ORTP_LOG_DOMAIN)); + return _bctbx_log_mask_to_linphone_log_mask(bctbx_get_log_level_mask(BCTBX_LOG_DOMAIN)); } void linphone_logging_service_set_log_file(const LinphoneLoggingService *service, const char *dir, const char *filename, size_t max_size) { diff --git a/tester/liblinphone_tester.c b/tester/liblinphone_tester.c index 2557f8de0..da5f813ae 100644 --- a/tester/liblinphone_tester.c +++ b/tester/liblinphone_tester.c @@ -148,7 +148,7 @@ static void log_handler(int lev, const char *fmt, va_list args) { #endif va_end(cap); #endif - bctbx_logv(ORTP_LOG_DOMAIN, lev, fmt, args); + bctbx_logv(BCTBX_LOG_DOMAIN, lev, fmt, args); } void liblinphone_tester_init(void(*ftester_printf)(int level, const char *fmt, va_list args)) { From 6dd6ea842d53b35fb79bc0a34c635d68bce6f0db Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 9 Nov 2017 14:45:55 +0100 Subject: [PATCH 084/121] add TMMBR callback at java level --- coreapi/linphonecore_jni.cc | 34 ++++++++++++++++--- .../org/linphone/core/LinphoneCall.java | 6 +++- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index a6b01bb58..81658c4b2 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -7755,19 +7755,45 @@ static void _next_video_frame_decoded_callback(LinphoneCall *call, void *user_da return; } - jobject listener = (jobject) user_data; + jobject listener = (jobject) env->NewLocalRef((jobject)user_data); + if (listener == NULL){ + ms_error("_next_video_frame_decoded_callback: listener has gone."); + return; + } jclass clazz = (jclass) env->GetObjectClass(listener); jmethodID method = env->GetMethodID(clazz, "onNextVideoFrameDecoded","(Lorg/linphone/core/LinphoneCall;)V"); env->DeleteLocalRef(clazz); jobject jcall = getCall(env, call); env->CallVoidMethod(listener, method, jcall); + env->DeleteLocalRef(listener); } -extern "C" void Java_org_linphone_core_LinphoneCallImpl_setListener(JNIEnv* env, jobject thiz, jlong ptr, jobject jlistener) { - jobject listener = env->NewGlobalRef(jlistener); +static void _on_tmmbr_received(LinphoneCall *call, int index, int bitrate){ + LinphoneCallCbs *cbs = linphone_call_get_current_callbacks(call); + JNIEnv *env = ms_get_jni_env(); + jobject listener = (jobject) env->NewLocalRef((jobject)linphone_call_cbs_get_user_data(cbs)); + if (listener == NULL){ + ms_error("_on_tmmbr_received: listener has gone."); + return; + } + jclass clazz = (jclass) env->GetObjectClass(listener); + jmethodID method = env->GetMethodID(clazz, "tmmbrReceived","(Lorg/linphone/core/LinphoneCall;II)V"); + env->DeleteLocalRef(clazz); + + jobject jcall = getCall(env, call); + env->CallVoidMethod(listener, method, jcall,(jint)index, (jint)bitrate); + env->DeleteLocalRef(listener); +} + +JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCallImpl_setListener(JNIEnv* env, jobject thiz, jlong ptr, jobject jlistener) { LinphoneCall *call = (LinphoneCall *)ptr; - linphone_call_set_next_video_frame_decoded_callback(call, _next_video_frame_decoded_callback, listener); + LinphoneCallCbs *cbs = linphone_factory_create_call_cbs(linphone_factory_get()); + linphone_call_cbs_set_user_data(cbs, env->NewWeakGlobalRef(jlistener)); + linphone_call_cbs_set_tmmbr_received(cbs, _on_tmmbr_received); + linphone_call_add_callbacks(call, cbs); + + linphone_call_set_next_video_frame_decoded_callback(call, _next_video_frame_decoded_callback, env->NewWeakGlobalRef(jlistener)); } extern "C" void Java_org_linphone_core_LinphoneCallImpl_setVideoWindowId(JNIEnv* env diff --git a/java/common/org/linphone/core/LinphoneCall.java b/java/common/org/linphone/core/LinphoneCall.java index 332a76b57..ead69a5f0 100644 --- a/java/common/org/linphone/core/LinphoneCall.java +++ b/java/common/org/linphone/core/LinphoneCall.java @@ -31,8 +31,12 @@ public interface LinphoneCall { /** * LinphoneCall listener */ - interface LinphoneCallListener { + public interface LinphoneCallListener { void onNextVideoFrameDecoded(LinphoneCall call); + /** + * Invoked when a TMMBR RTCP packet is received. + */ + void tmmbrReceived(LinphoneCall call, int streamIndex, int bitrate); } /** From bace23388402b05da06646cec9b9bedebf1e4690 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 10 Nov 2017 11:04:29 +0100 Subject: [PATCH 085/121] set callback before setting levels --- coreapi/linphonecore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 8d40a9ddc..3d06704fe 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1046,8 +1046,8 @@ void linphone_core_enable_logs(FILE *file){ } void linphone_core_enable_logs_with_cb(OrtpLogFunc logfunc){ - linphone_core_set_log_level(ORTP_MESSAGE); linphone_core_set_log_handler(logfunc); + linphone_core_set_log_level(ORTP_MESSAGE); } void linphone_core_disable_logs(void){ From 291bf82bed643ac5661c7d9144a33ce7cf800b22 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 10 Apr 2018 11:57:55 +0200 Subject: [PATCH 086/121] Store the date of message receiving and display for each participant of a chat room in DB. --- src/chat/chat-message/chat-message-p.h | 2 +- src/chat/chat-message/chat-message.cpp | 4 +- src/chat/notification/imdn.cpp | 7 ++-- src/db/main-db-p.h | 2 +- src/db/main-db.cpp | 54 ++++++++++---------------- src/db/main-db.h | 3 +- src/db/session/db-session.cpp | 25 ++++++++++++ src/db/session/db-session.h | 1 + 8 files changed, 56 insertions(+), 42 deletions(-) diff --git a/src/chat/chat-message/chat-message-p.h b/src/chat/chat-message/chat-message-p.h index 4c957ed71..1c7e8d854 100644 --- a/src/chat/chat-message/chat-message-p.h +++ b/src/chat/chat-message/chat-message-p.h @@ -58,7 +58,7 @@ public: void setDirection (ChatMessage::Direction dir); - void setParticipantState (const IdentityAddress &participantAddress, ChatMessage::State newState); + void setParticipantState (const IdentityAddress &participantAddress, ChatMessage::State newState, time_t stateChangeTime); std::list> getParticipantsInState (const ChatMessage::State state) const; void setState (ChatMessage::State newState, bool force = false); diff --git a/src/chat/chat-message/chat-message.cpp b/src/chat/chat-message/chat-message.cpp index 90eb244c2..ae75b0525 100644 --- a/src/chat/chat-message/chat-message.cpp +++ b/src/chat/chat-message/chat-message.cpp @@ -70,7 +70,7 @@ void ChatMessagePrivate::setIsReadOnly (bool readOnly) { isReadOnly = readOnly; } -void ChatMessagePrivate::setParticipantState (const IdentityAddress &participantAddress, ChatMessage::State newState) { +void ChatMessagePrivate::setParticipantState (const IdentityAddress &participantAddress, ChatMessage::State newState, time_t stateChangeTime) { L_Q(); if (!(q->getChatRoom()->getCapabilities() & AbstractChatRoom::Capabilities::Conference) @@ -93,7 +93,7 @@ void ChatMessagePrivate::setParticipantState (const IdentityAddress &participant lInfo() << "Chat message " << this << ": moving participant '" << participantAddress.asString() << "' state to " << Utils::toString(newState); - mainDb->setChatMessageParticipantState(eventLog, participantAddress, newState); + mainDb->setChatMessageParticipantState(eventLog, participantAddress, newState, stateChangeTime); list states = mainDb->getChatMessageParticipantStates(eventLog); size_t nbDisplayedStates = 0; diff --git a/src/chat/notification/imdn.cpp b/src/chat/notification/imdn.cpp index 817ae3a2a..83ffa3b8d 100644 --- a/src/chat/notification/imdn.cpp +++ b/src/chat/notification/imdn.cpp @@ -170,6 +170,7 @@ void Imdn::parse (const shared_ptr &imdnMessage, xmlparsing_context if (!cm) { lWarning() << "Received IMDN for unknown message " << messageIdStr; } else { + time_t imdnTime = imdnMessage->getTime(); LinphoneImNotifPolicy *policy = linphone_core_get_im_notif_policy(cr->getCore()->getCCore()); snprintf(xpathStr, sizeof(xpathStr), "%s[1]/imdn:delivery-notification/imdn:status", imdnPrefix.c_str()); xmlXPathObjectPtr deliveryStatusObject = linphone_get_xml_xpath_object_for_node_list(xmlCtx, xpathStr); @@ -180,9 +181,9 @@ void Imdn::parse (const shared_ptr &imdnMessage, xmlparsing_context xmlNodePtr node = deliveryStatusObject->nodesetval->nodeTab[0]; if (node->children && node->children->name) { if (strcmp((const char *)node->children->name, "delivered") == 0) { - cm->getPrivate()->setParticipantState(participantAddress, ChatMessage::State::DeliveredToUser); + cm->getPrivate()->setParticipantState(participantAddress, ChatMessage::State::DeliveredToUser, imdnTime); } else if (strcmp((const char *)node->children->name, "error") == 0) { - cm->getPrivate()->setParticipantState(participantAddress, ChatMessage::State::NotDelivered); + cm->getPrivate()->setParticipantState(participantAddress, ChatMessage::State::NotDelivered, imdnTime); } } } @@ -193,7 +194,7 @@ void Imdn::parse (const shared_ptr &imdnMessage, xmlparsing_context xmlNodePtr node = displayStatusObject->nodesetval->nodeTab[0]; if (node->children && node->children->name) { if (strcmp((const char *)node->children->name, "displayed") == 0) { - cm->getPrivate()->setParticipantState(participantAddress, ChatMessage::State::Displayed); + cm->getPrivate()->setParticipantState(participantAddress, ChatMessage::State::Displayed, imdnTime); } } } diff --git a/src/db/main-db-p.h b/src/db/main-db-p.h index 8a8a52ad1..bd2076407 100644 --- a/src/db/main-db-p.h +++ b/src/db/main-db-p.h @@ -61,7 +61,7 @@ private: long long insertChatRoom (const std::shared_ptr &chatRoom); long long insertChatRoomParticipant (long long chatRoomId, long long participantSipAddressId, bool isAdmin); void insertChatRoomParticipantDevice (long long participantId, long long participantDeviceSipAddressId); - void insertChatMessageParticipant (long long chatMessageId, long long sipAddressId, int state); + void insertChatMessageParticipant (long long chatMessageId, long long sipAddressId, int state, time_t stateChangeTime); long long selectSipAddressId (const std::string &sipAddress) const; long long selectChatRoomId (long long peerSipAddressId, long long localSipAddressId) const; diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp index e6cfd375d..a3d4b9edd 100644 --- a/src/db/main-db.cpp +++ b/src/db/main-db.cpp @@ -47,7 +47,7 @@ using namespace std; LINPHONE_BEGIN_NAMESPACE namespace { - constexpr unsigned int ModuleVersionEvents = makeVersion(1, 0, 1); + constexpr unsigned int ModuleVersionEvents = makeVersion(1, 0, 2); constexpr unsigned int ModuleVersionFriends = makeVersion(1, 0, 0); constexpr unsigned int ModuleVersionLegacyFriendsImport = makeVersion(1, 0, 0); constexpr unsigned int ModuleVersionLegacyHistoryImport = makeVersion(1, 0, 0); @@ -408,12 +408,12 @@ void MainDbPrivate::insertChatRoomParticipantDevice ( soci::use(participantId), soci::use(participantDeviceSipAddressId); } -void MainDbPrivate::insertChatMessageParticipant (long long chatMessageId, long long sipAddressId, int state) { - if (state != static_cast(ChatMessage::State::Displayed)) - *dbSession.getBackendSession() << - "INSERT INTO chat_message_participant (event_id, participant_sip_address_id, state)" - " VALUES (:chatMessageId, :sipAddressId, :state)", - soci::use(chatMessageId), soci::use(sipAddressId), soci::use(state); +void MainDbPrivate::insertChatMessageParticipant (long long chatMessageId, long long sipAddressId, int state, time_t stateChangeTime) { + const tm &stateChangeTm = Utils::getTimeTAsTm(stateChangeTime); + *dbSession.getBackendSession() << + "INSERT INTO chat_message_participant (event_id, participant_sip_address_id, state, state_change_time)" + " VALUES (:chatMessageId, :sipAddressId, :state, :stateChangeTm)", + soci::use(chatMessageId), soci::use(sipAddressId), soci::use(state), soci::use(stateChangeTm); } // ----------------------------------------------------------------------------- @@ -744,7 +744,7 @@ long long MainDbPrivate::insertConferenceChatMessageEvent (const shared_ptrgetChatRoom()->getParticipants()) { const long long &participantSipAddressId = selectSipAddressId(participant->getAddress().asString()); - insertChatMessageParticipant(eventId, participantSipAddressId, state); + insertChatMessageParticipant(eventId, participantSipAddressId, state, chatMessage->getTime()); } return eventId; @@ -982,6 +982,11 @@ void MainDbPrivate::updateSchema () { if (version < makeVersion(1, 0, 1)) *session << "ALTER TABLE chat_room_participant_device ADD COLUMN state TINYINT UNSIGNED DEFAULT 0"; + if (version < makeVersion(1, 0, 2)) { + *session << "DROP TRIGGER IF EXISTS chat_message_participant_deleter"; + *session << "ALTER TABLE chat_message_participant ADD COLUMN state_change_time" + + dbSession.timestampType() + " NOT NULL DEFAULT " + dbSession.currentTimestamp(); + } } // ----------------------------------------------------------------------------- @@ -1227,9 +1232,7 @@ void MainDbPrivate::importLegacyHistory (DbSession &inDbSession) { if (content) insertContent(eventId, *content); insertChatRoomParticipant(chatRoomId, remoteSipAddressId, false); - - if (state != int(ChatMessage::State::Displayed)) - insertChatMessageParticipant(eventId, remoteSipAddressId, state); + insertChatMessageParticipant(eventId, remoteSipAddressId, state, std::time(nullptr)); } tr.commit(); lInfo() << "Successful import of legacy messages."; @@ -1594,26 +1597,6 @@ void MainDb::init () { " version INT UNSIGNED NOT NULL" ") " + charset; - if (getBackend() == Backend::Mysql) { - *session << - "DROP TRIGGER IF EXISTS chat_message_participant_deleter"; - *session << - "CREATE TRIGGER chat_message_participant_deleter" - " AFTER UPDATE ON conference_chat_message_event FOR EACH ROW" - " BEGIN" - " IF NEW.state = " + Utils::toString(int(ChatMessage::State::Displayed)) + " THEN" - " DELETE FROM chat_message_participant WHERE event_id = NEW.event_id;" - " END IF;" - " END "; - } else - *session << - "CREATE TRIGGER IF NOT EXISTS chat_message_participant_deleter" - " AFTER UPDATE OF state ON conference_chat_message_event FOR EACH ROW" - " WHEN NEW.state = " + Utils::toString(int(ChatMessage::State::Displayed)) + - " BEGIN" - " DELETE FROM chat_message_participant WHERE event_id = NEW.event_id;" - " END "; - d->updateSchema(); d->updateModuleVersion("events", ModuleVersionEvents); @@ -2018,7 +2001,8 @@ ChatMessage::State MainDb::getChatMessageParticipantState ( void MainDb::setChatMessageParticipantState ( const shared_ptr &eventLog, const IdentityAddress &participantAddress, - ChatMessage::State state + ChatMessage::State state, + time_t stateChangeTime ) { L_DB_TRANSACTION { L_D(); @@ -2028,10 +2012,12 @@ void MainDb::setChatMessageParticipantState ( const long long &eventId = dEventKey->storageId; const long long &participantSipAddressId = d->selectSipAddressId(participantAddress.asString()); int stateInt = static_cast(state); + const tm &stateChangeTm = Utils::getTimeTAsTm(stateChangeTime); - *d->dbSession.getBackendSession() << "UPDATE chat_message_participant SET state = :state" + *d->dbSession.getBackendSession() << "UPDATE chat_message_participant SET state = :state," + " state_change_time = :stateChangeTm" " WHERE event_id = :eventId AND participant_sip_address_id = :participantSipAddressId", - soci::use(stateInt), soci::use(eventId), soci::use(participantSipAddressId); + soci::use(stateInt), soci::use(stateChangeTm), soci::use(eventId), soci::use(participantSipAddressId); tr.commit(); }; diff --git a/src/db/main-db.h b/src/db/main-db.h index ae46a5e3e..d7ce028e0 100644 --- a/src/db/main-db.h +++ b/src/db/main-db.h @@ -99,7 +99,8 @@ public: void setChatMessageParticipantState ( const std::shared_ptr &eventLog, const IdentityAddress &participantAddress, - ChatMessage::State state + ChatMessage::State state, + time_t stateChangeTime ); std::shared_ptr getLastChatMessage (const ChatRoomId &chatRoomId) const; diff --git a/src/db/session/db-session.cpp b/src/db/session/db-session.cpp index e9fbc4450..b78ae04e7 100644 --- a/src/db/session/db-session.cpp +++ b/src/db/session/db-session.cpp @@ -124,6 +124,31 @@ string DbSession::varcharPrimaryKeyStr (int length) const { return ""; } +string DbSession::currentTimestamp () const { + L_D(); + + switch (d->backend) { + case DbSessionPrivate::Backend::Mysql: + return " CURRENT_TIMESTAMP"; + case DbSessionPrivate::Backend::Sqlite3: + // Ugly hack but Sqlite3 does not allow table alteration where we add a date column using a default value + // of CURRENT_TIMESTAMP + { + const tm &now = Utils::getTimeTAsTm(std::time(nullptr)); + const size_t bufSize = 22; + char buffer[bufSize]; + snprintf(buffer, bufSize, "'%d-%02d-%02d %02d:%02d:%02d'", + now.tm_year + 1900, now.tm_mon + 1, now.tm_mday, now.tm_hour, now.tm_min, now.tm_sec); + return buffer; + } + case DbSessionPrivate::Backend::None: + return ""; + } + + L_ASSERT(false); + return ""; +} + string DbSession::timestampType () const { L_D(); diff --git a/src/db/session/db-session.h b/src/db/session/db-session.h index 0189bf997..d05c47e18 100644 --- a/src/db/session/db-session.h +++ b/src/db/session/db-session.h @@ -47,6 +47,7 @@ public: std::string primaryKeyRefStr (const std::string &type = "INT") const; std::string varcharPrimaryKeyStr (int length) const; + std::string currentTimestamp () const; std::string timestampType () const; std::string noLimitValue () const; From 532c64bfc48cfe23aca0f8cac13a13b0b64fb840 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 10 Apr 2018 15:32:57 +0200 Subject: [PATCH 087/121] Add API to get the imdn state of a chat message for each participant. --- include/CMakeLists.txt | 1 + include/linphone/api/c-api.h | 1 + include/linphone/api/c-chat-message.h | 21 +++- .../linphone/api/c-participant-imdn-state.h | 91 ++++++++++++++++ include/linphone/api/c-types.h | 6 + src/CMakeLists.txt | 4 + src/c-wrapper/api/c-chat-message.cpp | 14 ++- .../api/c-participant-imdn-state.cpp | 59 ++++++++++ src/c-wrapper/c-wrapper.h | 1 + src/chat/chat-message/chat-message-p.h | 3 +- src/chat/chat-message/chat-message.cpp | 66 +++++++---- src/chat/chat-message/chat-message.h | 5 + src/conference/participant-imdn-state-p.h | 42 +++++++ src/conference/participant-imdn-state.cpp | 61 +++++++++++ src/conference/participant-imdn-state.h | 48 ++++++++ src/core/core.h | 1 + src/db/main-db.cpp | 103 ++++++++++++++---- src/db/main-db.h | 22 +++- tester/group_chat_tester.c | 34 +++++- 19 files changed, 530 insertions(+), 53 deletions(-) create mode 100644 include/linphone/api/c-participant-imdn-state.h create mode 100644 src/c-wrapper/api/c-participant-imdn-state.cpp create mode 100644 src/conference/participant-imdn-state-p.h create mode 100644 src/conference/participant-imdn-state.cpp create mode 100644 src/conference/participant-imdn-state.h diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 2e09af5eb..a55154d99 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -89,6 +89,7 @@ set(C_API_HEADER_FILES c-event-log.h c-magic-search.h c-participant.h + c-participant-imdn-state.h c-search-result.h c-types.h ) diff --git a/include/linphone/api/c-api.h b/include/linphone/api/c-api.h index 039b55246..54a47fe56 100644 --- a/include/linphone/api/c-api.h +++ b/include/linphone/api/c-api.h @@ -34,6 +34,7 @@ #include "linphone/api/c-dial-plan.h" #include "linphone/api/c-event-log.h" #include "linphone/api/c-participant.h" +#include "linphone/api/c-participant-imdn-state.h" #include "linphone/api/c-magic-search.h" #include "linphone/api/c-search-result.h" #include "linphone/api/c-types.h" diff --git a/include/linphone/api/c-chat-message.h b/include/linphone/api/c-chat-message.h index 1cd3dbd21..da24fa8f5 100644 --- a/include/linphone/api/c-chat-message.h +++ b/include/linphone/api/c-chat-message.h @@ -369,7 +369,26 @@ LINPHONE_PUBLIC const char* linphone_chat_message_get_text_content(const Linphon */ LINPHONE_PUBLIC bool_t linphone_chat_message_is_file_transfer_in_progress(LinphoneChatMessage *msg); -LINPHONE_PUBLIC bctbx_list_t *linphone_chat_message_get_participants_in_state (const LinphoneChatMessage *msg, const LinphoneChatMessageState state); +/** + * Gets the list of participants that displayed this message and the time at which they did. + * @param[in] msg LinphoneChatMessage object + * @return \bctbx_list{LinphoneParticipantImdnState} + */ +LINPHONE_PUBLIC bctbx_list_t *linphone_chat_message_get_participants_that_have_displayed (const LinphoneChatMessage *msg); + +/** + * Gets the list of participants that did not receive this message. + * @param[in] msg LinphoneChatMessage object + * @return \bctbx_list{LinphoneParticipantImdnState} + */ +LINPHONE_PUBLIC bctbx_list_t *linphone_chat_message_get_participants_that_have_not_received (const LinphoneChatMessage *msg); + +/** + * Gets the list of participants that received this message and the time at which they did. + * @param[in] msg LinphoneChatMessage object + * @return \bctbx_list{LinphoneParticipantImdnState} + */ +LINPHONE_PUBLIC bctbx_list_t *linphone_chat_message_get_participants_that_have_received (const LinphoneChatMessage *msg); /** * @} diff --git a/include/linphone/api/c-participant-imdn-state.h b/include/linphone/api/c-participant-imdn-state.h new file mode 100644 index 000000000..041dd2efc --- /dev/null +++ b/include/linphone/api/c-participant-imdn-state.h @@ -0,0 +1,91 @@ +/* + * c-participant-imdn-state.h + * Copyright (C) 2010-2018 Belledonne Communications SARL + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _L_C_PARTICIPANT_IMDN_STATE_H_ +#define _L_C_PARTICIPANT_IMDN_STATE_H_ + +#include "linphone/api/c-types.h" + +// ============================================================================= + +#ifdef __cplusplus + extern "C" { +#endif // ifdef __cplusplus + +/** + * @addtogroup misc + * @{ + */ + +/** + * Increment reference count of LinphoneParticipantImdnState object. + **/ +LINPHONE_PUBLIC LinphoneParticipantImdnState *linphone_participant_imdn_state_ref (LinphoneParticipantImdnState *state); + +/** + * Decrement reference count of LinphoneParticipantImdnState object. + **/ +LINPHONE_PUBLIC void linphone_participant_imdn_state_unref (LinphoneParticipantImdnState *state); + +/** + * Retrieve the user pointer associated with a LinphoneParticipantImdnState. + * @param[in] state A LinphoneParticipantImdnState object + * @return The user pointer associated with the LinphoneParticipantImdnState. +**/ +LINPHONE_PUBLIC void *linphone_participant_imdn_state_get_user_data(const LinphoneParticipantImdnState *state); + +/** + * Assign a user pointer to a LinphoneParticipantImdnState. + * @param[in] state A LinphoneParticipantImdnState object + * @param[in] ud The user pointer to associate with the LinphoneParticipantImdnState +**/ +LINPHONE_PUBLIC void linphone_participant_imdn_state_set_user_data(LinphoneParticipantImdnState *state, void *ud); + +/** + * Get the participant concerned by a LinphoneParticipantImdnState. + * @param[in] state A LinphoneParticipantImdnState object + * @return The participant concerned by the LinphoneParticipantImdnState + */ +LINPHONE_PUBLIC const LinphoneParticipant *linphone_participant_imdn_state_get_participant ( + const LinphoneParticipantImdnState *state +); + +/** + * Get the chat message state the participant is in. + * @param state A LinphoneParticipantImdnState object + * @return The chat message state the participant is in + */ +LINPHONE_PUBLIC LinphoneChatMessageState linphone_participant_imdn_state_get_state (const LinphoneParticipantImdnState *state); + +/** + * Get the timestamp at which a participant has reached the state described by a LinphoneParticipantImdnState. + * @param[in] state A LinphoneParticipantImdnState object + * @return The timestamp at which the participant has reached the state described in the LinphoneParticipantImdnState + */ +LINPHONE_PUBLIC time_t linphone_participant_imdn_state_get_state_change_time (const LinphoneParticipantImdnState *state); + +/** + * @} + */ + +#ifdef __cplusplus + } +#endif // ifdef __cplusplus + +#endif // ifndef _L_C_PARTICIPANT_IMDN_STATE_H_ diff --git a/include/linphone/api/c-types.h b/include/linphone/api/c-types.h index f587b77f8..bb1193001 100644 --- a/include/linphone/api/c-types.h +++ b/include/linphone/api/c-types.h @@ -162,6 +162,12 @@ typedef struct _LinphoneMagicSearch LinphoneMagicSearch; **/ typedef struct _LinphoneParticipant LinphoneParticipant; +/** + * The LinphoneParticipantImdnState object represents the state of chat message for a participant of a conference chat room. + * @ingroup misc +**/ +typedef struct _LinphoneParticipantImdnState LinphoneParticipantImdnState; + /** * The LinphoneSearchResult object represents a result of a search * @ingroup misc diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ca182139f..d9a4e79a6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -82,6 +82,8 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES conference/params/media-session-params-p.h conference/params/media-session-params.h conference/participant-device.h + conference/participant-imdn-state.h + conference/participant-imdn-state-p.h conference/participant-p.h conference/participant.h conference/remote-conference-p.h @@ -177,6 +179,7 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES c-wrapper/api/c-event-log.cpp c-wrapper/api/c-magic-search.cpp c-wrapper/api/c-participant.cpp + c-wrapper/api/c-participant-imdn-state.cpp c-wrapper/api/c-search-result.cpp c-wrapper/internal/c-sal.cpp c-wrapper/internal/c-tools.cpp @@ -212,6 +215,7 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES conference/params/call-session-params.cpp conference/params/media-session-params.cpp conference/participant-device.cpp + conference/participant-imdn-state.cpp conference/participant.cpp conference/remote-conference.cpp conference/session/call-session.cpp diff --git a/src/c-wrapper/api/c-chat-message.cpp b/src/c-wrapper/api/c-chat-message.cpp index a616a9659..4eaafb3ae 100644 --- a/src/c-wrapper/api/c-chat-message.cpp +++ b/src/c-wrapper/api/c-chat-message.cpp @@ -32,6 +32,7 @@ #include "content/content-type.h" #include "content/content.h" #include "conference/participant.h" +#include "conference/participant-imdn-state.h" // ============================================================================= @@ -247,10 +248,19 @@ bool_t linphone_chat_message_is_file_transfer_in_progress(LinphoneChatMessage *m return L_GET_CPP_PTR_FROM_C_OBJECT(msg)->isFileTransferInProgress(); } -bctbx_list_t *linphone_chat_message_get_participants_in_state (const LinphoneChatMessage *msg, const LinphoneChatMessageState state) { - return L_GET_RESOLVED_C_LIST_FROM_CPP_LIST(L_GET_PRIVATE_FROM_C_OBJECT(msg)->getParticipantsInState((LinphonePrivate::ChatMessage::State) state)); +bctbx_list_t *linphone_chat_message_get_participants_that_have_displayed (const LinphoneChatMessage *msg) { + return L_GET_RESOLVED_C_LIST_FROM_CPP_LIST(L_GET_CPP_PTR_FROM_C_OBJECT(msg)->getParticipantsThatHaveDisplayed()); } +bctbx_list_t *linphone_chat_message_get_participants_that_have_not_received (const LinphoneChatMessage *msg) { + return L_GET_RESOLVED_C_LIST_FROM_CPP_LIST(L_GET_CPP_PTR_FROM_C_OBJECT(msg)->getParticipantsThatHaveNotReceived()); +} + +bctbx_list_t *linphone_chat_message_get_participants_that_have_received (const LinphoneChatMessage *msg) { + return L_GET_RESOLVED_C_LIST_FROM_CPP_LIST(L_GET_CPP_PTR_FROM_C_OBJECT(msg)->getParticipantsThatHaveReceived()); +} + + // ============================================================================= // Old listener // ============================================================================= diff --git a/src/c-wrapper/api/c-participant-imdn-state.cpp b/src/c-wrapper/api/c-participant-imdn-state.cpp new file mode 100644 index 000000000..2f3a906d2 --- /dev/null +++ b/src/c-wrapper/api/c-participant-imdn-state.cpp @@ -0,0 +1,59 @@ +/* + * c-participant-imdn-state.cpp + * Copyright (C) 2010-2018 Belledonne Communications SARL + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "linphone/api/c-participant-imdn-state.h" + +#include "c-wrapper/c-wrapper.h" +#include "conference/participant.h" +#include "conference/participant-imdn-state.h" + +// ============================================================================= + +using namespace std; + +L_DECLARE_C_CLONABLE_OBJECT_IMPL(ParticipantImdnState); + +LinphoneParticipantImdnState *linphone_participant_imdn_state_ref (LinphoneParticipantImdnState *state) { + belle_sip_object_ref(state); + return state; +} + +void linphone_participant_imdn_state_unref (LinphoneParticipantImdnState *state) { + belle_sip_object_unref(state); +} + +void *linphone_participant_imdn_state_get_user_data(const LinphoneParticipantImdnState *state) { + return L_GET_USER_DATA_FROM_C_OBJECT(state); +} + +void linphone_participant_imdn_state_set_user_data(LinphoneParticipantImdnState *state, void *ud) { + L_SET_USER_DATA_FROM_C_OBJECT(state, ud); +} + +const LinphoneParticipant *linphone_participant_imdn_state_get_participant (const LinphoneParticipantImdnState *state) { + return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(state)->getParticipant()); +} + +LinphoneChatMessageState linphone_participant_imdn_state_get_state (const LinphoneParticipantImdnState *state) { + return (LinphoneChatMessageState)L_GET_CPP_PTR_FROM_C_OBJECT(state)->getState(); +} + +time_t linphone_participant_imdn_state_get_state_change_time (const LinphoneParticipantImdnState *state) { + return L_GET_CPP_PTR_FROM_C_OBJECT(state)->getStateChangeTime(); +} diff --git a/src/c-wrapper/c-wrapper.h b/src/c-wrapper/c-wrapper.h index e0109ce7c..9f59405ef 100644 --- a/src/c-wrapper/c-wrapper.h +++ b/src/c-wrapper/c-wrapper.h @@ -42,6 +42,7 @@ F(MagicSearch, MagicSearch) \ F(MediaSessionParams, CallParams) \ F(Participant, Participant) \ + F(ParticipantImdnState, ParticipantImdnState) \ F(SearchResult, SearchResult) #define L_REGISTER_SUBTYPES(F) \ diff --git a/src/chat/chat-message/chat-message-p.h b/src/chat/chat-message/chat-message-p.h index 1c7e8d854..c3350d887 100644 --- a/src/chat/chat-message/chat-message-p.h +++ b/src/chat/chat-message/chat-message-p.h @@ -30,6 +30,7 @@ #include "content/content.h" #include "content/file-content.h" #include "content/file-transfer-content.h" +#include "db/main-db.h" #include "db/main-db-chat-message-key.h" #include "event-log/conference/conference-chat-message-event.h" #include "object/object-p.h" @@ -58,8 +59,8 @@ public: void setDirection (ChatMessage::Direction dir); + std::list getParticipantsByImdnState (MainDb::ParticipantStateRetrievalFunc func) const; void setParticipantState (const IdentityAddress &participantAddress, ChatMessage::State newState, time_t stateChangeTime); - std::list> getParticipantsInState (const ChatMessage::State state) const; void setState (ChatMessage::State newState, bool force = false); void setTime (time_t time); diff --git a/src/chat/chat-message/chat-message.cpp b/src/chat/chat-message/chat-message.cpp index ae75b0525..5627ed922 100644 --- a/src/chat/chat-message/chat-message.cpp +++ b/src/chat/chat-message/chat-message.cpp @@ -35,6 +35,7 @@ #include "chat/modifier/file-transfer-chat-message-modifier.h" #include "chat/modifier/multipart-chat-message-modifier.h" #include "conference/participant.h" +#include "conference/participant-imdn-state.h" #include "content/file-content.h" #include "content/content.h" #include "core/core.h" @@ -70,6 +71,25 @@ void ChatMessagePrivate::setIsReadOnly (bool readOnly) { isReadOnly = readOnly; } +list ChatMessagePrivate::getParticipantsByImdnState (MainDb::ParticipantStateRetrievalFunc func) const { + L_Q(); + + list result; + if (!(q->getChatRoom()->getCapabilities() & AbstractChatRoom::Capabilities::Conference) || !dbKey.isValid()) + return result; + + unique_ptr &mainDb = q->getChatRoom()->getCore()->getPrivate()->mainDb; + shared_ptr eventLog = mainDb->getEventFromKey(dbKey); + list dbResults = func(eventLog); + for (const auto &dbResult : dbResults) { + auto participant = q->getChatRoom()->findParticipant(dbResult.address); + if (participant) + result.emplace_back(participant, dbResult.state, dbResult.timestamp); + } + + return result; +} + void ChatMessagePrivate::setParticipantState (const IdentityAddress &participantAddress, ChatMessage::State newState, time_t stateChangeTime) { L_Q(); @@ -123,29 +143,6 @@ void ChatMessagePrivate::setParticipantState (const IdentityAddress &participant setState(ChatMessage::State::DeliveredToUser); } -list> ChatMessagePrivate::getParticipantsInState (const ChatMessage::State state) const { - L_Q(); - - list> participantsInState; - if (!(q->getChatRoom()->getCapabilities() & AbstractChatRoom::Capabilities::Conference) || !dbKey.isValid()) { - return participantsInState; - } - - unique_ptr &mainDb = q->getChatRoom()->getCore()->getPrivate()->mainDb; - shared_ptr eventLog = mainDb->getEventFromKey(dbKey); - list addressesInState = mainDb->getChatMessageParticipantsInState(eventLog, state); - const list> &participants = q->getChatRoom()->getParticipants(); - for (IdentityAddress addr : addressesInState) { - for (const auto &participant : participants) { - if (participant->getAddress() == addr) { - participantsInState.push_back(participant); - } - } - } - - return participantsInState; -} - void ChatMessagePrivate::setState (ChatMessage::State newState, bool force) { L_Q(); @@ -997,6 +994,29 @@ void ChatMessage::setToBeStored (bool value) { // ----------------------------------------------------------------------------- +list ChatMessage::getParticipantsThatHaveDisplayed () const { + L_D(); + unique_ptr &mainDb = getChatRoom()->getCore()->getPrivate()->mainDb; + auto func = bind(&MainDb::getChatMessageParticipantsThatHaveDisplayed, mainDb.get(), std::placeholders::_1); + return d->getParticipantsByImdnState(func); +} + +list ChatMessage::getParticipantsThatHaveNotReceived () const { + L_D(); + unique_ptr &mainDb = getChatRoom()->getCore()->getPrivate()->mainDb; + auto func = bind(&MainDb::getChatMessageParticipantsThatHaveNotReceived, mainDb.get(), std::placeholders::_1); + return d->getParticipantsByImdnState(func); +} + +list ChatMessage::getParticipantsThatHaveReceived () const { + L_D(); + unique_ptr &mainDb = getChatRoom()->getCore()->getPrivate()->mainDb; + auto func = bind(&MainDb::getChatMessageParticipantsThatHaveReceived, mainDb.get(), std::placeholders::_1); + return d->getParticipantsByImdnState(func); +} + +// ----------------------------------------------------------------------------- + const LinphoneErrorInfo *ChatMessage::getErrorInfo () const { L_D(); if (!d->errorInfo) d->errorInfo = linphone_error_info_new(); // let's do it mutable diff --git a/src/chat/chat-message/chat-message.h b/src/chat/chat-message/chat-message.h index 2b53bda7d..86691880c 100644 --- a/src/chat/chat-message/chat-message.h +++ b/src/chat/chat-message/chat-message.h @@ -40,6 +40,7 @@ class Content; class FileTransferContent; class ChatMessagePrivate; class Participant; +class ParticipantImdnState; class LINPHONE_PUBLIC ChatMessage : public Object, public CoreAccessor { friend class BasicToClientGroupChatRoom; @@ -94,6 +95,10 @@ public: bool getToBeStored () const; void setToBeStored (bool value); + std::list getParticipantsThatHaveDisplayed () const; + std::list getParticipantsThatHaveReceived () const; + std::list getParticipantsThatHaveNotReceived () const; + const std::list &getContents () const; void addContent (Content &content); void removeContent (const Content &content); diff --git a/src/conference/participant-imdn-state-p.h b/src/conference/participant-imdn-state-p.h new file mode 100644 index 000000000..981bfefb1 --- /dev/null +++ b/src/conference/participant-imdn-state-p.h @@ -0,0 +1,42 @@ +/* + * participant-imdn-state-p.h + * Copyright (C) 2010-2018 Belledonne Communications SARL + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _L_PARTICIPANT_IMDN_STATE_P_H_ +#define _L_PARTICIPANT_IMDN_STATE_P_H_ + +#include "object/clonable-object-p.h" + +#include "conference/participant-imdn-state.h" + +// ============================================================================= + +LINPHONE_BEGIN_NAMESPACE + +class ParticipantImdnStatePrivate : public ClonableObjectPrivate { +public: + std::shared_ptr participant; + ChatMessage::State state = ChatMessage::State::Idle; + time_t stateChangeTime = 0; + + L_DECLARE_PUBLIC(ParticipantImdnState); +}; + +LINPHONE_END_NAMESPACE + +#endif // ifndef _L_PARTICIPANT_IMDN_STATE_P_H_ diff --git a/src/conference/participant-imdn-state.cpp b/src/conference/participant-imdn-state.cpp new file mode 100644 index 000000000..cd3772bdb --- /dev/null +++ b/src/conference/participant-imdn-state.cpp @@ -0,0 +1,61 @@ +/* + * participant-imdn-state.cpp + * Copyright (C) 2010-2018 Belledonne Communications SARL + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "participant-imdn-state-p.h" + +using namespace std; + +LINPHONE_BEGIN_NAMESPACE + +// ============================================================================= + +ParticipantImdnState::ParticipantImdnState (const shared_ptr &participant, ChatMessage::State state, time_t stateChangeTime) + : ClonableObject(*new ParticipantImdnStatePrivate) +{ + L_D(); + d->participant = participant; + d->state = state; + d->stateChangeTime = stateChangeTime; +} + +ParticipantImdnState::ParticipantImdnState(const ParticipantImdnState &other) : ClonableObject(*new ParticipantImdnStatePrivate) { + L_D(); + d->participant = other.getParticipant(); + d->state = other.getState(); + d->stateChangeTime = other.getStateChangeTime(); +} + +// ----------------------------------------------------------------------------- + +shared_ptr ParticipantImdnState::getParticipant () const { + L_D(); + return d->participant; +} + +ChatMessage::State ParticipantImdnState::getState () const { + L_D(); + return d->state; +} + +time_t ParticipantImdnState::getStateChangeTime () const { + L_D(); + return d->stateChangeTime; +} + +LINPHONE_END_NAMESPACE diff --git a/src/conference/participant-imdn-state.h b/src/conference/participant-imdn-state.h new file mode 100644 index 000000000..0a9c7ded4 --- /dev/null +++ b/src/conference/participant-imdn-state.h @@ -0,0 +1,48 @@ +/* + * participant-imdn-state.h + * Copyright (C) 2010-2018 Belledonne Communications SARL + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _L_PARTICIPANT_IMDN_STATE_H_ +#define _L_PARTICIPANT_IMDN_STATE_H_ + +#include "chat/chat-message/chat-message.h" +#include "object/clonable-object.h" + +// ============================================================================= + +LINPHONE_BEGIN_NAMESPACE + +class Participant; +class ParticipantImdnStatePrivate; + +class ParticipantImdnState : public ClonableObject { +public: + ParticipantImdnState (const std::shared_ptr &participant, ChatMessage::State state, time_t stateChangeTime); + ParticipantImdnState (const ParticipantImdnState &other); + + std::shared_ptr getParticipant () const; + ChatMessage::State getState () const; + time_t getStateChangeTime () const; + +private: + L_DECLARE_PRIVATE(ParticipantImdnState); +}; + +LINPHONE_END_NAMESPACE + +#endif // ifndef _L_PARTICIPANT_IMDN_STATE_H_ diff --git a/src/core/core.h b/src/core/core.h index 72b037003..bcb458a87 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -44,6 +44,7 @@ class LINPHONE_PUBLIC Core : public Object { friend class BasicToClientGroupChatRoomPrivate; friend class CallPrivate; friend class CallSession; + friend class ChatMessage; friend class ChatMessagePrivate; friend class ChatRoom; friend class ChatRoomPrivate; diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp index a3d4b9edd..afd1b42ff 100644 --- a/src/db/main-db.cpp +++ b/src/db/main-db.cpp @@ -1930,6 +1930,85 @@ list> MainDb::getUnreadChatMessages (const ChatRoomId &c }; } +list MainDb::getChatMessageParticipantsThatHaveDisplayed ( + const shared_ptr &eventLog +) const { + return L_DB_TRANSACTION { + L_D(); + + const EventLogPrivate *dEventLog = eventLog->getPrivate(); + MainDbKeyPrivate *dEventKey = static_cast(dEventLog->dbKey).getPrivate(); + const long long &eventId = dEventKey->storageId; + int stateInt = static_cast(ChatMessage::State::Displayed); + + static const string query = "SELECT sip_address.value, chat_message_participant.state_change_time" + " FROM sip_address, chat_message_participant" + " WHERE event_id = :eventId AND state = :state" + " AND sip_address.id = chat_message_participant.participant_sip_address_id"; + soci::rowset rows = (d->dbSession.getBackendSession()->prepare << query, + soci::use(eventId), soci::use(stateInt) + ); + + list result; + for (const auto &row : rows) + result.emplace_back(IdentityAddress(row.get(0)), ChatMessage::State::Displayed, Utils::getTmAsTimeT(row.get(1))); + return result; + }; +} + +list MainDb::getChatMessageParticipantsThatHaveNotReceived ( + const shared_ptr &eventLog +) const { + return L_DB_TRANSACTION { + L_D(); + + const EventLogPrivate *dEventLog = eventLog->getPrivate(); + MainDbKeyPrivate *dEventKey = static_cast(dEventLog->dbKey).getPrivate(); + const long long &eventId = dEventKey->storageId; + int deliveredStateInt = static_cast(ChatMessage::State::DeliveredToUser); + int displayedStateInt = static_cast(ChatMessage::State::Displayed); + + static const string query = "SELECT sip_address.value, chat_message_participant.state_change_time" + " FROM sip_address, chat_message_participant" + " WHERE event_id = :eventId AND state <> :deliveredState AND state <> :displayedState" + " AND sip_address.id = chat_message_participant.participant_sip_address_id"; + soci::rowset rows = (d->dbSession.getBackendSession()->prepare << query, + soci::use(eventId), soci::use(deliveredStateInt), soci::use(displayedStateInt) + ); + + list result; + for (const auto &row : rows) + result.emplace_back(IdentityAddress(row.get(0)), ChatMessage::State::Idle, 0); + return result; + }; +} + +list MainDb::getChatMessageParticipantsThatHaveReceived ( + const shared_ptr &eventLog +) const { + return L_DB_TRANSACTION { + L_D(); + + const EventLogPrivate *dEventLog = eventLog->getPrivate(); + MainDbKeyPrivate *dEventKey = static_cast(dEventLog->dbKey).getPrivate(); + const long long &eventId = dEventKey->storageId; + int stateInt = static_cast(ChatMessage::State::DeliveredToUser); + + static const string query = "SELECT sip_address.value, chat_message_participant.state_change_time" + " FROM sip_address, chat_message_participant" + " WHERE event_id = :eventId AND state = :state" + " AND sip_address.id = chat_message_participant.participant_sip_address_id"; + soci::rowset rows = (d->dbSession.getBackendSession()->prepare << query, + soci::use(eventId), soci::use(stateInt) + ); + + list result; + for (const auto &row : rows) + result.emplace_back(IdentityAddress(row.get(0)), ChatMessage::State::DeliveredToUser, Utils::getTmAsTimeT(row.get(1))); + return result; + }; +} + list MainDb::getChatMessageParticipantStates (const shared_ptr &eventLog) const { return L_DB_TRANSACTION { L_D(); @@ -1953,30 +2032,6 @@ list MainDb::getChatMessageParticipantStates (const shared_p }; } -list MainDb::getChatMessageParticipantsInState (const shared_ptr &eventLog, const ChatMessage::State state) const { - return L_DB_TRANSACTION { - L_D(); - - const EventLogPrivate *dEventLog = eventLog->getPrivate(); - MainDbKeyPrivate *dEventKey = static_cast(dEventLog->dbKey).getPrivate(); - const long long &eventId = dEventKey->storageId; - - int stateInt = static_cast(state); - list participantsAddresses; - - static const string query = "SELECT sip_address.value" - " FROM sip_address, chat_message_participant" - " WHERE event_id = :eventId AND state = :state" - " AND sip_address.id = chat_message_participant.participant_sip_address_id"; - soci::rowset rows = (d->dbSession.getBackendSession()->prepare << query, soci::use(eventId), soci::use(stateInt)); - for (const auto &row : rows) { - participantsAddresses.push_back(IdentityAddress(row.get(0))); - } - - return participantsAddresses; - }; -} - ChatMessage::State MainDb::getChatMessageParticipantState ( const shared_ptr &eventLog, const IdentityAddress &participantAddress diff --git a/src/db/main-db.h b/src/db/main-db.h index d7ce028e0..bb134ab50 100644 --- a/src/db/main-db.h +++ b/src/db/main-db.h @@ -20,6 +20,7 @@ #ifndef _L_MAIN_DB_H_ #define _L_MAIN_DB_H_ +#include #include #include "linphone/utils/enum-mask.h" @@ -59,6 +60,15 @@ public: typedef EnumMask FilterMask; + struct ParticipantState { + ParticipantState (const IdentityAddress &address, ChatMessage::State state, time_t timestamp) + : address(address), state(state), timestamp(timestamp) {} + + IdentityAddress address; + ChatMessage::State state = ChatMessage::State::Idle; + time_t timestamp = 0; + }; + MainDb (const std::shared_ptr &core); // --------------------------------------------------------------------------- @@ -85,13 +95,23 @@ public: // Conference chat message events. // --------------------------------------------------------------------------- + using ParticipantStateRetrievalFunc = std::function(const std::shared_ptr &eventLog)>; + int getChatMessageCount (const ChatRoomId &chatRoomId = ChatRoomId()) const; int getUnreadChatMessageCount (const ChatRoomId &chatRoomId = ChatRoomId()) const; void markChatMessagesAsRead (const ChatRoomId &chatRoomId) const; std::list> getUnreadChatMessages (const ChatRoomId &chatRoomId) const; + std::list getChatMessageParticipantsThatHaveDisplayed ( + const std::shared_ptr &eventLog + ) const; + std::list getChatMessageParticipantsThatHaveNotReceived ( + const std::shared_ptr &eventLog + ) const; + std::list getChatMessageParticipantsThatHaveReceived ( + const std::shared_ptr &eventLog + ) const; std::list getChatMessageParticipantStates (const std::shared_ptr &eventLog) const; - std::list getChatMessageParticipantsInState (const std::shared_ptr &eventLog, const ChatMessage::State state) const; ChatMessage::State getChatMessageParticipantState ( const std::shared_ptr &eventLog, const IdentityAddress &participantAddress diff --git a/tester/group_chat_tester.c b/tester/group_chat_tester.c index fd6372d0f..a8d29303c 100644 --- a/tester/group_chat_tester.c +++ b/tester/group_chat_tester.c @@ -3056,6 +3056,7 @@ static void imdn_for_group_chat_room (void) { stats initialMarieStats = marie->stat; stats initialPaulineStats = pauline->stat; stats initialChloeStats = chloe->stat; + time_t initialTime = ms_time(NULL); // Enable IMDN linphone_im_notif_policy_enable_all(linphone_core_get_im_notif_policy(marie->lc)); @@ -3090,15 +3091,46 @@ static void imdn_for_group_chat_room (void) { linphone_address_unref(chloeAddr); // Check that the message has been delivered to Marie and Pauline - BC_ASSERT_TRUE(wait_for_list(coresList, &chloe->stat.number_of_LinphoneMessageDeliveredToUser, initialChloeStats.number_of_LinphoneMessageDeliveredToUser + 1, 10000)); + BC_ASSERT_TRUE(wait_for_list(coresList, &chloe->stat.number_of_LinphoneMessageDeliveredToUser, initialChloeStats.number_of_LinphoneMessageDeliveredToUser + 1, 1000)); + BC_ASSERT_PTR_NULL(linphone_chat_message_get_participants_that_have_displayed(chloeMessage)); + bctbx_list_t *participantsThatReceivedChloeMessage = linphone_chat_message_get_participants_that_have_received(chloeMessage); + if (BC_ASSERT_PTR_NOT_NULL(participantsThatReceivedChloeMessage)) { + BC_ASSERT_EQUAL((int)bctbx_list_size(participantsThatReceivedChloeMessage), 2, int, "%d"); + for (bctbx_list_t *item = participantsThatReceivedChloeMessage; item; item = bctbx_list_next(item)) { + LinphoneParticipantImdnState *state = (LinphoneParticipantImdnState *)bctbx_list_get_data(item); + BC_ASSERT_GREATER(linphone_participant_imdn_state_get_state_change_time(state), initialTime, int, "%d"); + BC_ASSERT_EQUAL(linphone_participant_imdn_state_get_state(state), LinphoneChatMessageStateDeliveredToUser, int, "%d"); + BC_ASSERT_PTR_NOT_NULL(linphone_participant_imdn_state_get_participant(state)); + } + bctbx_list_free_with_data(participantsThatReceivedChloeMessage, (bctbx_list_free_func)linphone_participant_imdn_state_unref); + } + BC_ASSERT_PTR_NULL(linphone_chat_message_get_participants_that_have_not_received(chloeMessage)); // Marie marks the message as read, check that the state is not yet displayed on Chloe's side linphone_chat_room_mark_as_read(marieCr); BC_ASSERT_FALSE(wait_for_list(coresList, &chloe->stat.number_of_LinphoneMessageDisplayed, initialChloeStats.number_of_LinphoneMessageDisplayed + 1, 1000)); + bctbx_list_t *participantsThatDisplayedChloeMessage = linphone_chat_message_get_participants_that_have_displayed(chloeMessage); + if (BC_ASSERT_PTR_NOT_NULL(participantsThatDisplayedChloeMessage)) { + BC_ASSERT_EQUAL((int)bctbx_list_size(participantsThatDisplayedChloeMessage), 1, int, "%d"); + bctbx_list_free_with_data(participantsThatDisplayedChloeMessage, (bctbx_list_free_func)linphone_participant_imdn_state_unref); + } + participantsThatReceivedChloeMessage = linphone_chat_message_get_participants_that_have_received(chloeMessage); + if (BC_ASSERT_PTR_NOT_NULL(participantsThatReceivedChloeMessage)) { + BC_ASSERT_EQUAL((int)bctbx_list_size(participantsThatReceivedChloeMessage), 1, int, "%d"); + bctbx_list_free_with_data(participantsThatReceivedChloeMessage, (bctbx_list_free_func)linphone_participant_imdn_state_unref); + } + BC_ASSERT_PTR_NULL(linphone_chat_message_get_participants_that_have_not_received(chloeMessage)); // Pauline also marks the message as read, check that the state is now displayed on Chloe's side linphone_chat_room_mark_as_read(paulineCr); BC_ASSERT_TRUE(wait_for_list(coresList, &chloe->stat.number_of_LinphoneMessageDisplayed, initialChloeStats.number_of_LinphoneMessageDisplayed + 1, 1000)); + participantsThatDisplayedChloeMessage = linphone_chat_message_get_participants_that_have_displayed(chloeMessage); + if (BC_ASSERT_PTR_NOT_NULL(participantsThatDisplayedChloeMessage)) { + BC_ASSERT_EQUAL((int)bctbx_list_size(participantsThatDisplayedChloeMessage), 2, int, "%d"); + bctbx_list_free_with_data(participantsThatDisplayedChloeMessage, (bctbx_list_free_func)linphone_participant_imdn_state_unref); + } + BC_ASSERT_PTR_NULL(linphone_chat_message_get_participants_that_have_received(chloeMessage)); + BC_ASSERT_PTR_NULL(linphone_chat_message_get_participants_that_have_not_received(chloeMessage)); linphone_chat_message_unref(chloeMessage); From 4a0b9021a24a1916aa56c391818ef99f216bc1ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 10 Apr 2018 18:11:20 +0200 Subject: [PATCH 088/121] Fixes Java wrapper generator --- tools/abstractapi.py | 8 ++-- wrappers/java/genwrapper.py | 77 +++++++++++++++---------------- wrappers/java/java_class.mustache | 2 +- 3 files changed, 41 insertions(+), 46 deletions(-) diff --git a/tools/abstractapi.py b/tools/abstractapi.py index be6c1559b..a13dd241d 100644 --- a/tools/abstractapi.py +++ b/tools/abstractapi.py @@ -1212,11 +1212,11 @@ class JavaLangTranslator(CLikeLangTranslator): ptrtype = _type.containedTypeDesc.translate(self, native=native) ptrtype = '' if type(_type.containedTypeDesc) is ClassType: - ptrtype = _type.containedTypeDesc.translate(self, native=native) + ptrtype = _type.containedTypeDesc.translate(self, native=native, namespace=namespace) elif type(_type.containedTypeDesc) is BaseType: - ptrtype = _type.containedTypeDesc.translate(self, native=native) + ptrtype = _type.containedTypeDesc.translate(self, native=native, namespace=namespace) elif type(_type.containedTypeDesc) is EnumType: - ptrtype = _type.containedTypeDesc.translate(self, native=native) + ptrtype = _type.containedTypeDesc.translate(self, native=native, namespace=namespace) else: if _type.containedTypeDesc: raise Error('translation of bctbx_list_t of ' + _type.containedTypeDesc.name) @@ -1225,7 +1225,7 @@ class JavaLangTranslator(CLikeLangTranslator): return ptrtype + '[]' def translate_argument(self, arg, native=False, jni=False, hideArgName=False, namespace=None): - res = arg.type.translate(self, native=native, jni=jni, namespace=None) + res = arg.type.translate(self, native=native, jni=jni, namespace=namespace) if not hideArgName: res += (' ' + arg.name.translate(self.nameTranslator)) return res diff --git a/wrappers/java/genwrapper.py b/wrappers/java/genwrapper.py index 82480d18b..1f00356e0 100755 --- a/wrappers/java/genwrapper.py +++ b/wrappers/java/genwrapper.py @@ -161,12 +161,12 @@ class JavaTranslator(object): properties.append(self.translate_method(_property.setter, _hasCoreAccessor)) return properties - def translate_jni_property(self, className, _property): + def translate_jni_property(self, class_, _property): properties = [] if _property.getter is not None: - properties.append(self.translate_jni_method(className, _property.getter)) + properties.append(self.translate_jni_method(class_, _property.getter)) if _property.setter is not None: - properties.append(self.translate_jni_method(className, _property.setter)) + properties.append(self.translate_jni_method(class_, _property.setter)) return properties def generate_listener(self, name, _class): @@ -183,7 +183,7 @@ class JavaTranslator(object): methodDict['params'] = _class.name.to_camel_case() + 'Listener listener' methodDict['native_params'] = 'long nativePtr, ' + _class.name.to_camel_case() + 'Listener listener' methodDict['static_native_params'] = '' - methodDict['native_params_impl'] = ', listener' + methodDict['native_params_impl'] = 'nativePtr, listener' methodDict['deprecated'] = False methodDict['doc'] = None @@ -202,8 +202,10 @@ class JavaTranslator(object): def translate_method(self, _method, _hasCoreAccessor=False): methodDict = {} - methodDict['return'] = _method.returnType.translate(self.langTranslator, isReturn=True) - methodDict['return_native'] = _method.returnType.translate(self.langTranslator, native=True, isReturn=True) + namespace = _method.find_first_ancestor_by_type(AbsApi.Namespace) + + methodDict['return'] = _method.returnType.translate(self.langTranslator, isReturn=True, namespace=namespace) + methodDict['return_native'] = _method.returnType.translate(self.langTranslator, native=True, isReturn=True, namespace=namespace) methodDict['return_keyword'] = '' if methodDict['return'] == 'void' else 'return ' methodDict['hasReturn'] = not methodDict['return'] == 'void' @@ -217,57 +219,50 @@ class JavaTranslator(object): methodDict['enumCast'] = type(_method.returnType) is AbsApi.EnumType methodDict['classCast'] = type(_method.returnType) is AbsApi.ClassType - methodDict['params'] = '' - methodDict['native_params'] = 'long nativePtr' - methodDict['static_native_params'] = '' - methodDict['native_params_impl'] = '' - for arg in _method.args: - if arg is not _method.args[0]: - methodDict['params'] += ', ' - methodDict['static_native_params'] += ', ' - methodDict['native_params'] += ', ' - methodDict['native_params_impl'] += ', ' - - methodDict['params'] += arg.translate(self.langTranslator) - methodDict['native_params'] += arg.translate(self.langTranslator, native=True) - methodDict['static_native_params'] += arg.translate(self.langTranslator, native=True) - if type(arg.type) is AbsApi.EnumType: - methodDict['native_params_impl'] += arg.name.translate(self.nameTranslator) + '.toInt()' - else: - methodDict['native_params_impl'] += arg.name.translate(self.nameTranslator) + methodDict['params'] = ', '.join([arg.translate(self.langTranslator, namespace=namespace) for arg in _method.args]) + methodDict['native_params'] = ', '.join(['long nativePtr'] + [arg.translate(self.langTranslator, native=True, namespace=namespace) for arg in _method.args]) + methodDict['static_native_params'] = ', '.join([arg.translate(self.langTranslator, native=True, namespace=namespace) for arg in _method.args]) + methodDict['native_params_impl'] = ', '.join( + ['nativePtr'] + [arg.name.translate(self.nameTranslator) + ('.toInt()' if type(arg.type) is AbsApi.EnumType else '') for arg in _method.args]) methodDict['deprecated'] = _method.deprecated methodDict['doc'] = _method.briefDescription.translate(self.docTranslator) if _method.briefDescription is not None else None return methodDict - def translate_jni_method(self, className, _method, static=False): + def translate_jni_method(self, class_, _method, static=False): jni_blacklist = ['linphone_call_set_native_video_window_id', 'linphone_core_set_native_preview_window_id', 'linphone_core_set_native_video_window_id'] + namespace = class_.find_first_ancestor_by_type(AbsApi.Namespace) + className = class_.name.translate(self.nameTranslator) + methodDict = {'notEmpty': True} - methodDict['classCName'] = 'Linphone' + className.to_camel_case() - methodDict['className'] = className.to_camel_case() - methodDict['classImplName'] = className.to_camel_case() + 'Impl' - methodDict['isLinphoneFactory'] = className.to_camel_case() == 'Factory' + methodDict['classCName'] = class_.name.to_c() + methodDict['className'] = className + methodDict['classImplName'] = className + 'Impl' + methodDict['isLinphoneFactory'] = (className == 'Factory') methodDict['jniPath'] = self.jni_path - methodDict['return'] = _method.returnType.translate(self.langTranslator, jni=True, isReturn=True) + methodDict['return'] = _method.returnType.translate(self.langTranslator, jni=True, isReturn=True, namespace=namespace) methodDict['hasListReturn'] = methodDict['return'] == 'jobjectArray' methodDict['hasByteArrayReturn'] = methodDict['return'] == 'jbyteArray' methodDict['hasReturn'] = not methodDict['return'] == 'void' and not methodDict['hasListReturn'] and not methodDict['hasByteArrayReturn'] methodDict['hasStringReturn'] = methodDict['return'] == 'jstring' methodDict['hasNormalReturn'] = not methodDict['hasListReturn'] and not methodDict['hasStringReturn'] and not methodDict['hasByteArrayReturn'] - methodDict['name'] = 'Java_' + self.jni_package + className.to_camel_case() + 'Impl_' + _method.name.to_camel_case(lower=True) + methodDict['name'] = 'Java_' + self.jni_package + className + 'Impl_' + _method.name.translate(self.nameTranslator) methodDict['notStatic'] = not static - methodDict['c_name'] = 'linphone_' + className.to_snake_case() + "_" + _method.name.to_snake_case() - if _method.name.to_snake_case() == 'create_core': - methodDict['c_name'] = 'linphone_' + className.to_snake_case() + "_" + 'create_core_3' - elif _method.name.to_snake_case() == 'create_core_with_config': - methodDict['c_name'] = 'linphone_' + className.to_snake_case() + "_" + 'create_core_with_config_3' + + if _method.name.to_c() == 'linphone_factory_create_core': + methodDict['c_name'] = 'linphone_factory_create_core_3' + elif _method.name.to_c() == 'linphone_factory_create_core_with_config': + methodDict['c_name'] = 'linphone_factory_create_core_with_config_3' + else: + methodDict['c_name'] = _method.name.to_c() + methodDict['returnObject'] = methodDict['hasReturn'] and type(_method.returnType) is AbsApi.ClassType - methodDict['returnClassName'] = _method.returnType.translate(self.langTranslator) + methodDict['returnClassName'] = _method.returnType.translate(self.langTranslator, namespace=namespace) methodDict['isRealObjectArray'] = False methodDict['isStringObjectArray'] = False methodDict['c_type_return'] = _method.returnType.translate(self.clangTranslator) @@ -303,7 +298,7 @@ class JavaTranslator(object): else: methodDict['params_impl'] += ', ' - methodDict['params'] += arg.translate(self.langTranslator, jni=True) + methodDict['params'] += arg.translate(self.langTranslator, jni=True, namespace=namespace) argname = arg.name.translate(self.nameTranslator) if type(arg.type) is AbsApi.ClassType: @@ -353,14 +348,14 @@ class JavaTranslator(object): for _property in _class.properties: try: classDict['methods'] += self.translate_property(_property, hasCoreAccessor) - classDict['jniMethods'] += self.translate_jni_property(_class.name, _property) + classDict['jniMethods'] += self.translate_jni_property(_class, _property) except AbsApi.Error as e: logging.error('error while translating {0} property: {1}'.format(_property.name.to_snake_case(), e.args[0])) for method in _class.instanceMethods: try: methodDict = self.translate_method(method, hasCoreAccessor) - jniMethodDict = self.translate_jni_method(_class.name, method) + jniMethodDict = self.translate_jni_method(_class, method) classDict['methods'].append(methodDict) classDict['jniMethods'].append(jniMethodDict) except AbsApi.Error as e: @@ -369,7 +364,7 @@ class JavaTranslator(object): for method in _class.classMethods: try: methodDict = self.translate_method(method, hasCoreAccessor) - jniMethodDict = self.translate_jni_method(_class.name, method, True) + jniMethodDict = self.translate_jni_method(_class, method, True) classDict['methods'].append(methodDict) classDict['jniMethods'].append(jniMethodDict) except AbsApi.Error as e: diff --git a/wrappers/java/java_class.mustache b/wrappers/java/java_class.mustache index 93d84e00a..4f62209f2 100644 --- a/wrappers/java/java_class.mustache +++ b/wrappers/java/java_class.mustache @@ -196,7 +196,7 @@ class {{classImplName}} {{#isLinphoneFactory}}extends{{/isLinphoneFactory}}{{#is @Override synchronized public {{return}} {{name}}({{params}}) {{#exception}}throws CoreException{{/exception}} { {{#hasCoreAccessor}}{{#isNotGetCore}}synchronized(core) { {{/isNotGetCore}}{{/hasCoreAccessor}} - {{#exception}}int exceptionResult = {{/exception}}{{return_keyword}}{{#enumCast}}{{return}}.fromInt({{/enumCast}}{{#classCast}}({{return}}){{/classCast}}{{name}}(nativePtr{{native_params_impl}}){{#enumCast}}){{/enumCast}};{{#exception}} + {{#exception}}int exceptionResult = {{/exception}}{{return_keyword}}{{#enumCast}}{{return}}.fromInt({{/enumCast}}{{#classCast}}({{return}}){{/classCast}}{{name}}({{native_params_impl}}){{#enumCast}}){{/enumCast}};{{#exception}} if (exceptionResult != 0) throw new CoreException("{{name}} returned value " + exceptionResult);{{/exception}}{{#hasCoreAccessor}}{{#isNotGetCore}} }{{/isNotGetCore}}{{/hasCoreAccessor}} } From ad786fd2e671839fb510b719cc37781bbb600378 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 11 Apr 2018 14:10:50 +0200 Subject: [PATCH 089/121] Handle imdn even for incoming messages. --- src/chat/notification/imdn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chat/notification/imdn.cpp b/src/chat/notification/imdn.cpp index 83ffa3b8d..f74afa848 100644 --- a/src/chat/notification/imdn.cpp +++ b/src/chat/notification/imdn.cpp @@ -165,7 +165,7 @@ void Imdn::parse (const shared_ptr &imdnMessage, xmlparsing_context if (messageIdStr && datetimeStr) { shared_ptr cr = imdnMessage->getChatRoom(); - shared_ptr cm = cr->findChatMessage(messageIdStr, ChatMessage::Direction::Outgoing); + shared_ptr cm = cr->findChatMessage(messageIdStr); const IdentityAddress &participantAddress = imdnMessage->getFromAddress().getAddressWithoutGruu(); if (!cm) { lWarning() << "Received IMDN for unknown message " << messageIdStr; From c808560ed5f3fa43b08259d6daa72005b446f440 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 11 Apr 2018 14:22:34 +0200 Subject: [PATCH 090/121] Do not enable simple group chat message state by default. --- src/chat/chat-message/chat-message.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chat/chat-message/chat-message.cpp b/src/chat/chat-message/chat-message.cpp index 5627ed922..259d1e921 100644 --- a/src/chat/chat-message/chat-message.cpp +++ b/src/chat/chat-message/chat-message.cpp @@ -95,7 +95,7 @@ void ChatMessagePrivate::setParticipantState (const IdentityAddress &participant if (!(q->getChatRoom()->getCapabilities() & AbstractChatRoom::Capabilities::Conference) || (linphone_config_get_bool(linphone_core_get_config(q->getChatRoom()->getCore()->getCCore()), - "misc", "enable_simple_group_chat_message_state", TRUE + "misc", "enable_simple_group_chat_message_state", FALSE )) ) { setState(newState); From 15739433fbe52ae006b5088f87a63be80dfae075 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 13 Dec 2017 14:27:18 +0100 Subject: [PATCH 091/121] fix log issue again. --- coreapi/linphonecore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 3d06704fe..6f5530ebf 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1041,7 +1041,7 @@ void linphone_core_reset_log_collection(void) { void linphone_core_enable_logs(FILE *file){ if (file==NULL) file=stdout; - ortp_set_log_file(file); + linphone_core_set_log_file(file); linphone_core_set_log_level(ORTP_MESSAGE); } From 00e015436d14a26a6bd976f772475c60ada30336 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 11 Apr 2018 14:48:09 +0200 Subject: [PATCH 092/121] Fix logging service once for all. --- coreapi/linphonecore.c | 10 +++++++--- coreapi/logging.c | 7 ++++++- coreapi/private_functions.h | 2 ++ include/linphone/core.h | 2 +- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 6f5530ebf..8be7a24c4 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -486,7 +486,7 @@ const LinphoneAddress *linphone_core_get_current_call_remote_address(struct _Lin static void linphone_core_log_collection_handler(const char *domain, OrtpLogLevel level, const char *fmt, va_list args); -void linphone_core_set_log_handler(OrtpLogFunc logfunc) { +void _linphone_core_set_log_handler(OrtpLogFunc logfunc) { liblinphone_user_log_func = logfunc; if (liblinphone_current_log_func == linphone_core_log_collection_handler) { ms_message("There is already a log collection handler, keep it"); @@ -495,9 +495,13 @@ void linphone_core_set_log_handler(OrtpLogFunc logfunc) { } } +void linphone_core_set_log_handler(OrtpLogFunc logfunc){ + _linphone_core_set_log_handler(logfunc); +} + void linphone_core_set_log_file(FILE *file) { if (file == NULL) file = stdout; - linphone_core_set_log_handler(NULL); + _linphone_core_set_log_handler(NULL); bctbx_set_log_file(file); /*gather everythings*/ } @@ -1046,7 +1050,7 @@ void linphone_core_enable_logs(FILE *file){ } void linphone_core_enable_logs_with_cb(OrtpLogFunc logfunc){ - linphone_core_set_log_handler(logfunc); + _linphone_core_set_log_handler(logfunc); linphone_core_set_log_level(ORTP_MESSAGE); } diff --git a/coreapi/logging.c b/coreapi/logging.c index 7c7960650..fd3f12f36 100644 --- a/coreapi/logging.c +++ b/coreapi/logging.c @@ -183,7 +183,7 @@ static const char *_linphone_logging_service_log_domains[] = { "ortp", "mediastreamer", "bzrtp", - "linphone", + BCTBX_LOG_DOMAIN, /* which is "liblinphone", set from CMakeList.txt*/ NULL }; @@ -238,6 +238,11 @@ void linphone_logging_service_cbs_unref(LinphoneLoggingServiceCbs *cbs) { } void linphone_logging_service_cbs_set_log_message_written(LinphoneLoggingServiceCbs *cbs, LinphoneLoggingServiceCbsLogMessageWrittenCb cb) { + /* We need to set the legacy log handler to NULL here + because LinphoneCore have a default log handler that dump + all messages into the standard output. */ + /*this function is moved here to make sure default log handler is only removed when user defined logging cbs is set*/ + _linphone_core_set_log_handler(NULL); cbs->message_event_cb = cb; } diff --git a/coreapi/private_functions.h b/coreapi/private_functions.h index 772e89294..8f78e107d 100644 --- a/coreapi/private_functions.h +++ b/coreapi/private_functions.h @@ -558,6 +558,8 @@ LinphoneNatPolicy * linphone_config_create_nat_policy_from_section(const Linphon SalCustomHeader *linphone_info_message_get_headers (const LinphoneInfoMessage *im); void linphone_info_message_set_headers (LinphoneInfoMessage *im, const SalCustomHeader *headers); +void _linphone_core_set_log_handler(OrtpLogFunc logfunc); + #ifdef __cplusplus } #endif diff --git a/include/linphone/core.h b/include/linphone/core.h index 4d77351a3..c8e876c6a 100644 --- a/include/linphone/core.h +++ b/include/linphone/core.h @@ -807,7 +807,7 @@ LINPHONE_PUBLIC void linphone_core_reset_log_collection(void); /** * @bref Define a log handler. * @param logfunc The function pointer of the log handler. - * @deprecated Use #linphone_log_service_set_log_handler() instead. Deprecated since 2017-10-10. + * @deprecated Use #linphone_logging_service_cbs_set_log_message_written() instead. Deprecated since 2017-10-10. * @donotwrap */ LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_set_log_handler(OrtpLogFunc logfunc); From 07a7eec84c115464d4c2c49bdade6da66ee93baa Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 11 Apr 2018 14:48:44 +0200 Subject: [PATCH 093/121] Fixed basic chat room constructor causing it to not store participants in db --- src/chat/chat-room/basic-chat-room.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chat/chat-room/basic-chat-room.cpp b/src/chat/chat-room/basic-chat-room.cpp index c3752755f..5951f482d 100644 --- a/src/chat/chat-room/basic-chat-room.cpp +++ b/src/chat/chat-room/basic-chat-room.cpp @@ -32,7 +32,7 @@ LINPHONE_BEGIN_NAMESPACE // ----------------------------------------------------------------------------- BasicChatRoom::BasicChatRoom (const shared_ptr &core, const ChatRoomId &chatRoomId) : - ChatRoom(*new BasicChatRoomPrivate, core, chatRoomId) {} + BasicChatRoom(*new BasicChatRoomPrivate, core, chatRoomId) {} BasicChatRoom::BasicChatRoom ( BasicChatRoomPrivate &p, From 9377ac8f251f9e55f59978813791fd914136fa9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Wed, 11 Apr 2018 14:57:09 +0200 Subject: [PATCH 094/121] Removes dead code --- src/c-wrapper/internal/c-sal.cpp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/c-wrapper/internal/c-sal.cpp b/src/c-wrapper/internal/c-sal.cpp index 3e2457fc0..448c48a95 100644 --- a/src/c-wrapper/internal/c-sal.cpp +++ b/src/c-wrapper/internal/c-sal.cpp @@ -924,22 +924,3 @@ int sal_lines_get_value(const char *data, const char *key, char *value, size_t v }while(read!=0); return FALSE; } - -#if 0 -const char *sal_op_get_entity_tag(const SalOp* op) { - SalOpBase* op_base = (SalOpBase*)op; - return op_base->entity_tag; -} - - -void sal_op_set_entity_tag(SalOp *op, const char* entity_tag) { - SalOpBase* op_base = (SalOpBase*)op; - if (op_base->entity_tag != NULL){ - ms_free(op_base->entity_tag); - } - if (entity_tag) - op_base->entity_tag = ms_strdup(entity_tag); - else - op_base->entity_tag = NULL; -} -#endif From 2e26e0bab4c728a6062c645c3c811344a33f3453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Wed, 11 Apr 2018 15:40:35 +0200 Subject: [PATCH 095/121] Makes the INFO DTMF parser more tolerant about spaces --- src/c-wrapper/internal/c-sal.cpp | 60 ++++++++++++++------------------ 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/src/c-wrapper/internal/c-sal.cpp b/src/c-wrapper/internal/c-sal.cpp index 448c48a95..e03b84188 100644 --- a/src/c-wrapper/internal/c-sal.cpp +++ b/src/c-wrapper/internal/c-sal.cpp @@ -881,46 +881,38 @@ const char* sal_privacy_to_string(SalPrivacy privacy) { } } -static void remove_trailing_spaces(char *line) { - size_t size = strlen(line); - char *end = line + size - 1; - while (end >= line && isspace(*end)) { - end--; - } - *(end + 1) = '\0'; -} - -static int line_get_value(const char *input, const char *key, char *value, size_t value_size, size_t *read){ - const char *end=strchr(input,'\n'); - char line[256]={0}; - char key_candidate[256]; +static int line_get_value(const char *input, const char *key, char *value, size_t value_size, size_t *read) { + const char *end = strchr(input, '\n'); + char line[256] = {0}; + char key_candidate[256]; // key_candidate array must have the same size of line array to avoid potential invalid writes char *equal; size_t len; - if (!end) len=strlen(input); - else len=(size_t)(end + 1 - input); - *read=len; - strncpy(line,input,MIN(len,sizeof(line))); - equal=strchr(line,'='); + + if (!end) len = strlen(input); + else len = end + 1 - input; + *read = len; + strncpy(line, input, MIN(len, sizeof(line))); + + equal = strchr(line, '='); if (!equal) return FALSE; - *equal='\0'; - if (sscanf(line,"%s",key_candidate)!=1) return FALSE; - if (strcasecmp(key,key_candidate)==0){ - equal++; - remove_trailing_spaces(equal); - strncpy(value,equal,value_size-1); - value[value_size-1]='\0'; - return TRUE; - } - return FALSE; + *equal = '\0'; + + if (sscanf(line, "%s", key_candidate) != 1) return FALSE; + if (strcasecmp(key, key_candidate) != 0) return FALSE; + + equal++; + if (strlen(equal) >= value_size) equal[value_size - 1] = '\0'; + if (sscanf(equal, "%s", value) != 1) return FALSE; + return TRUE; } -int sal_lines_get_value(const char *data, const char *key, char *value, size_t value_size){ - size_t read=0; +int sal_lines_get_value(const char *data, const char *key, char *value, size_t value_size) { + size_t read = 0; - do{ - if (line_get_value(data,key,value,value_size,&read)) + do { + if (line_get_value(data, key, value, value_size, &read)) return TRUE; - data+=read; - }while(read!=0); + data += read; + } while (read != 0); return FALSE; } From 370b96225f42f4068d3a5462f20ff831a3c7125f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Fri, 3 Nov 2017 15:40:40 +0100 Subject: [PATCH 096/121] Fix build error when video support is disabled (cherry picked from commit 510869445be34c3bb04b0c51214d53af5c10f337) --- tester/call_video_tester.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tester/call_video_tester.c b/tester/call_video_tester.c index 4b4efb5ad..51d87b03c 100644 --- a/tester/call_video_tester.c +++ b/tester/call_video_tester.c @@ -1894,7 +1894,6 @@ static void outgoing_reinvite_with_invalid_ack_sdp(void) { linphone_core_manager_destroy(caller); } -#endif static void video_call_with_no_audio_and_no_video_codec(void){ LinphoneCoreManager* callee = linphone_core_manager_new("marie_rc"); LinphoneCoreManager* caller = linphone_core_manager_new(transport_supported(LinphoneTransportTcp) ? "pauline_rc" : "pauline_tcp_rc"); @@ -2163,6 +2162,8 @@ static void video_call_expected_fps_for_high_bandwidth(void) { #endif } +#endif // VIDEO_ENABLED + test_t call_video_tests[] = { #ifdef VIDEO_ENABLED TEST_NO_TAG("Call paused resumed with video", call_paused_resumed_with_video), From b76886ddbb71fc2bda6b60aa638563579b70cb73 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 11 Apr 2018 14:59:25 +0200 Subject: [PATCH 097/121] Enable storage of chat message participant state for basic chat rooms and if simple group chat message state is activated. --- src/chat/chat-message/chat-message.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/chat/chat-message/chat-message.cpp b/src/chat/chat-message/chat-message.cpp index 259d1e921..bd3c20c8b 100644 --- a/src/chat/chat-message/chat-message.cpp +++ b/src/chat/chat-message/chat-message.cpp @@ -93,15 +93,6 @@ list ChatMessagePrivate::getParticipantsByImdnState (MainD void ChatMessagePrivate::setParticipantState (const IdentityAddress &participantAddress, ChatMessage::State newState, time_t stateChangeTime) { L_Q(); - if (!(q->getChatRoom()->getCapabilities() & AbstractChatRoom::Capabilities::Conference) - || (linphone_config_get_bool(linphone_core_get_config(q->getChatRoom()->getCore()->getCCore()), - "misc", "enable_simple_group_chat_message_state", FALSE - )) - ) { - setState(newState); - return; - } - if (!dbKey.isValid()) return; @@ -115,6 +106,14 @@ void ChatMessagePrivate::setParticipantState (const IdentityAddress &participant << Utils::toString(newState); mainDb->setChatMessageParticipantState(eventLog, participantAddress, newState, stateChangeTime); + if (linphone_config_get_bool(linphone_core_get_config(q->getChatRoom()->getCore()->getCCore()), + "misc", "enable_simple_group_chat_message_state", FALSE + ) + ) { + setState(newState); + return; + } + list states = mainDb->getChatMessageParticipantStates(eventLog); size_t nbDisplayedStates = 0; size_t nbDeliveredToUserStates = 0; From 6b19ae1b6f75f176addfe69d6cbbac6ee154f6d2 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 11 Apr 2018 15:46:58 +0200 Subject: [PATCH 098/121] Add callback on chat message to notify participant IMDN state change. --- coreapi/private_functions.h | 2 + include/linphone/api/c-callbacks.h | 7 ++ include/linphone/api/c-chat-message-cbs.h | 94 +++++++++++-------- src/c-wrapper/api/c-chat-message-cbs.cpp | 56 ++++++++--- .../api/c-participant-imdn-state.cpp | 4 + src/chat/chat-message/chat-message.cpp | 10 ++ 6 files changed, 119 insertions(+), 54 deletions(-) diff --git a/coreapi/private_functions.h b/coreapi/private_functions.h index 8f78e107d..031e00eef 100644 --- a/coreapi/private_functions.h +++ b/coreapi/private_functions.h @@ -29,6 +29,7 @@ #include "private_types.h" #include "tester_utils.h" +#include "conference/participant-imdn-state.h" #include "sal/op.h" #include "sal/event-op.h" @@ -298,6 +299,7 @@ void _linphone_chat_room_notify_participant_registration_subscription_requested( void _linphone_chat_room_notify_participant_registration_unsubscription_requested(LinphoneChatRoom *cr, const LinphoneAddress *participantAddr); void _linphone_chat_room_notify_chat_message_should_be_stored(LinphoneChatRoom *cr, LinphoneChatMessage *msg); void _linphone_chat_room_clear_callbacks (LinphoneChatRoom *cr); +const LinphoneParticipantImdnState *_linphone_participant_imdn_state_from_cpp_obj (const LinphonePrivate::ParticipantImdnState &state); LinphoneToneDescription * linphone_tone_description_new(LinphoneReason reason, LinphoneToneID id, const char *audiofile); void linphone_tone_description_destroy(LinphoneToneDescription *obj); diff --git a/include/linphone/api/c-callbacks.h b/include/linphone/api/c-callbacks.h index 634e6a830..6a707e7b1 100644 --- a/include/linphone/api/c-callbacks.h +++ b/include/linphone/api/c-callbacks.h @@ -122,6 +122,13 @@ typedef void (*LinphoneChatMessageStateChangedCb)(LinphoneChatMessage* msg, Linp */ typedef void (*LinphoneChatMessageCbsMsgStateChangedCb)(LinphoneChatMessage* msg, LinphoneChatMessageState state); +/** + * Call back used to notify participant IMDN state + * @param msg #LinphoneChatMessage object + * @param state #LinphoneParticipantImdnState + */ +typedef void (*LinphoneChatMessageCbsParticipantImdnStateChangedCb)(LinphoneChatMessage* msg, const LinphoneParticipantImdnState *state); + /** * File transfer receive callback prototype. This function is called by the core upon an incoming File transfer is started. This function may be call several time for the same file in case of large file. * @param message #LinphoneChatMessage message from which the body is received. diff --git a/include/linphone/api/c-chat-message-cbs.h b/include/linphone/api/c-chat-message-cbs.h index 632353f87..35dc2ff19 100644 --- a/include/linphone/api/c-chat-message-cbs.h +++ b/include/linphone/api/c-chat-message-cbs.h @@ -34,7 +34,7 @@ * @{ */ -LinphoneChatMessageCbs *linphone_chat_message_cbs_new(void); +LinphoneChatMessageCbs *linphone_chat_message_cbs_new (void); /** * Acquire a reference to the chat room callbacks object. @@ -68,56 +68,70 @@ LINPHONE_PUBLIC void linphone_chat_message_cbs_set_user_data (LinphoneChatMessag * @param[in] cbs #LinphoneChatMessageCbs object. * @return The current message state changed callback. */ - LINPHONE_PUBLIC LinphoneChatMessageCbsMsgStateChangedCb linphone_chat_message_cbs_get_msg_state_changed(const LinphoneChatMessageCbs *cbs); +LINPHONE_PUBLIC LinphoneChatMessageCbsMsgStateChangedCb linphone_chat_message_cbs_get_msg_state_changed (const LinphoneChatMessageCbs *cbs); - /** - * Set the message state changed callback. - * @param[in] cbs LinphoneChatMessageCbs object. - * @param[in] cb The message state changed callback to be used. - */ - LINPHONE_PUBLIC void linphone_chat_message_cbs_set_msg_state_changed(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsMsgStateChangedCb cb); +/** + * Set the message state changed callback. + * @param[in] cbs LinphoneChatMessageCbs object. + * @param[in] cb The message state changed callback to be used. + */ +LINPHONE_PUBLIC void linphone_chat_message_cbs_set_msg_state_changed (LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsMsgStateChangedCb cb); - /** - * Get the file transfer receive callback. - * @param[in] cbs LinphoneChatMessageCbs object. - * @return The current file transfer receive callback. - */ - LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferRecvCb linphone_chat_message_cbs_get_file_transfer_recv(const LinphoneChatMessageCbs *cbs); +/** + * Get the file transfer receive callback. + * @param[in] cbs LinphoneChatMessageCbs object. + * @return The current file transfer receive callback. + */ +LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferRecvCb linphone_chat_message_cbs_get_file_transfer_recv (const LinphoneChatMessageCbs *cbs); - /** - * Set the file transfer receive callback. - * @param[in] cbs LinphoneChatMessageCbs object. - * @param[in] cb The file transfer receive callback to be used. - */ - LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_recv(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferRecvCb cb); +/** + * Set the file transfer receive callback. + * @param[in] cbs LinphoneChatMessageCbs object. + * @param[in] cb The file transfer receive callback to be used. + */ +LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_recv (LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferRecvCb cb); - /** +/** * Get the file transfer send callback. * @param[in] cbs LinphoneChatMessageCbs object. * @return The current file transfer send callback. */ - LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferSendCb linphone_chat_message_cbs_get_file_transfer_send(const LinphoneChatMessageCbs *cbs); +LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferSendCb linphone_chat_message_cbs_get_file_transfer_send (const LinphoneChatMessageCbs *cbs); - /** - * Set the file transfer send callback. - * @param[in] cbs LinphoneChatMessageCbs object. - * @param[in] cb The file transfer send callback to be used. - */ - LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_send(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferSendCb cb); +/** + * Set the file transfer send callback. + * @param[in] cbs LinphoneChatMessageCbs object. + * @param[in] cb The file transfer send callback to be used. + */ +LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_send (LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferSendCb cb); - /** - * Get the file transfer progress indication callback. - * @param[in] cbs LinphoneChatMessageCbs object. - * @return The current file transfer progress indication callback. - */ - LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferProgressIndicationCb linphone_chat_message_cbs_get_file_transfer_progress_indication(const LinphoneChatMessageCbs *cbs); +/** + * Get the file transfer progress indication callback. + * @param[in] cbs LinphoneChatMessageCbs object. + * @return The current file transfer progress indication callback. + */ +LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferProgressIndicationCb linphone_chat_message_cbs_get_file_transfer_progress_indication (const LinphoneChatMessageCbs *cbs); - /** - * Set the file transfer progress indication callback. - * @param[in] cbs LinphoneChatMessageCbs object. - * @param[in] cb The file transfer progress indication callback to be used. - */ - LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_progress_indication(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferProgressIndicationCb cb); +/** + * Set the file transfer progress indication callback. + * @param[in] cbs LinphoneChatMessageCbs object. + * @param[in] cb The file transfer progress indication callback to be used. + */ +LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_progress_indication (LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferProgressIndicationCb cb); + +/** + * Get the participant IMDN state changed callback. + * @param[in] cbs #LinphoneChatMessageCbs object. + * @return The current participant IMDN state changed callback. + */ +LINPHONE_PUBLIC LinphoneChatMessageCbsParticipantImdnStateChangedCb linphone_chat_message_cbs_get_participant_imdn_state_changed (const LinphoneChatMessageCbs *cbs); + +/** + * Set the participant IMDN state changed callback. + * @param[in] cbs LinphoneChatMessageCbs object. + * @param[in] cb The participant IMDN state changed callback to be used. + */ +LINPHONE_PUBLIC void linphone_chat_message_cbs_set_participant_imdn_state_changed (LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsParticipantImdnStateChangedCb cb); /** * @} diff --git a/src/c-wrapper/api/c-chat-message-cbs.cpp b/src/c-wrapper/api/c-chat-message-cbs.cpp index 16511eff6..aced7c8bb 100644 --- a/src/c-wrapper/api/c-chat-message-cbs.cpp +++ b/src/c-wrapper/api/c-chat-message-cbs.cpp @@ -30,6 +30,7 @@ struct _LinphoneChatMessageCbs { LinphoneChatMessageCbsFileTransferRecvCb file_transfer_recv; LinphoneChatMessageCbsFileTransferSendCb file_transfer_send; LinphoneChatMessageCbsFileTransferProgressIndicationCb file_transfer_progress_indication; + LinphoneChatMessageCbsParticipantImdnStateChangedCb participant_imdn_state_changed; }; BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneChatMessageCbs); @@ -66,40 +67,67 @@ void linphone_chat_message_cbs_set_user_data (LinphoneChatMessageCbs *cbs, void cbs->userData = ud; } -LinphoneChatMessageCbsMsgStateChangedCb -linphone_chat_message_cbs_get_msg_state_changed(const LinphoneChatMessageCbs *cbs) { +LinphoneChatMessageCbsMsgStateChangedCb linphone_chat_message_cbs_get_msg_state_changed ( + const LinphoneChatMessageCbs *cbs +) { return cbs->msg_state_changed; } -void linphone_chat_message_cbs_set_msg_state_changed(LinphoneChatMessageCbs *cbs, - LinphoneChatMessageCbsMsgStateChangedCb cb) { +void linphone_chat_message_cbs_set_msg_state_changed ( + LinphoneChatMessageCbs *cbs, + LinphoneChatMessageCbsMsgStateChangedCb cb +) { cbs->msg_state_changed = cb; } -LinphoneChatMessageCbsFileTransferRecvCb linphone_chat_message_cbs_get_file_transfer_recv(const LinphoneChatMessageCbs *cbs) { +LinphoneChatMessageCbsFileTransferRecvCb linphone_chat_message_cbs_get_file_transfer_recv ( + const LinphoneChatMessageCbs *cbs +) { return cbs->file_transfer_recv; } -void linphone_chat_message_cbs_set_file_transfer_recv(LinphoneChatMessageCbs *cbs, - LinphoneChatMessageCbsFileTransferRecvCb cb) { +void linphone_chat_message_cbs_set_file_transfer_recv ( + LinphoneChatMessageCbs *cbs, + LinphoneChatMessageCbsFileTransferRecvCb cb +) { cbs->file_transfer_recv = cb; } -LinphoneChatMessageCbsFileTransferSendCb linphone_chat_message_cbs_get_file_transfer_send(const LinphoneChatMessageCbs *cbs) { +LinphoneChatMessageCbsFileTransferSendCb linphone_chat_message_cbs_get_file_transfer_send ( + const LinphoneChatMessageCbs *cbs +) { return cbs->file_transfer_send; } -void linphone_chat_message_cbs_set_file_transfer_send(LinphoneChatMessageCbs *cbs, - LinphoneChatMessageCbsFileTransferSendCb cb) { +void linphone_chat_message_cbs_set_file_transfer_send ( + LinphoneChatMessageCbs *cbs, + LinphoneChatMessageCbsFileTransferSendCb cb +) { cbs->file_transfer_send = cb; } -LinphoneChatMessageCbsFileTransferProgressIndicationCb -linphone_chat_message_cbs_get_file_transfer_progress_indication(const LinphoneChatMessageCbs *cbs) { +LinphoneChatMessageCbsFileTransferProgressIndicationCb linphone_chat_message_cbs_get_file_transfer_progress_indication ( + const LinphoneChatMessageCbs *cbs +) { return cbs->file_transfer_progress_indication; } -void linphone_chat_message_cbs_set_file_transfer_progress_indication( - LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferProgressIndicationCb cb) { +void linphone_chat_message_cbs_set_file_transfer_progress_indication ( + LinphoneChatMessageCbs *cbs, + LinphoneChatMessageCbsFileTransferProgressIndicationCb cb +) { cbs->file_transfer_progress_indication = cb; } + +LinphoneChatMessageCbsParticipantImdnStateChangedCb linphone_chat_message_cbs_get_participant_imdn_state_changed ( + const LinphoneChatMessageCbs *cbs +) { + return cbs->participant_imdn_state_changed; +} + +void linphone_chat_message_cbs_set_participant_imdn_state_changed ( + LinphoneChatMessageCbs *cbs, + LinphoneChatMessageCbsParticipantImdnStateChangedCb cb +) { + cbs->participant_imdn_state_changed = cb; +} diff --git a/src/c-wrapper/api/c-participant-imdn-state.cpp b/src/c-wrapper/api/c-participant-imdn-state.cpp index 2f3a906d2..85dc5e74a 100644 --- a/src/c-wrapper/api/c-participant-imdn-state.cpp +++ b/src/c-wrapper/api/c-participant-imdn-state.cpp @@ -57,3 +57,7 @@ LinphoneChatMessageState linphone_participant_imdn_state_get_state (const Linpho time_t linphone_participant_imdn_state_get_state_change_time (const LinphoneParticipantImdnState *state) { return L_GET_CPP_PTR_FROM_C_OBJECT(state)->getStateChangeTime(); } + +const LinphoneParticipantImdnState *_linphone_participant_imdn_state_from_cpp_obj (const LinphonePrivate::ParticipantImdnState &state) { + return L_GET_C_BACK_PTR(&state); +} \ No newline at end of file diff --git a/src/chat/chat-message/chat-message.cpp b/src/chat/chat-message/chat-message.cpp index bd3c20c8b..8c21e25c7 100644 --- a/src/chat/chat-message/chat-message.cpp +++ b/src/chat/chat-message/chat-message.cpp @@ -106,6 +106,16 @@ void ChatMessagePrivate::setParticipantState (const IdentityAddress &participant << Utils::toString(newState); mainDb->setChatMessageParticipantState(eventLog, participantAddress, newState, stateChangeTime); + LinphoneChatMessage *msg = L_GET_C_BACK_PTR(q); + LinphoneChatMessageCbs *cbs = linphone_chat_message_get_callbacks(msg); + if (cbs && linphone_chat_message_cbs_get_participant_imdn_state_changed(cbs)) { + auto participant = q->getChatRoom()->findParticipant(participantAddress); + ParticipantImdnState imdnState(participant, newState, stateChangeTime); + linphone_chat_message_cbs_get_participant_imdn_state_changed(cbs)(msg, + _linphone_participant_imdn_state_from_cpp_obj(imdnState) + ); + } + if (linphone_config_get_bool(linphone_core_get_config(q->getChatRoom()->getCore()->getCCore()), "misc", "enable_simple_group_chat_message_state", FALSE ) From 88a55217832dfd0ca3f8be98a656646e2136190f Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 11 Apr 2018 16:04:06 +0200 Subject: [PATCH 099/121] Fix build. --- src/c-wrapper/internal/c-sal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/c-wrapper/internal/c-sal.cpp b/src/c-wrapper/internal/c-sal.cpp index e03b84188..ac0260208 100644 --- a/src/c-wrapper/internal/c-sal.cpp +++ b/src/c-wrapper/internal/c-sal.cpp @@ -889,7 +889,7 @@ static int line_get_value(const char *input, const char *key, char *value, size_ size_t len; if (!end) len = strlen(input); - else len = end + 1 - input; + else len = (size_t)(end + 1 - input); *read = len; strncpy(line, input, MIN(len, sizeof(line))); From e9f857c731c6c37b8cbafd8ac6ba09ec895ae25c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Wed, 11 Apr 2018 16:12:20 +0200 Subject: [PATCH 100/121] Fixes build when ENABLE_SQLITE_STORAGE=NO --- tester/message_tester.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tester/message_tester.c b/tester/message_tester.c index 396f4b9c4..84949db73 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -41,12 +41,14 @@ static char* message_external_body_url=NULL; +#ifdef SQLITE_STORAGE_ENABLED /* sql cache creation string, contains 3 string to be inserted : selfuri/selfuri/peeruri */ static const char *marie_zid_sqlcache = "BEGIN TRANSACTION; CREATE TABLE IF NOT EXISTS ziduri (zuid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,zid BLOB NOT NULL DEFAULT '000000000000',selfuri TEXT NOT NULL DEFAULT 'unset',peeruri TEXT NOT NULL DEFAULT 'unset'); INSERT INTO `ziduri` (zuid,zid,selfuri,peeruri) VALUES (1,X'4ddc8042bee500ad0366bf93','%s','self'), (2,X'bcb4028bf55e1b7ac4c4edee','%s','%s'); CREATE TABLE IF NOT EXISTS zrtp (zuid INTEGER NOT NULL DEFAULT 0 UNIQUE,rs1 BLOB DEFAULT NULL,rs2 BLOB DEFAULT NULL,aux BLOB DEFAULT NULL,pbx BLOB DEFAULT NULL,pvs BLOB DEFAULT NULL,FOREIGN KEY(zuid) REFERENCES ziduri(zuid) ON UPDATE CASCADE ON DELETE CASCADE); INSERT INTO `zrtp` (zuid,rs1,rs2,aux,pbx,pvs) VALUES (2,X'f0e0ad4d3d4217ba4048d1553e5ab26fae0b386cdac603f29a66d5f4258e14ef',NULL,NULL,NULL,X'01'); CREATE TABLE IF NOT EXISTS lime (zuid INTEGER NOT NULL DEFAULT 0 UNIQUE,sndKey BLOB DEFAULT NULL,rcvKey BLOB DEFAULT NULL,sndSId BLOB DEFAULT NULL,rcvSId BLOB DEFAULT NULL,sndIndex BLOB DEFAULT NULL,rcvIndex BLOB DEFAULT NULL,valid BLOB DEFAULT NULL,FOREIGN KEY(zuid) REFERENCES ziduri(zuid) ON UPDATE CASCADE ON DELETE CASCADE); INSERT INTO `lime` (zuid,sndKey,rcvKey,sndSId,rcvSId,sndIndex,rcvIndex,valid) VALUES (2,X'97c75a5a92a041b415296beec268efc3373ef4aa8b3d5f301ac7522a7fb4e332',x'3b74b709b961e5ebccb1db6b850ea8c1f490546d6adee2f66b5def7093cead3d',X'e2ebca22ad33071bc37631393bf25fc0a9badeea7bf6dcbcb5d480be7ff8c5ea',X'a2086d195344ec2997bf3de7441d261041cda5d90ed0a0411ab2032e5860ea48',X'33376935',X'7ce32d86',X'0000000000000000'); COMMIT;"; static const char *pauline_zid_sqlcache = "BEGIN TRANSACTION; CREATE TABLE IF NOT EXISTS ziduri (zuid INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,zid BLOB NOT NULL DEFAULT '000000000000',selfuri TEXT NOT NULL DEFAULT 'unset',peeruri TEXT NOT NULL DEFAULT 'unset'); INSERT INTO `ziduri` (zuid,zid,selfuri,peeruri) VALUES (1,X'bcb4028bf55e1b7ac4c4edee','%s','self'), (2,X'4ddc8042bee500ad0366bf93','%s','%s'); CREATE TABLE IF NOT EXISTS zrtp (zuid INTEGER NOT NULL DEFAULT 0 UNIQUE,rs1 BLOB DEFAULT NULL,rs2 BLOB DEFAULT NULL,aux BLOB DEFAULT NULL,pbx BLOB DEFAULT NULL,pvs BLOB DEFAULT NULL,FOREIGN KEY(zuid) REFERENCES ziduri(zuid) ON UPDATE CASCADE ON DELETE CASCADE); INSERT INTO `zrtp` (zuid,rs1,rs2,aux,pbx,pvs) VALUES (2,X'f0e0ad4d3d4217ba4048d1553e5ab26fae0b386cdac603f29a66d5f4258e14ef',NULL,NULL,NULL,X'01'); CREATE TABLE IF NOT EXISTS lime (zuid INTEGER NOT NULL DEFAULT 0 UNIQUE,sndKey BLOB DEFAULT NULL,rcvKey BLOB DEFAULT NULL,sndSId BLOB DEFAULT NULL,rcvSId BLOB DEFAULT NULL,sndIndex BLOB DEFAULT NULL,rcvIndex BLOB DEFAULT NULL,valid BLOB DEFAULT NULL,FOREIGN KEY(zuid) REFERENCES ziduri(zuid) ON UPDATE CASCADE ON DELETE CASCADE); INSERT INTO `lime` (zuid,rcvKey,sndKey,rcvSId,sndSId,rcvIndex,sndIndex,valid) VALUES (2,X'97c75a5a92a041b415296beec268efc3373ef4aa8b3d5f301ac7522a7fb4e332',x'3b74b709b961e5ebccb1db6b850ea8c1f490546d6adee2f66b5def7093cead3d',X'e2ebca22ad33071bc37631393bf25fc0a9badeea7bf6dcbcb5d480be7ff8c5ea',X'a2086d195344ec2997bf3de7441d261041cda5d90ed0a0411ab2032e5860ea48',X'33376935',X'7ce32d86',X'0000000000000000'); COMMIT;"; static const char *xmlCacheMigration = "\n00112233445566778899aabb99887766554433221100ffeec4274f13a2b6fa05c15ec93158f930e7264b0a893393376dbc80c6eb1cccdc5asip:bob@sip.linphone.org219d9e445d10d4ed64083c7ccbb83a23bc17a97df0af5de4261f3fe026b05b0b747e72a5cc996413cb9fa6e3d18d8b370436e274cd6ba4efc1a4580340af57cadf2bf38e719fa89e17332cf8d5e774ee70d347baa74d16dee01f306c54789869928ce78b0bfc30427a02b1b668b2b3b0496d5664d7e89b75ed292ee97e3fc850496bcc8959337abe5dda11f388384b349d210612f30824268a3753a7afa52ef6df5866dca76315c4sip:bob2@sip.linphone.orgffeeddccbbaa987654321012858b495dfad483af3c088f26d68c4beebc638bd44feae45aea726a771727235esip:bob@sip.linphone.orgb6aac945057bc4466bfe9a23771c6a1b3b8d72ec3e7d8f30ed63cbc5a9479a25bea5ac3225edd0545b816f061a8190370e3ee5160e75404846a34d1580e0c26317ce70fdf12e500294bcb5f2ffef53096761bb1c912b21e972ae03a5a9f05c477e13a20e15a517700f0be0921f74b96d4b4a0c539d5e14d5cdd8706441874ac075e18caa2cfbbf061533dee20c8116dc2c282cae9adfea689b87bc4c6a4e18a846f12e3e7fea39590987654321fedcba5a5a5a5acb6ecc87d1dd87b23f225eec53a26fc541384917623e0c46abab8c0350c6929e92bb03988e8f0ccfefa37a55fd7c5893bea3bfbb27312f49dd9b10d0e3c15fc72315705a5830b98f68458fcd49623144cb34a667512c4d44686aee125bb8b62294c56eea0dd829379263b6da3f6ac0a95388090f168a3568736ca0bd9f8d595fc319ae0d41183fec90afc412d42253c5b456580f7a463c111c7293623b8631f4sip:bob@sip.linphone.org2c46ddcc15f5779e0000000058f095bf01"; +#endif // SQLITE_STORAGE_ENABLED void message_received(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage* msg) { char* from=linphone_address_as_string(linphone_chat_message_get_from_address(msg)); @@ -1179,7 +1181,6 @@ static void imdn_notifications_with_lime(void) { static void im_notification_policy_with_lime(void) { _im_notification_policy(TRUE); } -#endif static void _im_error_delivery_notification(bool_t online) { LinphoneChatRoom *chat_room; @@ -1252,7 +1253,6 @@ static void im_error_delivery_notification_offline(void) { _im_error_delivery_notification(FALSE); } -#ifdef SQLITE_STORAGE_ENABLED static void lime_text_message(void) { LinphoneChatRoom* chat_room; LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); From 701685a9fca6b420861d1917cbadffae6daee71e Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 11 Apr 2018 17:26:20 +0200 Subject: [PATCH 101/121] Fix db management version (do not go backward) --- src/db/main-db.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp index afd1b42ff..f982643d2 100644 --- a/src/db/main-db.cpp +++ b/src/db/main-db.cpp @@ -968,7 +968,7 @@ unsigned int MainDbPrivate::getModuleVersion (const string &name) { void MainDbPrivate::updateModuleVersion (const string &name, unsigned int version) { unsigned int oldVersion = getModuleVersion(name); - if (oldVersion == version) + if (version <= oldVersion) return; soci::session *session = dbSession.getBackendSession(); From 1a2e1206789fc1383c757592ce52537dd65ad453 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Thu, 12 Apr 2018 10:27:19 +0200 Subject: [PATCH 102/121] play call_error_tone on play_sndcard instead of ring_sndcard --- coreapi/linphonecore.c | 45 ++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 8be7a24c4..e6f98fa9b 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2285,7 +2285,7 @@ static void linphone_core_init(LinphoneCore * lc, LinphoneCoreCbs *cbs, LpConfig lc->vcard_context = linphone_vcard_context_new(); linphone_core_initialize_supported_content_types(lc); lc->bw_controller = ms_bandwidth_controller_new(); - + getPlatformHelpers(lc)->setDnsServers(); LinphoneFriendList *list = linphone_core_create_friend_list(lc); @@ -5554,7 +5554,7 @@ typedef enum{ LinphoneLocalPlayer }LinphoneAudioResourceType; -static MSFilter *get_audio_resource(LinphoneCore *lc, LinphoneAudioResourceType rtype){ +static MSFilter *get_audio_resource(LinphoneCore *lc, LinphoneAudioResourceType rtype, MSSndCard *card) { LinphoneCall *call=linphone_core_get_current_call(lc); AudioStream *stream=NULL; RingStream *ringstream; @@ -5568,9 +5568,17 @@ static MSFilter *get_audio_resource(LinphoneCore *lc, LinphoneAudioResourceType if (rtype==LinphoneLocalPlayer) return stream->local_player; return NULL; } - if (lc->ringstream==NULL){ + if (card || lc->ringstream == NULL) { + if (lc->ringstream) + ring_stop(lc->ringstream); + float amp=lp_config_get_float(lc->config,"sound","dtmf_player_amp",0.1f); - MSSndCard *ringcard=lc->sound_conf.lsd_card ?lc->sound_conf.lsd_card : lc->sound_conf.ring_sndcard; + MSSndCard *ringcard=lc->sound_conf.lsd_card + ? lc->sound_conf.lsd_card + : card + ? card + : lc->sound_conf.ring_sndcard; + if (ringcard == NULL) return NULL; @@ -5587,12 +5595,15 @@ static MSFilter *get_audio_resource(LinphoneCore *lc, LinphoneAudioResourceType return NULL; } -static MSFilter *get_dtmf_gen(LinphoneCore *lc){ - return get_audio_resource(lc,LinphoneToneGenerator); +static MSFilter *get_dtmf_gen(LinphoneCore *lc, MSSndCard *card) { + return get_audio_resource(lc,LinphoneToneGenerator, card); } void linphone_core_play_dtmf(LinphoneCore *lc, char dtmf, int duration_ms){ - MSFilter *f=get_dtmf_gen(lc); + MSSndCard *card = linphone_core_in_call(lc) + ? lc->sound_conf.play_sndcard + : lc->sound_conf.ring_sndcard; + MSFilter *f=get_dtmf_gen(lc, card); if (f==NULL){ ms_error("No dtmf generator at this time !"); return; @@ -5603,8 +5614,8 @@ void linphone_core_play_dtmf(LinphoneCore *lc, char dtmf, int duration_ms){ else ms_filter_call_method(f, MS_DTMF_GEN_START, &dtmf); } -LinphoneStatus linphone_core_play_local(LinphoneCore *lc, const char *audiofile){ - MSFilter *f=get_audio_resource(lc,LinphoneLocalPlayer); +LinphoneStatus _linphone_core_play_local(LinphoneCore *lc, const char *audiofile, MSSndCard *card) { + MSFilter *f=get_audio_resource(lc,LinphoneLocalPlayer, card); int loopms=-1; if (!f) return -1; ms_filter_call_method(f,MS_PLAYER_SET_LOOP,&loopms); @@ -5615,11 +5626,15 @@ LinphoneStatus linphone_core_play_local(LinphoneCore *lc, const char *audiofile) return 0; } +LinphoneStatus linphone_core_play_local(LinphoneCore *lc, const char *audiofile) { + return _linphone_core_play_local(lc, audiofile, NULL); +} + void linphone_core_play_named_tone(LinphoneCore *lc, LinphoneToneID toneid){ if (linphone_core_tone_indications_enabled(lc)){ const char *audiofile=linphone_core_get_tone_file(lc,toneid); if (!audiofile){ - MSFilter *f=get_dtmf_gen(lc); + MSFilter *f=get_dtmf_gen(lc, lc->sound_conf.play_sndcard); MSDtmfGenCustomTone def; if (f==NULL){ ms_error("No dtmf generator at this time !"); @@ -5655,7 +5670,7 @@ void linphone_core_play_named_tone(LinphoneCore *lc, LinphoneToneID toneid){ if (def.duration>0) ms_filter_call_method(f, MS_DTMF_GEN_PLAY_CUSTOM,&def); }else{ - linphone_core_play_local(lc,audiofile); + _linphone_core_play_local(lc,audiofile, lc->sound_conf.play_sndcard); } } } @@ -5665,16 +5680,16 @@ void linphone_core_play_call_error_tone(LinphoneCore *lc, LinphoneReason reason) LinphoneToneDescription *tone=linphone_core_get_call_error_tone(lc,reason); if (tone){ if (tone->audiofile){ - linphone_core_play_local(lc,tone->audiofile); + _linphone_core_play_local(lc, tone->audiofile, lc->sound_conf.play_sndcard); }else if (tone->toneid != LinphoneToneUndefined){ - linphone_core_play_named_tone(lc,tone->toneid); + linphone_core_play_named_tone(lc, tone->toneid); } } } } void linphone_core_stop_dtmf(LinphoneCore *lc){ - MSFilter *f=get_dtmf_gen(lc); + MSFilter *f=get_dtmf_gen(lc, NULL); if (f!=NULL) ms_filter_call_method_noarg (f, MS_DTMF_GEN_STOP); } @@ -6319,7 +6334,7 @@ bool_t linphone_core_keep_alive_enabled(LinphoneCore* lc) { } void linphone_core_start_dtmf_stream(LinphoneCore* lc) { - get_dtmf_gen(lc); /*make sure ring stream is started*/ + get_dtmf_gen(lc, lc->sound_conf.ring_sndcard); /*make sure ring stream is started*/ lc->ringstream_autorelease=FALSE; /*disable autorelease mode*/ } From fa40c4324b4ea4b89dbc663a069a74c18b0bd6e2 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Thu, 16 Nov 2017 11:43:14 +0100 Subject: [PATCH 103/121] Not setting dns automatically in core if an app has set it --- coreapi/linphonecore.c | 9 +++++ coreapi/linphonecore_jni.cc | 6 ++-- coreapi/private.h | 1 - coreapi/private_structs.h | 1 + include/linphone/core.h | 36 ++++++++++++++----- .../android-platform-helpers.cpp | 2 +- 6 files changed, 42 insertions(+), 13 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index e6f98fa9b..c32a6ce22 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1861,6 +1861,15 @@ int linphone_core_get_sip_transport_timeout(LinphoneCore *lc) { return lc->sal->get_transport_timeout(); } +bool_t linphone_core_get_dns_set_by_app(LinphoneCore *lc) { + return lc->dns_set_by_app; +} + +void linphone_core_set_dns_servers_app(LinphoneCore *lc, const bctbx_list_t *servers){ + lc->dns_set_by_app = (servers != NULL); + linphone_core_set_dns_servers(lc, servers); +} + void linphone_core_set_dns_servers(LinphoneCore *lc, const bctbx_list_t *servers){ lc->sal->set_dns_servers(servers); } diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 81658c4b2..c38b55f3c 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -4909,7 +4909,7 @@ extern "C" void Java_org_linphone_core_LinphoneChatRoomImpl_sendChatMessage(JNIE ,jlong chatroom_ptr ,jobject message ,jlong messagePtr) { - + linphone_chat_room_send_chat_message_2((LinphoneChatRoom*)chatroom_ptr, (LinphoneChatMessage*)messagePtr); } @@ -7693,7 +7693,7 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setDnsServers(JNIEnv *e } } } - linphone_core_set_dns_servers((LinphoneCore*)lc, l); + linphone_core_set_dns_servers_app((LinphoneCore*)lc, l); bctbx_list_free_with_data(l, ms_free); } @@ -7792,7 +7792,7 @@ JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCallImpl_setListener(JNIEn linphone_call_cbs_set_user_data(cbs, env->NewWeakGlobalRef(jlistener)); linphone_call_cbs_set_tmmbr_received(cbs, _on_tmmbr_received); linphone_call_add_callbacks(call, cbs); - + linphone_call_set_next_video_frame_decoded_callback(call, _next_video_frame_decoded_callback, env->NewWeakGlobalRef(jlistener)); } diff --git a/coreapi/private.h b/coreapi/private.h index 37d433c90..bc33c4184 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -127,7 +127,6 @@ #define STRING_SET(field, value) do{ if (field){bctbx_free(field);field=NULL;}; field=bctbx_strdup(value); }while(0) #define STRING_TRANSFER(field, newvalue) do{ if (field){bctbx_free(field);field=NULL;}; field=newvalue; }while(0) - #ifdef __cplusplus #define getPlatformHelpers(lc) static_cast(lc->platform_helper) #endif diff --git a/coreapi/private_structs.h b/coreapi/private_structs.h index 3bcfc4d78..0b68e7c8b 100644 --- a/coreapi/private_structs.h +++ b/coreapi/private_structs.h @@ -822,6 +822,7 @@ namespace LinphonePrivate { char *update_check_current_version; \ bctbx_list_t *chat_rooms; \ bctbx_list_t *callsCache; \ + bool_t dns_set_by_app; \ #ifdef SQLITE_STORAGE_ENABLED #define LINPHONE_CORE_STRUCT_FIELDS \ diff --git a/include/linphone/core.h b/include/linphone/core.h index c8e876c6a..4856a5177 100644 --- a/include/linphone/core.h +++ b/include/linphone/core.h @@ -183,8 +183,7 @@ typedef struct _LinphoneCoreVTable{ LinphoneCoreSubscriptionStateChangedCb subscription_state_changed; /** Date: Thu, 12 Apr 2018 11:47:14 +0200 Subject: [PATCH 104/121] Revert "Revert "Merge branch 'dev_content_cpp' into dev_refactor_cpp"" This reverts commit 2686dca63a47a21ee075d23b5b2179ee6fc2e92f. --- coreapi/CMakeLists.txt | 1 - coreapi/Makefile.am | 1 - coreapi/bellesip_sal/sal_impl.c | 32 ++ coreapi/callbacks.c | 3 +- coreapi/content.c | 243 ------------- coreapi/friendlist.c | 3 +- coreapi/info.c | 1 + coreapi/lime.c | 9 +- coreapi/linphonecore.c | 4 +- coreapi/private_structs.h | 11 - coreapi/proxy.c | 1 + coreapi/quality_reporting.c | 2 + include/CMakeLists.txt | 2 +- include/linphone/Makefile.am | 1 - include/linphone/api/c-api.h | 7 +- include/linphone/api/c-chat-room.h | 2 +- .../linphone/{content.h => api/c-content.h} | 62 ++-- include/linphone/api/c-types.h | 6 + include/linphone/core.h | 1 - include/linphone/types.h | 6 - src/CMakeLists.txt | 6 + src/c-wrapper/api/c-chat-message.cpp | 7 +- src/c-wrapper/api/c-chat-room.cpp | 4 +- src/c-wrapper/api/c-content.cpp | 331 ++++++++++++++++++ src/c-wrapper/c-wrapper.h | 2 +- src/c-wrapper/internal/c-sal.h | 5 + src/chat/chat-message/chat-message-p.h | 8 +- src/chat/chat-message/chat-message.cpp | 77 ++-- src/chat/chat-message/chat-message.h | 6 +- src/chat/chat-room/abstract-chat-room.h | 3 +- src/chat/chat-room/chat-room.cpp | 6 +- src/chat/chat-room/chat-room.h | 3 +- src/chat/chat-room/proxy-chat-room.cpp | 2 +- src/chat/chat-room/proxy-chat-room.h | 3 +- src/chat/cpim/message/cpim-message.cpp | 8 +- .../modifier/cpim-chat-message-modifier.cpp | 2 +- .../file-transfer-chat-message-modifier.cpp | 77 ++-- .../multipart-chat-message-modifier.cpp | 100 +----- .../local-conference-event-handler.cpp | 3 +- src/conference/session/call-session.cpp | 7 +- src/content/content-manager.cpp | 101 ++---- src/content/content-manager.h | 2 +- src/content/content-p.h | 4 +- src/content/content-type.cpp | 73 ++-- src/content/content-type.h | 12 +- src/content/content.cpp | 38 +- src/content/content.h | 11 +- src/content/file-content.cpp | 30 +- src/content/file-content.h | 7 +- src/content/file-transfer-content.cpp | 35 +- src/content/file-transfer-content.h | 11 +- src/content/header/header-p.h | 43 +++ src/content/header/header-param.cpp | 108 ++++++ src/content/header/header-param.h | 61 ++++ src/content/header/header.cpp | 183 ++++++++++ src/content/header/header.h | 74 ++++ src/db/main-db.cpp | 2 +- src/sal/op.cpp | 8 +- tester/CMakeLists.txt | 2 +- ...manager-tester.cpp => contents-tester.cpp} | 172 ++++++++- tester/cpim-tester.cpp | 4 +- tester/eventapi_tester.c | 2 +- tester/liblinphone_tester.h | 2 +- tester/message_tester.c | 8 +- tester/multipart-tester.cpp | 27 +- tester/presence_server_tester.c | 9 +- tester/tester.c | 2 +- 67 files changed, 1407 insertions(+), 682 deletions(-) delete mode 100644 coreapi/content.c rename include/linphone/{content.h => api/c-content.h} (83%) create mode 100644 src/c-wrapper/api/c-content.cpp create mode 100644 src/content/header/header-p.h create mode 100644 src/content/header/header-param.cpp create mode 100644 src/content/header/header-param.h create mode 100644 src/content/header/header.cpp create mode 100644 src/content/header/header.h rename tester/{content-manager-tester.cpp => contents-tester.cpp} (62%) diff --git a/coreapi/CMakeLists.txt b/coreapi/CMakeLists.txt index d1190e83a..521d866a8 100644 --- a/coreapi/CMakeLists.txt +++ b/coreapi/CMakeLists.txt @@ -64,7 +64,6 @@ set(LINPHONE_SOURCE_FILES_C carddav.c chat.c contactprovider.c - content.c dial_plan.c dict.c ec-calibrator.c diff --git a/coreapi/Makefile.am b/coreapi/Makefile.am index 4e63d8879..c2b2ee53b 100644 --- a/coreapi/Makefile.am +++ b/coreapi/Makefile.am @@ -39,7 +39,6 @@ liblinphone_la_SOURCES=\ chat_file_transfer.c \ conference.cc conference_private.h \ contactprovider.c contact_providers_priv.h \ - content.c \ dial_plan.c \ dict.c \ ec-calibrator.c \ diff --git a/coreapi/bellesip_sal/sal_impl.c b/coreapi/bellesip_sal/sal_impl.c index ad11525fb..bdf3683dd 100644 --- a/coreapi/bellesip_sal/sal_impl.c +++ b/coreapi/bellesip_sal/sal_impl.c @@ -348,6 +348,29 @@ void sal_body_handler_set_subtype(SalBodyHandler *body_handler, const char *subt belle_sip_header_content_type_set_subtype(content_type, subtype); } +const belle_sip_list_t * sal_body_handler_get_content_type_parameters_names(const SalBodyHandler *body_handler) { + belle_sip_header_content_type_t *content_type = BELLE_SIP_HEADER_CONTENT_TYPE(sal_body_handler_find_header(body_handler, "Content-Type")); + if (content_type != NULL) { + return belle_sip_parameters_get_parameter_names(BELLE_SIP_PARAMETERS(content_type)); + } + return NULL; +} + +const char * sal_body_handler_get_content_type_parameter(const SalBodyHandler *body_handler, const char *name) { + belle_sip_header_content_type_t *content_type = BELLE_SIP_HEADER_CONTENT_TYPE(sal_body_handler_find_header(body_handler, "Content-Type")); + if (content_type != NULL) { + return belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type), name); + } + return NULL; +} + +void sal_body_handler_set_content_type_parameter(SalBodyHandler *body_handler, const char *paramName, const char *paramValue) { + belle_sip_header_content_type_t *content_type = BELLE_SIP_HEADER_CONTENT_TYPE(sal_body_handler_find_header(body_handler, "Content-Type")); + if (content_type != NULL) { + belle_sip_parameters_set_parameter(BELLE_SIP_PARAMETERS(content_type), paramName, paramValue); + } +} + const char * sal_body_handler_get_encoding(const SalBodyHandler *body_handler) { belle_sip_header_t *content_encoding = sal_body_handler_find_header(body_handler, "Content-Encoding"); if (content_encoding != NULL) { @@ -396,6 +419,11 @@ SalBodyHandler * sal_body_handler_get_part(const SalBodyHandler *body_handler, i return (SalBodyHandler *)belle_sip_list_nth_data(l, idx); } +const belle_sip_list_t * sal_body_handler_get_parts(const SalBodyHandler *body_handler) { + if (!sal_body_handler_is_multipart(body_handler)) return NULL; + return belle_sip_multipart_body_handler_get_parts(BELLE_SIP_MULTIPART_BODY_HANDLER(body_handler)); +} + SalBodyHandler * sal_body_handler_find_part_by_header(const SalBodyHandler *body_handler, const char *header_name, const char *header_value) { const belle_sip_list_t *l = belle_sip_multipart_body_handler_get_parts(BELLE_SIP_MULTIPART_BODY_HANDLER(body_handler)); for (; l != NULL; l = l->next) { @@ -418,3 +446,7 @@ const char * sal_body_handler_get_header(const SalBodyHandler *body_handler, con } return NULL; } + +const belle_sip_list_t* sal_body_handler_get_headers(const SalBodyHandler *body_handler) { + return belle_sip_body_handler_get_headers(BELLE_SIP_BODY_HANDLER(body_handler)); +} diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index dd85c26a0..bb6919d81 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -17,14 +17,15 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ - #include "c-wrapper/internal/c-sal.h" #include "sal/call-op.h" #include "sal/message-op.h" #include "sal/refer-op.h" +#include "linphone/api/c-content.h" #include "linphone/core.h" #include "linphone/utils/utils.h" + #include "private.h" #include "mediastreamer2/mediastream.h" #include "linphone/lpconfig.h" diff --git a/coreapi/content.c b/coreapi/content.c deleted file mode 100644 index 8d20964bd..000000000 --- a/coreapi/content.c +++ /dev/null @@ -1,243 +0,0 @@ -/* -linphone -Copyright (C) 2010-2014 Belledonne Communications SARL - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#include "linphone/core.h" - -#include "c-wrapper/c-wrapper.h" - -// TODO: From coreapi. Remove me later. -#include "private.h" - -static void linphone_content_set_sal_body_handler(LinphoneContent *content, SalBodyHandler *body_handler) { - if (content->body_handler != NULL) { - sal_body_handler_unref(content->body_handler); - content->body_handler = NULL; - } - content->body_handler = sal_body_handler_ref(body_handler); -} - -static LinphoneContent * linphone_content_new_with_body_handler(SalBodyHandler *body_handler) { - LinphoneContent *content = belle_sip_object_new(LinphoneContent); - belle_sip_object_ref(content); - content->owned_fields = TRUE; - content->cryptoContext = NULL; /* this field is managed externally by encryption/decryption functions so be careful to initialise it to NULL */ - if (body_handler == NULL) { - linphone_content_set_sal_body_handler(content, sal_body_handler_new()); - } else { - linphone_content_set_sal_body_handler(content, body_handler); - } - return content; -} - -static void linphone_content_destroy(LinphoneContent *content) { - if (content->owned_fields == TRUE) { - if (content->body_handler) sal_body_handler_unref(content->body_handler); - if (content->name) belle_sip_free(content->name); - if (content->key) belle_sip_free(content->key); - /* note : crypto context is allocated/destroyed by the encryption function */ - } -} - -static void linphone_content_clone(LinphoneContent *obj, const LinphoneContent *ref) { - obj->owned_fields = TRUE; - linphone_content_set_sal_body_handler(obj, sal_body_handler_new()); - if ((linphone_content_get_type(ref) != NULL) || (linphone_content_get_subtype(ref) != NULL)) { - linphone_content_set_type(obj, linphone_content_get_type(ref)); - linphone_content_set_subtype(obj, linphone_content_get_subtype(ref)); - } - if (linphone_content_get_encoding(ref) != NULL) { - linphone_content_set_encoding(obj, linphone_content_get_encoding(ref)); - } - linphone_content_set_name(obj, linphone_content_get_name(ref)); - linphone_content_set_key(obj, linphone_content_get_key(ref), linphone_content_get_key_size(ref)); - if (linphone_content_get_buffer(ref) != NULL) { - linphone_content_set_buffer(obj, linphone_content_get_buffer(ref), linphone_content_get_size(ref)); - } else { - linphone_content_set_size(obj, linphone_content_get_size(ref)); - } -} - - -BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneContent); - -BELLE_SIP_INSTANCIATE_VPTR(LinphoneContent, belle_sip_object_t, - (belle_sip_object_destroy_t)linphone_content_destroy, - (belle_sip_object_clone_t)linphone_content_clone, - NULL, // marshal - TRUE -); - - -LinphoneContent * linphone_core_create_content(LinphoneCore *lc) { - return linphone_content_new(); -} - -LinphoneContent * linphone_content_ref(LinphoneContent *content) { - belle_sip_object_ref(content); - return content; -} - -void linphone_content_unref(LinphoneContent *content) { - belle_sip_object_unref(content); -} - -void *linphone_content_get_user_data(const LinphoneContent *content) { - return content->user_data; -} - -void linphone_content_set_user_data(LinphoneContent *content, void *ud) { - content->user_data = ud; -} - -const char * linphone_content_get_type(const LinphoneContent *content) { - return sal_body_handler_get_type(content->body_handler); -} - -void linphone_content_set_type(LinphoneContent *content, const char *type) { - sal_body_handler_set_type(content->body_handler, type); -} - -const char * linphone_content_get_subtype(const LinphoneContent *content) { - return sal_body_handler_get_subtype(content->body_handler); -} - -void linphone_content_set_subtype(LinphoneContent *content, const char *subtype) { - sal_body_handler_set_subtype(content->body_handler, subtype); -} - -uint8_t * linphone_content_get_buffer(const LinphoneContent *content) { - return (uint8_t *)sal_body_handler_get_data(content->body_handler); -} - -void linphone_content_set_buffer(LinphoneContent *content, const uint8_t *buffer, size_t size) { - void *data; - sal_body_handler_set_size(content->body_handler, size); - data = belle_sip_malloc(size + 1); - memcpy(data, buffer, size); - ((char *)data)[size] = '\0'; - sal_body_handler_set_data(content->body_handler, data); -} - -const char * linphone_content_get_string_buffer(const LinphoneContent *content) { - return (const char *)linphone_content_get_buffer(content); -} - -void linphone_content_set_string_buffer(LinphoneContent *content, const char *buffer) { - sal_body_handler_set_size(content->body_handler, strlen(buffer)); - sal_body_handler_set_data(content->body_handler, belle_sip_strdup(buffer)); -} - -size_t linphone_content_get_size(const LinphoneContent *content) { - return sal_body_handler_get_size(content->body_handler); -} - -void linphone_content_set_size(LinphoneContent *content, size_t size) { - sal_body_handler_set_size(content->body_handler, size); -} - -const char * linphone_content_get_encoding(const LinphoneContent *content) { - return sal_body_handler_get_encoding(content->body_handler); -} - -void linphone_content_set_encoding(LinphoneContent *content, const char *encoding) { - sal_body_handler_set_encoding(content->body_handler, encoding); -} - -const char * linphone_content_get_name(const LinphoneContent *content) { - return content->name; -} - -void linphone_content_set_name(LinphoneContent *content, const char *name) { - if (content->name != NULL) { - belle_sip_free(content->name); - content->name = NULL; - } - if (name != NULL) { - content->name = belle_sip_strdup(name); - } -} - -size_t linphone_content_get_key_size(const LinphoneContent *content) { - return content->keyLength; -} - -const char * linphone_content_get_key(const LinphoneContent *content) { - return content->key; -} - -void linphone_content_set_key(LinphoneContent *content, const char *key, const size_t keyLength) { - if (content->key != NULL) { - belle_sip_free(content->key); - content->key = NULL; - } - if (key != NULL) { - content->key = reinterpret_cast(belle_sip_malloc(keyLength + 1)); - memcpy(content->key, key, keyLength); - content->key[keyLength] = '\0'; - content->keyLength = keyLength; - } -} - -/* crypto context is managed(allocated/freed) by the encryption function, so provide the address of field in the private structure */ -void ** linphone_content_get_cryptoContext_address(LinphoneContent *content) { - return &(content->cryptoContext); -} - -bool_t linphone_content_is_multipart(const LinphoneContent *content) { - return sal_body_handler_is_multipart(content->body_handler); -} - -LinphoneContent * linphone_content_get_part(const LinphoneContent *content, int idx) { - SalBodyHandler *part_body_handler; - if (!linphone_content_is_multipart(content)) return NULL; - part_body_handler = sal_body_handler_get_part(content->body_handler, idx); - return linphone_content_from_sal_body_handler(part_body_handler); -} - -LinphoneContent * linphone_content_find_part_by_header(const LinphoneContent *content, const char *header_name, const char *header_value) { - SalBodyHandler *part_body_handler; - if (!linphone_content_is_multipart(content)) return NULL; - part_body_handler = sal_body_handler_find_part_by_header(content->body_handler, header_name, header_value); - return linphone_content_from_sal_body_handler(part_body_handler); -} - -const char * linphone_content_get_custom_header(const LinphoneContent *content, const char *header_name) { - return sal_body_handler_get_header(content->body_handler, header_name); -} - - -LinphoneContent * linphone_content_new(void) { - return linphone_content_new_with_body_handler(NULL); -} - -LinphoneContent * linphone_content_copy(const LinphoneContent *ref) { - return (LinphoneContent *)belle_sip_object_ref(belle_sip_object_clone(BELLE_SIP_OBJECT(ref))); -} - -LinphoneContent * linphone_content_from_sal_body_handler(SalBodyHandler *body_handler) { - if (body_handler) { - return linphone_content_new_with_body_handler(body_handler); - } - return NULL; -} - -SalBodyHandler * sal_body_handler_from_content(const LinphoneContent *content) { - if (content == NULL) return NULL; - return content->body_handler; -} diff --git a/coreapi/friendlist.c b/coreapi/friendlist.c index 5e9ca2abf..6f196721e 100644 --- a/coreapi/friendlist.c +++ b/coreapi/friendlist.c @@ -19,6 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include +#include "linphone/api/c-content.h" #include "linphone/core.h" #include "c-wrapper/c-wrapper.h" @@ -961,7 +962,7 @@ void linphone_friend_list_notify_presence_received(LinphoneFriendList *list, Lin const char *subtype = linphone_content_get_subtype(body); if ((strcmp(type, "multipart") != 0) || (strcmp(subtype, "related") != 0)) { - ms_warning("multipart presence notified but it is not 'multipart/related'"); + ms_warning("multipart presence notified but it is not 'multipart/related', instead is '%s/%s'", type, subtype); return; } diff --git a/coreapi/info.c b/coreapi/info.c index 5b12089bb..f68bb4522 100644 --- a/coreapi/info.c +++ b/coreapi/info.c @@ -23,6 +23,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "linphone/api/c-content.h" #include "linphone/core.h" #include "linphone/lpconfig.h" diff --git a/coreapi/lime.c b/coreapi/lime.c index 4270f9d2a..cdf697b95 100644 --- a/coreapi/lime.c +++ b/coreapi/lime.c @@ -17,6 +17,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "linphone/api/c-content.h" + #include "lime.h" #ifdef HAVE_CONFIG_H #include "config.h" @@ -419,6 +421,8 @@ int lime_encryptFile(void **cryptoContext, unsigned char *key, size_t length, ch int lime_decryptFile(void **cryptoContext, unsigned char *key, size_t length, char *plain, char *cipher) { bctbx_aes_gcm_context_t *gcmContext; + if (key == NULL) return -1; + if (*cryptoContext == NULL) { /* first call to the function, allocate a crypto context and initialise it */ /* key contains 192bits of key || 64 bits of Initialisation Vector, no additional data */ gcmContext = bctbx_aes_gcm_context_new(key, 24, NULL, 0, key+24, 8, BCTBX_GCM_DECRYPT); @@ -787,8 +791,8 @@ int lime_im_encryption_engine_process_incoming_message_cb(LinphoneImEncryptionEn LinphoneCore *lc = linphone_im_encryption_engine_get_core(engine); int errcode = -1; /* check if we have a xml/cipher message to be decrypted */ - if (linphone_chat_message_get_content_type(msg) && - (strcmp("xml/cipher", linphone_chat_message_get_content_type(msg)) == 0 || + if (linphone_chat_message_get_content_type(msg) && + (strcmp("xml/cipher", linphone_chat_message_get_content_type(msg)) == 0 || strcmp("application/cipher.vnd.gsma.rcs-ft-http+xml", linphone_chat_message_get_content_type(msg)) == 0)) { errcode = 0; int retval; @@ -893,6 +897,7 @@ int lime_im_encryption_engine_process_downloading_file_cb(LinphoneImEncryptionEn LinphoneContent *content = linphone_chat_message_get_file_transfer_information(msg); if (!content) return -1; + if (!linphone_content_get_key(content)) { linphone_content_unref(content); return -1; diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index c32a6ce22..203d77289 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -18,10 +18,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "linphone/api/c-content.h" #include "linphone/core.h" -#include "linphone/sipsetup.h" #include "linphone/lpconfig.h" #include "linphone/logging.h" +#include "linphone/sipsetup.h" + #include "private.h" #include "logging-private.h" #include "quality_reporting.h" diff --git a/coreapi/private_structs.h b/coreapi/private_structs.h index 0b68e7c8b..81dafc688 100644 --- a/coreapi/private_structs.h +++ b/coreapi/private_structs.h @@ -449,17 +449,6 @@ struct _EchoTester { unsigned int rate; }; -struct _LinphoneContent { - belle_sip_object_t base; - void *user_data; - SalBodyHandler *body_handler; - char *name; /**< used by RCS File transfer messages to store the original filename of the file to be downloaded from server */ - char *key; /**< used by RCS File transfer messages to store the key to encrypt file if needed */ - size_t keyLength; /**< Length of key in bytes */ - void *cryptoContext; /**< crypto context used to encrypt file for RCS file transfer */ - bool_t owned_fields; -}; - BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneContent); struct _LinphoneBuffer { diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 03213da1e..b797e1d0b 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -25,6 +25,7 @@ Copyright (C) 2000 Simon MORLAT (simon.morlat@linphone.org) #include "linphone/core.h" #include "linphone/lpconfig.h" #include "linphone/sipsetup.h" + #include "mediastreamer2/mediastream.h" #include "enum.h" diff --git a/coreapi/quality_reporting.c b/coreapi/quality_reporting.c index 571a8faa0..a20b03b8e 100644 --- a/coreapi/quality_reporting.c +++ b/coreapi/quality_reporting.c @@ -21,7 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "config.h" #endif +#include "linphone/api/c-content.h" #include "linphone/core.h" + #include "private.h" #include "c-wrapper/internal/c-sal.h" #include "sal/sal.h" diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index a55154d99..225a6c13e 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -33,7 +33,6 @@ set(ROOT_HEADER_FILES chat.h conference.h contactprovider.h - content.h core_utils.h core.h defs.h @@ -85,6 +84,7 @@ set(C_API_HEADER_FILES c-chat-message.h c-chat-room-cbs.h c-chat-room.h + c-content.h c-dial-plan.h c-event-log.h c-magic-search.h diff --git a/include/linphone/Makefile.am b/include/linphone/Makefile.am index dc9488e0b..56c2c3dda 100644 --- a/include/linphone/Makefile.am +++ b/include/linphone/Makefile.am @@ -14,7 +14,6 @@ linphone_include_HEADERS=\ chat.h \ conference.h \ contactprovider.h \ - content.h \ core.h \ core_utils.h \ defs.h \ diff --git a/include/linphone/api/c-api.h b/include/linphone/api/c-api.h index 54a47fe56..3cae0b5c2 100644 --- a/include/linphone/api/c-api.h +++ b/include/linphone/api/c-api.h @@ -23,14 +23,15 @@ #include "linphone/utils/general.h" #include "linphone/api/c-address.h" -#include "linphone/api/c-call.h" #include "linphone/api/c-call-cbs.h" #include "linphone/api/c-call-stats.h" +#include "linphone/api/c-call.h" #include "linphone/api/c-callbacks.h" -#include "linphone/api/c-chat-message.h" #include "linphone/api/c-chat-message-cbs.h" -#include "linphone/api/c-chat-room.h" +#include "linphone/api/c-chat-message.h" #include "linphone/api/c-chat-room-cbs.h" +#include "linphone/api/c-chat-room.h" +#include "linphone/api/c-content.h" #include "linphone/api/c-dial-plan.h" #include "linphone/api/c-event-log.h" #include "linphone/api/c-participant.h" diff --git a/include/linphone/api/c-chat-room.h b/include/linphone/api/c-chat-room.h index 40def6087..b3a98453c 100644 --- a/include/linphone/api/c-chat-room.h +++ b/include/linphone/api/c-chat-room.h @@ -90,7 +90,7 @@ LINPHONE_PUBLIC LinphoneChatMessage* linphone_chat_room_create_message_2(Linphon * @param initial_content #LinphoneContent initial content. #LinphoneCoreVTable.file_transfer_send is invoked later to notify file transfer progress and collect next chunk of the message if LinphoneContent.data is NULL. * @return a new #LinphoneChatMessage */ -LINPHONE_PUBLIC LinphoneChatMessage* linphone_chat_room_create_file_transfer_message(LinphoneChatRoom *cr, const LinphoneContent* initial_content); +LINPHONE_PUBLIC LinphoneChatMessage* linphone_chat_room_create_file_transfer_message(LinphoneChatRoom *cr, LinphoneContent* initial_content); /** * get peer address \link linphone_core_get_chat_room() associated to \endlink this #LinphoneChatRoom diff --git a/include/linphone/content.h b/include/linphone/api/c-content.h similarity index 83% rename from include/linphone/content.h rename to include/linphone/api/c-content.h index 969d6b9b5..6114875a3 100644 --- a/include/linphone/content.h +++ b/include/linphone/api/c-content.h @@ -1,33 +1,32 @@ /* -content.h -Copyright (C) 2010-2014 Belledonne Communications SARL + * c-content.h + * Copyright (C) 2010-2018 Belledonne Communications SARL + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. +#ifndef _L_C_CONTENT_H_ +#define _L_C_CONTENT_H_ -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ - -#ifndef LINPHONE_CONTENT_H_ -#define LINPHONE_CONTENT_H_ - - -#include "linphone/types.h" +#include "linphone/api/c-types.h" +// ============================================================================= #ifdef __cplusplus -extern "C" { -#endif - + extern "C" { +#endif // ifdef __cplusplus /** * @addtogroup misc @@ -89,6 +88,14 @@ LINPHONE_PUBLIC const char * linphone_content_get_subtype(const LinphoneContent */ LINPHONE_PUBLIC void linphone_content_set_subtype(LinphoneContent *content, const char *subtype); +/** + * Adds a parameter to the ContentType header. + * @param[in] content LinphoneContent object. + * @param[in] name the name of the parameter to add. + * @param[in] value the value of the parameter to add. + */ +LINPHONE_PUBLIC void linphone_content_add_content_type_parameter(LinphoneContent *content, const char *name, const char *value); + /** * Get the content data buffer, usually a string. * @param[in] content #LinphoneContent object. @@ -218,9 +225,8 @@ LINPHONE_PUBLIC void linphone_content_set_key(LinphoneContent *content, const ch * @} */ - #ifdef __cplusplus -} -#endif + } +#endif // ifdef __cplusplus -#endif /* LINPHONE_CONTENT_H_ */ +#endif // ifndef _L_C_CONTENT_H_ \ No newline at end of file diff --git a/include/linphone/api/c-types.h b/include/linphone/api/c-types.h index dbf15b1fd..0e5f8c475 100644 --- a/include/linphone/api/c-types.h +++ b/include/linphone/api/c-types.h @@ -144,6 +144,12 @@ typedef struct _LinphoneEventLog LinphoneEventLog; // Misc. // ----------------------------------------------------------------------------- +/** + * The LinphoneContent object holds data that can be embedded in a signaling message. + * @ingroup misc +**/ +typedef struct _LinphoneContent LinphoneContent; + /** * Represents a dial plan * @ingroup misc diff --git a/include/linphone/core.h b/include/linphone/core.h index 4856a5177..b68a2f362 100644 --- a/include/linphone/core.h +++ b/include/linphone/core.h @@ -42,7 +42,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "linphone/call_stats.h" #include "linphone/chat.h" #include "linphone/conference.h" -#include "linphone/content.h" #include "linphone/dictionary.h" #include "linphone/error_info.h" #include "linphone/event.h" diff --git a/include/linphone/types.h b/include/linphone/types.h index bd408358b..a7ad26c9d 100644 --- a/include/linphone/types.h +++ b/include/linphone/types.h @@ -367,12 +367,6 @@ typedef unsigned int LinphoneContactSearchID; */ LINPHONE_DEPRECATED typedef LinphoneContactSearchID ContactSearchID; -/** - * The #LinphoneContent object holds data that can be embedded in a signaling message. - * @ingroup misc -**/ -typedef struct _LinphoneContent LinphoneContent; - /** * Linphone core main object created by function linphone_core_new() . * @ingroup initializing diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d9a4e79a6..e8f3751eb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -101,6 +101,9 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES content/content.h content/file-content.h content/file-transfer-content.h + content/header/header.h + content/header/header-p.h + content/header/header-param.h core/core-accessor.h core/core-listener.h core/core-p.h @@ -175,6 +178,7 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES c-wrapper/api/c-chat-room-cbs.cpp c-wrapper/api/c-chat-room.cpp c-wrapper/api/c-core.cpp + c-wrapper/api/c-content.cpp c-wrapper/api/c-dial-plan.cpp c-wrapper/api/c-event-log.cpp c-wrapper/api/c-magic-search.cpp @@ -226,6 +230,8 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES content/content.cpp content/file-content.cpp content/file-transfer-content.cpp + content/header/header.cpp + content/header/header-param.cpp core/core-accessor.cpp core/core-call.cpp core/core-chat-room.cpp diff --git a/src/c-wrapper/api/c-chat-message.cpp b/src/c-wrapper/api/c-chat-message.cpp index 4eaafb3ae..a8e8f923f 100644 --- a/src/c-wrapper/api/c-chat-message.cpp +++ b/src/c-wrapper/api/c-chat-message.cpp @@ -18,6 +18,7 @@ */ #include "linphone/api/c-chat-message.h" +#include "linphone/api/c-content.h" #include "linphone/utils/utils.h" #include "linphone/wrapper_utils.h" @@ -229,7 +230,7 @@ void linphone_chat_message_add_text_content(LinphoneChatMessage *msg, const char LinphonePrivate::ContentType contentType = LinphonePrivate::ContentType::PlainText; content->setContentType(contentType); content->setBody(L_C_TO_STRING(c_content)); - L_GET_CPP_PTR_FROM_C_OBJECT(msg)->addContent(*content); + L_GET_CPP_PTR_FROM_C_OBJECT(msg)->addContent(content); } bool_t linphone_chat_message_has_text_content(const LinphoneChatMessage *msg) { @@ -304,7 +305,9 @@ int linphone_chat_message_set_text(LinphoneChatMessage *msg, const char* text) { } LinphoneContent *linphone_chat_message_get_file_transfer_information(LinphoneChatMessage *msg) { - return L_GET_PRIVATE_FROM_C_OBJECT(msg)->getFileTransferInformation(); + const LinphonePrivate::Content *content = L_GET_PRIVATE_FROM_C_OBJECT(msg)->getFileTransferInformation(); + if (content) return L_GET_C_BACK_PTR(content); + return NULL; } // ============================================================================= diff --git a/src/c-wrapper/api/c-chat-room.cpp b/src/c-wrapper/api/c-chat-room.cpp index faf919bee..7bb5b8b03 100644 --- a/src/c-wrapper/api/c-chat-room.cpp +++ b/src/c-wrapper/api/c-chat-room.cpp @@ -355,8 +355,8 @@ const bctbx_list_t *linphone_chat_room_get_composing_addresses (LinphoneChatRoom return cr->composingAddresses; } -LinphoneChatMessage *linphone_chat_room_create_file_transfer_message(LinphoneChatRoom *cr, const LinphoneContent *initial_content) { - shared_ptr cppPtr = L_GET_CPP_PTR_FROM_C_OBJECT(cr)->createFileTransferMessage(initial_content); +LinphoneChatMessage *linphone_chat_room_create_file_transfer_message(LinphoneChatRoom *cr, LinphoneContent *initial_content) { + shared_ptr cppPtr = L_GET_CPP_PTR_FROM_C_OBJECT(cr)->createFileTransferMessage(L_GET_CPP_PTR_FROM_C_OBJECT(initial_content)); LinphoneChatMessage *object = L_INIT(ChatMessage); L_SET_CPP_PTR_FROM_C_OBJECT(object, cppPtr); return object; diff --git a/src/c-wrapper/api/c-content.cpp b/src/c-wrapper/api/c-content.cpp new file mode 100644 index 000000000..580c78ca3 --- /dev/null +++ b/src/c-wrapper/api/c-content.cpp @@ -0,0 +1,331 @@ +/* + * c-content.cpp + * Copyright (C) 2010-2018 Belledonne Communications SARL + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "linphone/api/c-content.h" +#include "linphone/wrapper_utils.h" + +#include "c-wrapper/c-wrapper.h" + +#include "content/content.h" +#include "content/content-type.h" +#include "content/header/header-param.h" +#include "content/header/header.h" +#include "content/content-manager.h" +#include "content/file-content.h" +#include "content/file-transfer-content.h" + +// ============================================================================= + +using namespace std; + +L_DECLARE_C_CLONABLE_OBJECT_IMPL(Content, + void *cryptoContext; /**< crypto context used to encrypt file for RCS file transfer */ + mutable char *name; + mutable char *type; + mutable char *subtype; + mutable char *body; + mutable size_t size; + mutable char *encoding; + mutable char *key; +) + +// ============================================================================= +// Reference and user data handling functions. +// ============================================================================= + +LinphoneContent * linphone_content_ref(LinphoneContent *content) { + belle_sip_object_ref(content); + return content; +} + +void linphone_content_unref(LinphoneContent *content) { + belle_sip_object_unref(content); +} + +void *linphone_content_get_user_data(const LinphoneContent *content) { + return L_GET_USER_DATA_FROM_C_OBJECT(content); +} + +void linphone_content_set_user_data(LinphoneContent *content, void *ud) { + return L_SET_USER_DATA_FROM_C_OBJECT(content, ud); +} + +// ============================================================================= + +const char * linphone_content_get_type(const LinphoneContent *content) { + if (content->type) ms_free(content->type); + content->type = ms_strdup(L_STRING_TO_C(L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType().getType())); + return content->type; +} + +void linphone_content_set_type(LinphoneContent *content, const char *type) { + LinphonePrivate::ContentType ct = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType(); + ct.setType(L_C_TO_STRING(type)); + L_GET_CPP_PTR_FROM_C_OBJECT(content)->setContentType(ct); +} + +const char * linphone_content_get_subtype(const LinphoneContent *content) { + if (content->subtype) ms_free(content->subtype); + content->subtype = ms_strdup(L_STRING_TO_C(L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType().getSubType())); + return content->subtype; +} + +void linphone_content_set_subtype(LinphoneContent *content, const char *subtype) { + LinphonePrivate::ContentType ct = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType(); + ct.setSubType(L_C_TO_STRING(subtype)); + L_GET_CPP_PTR_FROM_C_OBJECT(content)->setContentType(ct); +} + +void linphone_content_add_content_type_parameter(LinphoneContent *content, const char *name, const char *value) { + LinphonePrivate::ContentType ct = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType(); + ct.addParameter(L_C_TO_STRING(name), L_C_TO_STRING(value)); + L_GET_CPP_PTR_FROM_C_OBJECT(content)->setContentType(ct); +} + +uint8_t * linphone_content_get_buffer(const LinphoneContent *content) { + return (uint8_t *)linphone_content_get_string_buffer(content); +} + +void linphone_content_set_buffer(LinphoneContent *content, const uint8_t *buffer, size_t size) { + L_GET_CPP_PTR_FROM_C_OBJECT(content)->setBody(buffer, size); +} + +const char * linphone_content_get_string_buffer(const LinphoneContent *content) { + if (content->body) ms_free(content->body); + content->body = ms_strdup(L_GET_CPP_PTR_FROM_C_OBJECT(content)->getBodyAsUtf8String().c_str()); + return content->body; +} + +void linphone_content_set_string_buffer(LinphoneContent *content, const char *buffer) { + L_GET_CPP_PTR_FROM_C_OBJECT(content)->setBodyFromUtf8(L_C_TO_STRING(buffer)); +} + +size_t linphone_content_get_size(const LinphoneContent *content) { + size_t size = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getSize(); + if (size == 0) { + size = content->size; + } + return size; +} + +void linphone_content_set_size(LinphoneContent *content, size_t size) { + content->size = size; +} + +const char * linphone_content_get_encoding(const LinphoneContent *content) { + return content->encoding; +} + +void linphone_content_set_encoding(LinphoneContent *content, const char *encoding) { + if (content->encoding) ms_free(content->encoding); + content->encoding = ms_strdup(encoding); +} + +const char * linphone_content_get_name(const LinphoneContent *content) { + const LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content); + if (c->isFile()) { + const LinphonePrivate::FileContent *fc = static_cast(c); + if (content->name) ms_free(content->name); + content->name = ms_strdup(L_STRING_TO_C(fc->getFileName())); + } else if (c->isFileTransfer()) { + const LinphonePrivate::FileTransferContent *ftc = static_cast(c); + if (content->name) ms_free(content->name); + content->name = ms_strdup(L_STRING_TO_C(ftc->getFileName())); + } + return content->name; +} + +void linphone_content_set_name(LinphoneContent *content, const char *name) { + if (content->name) ms_free(content->name); + + LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content); + if (c->isFile()) { + LinphonePrivate::FileContent *fc = static_cast(c); + fc->setFileName(L_C_TO_STRING(name)); + } else if (c->isFileTransfer()) { + LinphonePrivate::FileTransferContent *ftc = static_cast(c); + ftc->setFileName(L_C_TO_STRING(name)); + } + + content->name = ms_strdup(name); +} + +bool_t linphone_content_is_multipart(const LinphoneContent *content) { + return L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType().isMultipart(); +} + +LinphoneContent * linphone_content_get_part(const LinphoneContent *content, int idx) { + SalBodyHandler *part_body_handler; + SalBodyHandler *body_handler = sal_body_handler_from_content(content); + if (!sal_body_handler_is_multipart(body_handler)) { + sal_body_handler_unref(body_handler); + return NULL; + } + part_body_handler = sal_body_handler_get_part(body_handler, idx); + LinphoneContent *result = linphone_content_from_sal_body_handler(part_body_handler); + sal_body_handler_unref(body_handler); + return result; +} + +LinphoneContent * linphone_content_find_part_by_header(const LinphoneContent *content, const char *header_name, const char *header_value) { + SalBodyHandler *part_body_handler; + SalBodyHandler *body_handler = sal_body_handler_from_content(content); + if (!sal_body_handler_is_multipart(body_handler)) { + sal_body_handler_unref(body_handler); + return NULL; + } + part_body_handler = sal_body_handler_find_part_by_header(body_handler, header_name, header_value); + LinphoneContent *result = linphone_content_from_sal_body_handler(part_body_handler); + sal_body_handler_unref(body_handler); + return result; +} + +const char * linphone_content_get_custom_header(const LinphoneContent *content, const char *header_name) { + SalBodyHandler *body_handler = sal_body_handler_from_content(content); + const char *header = sal_body_handler_get_header(body_handler, header_name); + sal_body_handler_unref(body_handler); + return header; +} + +const char *linphone_content_get_key(const LinphoneContent *content) { + if (content->key) ms_free(content->key); + + const LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content); + if (c->isFileTransfer()) { + const LinphonePrivate::FileTransferContent *ftc = static_cast(c); + content->key = ms_strdup(ftc->getFileKeyAsString()); + } + + return content->key; +} + +size_t linphone_content_get_key_size(const LinphoneContent *content) { + const LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content); + if (c->isFileTransfer()) { + const LinphonePrivate::FileTransferContent *ftc = static_cast(c); + return ftc->getFileKeySize(); + } + return 0; +} + +void linphone_content_set_key(LinphoneContent *content, const char *key, const size_t keyLength) { + LinphonePrivate::Content *c = L_GET_CPP_PTR_FROM_C_OBJECT(content); + if (c->isFileTransfer()) { + LinphonePrivate::FileTransferContent *ftc = static_cast(c); + ftc->setFileKey(key, keyLength); + } +} + +// ============================================================================= +// Private functions. +// ============================================================================= + +static LinphoneContent * linphone_content_new_with_body_handler(SalBodyHandler *body_handler) { + LinphoneContent *content = L_INIT(Content); + content->cryptoContext = NULL; + LinphonePrivate::Content *c = new LinphonePrivate::Content(); + L_SET_CPP_PTR_FROM_C_OBJECT(content, c); + + if (body_handler != NULL) { + linphone_content_set_type(content, sal_body_handler_get_type(body_handler)); + linphone_content_set_subtype(content, sal_body_handler_get_subtype(body_handler)); + for (const belle_sip_list_t *params = sal_body_handler_get_content_type_parameters_names(body_handler); params; params = params->next) { + const char *paramName = (const char *)(params->data); + const char *paramValue = sal_body_handler_get_content_type_parameter(body_handler, paramName); + linphone_content_add_content_type_parameter(content, paramName, paramValue); + } + + if (!linphone_content_is_multipart(content)) { + linphone_content_set_string_buffer(content, (char *)sal_body_handler_get_data(body_handler)); + } else { + belle_sip_multipart_body_handler_t *mpbh = BELLE_SIP_MULTIPART_BODY_HANDLER(body_handler); + char *body = belle_sip_object_to_string(mpbh); + linphone_content_set_string_buffer(content, body); + belle_sip_free(body); + } + + belle_sip_list_t *headers = (belle_sip_list_t *)sal_body_handler_get_headers(body_handler); + while (headers) { + belle_sip_header_t *cHeader = BELLE_SIP_HEADER(headers->data); + LinphonePrivate::Header header = LinphonePrivate::Header(belle_sip_header_get_name(cHeader), belle_sip_header_get_unparsed_value(cHeader)); + L_GET_CPP_PTR_FROM_C_OBJECT(content)->addHeader(header); + headers = headers->next; + } + if (sal_body_handler_get_encoding(body_handler)) linphone_content_set_encoding(content, sal_body_handler_get_encoding(body_handler)); + } + + return content; +} + +LinphoneContent * linphone_content_new(void) { + return linphone_content_new_with_body_handler(NULL); +} + +LinphoneContent * linphone_content_copy(const LinphoneContent *ref) { + return (LinphoneContent *)(belle_sip_object_clone(BELLE_SIP_OBJECT(ref))); +} + +LinphoneContent * linphone_core_create_content(LinphoneCore *lc) { + return linphone_content_new(); +} + +/* crypto context is managed(allocated/freed) by the encryption function, so provide the address of field in the private structure */ +void ** linphone_content_get_cryptoContext_address(LinphoneContent *content) { + return &(content->cryptoContext); +} + +LinphoneContent * linphone_content_from_sal_body_handler(SalBodyHandler *body_handler) { + if (body_handler) { + return linphone_content_new_with_body_handler(body_handler); + } + return NULL; +} + +SalBodyHandler * sal_body_handler_from_content(const LinphoneContent *content) { + if (content == NULL) return NULL; + + SalBodyHandler *body_handler; + LinphonePrivate::ContentType contentType = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType(); + + if (contentType.isMultipart()) { + size_t size = linphone_content_get_size(content); + char *buffer = ms_strdup(L_GET_CPP_PTR_FROM_C_OBJECT(content)->getBodyAsUtf8String().c_str()); + const char *boundary = L_STRING_TO_C(contentType.getParameter("boundary").getValue()); + belle_sip_multipart_body_handler_t *bh = belle_sip_multipart_body_handler_new_from_buffer(buffer, size, boundary); + body_handler = (SalBodyHandler *)BELLE_SIP_BODY_HANDLER(bh); + } else { + body_handler = sal_body_handler_new(); + sal_body_handler_set_data(body_handler, belle_sip_strdup(linphone_content_get_string_buffer(content))); + } + + for (const auto &header : L_GET_CPP_PTR_FROM_C_OBJECT(content)->getHeaders()) { + belle_sip_header_t *additionalHeader = belle_sip_header_parse(header.asString().c_str()); + belle_sip_body_handler_add_header(BELLE_SIP_BODY_HANDLER(body_handler), additionalHeader); + } + + sal_body_handler_set_type(body_handler, contentType.getType().c_str()); + sal_body_handler_set_subtype(body_handler, contentType.getSubType().c_str()); + sal_body_handler_set_size(body_handler, linphone_content_get_size(content)); + for (const auto ¶m : contentType.getParameters()) { + sal_body_handler_set_content_type_parameter(body_handler, param.getName().c_str(), param.getValue().c_str()); + } + if (content->encoding) sal_body_handler_set_encoding(body_handler, linphone_content_get_encoding(content)); + + return body_handler; +} diff --git a/src/c-wrapper/c-wrapper.h b/src/c-wrapper/c-wrapper.h index 9f59405ef..11d1b2033 100644 --- a/src/c-wrapper/c-wrapper.h +++ b/src/c-wrapper/c-wrapper.h @@ -37,6 +37,7 @@ F(ChatMessage, ChatMessage) \ F(AbstractChatRoom, ChatRoom) \ F(Core, Core) \ + F(Content, Content) \ F(DialPlan, DialPlan) \ F(EventLog, EventLog) \ F(MagicSearch, MagicSearch) \ @@ -86,7 +87,6 @@ BELLE_SIP_TYPE_ID(LinphoneConferenceParams), BELLE_SIP_TYPE_ID(LinphoneConfig), BELLE_SIP_TYPE_ID(LinphoneContactProvider), BELLE_SIP_TYPE_ID(LinphoneContactSearch), -BELLE_SIP_TYPE_ID(LinphoneContent), BELLE_SIP_TYPE_ID(LinphoneCoreCbs), BELLE_SIP_TYPE_ID(LinphoneErrorInfo), BELLE_SIP_TYPE_ID(LinphoneEvent), diff --git a/src/c-wrapper/internal/c-sal.h b/src/c-wrapper/internal/c-sal.h index 4aeca0042..f34c4ee5f 100644 --- a/src/c-wrapper/internal/c-sal.h +++ b/src/c-wrapper/internal/c-sal.h @@ -636,6 +636,9 @@ const char * sal_body_handler_get_type(const SalBodyHandler *body_handler); void sal_body_handler_set_type(SalBodyHandler *body_handler, const char *type); const char * sal_body_handler_get_subtype(const SalBodyHandler *body_handler); void sal_body_handler_set_subtype(SalBodyHandler *body_handler, const char *subtype); +const belle_sip_list_t * sal_body_handler_get_content_type_parameters_names(const SalBodyHandler *body_handler); +const char * sal_body_handler_get_content_type_parameter(const SalBodyHandler *body_handler, const char *name); +void sal_body_handler_set_content_type_parameter(SalBodyHandler *body_handler, const char *paramName, const char *paramValue); const char * sal_body_handler_get_encoding(const SalBodyHandler *body_handler); void sal_body_handler_set_encoding(SalBodyHandler *body_handler, const char *encoding); void * sal_body_handler_get_data(const SalBodyHandler *body_handler); @@ -644,8 +647,10 @@ size_t sal_body_handler_get_size(const SalBodyHandler *body_handler); void sal_body_handler_set_size(SalBodyHandler *body_handler, size_t size); bool_t sal_body_handler_is_multipart(const SalBodyHandler *body_handler); SalBodyHandler * sal_body_handler_get_part(const SalBodyHandler *body_handler, int idx); +const belle_sip_list_t * sal_body_handler_get_parts(const SalBodyHandler *body_handler); SalBodyHandler * sal_body_handler_find_part_by_header(const SalBodyHandler *body_handler, const char *header_name, const char *header_value); const char * sal_body_handler_get_header(const SalBodyHandler *body_handler, const char *header_name); +const belle_sip_list_t* sal_body_handler_get_headers(const SalBodyHandler *body_handler); /*this function parses a document with key=value pairs separated by new lines, and extracts the value for a given key*/ int sal_lines_get_value(const char *data, const char *key, char *value, size_t value_size); diff --git a/src/chat/chat-message/chat-message-p.h b/src/chat/chat-message/chat-message-p.h index c3350d887..919bae443 100644 --- a/src/chat/chat-message/chat-message-p.h +++ b/src/chat/chat-message/chat-message-p.h @@ -138,11 +138,11 @@ public: bool hasFileTransferContent () const; const Content* getFileTransferContent () const; - LinphoneContent *getFileTransferInformation () const; - void setFileTransferInformation (const LinphoneContent *content); + const Content* getFileTransferInformation () const; + void setFileTransferInformation (Content *content); - void addContent (Content &content); - void removeContent (const Content &content); + void addContent (Content *content); + void removeContent (Content *content); bool downloadFile (); diff --git a/src/chat/chat-message/chat-message.cpp b/src/chat/chat-message/chat-message.cpp index 8c21e25c7..f2ec811fe 100644 --- a/src/chat/chat-message/chat-message.cpp +++ b/src/chat/chat-message/chat-message.cpp @@ -19,6 +19,7 @@ #include "object/object-p.h" +#include "linphone/api/c-content.h" #include "linphone/core.h" #include "linphone/lpconfig.h" #include "linphone/utils/utils.h" @@ -37,6 +38,7 @@ #include "conference/participant.h" #include "conference/participant-imdn-state.h" #include "content/file-content.h" +#include "content/header/header-param.h" #include "content/content.h" #include "core/core.h" #include "core/core-p.h" @@ -245,8 +247,8 @@ const Content* ChatMessagePrivate::getTextContent() const { } bool ChatMessagePrivate::hasFileTransferContent() const { - for (const Content *c : getContents()) { - if (c->getContentType() == ContentType::FileTransfer) { + for (const Content *c : contents) { + if (c->isFileTransfer()) { return true; } } @@ -254,8 +256,8 @@ bool ChatMessagePrivate::hasFileTransferContent() const { } const Content* ChatMessagePrivate::getFileTransferContent() const { - for (const Content *c : getContents()) { - if (c->getContentType() == ContentType::FileTransfer) { + for (const Content *c : contents) { + if (c->isFileTransfer()) { return c; } } @@ -380,51 +382,54 @@ void ChatMessagePrivate::setText (const string &text) { } } -LinphoneContent *ChatMessagePrivate::getFileTransferInformation () const { +const Content *ChatMessagePrivate::getFileTransferInformation () const { if (hasFileTransferContent()) { - return getFileTransferContent()->toLinphoneContent(); + return getFileTransferContent(); } for (const Content *c : getContents()) { if (c->isFile()) { FileContent *fileContent = (FileContent *)c; - return fileContent->toLinphoneContent(); + return fileContent; } } return nullptr; } -void ChatMessagePrivate::setFileTransferInformation (const LinphoneContent *c_content) { +void ChatMessagePrivate::setFileTransferInformation (Content *content) { L_Q(); - // Create a FileContent, it will create the FileTransferContent at upload time - FileContent *fileContent = new FileContent(); - ContentType contentType(linphone_content_get_type(c_content), linphone_content_get_subtype(c_content)); - fileContent->setContentType(contentType); - fileContent->setFileSize(linphone_content_get_size(c_content)); - fileContent->setFileName(linphone_content_get_name(c_content)); - if (linphone_content_get_string_buffer(c_content)) { - fileContent->setBody(linphone_content_get_string_buffer(c_content)); + if (content->isFile()) { + q->addContent(content); + } else { + // This scenario is more likely to happen because the caller is using the C API + LinphoneContent *c_content = L_GET_C_BACK_PTR(content); + FileContent *fileContent = new FileContent(); + fileContent->setContentType(content->getContentType()); + fileContent->setFileSize(linphone_content_get_size(c_content)); // This information is only available from C Content if it was created from C API + fileContent->setFileName(linphone_content_get_name(c_content)); // This information is only available from C Content if it was created from C API + if (!content->isEmpty()) { + fileContent->setBody(content->getBody()); + } + q->addContent(fileContent); } - - q->addContent(*fileContent); } bool ChatMessagePrivate::downloadFile () { L_Q(); for (auto &content : getContents()) - if (content->getContentType() == ContentType::FileTransfer) - return q->downloadFile(*static_cast(content)); + if (content->isFileTransfer()) + return q->downloadFile(static_cast(content)); return false; } -void ChatMessagePrivate::addContent (Content &content) { - getContents().push_back(&content); +void ChatMessagePrivate::addContent (Content *content) { + getContents().push_back(content); } -void ChatMessagePrivate::removeContent (const Content &content) { - getContents().remove(&const_cast(content)); +void ChatMessagePrivate::removeContent (Content *content) { + getContents().remove(content); } void ChatMessagePrivate::loadFileTransferUrlFromBodyToContent() { @@ -459,7 +464,7 @@ void ChatMessagePrivate::sendImdn (Imdn::Type imdnType, LinphoneReason reason) { Content *content = new Content(); content->setContentType(ContentType::Imdn); content->setBody(Imdn::createXml(imdnId, time, imdnType, reason)); - msg->addContent(*content); + msg->addContent(content); if (reason != LinphoneReasonNone) msg->getPrivate()->setEncryptionPrevented(true); @@ -476,7 +481,7 @@ static void forceUtf8Content (Content &content) { if (contentType != ContentType::PlainText) return; - string charset = contentType.getParameter(); + string charset = contentType.getParameter("charset").getValue(); if (charset.empty()) return; @@ -495,7 +500,7 @@ static void forceUtf8Content (Content &content) { if (!utf8Body.empty()) { // TODO: use move operator if possible in the future! content.setBodyFromUtf8(utf8Body); - contentType.setParameter(string(contentType.getParameter()).replace(begin, end - begin, "UTF-8")); + contentType.addParameter("charset", "UTF-8"); content.setContentType(contentType); } } @@ -607,7 +612,7 @@ LinphoneReason ChatMessagePrivate::receive () { foundSupportContentType = true; break; } else - lError() << "Unsupported content-type: " << c->getContentType().asString(); + lError() << "Unsupported content-type: " << c->getContentType(); } if (!foundSupportContentType) { @@ -766,7 +771,7 @@ void ChatMessagePrivate::send () { auto msgOp = dynamic_cast(op); if (!externalBodyUrl.empty()) { - char *content_type = ms_strdup_printf("message/external-body; access-type=URL; URL=\"%s\"", externalBodyUrl.c_str()); + char *content_type = ms_strdup_printf("message/external-body;access-type=URL;URL=\"%s\"", externalBodyUrl.c_str()); msgOp->send_message(content_type, NULL); ms_free(content_type); } else if (internalContent.getContentType().isValid()) { @@ -779,10 +784,10 @@ void ChatMessagePrivate::send () { list::iterator it = contents.begin(); while (it != contents.end()) { Content *content = *it; - if (content->getContentType() == ContentType::FileTransfer) { - FileTransferContent *fileTransferContent = (FileTransferContent *)content; + if (content->isFileTransfer()) { + FileTransferContent *fileTransferContent = static_cast(content); it = contents.erase(it); - addContent(*fileTransferContent->getFileContent()); + addContent(fileTransferContent->getFileContent()); delete fileTransferContent; } else { it++; @@ -1043,13 +1048,13 @@ const list &ChatMessage::getContents () const { return d->getContents(); } -void ChatMessage::addContent (Content &content) { +void ChatMessage::addContent (Content *content) { L_D(); if (!d->isReadOnly) d->addContent(content); } -void ChatMessage::removeContent (const Content &content) { +void ChatMessage::removeContent (Content *content) { L_D(); if (!d->isReadOnly) d->removeContent(content); @@ -1119,9 +1124,9 @@ void ChatMessage::sendDisplayNotification () { d->sendImdn(Imdn::Type::Display, LinphoneReasonNone); } -bool ChatMessage::downloadFile(FileTransferContent &fileTransferContent) { +bool ChatMessage::downloadFile(FileTransferContent *fileTransferContent) { L_D(); - return d->fileTransferChatMessageModifier.downloadFile(getSharedFromThis(), &fileTransferContent); + return d->fileTransferChatMessageModifier.downloadFile(getSharedFromThis(), fileTransferContent); } bool ChatMessage::isFileTransferInProgress() { diff --git a/src/chat/chat-message/chat-message.h b/src/chat/chat-message/chat-message.h index 86691880c..633b379b3 100644 --- a/src/chat/chat-message/chat-message.h +++ b/src/chat/chat-message/chat-message.h @@ -100,8 +100,8 @@ public: std::list getParticipantsThatHaveNotReceived () const; const std::list &getContents () const; - void addContent (Content &content); - void removeContent (const Content &content); + void addContent (Content *content); + void removeContent (Content *content); const Content &getInternalContent () const; void setInternalContent (const Content &content); @@ -111,7 +111,7 @@ public: void addCustomHeader (const std::string &headerName, const std::string &headerValue); void removeCustomHeader (const std::string &headerName); - bool downloadFile (FileTransferContent &content); + bool downloadFile (FileTransferContent *content); bool isFileTransferInProgress(); private: diff --git a/src/chat/chat-room/abstract-chat-room.h b/src/chat/chat-room/abstract-chat-room.h index 9662f89b9..8a259466f 100644 --- a/src/chat/chat-room/abstract-chat-room.h +++ b/src/chat/chat-room/abstract-chat-room.h @@ -89,8 +89,7 @@ public: virtual std::shared_ptr createChatMessage () = 0; virtual std::shared_ptr createChatMessage (const std::string &text) = 0; - // TODO: Remove LinphoneContent by LinphonePrivate::Content. - virtual std::shared_ptr createFileTransferMessage (const LinphoneContent *initialContent) = 0; + virtual std::shared_ptr createFileTransferMessage (Content *initialContent) = 0; virtual std::shared_ptr findChatMessage (const std::string &messageId) const = 0; virtual std::shared_ptr findChatMessage ( diff --git a/src/chat/chat-room/chat-room.cpp b/src/chat/chat-room/chat-room.cpp index 28106b50d..b0b86553f 100644 --- a/src/chat/chat-room/chat-room.cpp +++ b/src/chat/chat-room/chat-room.cpp @@ -86,7 +86,7 @@ void ChatRoomPrivate::sendIsComposingNotification () { shared_ptr chatMessage = createChatMessage(ChatMessage::Direction::Outgoing); chatMessage->setToBeStored(false); - chatMessage->addContent(*content); + chatMessage->addContent(content); chatMessage->getPrivate()->addSalCustomHeader(PriorityHeader::HeaderName, PriorityHeader::NonUrgent); chatMessage->getPrivate()->addSalCustomHeader("Expires", "0"); @@ -414,11 +414,11 @@ shared_ptr ChatRoom::createChatMessage (const string &text) { Content *content = new Content(); content->setContentType(ContentType::PlainText); content->setBody(text); - chatMessage->addContent(*content); + chatMessage->addContent(content); return chatMessage; } -shared_ptr ChatRoom::createFileTransferMessage (const LinphoneContent *initialContent) { +shared_ptr ChatRoom::createFileTransferMessage (Content *initialContent) { shared_ptr chatMessage = createChatMessage(); chatMessage->getPrivate()->setFileTransferInformation(initialContent); return chatMessage; diff --git a/src/chat/chat-room/chat-room.h b/src/chat/chat-room/chat-room.h index 40bc7a05e..bbdb34e2d 100644 --- a/src/chat/chat-room/chat-room.h +++ b/src/chat/chat-room/chat-room.h @@ -66,8 +66,7 @@ public: std::shared_ptr createChatMessage () override; std::shared_ptr createChatMessage (const std::string &text) override; - // TODO: Remove LinphoneContent by LinphonePrivate::Content. - std::shared_ptr createFileTransferMessage (const LinphoneContent *initialContent) override; + std::shared_ptr createFileTransferMessage (Content *initialContent) override; std::shared_ptr findChatMessage (const std::string &messageId) const override; std::shared_ptr findChatMessage ( diff --git a/src/chat/chat-room/proxy-chat-room.cpp b/src/chat/chat-room/proxy-chat-room.cpp index bb4239cce..2316d3f70 100644 --- a/src/chat/chat-room/proxy-chat-room.cpp +++ b/src/chat/chat-room/proxy-chat-room.cpp @@ -173,7 +173,7 @@ shared_ptr ProxyChatRoom::createChatMessage (const string &text) { return d->chatRoom->createChatMessage(text); } -shared_ptr ProxyChatRoom::createFileTransferMessage (const LinphoneContent *initialContent) { +shared_ptr ProxyChatRoom::createFileTransferMessage (Content *initialContent) { L_D(); return d->chatRoom->createFileTransferMessage(initialContent); } diff --git a/src/chat/chat-room/proxy-chat-room.h b/src/chat/chat-room/proxy-chat-room.h index 35b7ec851..a464bb791 100644 --- a/src/chat/chat-room/proxy-chat-room.h +++ b/src/chat/chat-room/proxy-chat-room.h @@ -66,8 +66,7 @@ public: std::shared_ptr createChatMessage () override; std::shared_ptr createChatMessage (const std::string &text) override; - // TODO: Remove LinphoneContent by LinphonePrivate::Content. - std::shared_ptr createFileTransferMessage (const LinphoneContent *initialContent) override; + std::shared_ptr createFileTransferMessage (Content *initialContent) override; std::shared_ptr findChatMessage (const std::string &messageId) const override; std::shared_ptr findChatMessage ( diff --git a/src/chat/cpim/message/cpim-message.cpp b/src/chat/cpim/message/cpim-message.cpp index 84753f4ef..123ef6c66 100644 --- a/src/chat/cpim/message/cpim-message.cpp +++ b/src/chat/cpim/message/cpim-message.cpp @@ -149,9 +149,11 @@ string Cpim::Message::asString () const { string output; // TODO: Remove cpimHeaders - for (const auto &cpimHeader : *d->cpimHeaders) - output += cpimHeader->asString(); - output += "\r\n"; + if (d->cpimHeaders->size() > 0) { + for (const auto &cpimHeader : *d->cpimHeaders) + output += cpimHeader->asString(); + output += "\r\n"; + } // TODO Remove cpimHeaders if (d->messageHeaders->size() > 0) { diff --git a/src/chat/modifier/cpim-chat-message-modifier.cpp b/src/chat/modifier/cpim-chat-message-modifier.cpp index 8958c0f82..03c35fed0 100644 --- a/src/chat/modifier/cpim-chat-message-modifier.cpp +++ b/src/chat/modifier/cpim-chat-message-modifier.cpp @@ -98,7 +98,7 @@ ChatMessageModifier::Result CpimChatMessageModifier::decode (const shared_ptrgetContents().front(); if (content->getContentType() != ContentType::Cpim) { - lError() << "[CPIM] Message is not CPIM but " << content->getContentType().asString(); + lError() << "[CPIM] Message is not CPIM but " << content->getContentType(); return ChatMessageModifier::Result::Skipped; } diff --git a/src/chat/modifier/file-transfer-chat-message-modifier.cpp b/src/chat/modifier/file-transfer-chat-message-modifier.cpp index d9d0767b2..6bebbfa0b 100644 --- a/src/chat/modifier/file-transfer-chat-message-modifier.cpp +++ b/src/chat/modifier/file-transfer-chat-message-modifier.cpp @@ -17,15 +17,17 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "c-wrapper/c-wrapper.h" +#include "linphone/api/c-content.h" + #include "address/address.h" +#include "bctoolbox/crypto.h" +#include "c-wrapper/c-wrapper.h" #include "chat/chat-message/chat-message-p.h" +#include "chat/chat-room/chat-room-p.h" #include "content/content-type.h" #include "content/content.h" -#include "chat/chat-room/chat-room-p.h" #include "core/core.h" #include "logger/logger.h" -#include "bctoolbox/crypto.h" #include "file-transfer-chat-message-modifier.h" @@ -107,7 +109,7 @@ void FileTransferChatMessageModifier::fileTransferOnProgress ( LinphoneChatMessage *msg = L_GET_C_BACK_PTR(message); LinphoneChatMessageCbs *cbs = linphone_chat_message_get_callbacks(msg); - LinphoneContent *content = currentFileContentToTransfer->toLinphoneContent(); + LinphoneContent *content = L_GET_C_BACK_PTR((Content *)currentFileContentToTransfer); if (linphone_chat_message_cbs_get_file_transfer_progress_indication(cbs)) { linphone_chat_message_cbs_get_file_transfer_progress_indication(cbs)(msg, content, offset, total); } else { @@ -157,7 +159,7 @@ int FileTransferChatMessageModifier::onSendBody ( LinphoneChatMessageCbs *cbs = linphone_chat_message_get_callbacks(msg); LinphoneChatMessageCbsFileTransferSendCb file_transfer_send_cb = linphone_chat_message_cbs_get_file_transfer_send(cbs); - LinphoneContent *content = currentFileContentToTransfer->toLinphoneContent(); + LinphoneContent *content = L_GET_C_BACK_PTR((Content *)currentFileContentToTransfer); if (file_transfer_send_cb) { LinphoneBuffer *lb = file_transfer_send_cb(msg, content, offset, *size); if (lb) { @@ -253,12 +255,6 @@ void FileTransferChatMessageModifier::processResponseFromPostFile (const belle_h } // shall we encrypt the file if (is_file_encryption_enabled && message->getChatRoom()) { - LinphoneImEncryptionEngineCbs *imee_cbs = linphone_im_encryption_engine_get_callbacks(imee); - LinphoneImEncryptionEngineCbsGenerateFileTransferKeyCb generate_file_transfer_key_cb = - linphone_im_encryption_engine_cbs_get_generate_file_transfer_key(imee_cbs); - if (generate_file_transfer_key_cb) { - generate_file_transfer_key_cb(imee, L_GET_C_BACK_PTR(message->getChatRoom()), L_GET_C_BACK_PTR(message)); - } // temporary storage for the Content-disposition header value : use a generic filename to not leak it // Actual filename stored in msg->file_transfer_information->name will be set in encrypted msg // sended to the @@ -301,9 +297,31 @@ void FileTransferChatMessageModifier::processResponseFromPostFile (const belle_h const char *body = belle_sip_message_get_body((belle_sip_message_t *)event->response); if (body && strlen(body) > 0) { FileTransferContent *fileTransferContent = new FileTransferContent(); + fileTransferContent->setContentType(ContentType::FileTransfer); + + LinphoneImEncryptionEngine *imee = linphone_core_get_im_encryption_engine(message->getCore()->getCCore()); + bool_t is_file_encryption_enabled = FALSE; + if (imee && message->getChatRoom()) { + LinphoneImEncryptionEngineCbs *imee_cbs = linphone_im_encryption_engine_get_callbacks(imee); + LinphoneImEncryptionEngineCbsIsEncryptionEnabledForFileTransferCb is_encryption_enabled_for_file_transfer_cb = + linphone_im_encryption_engine_cbs_get_is_encryption_enabled_for_file_transfer(imee_cbs); + if (is_encryption_enabled_for_file_transfer_cb) { + is_file_encryption_enabled = is_encryption_enabled_for_file_transfer_cb(imee, L_GET_C_BACK_PTR(message->getChatRoom())); + } + } + if (is_file_encryption_enabled && message->getChatRoom()) { + LinphoneImEncryptionEngineCbs *imee_cbs = linphone_im_encryption_engine_get_callbacks(imee); + LinphoneImEncryptionEngineCbsGenerateFileTransferKeyCb generate_file_transfer_key_cb = + linphone_im_encryption_engine_cbs_get_generate_file_transfer_key(imee_cbs); + if (generate_file_transfer_key_cb) { + generate_file_transfer_key_cb(imee, L_GET_C_BACK_PTR(message->getChatRoom()), L_GET_C_BACK_PTR(message)); + } + } + // if we have an encryption key for the file, we must insert it into the msg and restore the correct filename - string content_key = currentFileContentToTransfer->getFileKey(); - if (!content_key.empty()) { + const char *content_key = fileTransferContent->getFileKeyAsString(); + size_t content_key_size = fileTransferContent->getFileKey().size(); + if (content_key_size > 0) { // parse the msg body xmlDocPtr xmlMessageBody = xmlParseDoc((const xmlChar *)body); @@ -316,16 +334,15 @@ void FileTransferChatMessageModifier::processResponseFromPostFile (const belle_h xmlChar *typeAttribute = xmlGetProp(cur, (const xmlChar *)"type"); // this is the node we are looking for : add a file-key children node if (!xmlStrcmp(typeAttribute, (const xmlChar *)"file")) { - size_t content_key_size = content_key.length(); // need to parse the children node to update the file-name one xmlNodePtr fileInfoNodeChildren = cur->xmlChildrenNode; // convert key to base64 size_t b64Size; - bctbx_base64_encode(nullptr, &b64Size, (unsigned char *)content_key.c_str(), content_key_size); + bctbx_base64_encode(nullptr, &b64Size, (unsigned char *)content_key, content_key_size); unsigned char *keyb64 = (unsigned char *)ms_malloc0(b64Size + 1); int xmlStringLength; - bctbx_base64_encode(keyb64, &b64Size, (unsigned char *)content_key.c_str(), content_key_size); + bctbx_base64_encode(keyb64, &b64Size, (unsigned char *)content_key, content_key_size); keyb64[b64Size] = '\0'; // libxml need a null terminated string // add the node containing the key to the file-info node @@ -361,11 +378,10 @@ void FileTransferChatMessageModifier::processResponseFromPostFile (const belle_h } FileContent *fileContent = currentFileContentToTransfer; - fileTransferContent->setContentType(ContentType::FileTransfer); fileTransferContent->setFileContent(fileContent); - message->getPrivate()->removeContent(*fileContent); - message->getPrivate()->addContent(*fileTransferContent); + message->getPrivate()->removeContent(fileContent); + message->getPrivate()->addContent(fileTransferContent); message->getPrivate()->setState(ChatMessage::State::FileTransferDone); releaseHttpRequest(); @@ -559,13 +575,13 @@ ChatMessageModifier::Result FileTransferChatMessageModifier::decode (const share fileTransferContent->setContentType(internalContent.getContentType()); fileTransferContent->setBody(internalContent.getBody()); fillFileTransferContentInformationsFromVndGsmaRcsFtHttpXml(fileTransferContent); - message->addContent(*fileTransferContent); + message->addContent(fileTransferContent); return ChatMessageModifier::Result::Done; } for (Content *content : message->getContents()) { - if (content->getContentType() == ContentType::FileTransfer) { - FileTransferContent *fileTransferContent = (FileTransferContent *)content; + if (content->isFileTransfer()) { + FileTransferContent *fileTransferContent = static_cast(content); fillFileTransferContentInformationsFromVndGsmaRcsFtHttpXml(fileTransferContent); } } @@ -634,8 +650,7 @@ static void createFileTransferInformationsFromVndGsmaRcsFtHttpXml (FileTransferC uint8_t *keyBuffer = (uint8_t *)malloc(keyLength); // decode the key into local key buffer bctbx_base64_decode(keyBuffer, &keyLength, (unsigned char *)keyb64, strlen((const char *)keyb64)); - string key = string((const char *)keyBuffer); - fileContent->setFileKey(key); + fileTransferContent->setFileKey((const char *)keyBuffer, keyLength); // duplicate key value into the linphone content private structure xmlFree(keyb64); free(keyBuffer); @@ -699,7 +714,7 @@ void FileTransferChatMessageModifier::onRecvBody (belle_sip_user_body_handler_t if (currentFileContentToTransfer->getFilePath().empty()) { LinphoneChatMessage *msg = L_GET_C_BACK_PTR(message); LinphoneChatMessageCbs *cbs = linphone_chat_message_get_callbacks(msg); - LinphoneContent *content = currentFileContentToTransfer->toLinphoneContent(); + LinphoneContent *content = L_GET_C_BACK_PTR((Content *)currentFileContentToTransfer); if (linphone_chat_message_cbs_get_file_transfer_recv(cbs)) { LinphoneBuffer *lb = linphone_buffer_new_from_data(buffer, size); linphone_chat_message_cbs_get_file_transfer_recv(cbs)(msg, content, lb); @@ -740,7 +755,7 @@ void FileTransferChatMessageModifier::onRecvEnd (belle_sip_user_body_handler_t * if (currentFileContentToTransfer->getFilePath().empty()) { LinphoneChatMessage *msg = L_GET_C_BACK_PTR(message); LinphoneChatMessageCbs *cbs = linphone_chat_message_get_callbacks(msg); - LinphoneContent *content = currentFileContentToTransfer->toLinphoneContent(); + LinphoneContent *content = L_GET_C_BACK_PTR((Content *)currentFileContentToTransfer); if (linphone_chat_message_cbs_get_file_transfer_recv(cbs)) { LinphoneBuffer *lb = linphone_buffer_new(); linphone_chat_message_cbs_get_file_transfer_recv(cbs)(msg, content, lb); @@ -756,12 +771,12 @@ void FileTransferChatMessageModifier::onRecvEnd (belle_sip_user_body_handler_t * if (retval <= 0 && message->getState() != ChatMessage::State::FileTransferError) { // Remove the FileTransferContent from the message and store the FileContent FileContent *fileContent = currentFileContentToTransfer; - message->getPrivate()->addContent(*fileContent); + message->getPrivate()->addContent(fileContent); for (Content *content : message->getContents()) { - if (content->getContentType() == ContentType::FileTransfer) { - FileTransferContent *fileTransferContent = (FileTransferContent*)content; + if (content->isFileTransfer()) { + FileTransferContent *fileTransferContent = static_cast(content); if (fileTransferContent->getFileContent() == fileContent) { - message->getPrivate()->removeContent(*content); + message->getPrivate()->removeContent(content); delete fileTransferContent; break; } @@ -814,7 +829,7 @@ void FileTransferChatMessageModifier::processResponseHeadersFromGetFile (const b } else { lWarning() << "No file transfer information for msg [" << this << "]: creating..."; FileContent *content = createFileTransferInformationFromHeaders(response); - message->addContent(*content); + message->addContent(content); } size_t body_size = 0; diff --git a/src/chat/modifier/multipart-chat-message-modifier.cpp b/src/chat/modifier/multipart-chat-message-modifier.cpp index 243cb32e1..8ed8312d9 100644 --- a/src/chat/modifier/multipart-chat-message-modifier.cpp +++ b/src/chat/modifier/multipart-chat-message-modifier.cpp @@ -20,13 +20,11 @@ // TODO: Remove me later. #include "private.h" -#include "address/address.h" #include "chat/chat-message/chat-message.h" -#include "chat/chat-room/chat-room.h" #include "content/content-type.h" +#include "content/header/header.h" +#include "content/content-manager.h" #include "content/file-transfer-content.h" -#include "logger/logger.h" -#include "core/core.h" #include "multipart-chat-message-modifier.h" @@ -43,90 +41,30 @@ ChatMessageModifier::Result MultipartChatMessageModifier::encode ( if (message->getContents().size() <= 1) return ChatMessageModifier::Result::Skipped; - LinphoneCore *lc = message->getChatRoom()->getCore()->getCCore(); - char tmp[64]; - lc->sal->create_uuid(tmp, sizeof(tmp)); - string boundary = tmp; - stringstream multipartMessage; - - multipartMessage << "--" << boundary; - for (Content *content : message->getContents()) { - multipartMessage << "\r\n"; - multipartMessage << "Content-Type: " << content->getContentType().asString() << "\r\n\r\n"; - multipartMessage << content->getBodyAsString() << "\r\n\r\n"; - multipartMessage << "--" << boundary; - } - multipartMessage << "--"; - - Content newContent; - ContentType newContentType(ContentType::Multipart); - newContentType.setParameter("boundary=" + boundary); - newContent.setContentType(newContentType); - newContent.setBody(multipartMessage.str()); - message->setInternalContent(newContent); + Content content = ContentManager::contentListToMultipart(message->getContents()); + message->setInternalContent(content); return ChatMessageModifier::Result::Done; } ChatMessageModifier::Result MultipartChatMessageModifier::decode (const shared_ptr &message, int &errorCode) { - if (message->getInternalContent().getContentType().getType() == "multipart") { - string boundary = message->getInternalContent().getContentType().getParameter(); - if (boundary.empty()) { - lError() << "Boundary parameter of content-type not found: " << message->getInternalContent().getContentType().asString(); - return ChatMessageModifier::Result::Error; - } - - size_t pos = boundary.find("="); - if (pos == string::npos) { - lError() << "Parameter seems invalid: " << boundary; - return ChatMessageModifier::Result::Error; - } - boundary = "--" + boundary.substr(pos + 1); - lInfo() << "Multipart boundary is " << boundary; - - const vector body = message->getInternalContent().getBody(); - string contentsString(body.begin(), body.end()); - - pos = contentsString.find(boundary); - if (pos == string::npos) { - lError() << "Boundary not found in body !"; - return ChatMessageModifier::Result::Error; - } - - size_t start = pos + boundary.length() + 2; // 2 is the size of \r\n - size_t end; - do { - end = contentsString.find(boundary, start); - if (end != string::npos) { - string contentString = contentsString.substr(start, end - start); - - size_t contentTypePos = contentString.find(": ") + 2; // 2 is the size of : - size_t endOfLinePos = contentString.find("\r\n"); - if (contentTypePos >= endOfLinePos) { - lError() << "Content should start by a 'Content-Type: ' line !"; - continue; + if (message->getInternalContent().getContentType().isMultipart()) { + for (Content &c : ContentManager::multipartToContentList(message->getInternalContent())) { + Content *content; + if (c.getContentType() == ContentType::FileTransfer) { + content = new FileTransferContent(); + content->setContentType(c.getContentType()); + content->setContentDisposition(c.getContentDisposition()); + content->setContentEncoding(c.getContentEncoding()); + for (const Header &header : c.getHeaders()) { + content->addHeader(header); } - string contentTypeString = contentString.substr(contentTypePos, endOfLinePos - contentTypePos); - ContentType contentType(contentTypeString); - - endOfLinePos += 4; // 4 is two time the size of \r\n - string contentBody = contentString.substr(endOfLinePos, contentString.length() - (endOfLinePos + 4)); // 4 is two time the size of \r\n - - Content *content; - if (contentType == ContentType::FileTransfer) { - content = new FileTransferContent(); - } else { - content = new Content(); - } - content->setContentType(contentType); - content->setBody(contentBody); - message->addContent(*content); - - lInfo() << "Parsed and added content with type " << contentType.asString(); + content->setBodyFromUtf8(c.getBodyAsUtf8String()); + } else { + content = new Content(c); } - start = end + boundary.length() + 2; // 2 is the size of \r\n - } while (end != string::npos); - + message->addContent(content); + } return ChatMessageModifier::Result::Done; } return ChatMessageModifier::Result::Skipped; diff --git a/src/conference/handlers/local-conference-event-handler.cpp b/src/conference/handlers/local-conference-event-handler.cpp index 84be4fa72..a9aca08b7 100644 --- a/src/conference/handlers/local-conference-event-handler.cpp +++ b/src/conference/handlers/local-conference-event-handler.cpp @@ -19,6 +19,7 @@ #include +#include "linphone/api/c-content.h" #include "linphone/utils/utils.h" #include "conference/local-conference.h" @@ -106,7 +107,7 @@ string LocalConferenceEventHandlerPrivate::createNotifyMultipart (int notifyId) static_cast(notifyId) ); - list contents; + list contents; for (const auto &eventLog : events) { Content *content = new Content(); content->setContentType(ContentType("application","conference-info")); diff --git a/src/conference/session/call-session.cpp b/src/conference/session/call-session.cpp index 668f0df33..ea125826e 100644 --- a/src/conference/session/call-session.cpp +++ b/src/conference/session/call-session.cpp @@ -19,19 +19,18 @@ #include -#include "c-wrapper/c-wrapper.h" +#include "linphone/api/c-content.h" +#include "linphone/core.h" #include "address/address-p.h" +#include "c-wrapper/c-wrapper.h" #include "call/call-p.h" #include "conference/params/call-session-params-p.h" #include "conference/session/call-session-p.h" #include "conference/session/call-session.h" #include "core/core-p.h" - #include "logger/logger.h" -#include "linphone/core.h" - #include "private.h" using namespace std; diff --git a/src/content/content-manager.cpp b/src/content/content-manager.cpp index 94ee69ce9..ff341bcf2 100644 --- a/src/content/content-manager.cpp +++ b/src/content/content-manager.cpp @@ -19,101 +19,68 @@ #include +#include "c-wrapper/c-wrapper.h" + +#include "linphone/api/c-content.h" + #include "content-manager.h" #include "content-type.h" #include "content/content.h" // ============================================================================= -using namespace std; - -LINPHONE_BEGIN_NAMESPACE - namespace { constexpr const char MultipartBoundary[] = "---------------------------14737809831466499882746641449"; } +using namespace std; + +LINPHONE_BEGIN_NAMESPACE + // ----------------------------------------------------------------------------- list ContentManager::multipartToContentList (const Content &content) { - const string body = content.getBodyAsString(); - belle_sip_multipart_body_handler_t *mpbh = belle_sip_multipart_body_handler_new_from_buffer( - body.c_str(), body.length(), MultipartBoundary - ); - belle_sip_object_ref(mpbh); + LinphoneContent *cContent = L_GET_C_BACK_PTR(&content); + SalBodyHandler *sbh = sal_body_handler_ref(sal_body_handler_from_content(cContent)); list contents; - for (const belle_sip_list_t *parts = belle_sip_multipart_body_handler_get_parts(mpbh); parts; parts = parts->next) { - belle_sip_body_handler_t *part = BELLE_SIP_BODY_HANDLER(parts->data); - belle_sip_header_content_type_t *partContentType = nullptr; - for (const belle_sip_list_t *it = belle_sip_body_handler_get_headers(part); it; it = it->next) { - belle_sip_header_t *header = BELLE_SIP_HEADER(it->data); - if (strcasecmp("Content-Type", belle_sip_header_get_name(header)) == 0) { - partContentType = BELLE_SIP_HEADER_CONTENT_TYPE(header); - break; - } - } - - Content content; - content.setBody(static_cast( - belle_sip_memory_body_handler_get_buffer(BELLE_SIP_MEMORY_BODY_HANDLER(part)) - )); - content.setContentType(ContentType( - belle_sip_header_content_type_get_type(partContentType), - belle_sip_header_content_type_get_subtype(partContentType) - )); - contents.push_back(move(content)); + for (const belle_sip_list_t *parts = sal_body_handler_get_parts(sbh); parts; parts = parts->next) { + SalBodyHandler *part = (SalBodyHandler *)parts->data; + LinphoneContent *cContent = linphone_content_from_sal_body_handler(part); + Content *cppContent = L_GET_CPP_PTR_FROM_C_OBJECT(cContent); + contents.push_back(*cppContent); + linphone_content_unref(cContent); } - belle_sip_object_unref(mpbh); + sal_body_handler_unref(sbh); + linphone_content_unref(cContent); return contents; } -Content ContentManager::contentListToMultipart (const list &contents) { +Content ContentManager::contentListToMultipart (const list &contents) { belle_sip_multipart_body_handler_t *mpbh = belle_sip_multipart_body_handler_new( nullptr, nullptr, nullptr, MultipartBoundary ); - belle_sip_object_ref(mpbh); + mpbh = (belle_sip_multipart_body_handler_t *)belle_sip_object_ref(mpbh); - for (const auto &content : contents) { - const ContentType &contentType = content.getContentType(); - belle_sip_header_t *cContentType = BELLE_SIP_HEADER( - belle_sip_header_content_type_create( - contentType.getType().c_str(), - string(contentType.getSubType() + "; charset=\"UTF-8\"").c_str() - ) - ); - - const string body = content.getBodyAsString(); - belle_sip_memory_body_handler_t *mbh = belle_sip_memory_body_handler_new_copy_from_buffer( - body.c_str(), body.length(), nullptr, nullptr - ); - belle_sip_body_handler_add_header(BELLE_SIP_BODY_HANDLER(mbh), cContentType); - - for (const auto &header : content.getHeaders()) { - belle_sip_header_t *additionalHeader = BELLE_SIP_HEADER( - belle_sip_header_create( - header.first.c_str(), - header.second.c_str() - ) - ); - belle_sip_body_handler_add_header(BELLE_SIP_BODY_HANDLER(mbh), additionalHeader); - } - - belle_sip_multipart_body_handler_add_part(mpbh, BELLE_SIP_BODY_HANDLER(mbh)); + for (Content *content : contents) { + LinphoneContent *cContent = L_GET_C_BACK_PTR(content); + SalBodyHandler *sbh = sal_body_handler_from_content(cContent); + belle_sip_multipart_body_handler_add_part(mpbh, BELLE_SIP_BODY_HANDLER(sbh)); + linphone_content_unref(cContent); } - char *desc = belle_sip_object_to_string(mpbh); - Content content; - content.setBody(desc); - belle_sip_free(desc); + SalBodyHandler *sbh = (SalBodyHandler *)mpbh; + sal_body_handler_set_type(sbh, ContentType::Multipart.getType().c_str()); + sal_body_handler_set_subtype(sbh, ContentType::Multipart.getSubType().c_str()); + sal_body_handler_set_content_type_parameter(sbh, "boundary", MultipartBoundary); + LinphoneContent *cContent = linphone_content_from_sal_body_handler(sbh); + Content *content = L_GET_CPP_PTR_FROM_C_OBJECT(cContent); + Content returnContent = *content; + linphone_content_unref(cContent); belle_sip_object_unref(mpbh); - ContentType contentType = ContentType::Multipart; - contentType.setParameter("boundary=" + string(MultipartBoundary)); - content.setContentType(contentType); - - return content; + return returnContent; } LINPHONE_END_NAMESPACE diff --git a/src/content/content-manager.h b/src/content/content-manager.h index 8251d3c3b..4d19076f0 100644 --- a/src/content/content-manager.h +++ b/src/content/content-manager.h @@ -32,7 +32,7 @@ class Content; namespace ContentManager { std::list multipartToContentList (const Content &content); - Content contentListToMultipart (const std::list &contents); + Content contentListToMultipart (const std::list &contents); } LINPHONE_END_NAMESPACE diff --git a/src/content/content-p.h b/src/content/content-p.h index 167712313..9dc4e1d31 100644 --- a/src/content/content-p.h +++ b/src/content/content-p.h @@ -29,13 +29,15 @@ LINPHONE_BEGIN_NAMESPACE +class Header; + class ContentPrivate : public ClonableObjectPrivate { private: std::vector body; ContentType contentType; ContentDisposition contentDisposition; std::string contentEncoding; - std::list> headers; + std::list
headers; L_DECLARE_PUBLIC(Content); }; diff --git a/src/content/content-type.cpp b/src/content/content-type.cpp index 34ca68d0e..6463a501a 100644 --- a/src/content/content-type.cpp +++ b/src/content/content-type.cpp @@ -20,7 +20,8 @@ #include "linphone/utils/utils.h" #include "content-type.h" -#include "object/clonable-object-p.h" +#include "header/header-p.h" +#include "header/header-param.h" // ============================================================================= @@ -30,11 +31,10 @@ LINPHONE_BEGIN_NAMESPACE // ----------------------------------------------------------------------------- -class ContentTypePrivate : public ClonableObjectPrivate { +class ContentTypePrivate : public HeaderPrivate { public: string type; string subType; - string parameter; }; // ----------------------------------------------------------------------------- @@ -52,7 +52,7 @@ const ContentType ContentType::Sdp("application/sdp"); // ----------------------------------------------------------------------------- -ContentType::ContentType (const string &contentType) : ClonableObject(*new ContentTypePrivate) { +ContentType::ContentType (const string &contentType) : Header(*new ContentTypePrivate) { L_D(); size_t pos = contentType.find('/'); @@ -68,11 +68,23 @@ ContentType::ContentType (const string &contentType) : ClonableObject(*new Conte d->type.clear(); } - if (posParam != string::npos) - setParameter(Utils::trim(contentType.substr(posParam + 1))); + if (posParam != string::npos) { + string params = contentType.substr(posParam + 1); + string token; + do { + posParam = params.find(";"); + if (posParam == string::npos) { + token = params; + } else { + token = params.substr(0, posParam); + } + addParameter(HeaderParam(token)); + params.erase(0, posParam + 1); + } while (posParam != std::string::npos); + } } -ContentType::ContentType (const string &type, const string &subType) : ClonableObject(*new ContentTypePrivate) { +ContentType::ContentType (const string &type, const string &subType) : Header(*new ContentTypePrivate) { L_D(); if (setType(type) && !setSubType(subType)) @@ -82,22 +94,35 @@ ContentType::ContentType (const string &type, const string &subType) : ClonableO ContentType::ContentType ( const string &type, const string &subType, - const string ¶meter -) : ClonableObject(*new ContentTypePrivate) { + const HeaderParam ¶meter +) : Header(*new ContentTypePrivate) { L_D(); if (setType(type) && !setSubType(subType)) d->type.clear(); - setParameter(parameter); + addParameter(parameter); } -ContentType::ContentType (const ContentType &other) : ContentType(other.getType(), other.getSubType(), other.getParameter()) {} +ContentType::ContentType ( + const string &type, + const string &subType, + const std::list ¶meters +) : Header(*new ContentTypePrivate) { + L_D(); + + if (setType(type) && !setSubType(subType)) + d->type.clear(); + addParameters(parameters); +} + +ContentType::ContentType (const ContentType &other) : ContentType(other.getType(), other.getSubType(), other.getParameters()) {} ContentType &ContentType::operator= (const ContentType &other) { if (this != &other) { setType(other.getType()); setSubType(other.getSubType()); - setParameter(other.getParameter()); + cleanParameters(); + addParameters(other.getParameters()); } return *this; @@ -124,6 +149,7 @@ bool ContentType::setType (const string &type) { L_D(); if (type.find('/') == string::npos) { d->type = Utils::stringToLower(type); + setValue(d->type + "/" + d->subType); return true; } return false; @@ -138,21 +164,12 @@ bool ContentType::setSubType (const string &subType) { L_D(); if (subType.find('/') == string::npos) { d->subType = Utils::stringToLower(subType); + setValue(d->type + "/" + d->subType); return true; } return false; } -const string &ContentType::getParameter () const { - L_D(); - return d->parameter; -} - -void ContentType::setParameter (const string ¶meter) { - L_D(); - d->parameter = parameter; -} - bool ContentType::isEmpty () const { L_D(); return d->type.empty() && d->subType.empty(); @@ -163,18 +180,10 @@ bool ContentType::isValid () const { return !d->type.empty() && !d->subType.empty(); } -string ContentType::asString () const { - L_D(); - if (isValid()) { - string asString = d->type + "/" + d->subType; - if (!d->parameter.empty()) - asString += "; " + d->parameter; - return asString; - } - return ""; +bool ContentType::isMultipart() const { + return getType() == "multipart"; } - bool ContentType::isFile () const { // TODO Remove when not needed anymore in step 2.1 of maindb return isFile(*this); diff --git a/src/content/content-type.h b/src/content/content-type.h index ea4fb980c..b509ef7bc 100644 --- a/src/content/content-type.h +++ b/src/content/content-type.h @@ -21,18 +21,21 @@ #define _L_CONTENT_TYPE_H_ #include "object/clonable-object.h" +#include "header/header.h" // ============================================================================= LINPHONE_BEGIN_NAMESPACE class ContentTypePrivate; +class HeaderParam; -class LINPHONE_PUBLIC ContentType : public ClonableObject { +class LINPHONE_PUBLIC ContentType : public Header { public: explicit ContentType (const std::string &contentType = ""); ContentType (const std::string &type, const std::string &subType); - ContentType (const std::string &type, const std::string &subType, const std::string ¶meter); + ContentType (const std::string &type, const std::string &subType, const HeaderParam ¶meter); + ContentType (const std::string &type, const std::string &subType, const std::list ¶meters); ContentType (const ContentType &other); ContentType &operator= (const ContentType &other); @@ -56,10 +59,7 @@ public: const std::string &getSubType () const; bool setSubType (const std::string &subType); - const std::string &getParameter () const; - void setParameter (const std::string ¶meter); - - std::string asString () const; + bool isMultipart() const; static bool isFile (const ContentType &contentType); diff --git a/src/content/content.cpp b/src/content/content.cpp index aa30503d4..ad74de27f 100644 --- a/src/content/content.cpp +++ b/src/content/content.cpp @@ -25,6 +25,7 @@ #include "content-p.h" #include "content-type.h" +#include "header/header.h" // ============================================================================= @@ -190,17 +191,37 @@ bool Content::isFile () const { return false; } +bool Content::isFileTransfer () const { + return false; +} + void Content::addHeader (const string &headerName, const string &headerValue) { L_D(); removeHeader(headerName); - d->headers.push_back(make_pair(headerName, headerValue)); + Header header = Header(headerName, headerValue); + d->headers.push_back(header); } -const list> &Content::getHeaders () const { +void Content::addHeader (const Header &header) { + L_D(); + removeHeader(header.getName()); + d->headers.push_back(header); +} + +const list
&Content::getHeaders () const { L_D(); return d->headers; } +const Header &Content::getHeader (const string &headerName) const { + L_D(); + list
::const_iterator it = findHeader(headerName); + if (it != d->headers.cend()) { + return *it; + } + return Utils::getEmptyConstRefObject
(); +} + void Content::removeHeader (const string &headerName) { L_D(); auto it = findHeader(headerName); @@ -208,18 +229,11 @@ void Content::removeHeader (const string &headerName) { d->headers.remove(*it); } -list>::const_iterator Content::findHeader (const string &headerName) const { +list
::const_iterator Content::findHeader (const string &headerName) const { L_D(); - return findIf(d->headers, [&headerName](const pair &pair) { - return pair.first == headerName; + return findIf(d->headers, [&headerName](const Header &header) { + return header.getName() == headerName; }); } -LinphoneContent *Content::toLinphoneContent () const { - LinphoneContent *content = linphone_core_create_content(nullptr); - linphone_content_set_type(content, getContentType().getType().c_str()); - linphone_content_set_subtype(content, getContentType().getSubType().c_str()); - return content; -} - LINPHONE_END_NAMESPACE diff --git a/src/content/content.h b/src/content/content.h index c570670c5..3c29d3a1a 100644 --- a/src/content/content.h +++ b/src/content/content.h @@ -35,6 +35,7 @@ LINPHONE_BEGIN_NAMESPACE class ContentDisposition; class ContentType; class ContentPrivate; +class Header; class LINPHONE_PUBLIC Content : public ClonableObject, public AppDataContainer { public: @@ -74,14 +75,14 @@ public: bool isEmpty () const; virtual bool isFile () const; + virtual bool isFileTransfer () const; - const std::list> &getHeaders () const; + const std::list
&getHeaders () const; + const Header &getHeader (const std::string &headerName) const; void addHeader (const std::string &headerName, const std::string &headerValue); + void addHeader (const Header &header); void removeHeader (const std::string &headerName); - std::list>::const_iterator findHeader (const std::string &headerName) const; - - // TODO: Remove me later. - virtual LinphoneContent *toLinphoneContent () const; + std::list
::const_iterator findHeader (const std::string &headerName) const; protected: explicit Content (ContentPrivate &p); diff --git a/src/content/file-content.cpp b/src/content/file-content.cpp index 851d935d3..b4a0ef0fb 100644 --- a/src/content/file-content.cpp +++ b/src/content/file-content.cpp @@ -36,7 +36,6 @@ public: string fileName; string filePath; size_t fileSize = 0; - string fileKey; }; // ----------------------------------------------------------------------------- @@ -48,7 +47,6 @@ FileContent::FileContent (const FileContent &other) : Content(*new FileContentPr d->fileName = other.getFileName(); d->filePath = other.getFilePath(); d->fileSize = other.getFileSize(); - d->fileKey = other.getFileKey(); } FileContent::FileContent (FileContent &&other) : Content(*new FileContentPrivate) { @@ -56,18 +54,14 @@ FileContent::FileContent (FileContent &&other) : Content(*new FileContentPrivate d->fileName = move(other.getPrivate()->fileName); d->filePath = move(other.getPrivate()->filePath); d->fileSize = move(other.getPrivate()->fileSize); - d->fileKey = move(other.getPrivate()->fileKey); } FileContent &FileContent::operator= (const FileContent &other) { L_D(); - if (this != &other) { Content::operator=(other); d->fileName = other.getFileName(); d->filePath = other.getFilePath(); d->fileSize = other.getFileSize(); - d->fileKey = other.getFileKey(); - } return *this; } @@ -78,7 +72,6 @@ FileContent &FileContent::operator= (FileContent &&other) { d->fileName = move(other.getPrivate()->fileName); d->filePath = move(other.getPrivate()->filePath); d->fileSize = move(other.getPrivate()->fileSize); - d->fileKey = move(other.getPrivate()->fileKey); return *this; } @@ -87,8 +80,7 @@ bool FileContent::operator== (const FileContent &other) const { return Content::operator==(other) && d->fileName == other.getFileName() && d->filePath == other.getFilePath() && - d->fileSize == other.getFileSize() && - d->fileKey == other.getFileKey(); + d->fileSize == other.getFileSize(); } void FileContent::setFileSize (size_t size) { @@ -121,28 +113,12 @@ const string &FileContent::getFilePath () const { return d->filePath; } -void FileContent::setFileKey (const string &key) { - L_D(); - d->fileKey = key; -} - -const string &FileContent::getFileKey () const { - L_D(); - return d->fileKey; -} - bool FileContent::isFile () const { return true; } -LinphoneContent *FileContent::toLinphoneContent () const { - LinphoneContent *content = linphone_core_create_content(nullptr); - linphone_content_set_type(content, getContentType().getType().c_str()); - linphone_content_set_subtype(content, getContentType().getSubType().c_str()); - linphone_content_set_name(content, getFileName().c_str()); - linphone_content_set_size(content, getFileSize()); - linphone_content_set_key(content, getFileKey().c_str(), getFileKey().size()); - return content; +bool FileContent::isFileTransfer () const { + return false; } LINPHONE_END_NAMESPACE diff --git a/src/content/file-content.h b/src/content/file-content.h index 645fc6312..081a5898a 100644 --- a/src/content/file-content.h +++ b/src/content/file-content.h @@ -48,13 +48,8 @@ public: void setFilePath (const std::string &path); const std::string &getFilePath () const; - void setFileKey (const std::string &key); - const std::string &getFileKey () const; - bool isFile () const override; - - // TODO: Remove me later. - LinphoneContent *toLinphoneContent () const override; + bool isFileTransfer () const override; private: L_DECLARE_PRIVATE(FileContent); diff --git a/src/content/file-transfer-content.cpp b/src/content/file-transfer-content.cpp index 4bc5ed691..e2fe5ab4f 100644 --- a/src/content/file-transfer-content.cpp +++ b/src/content/file-transfer-content.cpp @@ -38,6 +38,7 @@ public: string filePath; FileContent *fileContent = nullptr; size_t fileSize = 0; + std::vector fileKey; }; // ----------------------------------------------------------------------------- @@ -51,6 +52,7 @@ FileTransferContent::FileTransferContent (const FileTransferContent &other) : Co d->filePath = other.getFilePath(); d->fileContent = other.getFileContent(); d->fileSize = other.getFileSize(); + d->fileKey = other.getFileKey(); } FileTransferContent::FileTransferContent (FileTransferContent &&other) : Content(*new FileTransferContentPrivate) { @@ -60,6 +62,7 @@ FileTransferContent::FileTransferContent (FileTransferContent &&other) : Content d->filePath = move(other.getPrivate()->filePath); d->fileContent = move(other.getPrivate()->fileContent); d->fileSize = move(other.getPrivate()->fileSize); + d->fileKey = move(other.getPrivate()->fileKey); } FileTransferContent &FileTransferContent::operator= (const FileTransferContent &other) { @@ -71,6 +74,7 @@ FileTransferContent &FileTransferContent::operator= (const FileTransferContent & d->filePath = other.getFilePath(); d->fileContent = other.getFileContent(); d->fileSize = other.getFileSize(); + d->fileKey = other.getFileKey(); } return *this; @@ -84,6 +88,8 @@ FileTransferContent &FileTransferContent::operator= (FileTransferContent &&other d->filePath = move(other.getPrivate()->filePath); d->fileContent = move(other.getPrivate()->fileContent); d->fileSize = move(other.getPrivate()->fileSize); + d->fileKey = move(other.getPrivate()->fileKey); + return *this; } @@ -146,17 +152,32 @@ size_t FileTransferContent::getFileSize () const { return d->fileSize; } -LinphoneContent *FileTransferContent::toLinphoneContent () const { - LinphoneContent *content = linphone_core_create_content(nullptr); - linphone_content_set_type(content, getContentType().getType().c_str()); - linphone_content_set_subtype(content, getContentType().getSubType().c_str()); - linphone_content_set_name(content, getFileName().c_str()); - linphone_content_set_size(content, getFileSize()); - return content; +void FileTransferContent::setFileKey (const char *key, size_t size) { + L_D(); + d->fileKey = vector(key, key + size); +} + +const vector &FileTransferContent::getFileKey () const { + L_D(); + return d->fileKey; +} + +const char *FileTransferContent::getFileKeyAsString() const { + L_D(); + return d->fileKey.data(); +} + +size_t FileTransferContent::getFileKeySize() const { + L_D(); + return d->fileKey.size(); } bool FileTransferContent::isFile () const { return false; } +bool FileTransferContent::isFileTransfer () const { + return true; +} + LINPHONE_END_NAMESPACE diff --git a/src/content/file-transfer-content.h b/src/content/file-transfer-content.h index 59b4cc125..1904e11c5 100644 --- a/src/content/file-transfer-content.h +++ b/src/content/file-transfer-content.h @@ -20,6 +20,8 @@ #ifndef _L_FILE_TRANSFER_CONTENT_H_ #define _L_FILE_TRANSFER_CONTENT_H_ +#include + #include "content.h" // ============================================================================= @@ -55,10 +57,13 @@ public: void setFileSize (size_t size); size_t getFileSize () const; - bool isFile () const override; + void setFileKey (const char *key, size_t size); + const std::vector &getFileKey () const; + const char *getFileKeyAsString () const; + size_t getFileKeySize() const; - // TODO: Remove me later. - LinphoneContent *toLinphoneContent () const override; + bool isFile () const override; + bool isFileTransfer () const override; private: L_DECLARE_PRIVATE(FileTransferContent); diff --git a/src/content/header/header-p.h b/src/content/header/header-p.h new file mode 100644 index 000000000..fd4663efe --- /dev/null +++ b/src/content/header/header-p.h @@ -0,0 +1,43 @@ +/* + * header-p.h + * Copyright (C) 2010-2018 Belledonne Communications SARL + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _L_HEADER_P_H_ +#define _L_HEADER_P_H_ + +#include + +#include "object/clonable-object-p.h" + +#include "header.h" + +// ============================================================================= + +LINPHONE_BEGIN_NAMESPACE + +class HeaderPrivate : public ClonableObjectPrivate { +private: + std::string name; + std::string value; + std::list parameters; + L_DECLARE_PUBLIC(Header); +}; + +LINPHONE_END_NAMESPACE + +#endif // ifndef _L_HEADER_P_H_ \ No newline at end of file diff --git a/src/content/header/header-param.cpp b/src/content/header/header-param.cpp new file mode 100644 index 000000000..9605a2f84 --- /dev/null +++ b/src/content/header/header-param.cpp @@ -0,0 +1,108 @@ +/* + * header-param.cpp + * Copyright (C) 2010-2018 Belledonne Communications SARL + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "linphone/utils/utils.h" + +#include "header-param.h" +#include "object/clonable-object-p.h" + +// ============================================================================= + +using namespace std; + +LINPHONE_BEGIN_NAMESPACE + +// ----------------------------------------------------------------------------- + +class HeaderParamPrivate : public ClonableObjectPrivate { +public: + string name; + string value; +}; + +// ----------------------------------------------------------------------------- + +HeaderParam::HeaderParam (const string ¶m) : ClonableObject(*new HeaderParamPrivate) { + size_t pos = param.find("="); + size_t end = param.length(); + + if (pos == string::npos) { + setName(param); + } else { + setName(param.substr(0, pos)); + setValue(param.substr(pos + 1, end - (pos + 1))); + } +} + +HeaderParam::HeaderParam (const string &name, const string &value) : ClonableObject(*new HeaderParamPrivate) { + setName(name); + setValue(value); +} + +HeaderParam::HeaderParam (const HeaderParam &other) : HeaderParam(other.getName(), other.getValue()) {} + +HeaderParam &HeaderParam::operator= (const HeaderParam &other) { + if (this != &other) { + setName(other.getName()); + setValue(other.getValue()); + } + + return *this; +} + +bool HeaderParam::operator== (const HeaderParam &other) const { + return getName() == other.getName() && + getValue() == other.getValue(); +} + +bool HeaderParam::operator!= (const HeaderParam &other) const { + return !(*this == other); +} + +const string &HeaderParam::getName () const { + L_D(); + return d->name; +} + +bool HeaderParam::setName (const string &name) { + L_D(); + d->name = name; + return true; +} + +const string &HeaderParam::getValue () const { + L_D(); + return d->value; +} + +bool HeaderParam::setValue (const string &value) { + L_D(); + d->value = value; + return true; +} + +string HeaderParam::asString () const { + L_D(); + string asString = ";" + d->name; + if (!d->value.empty()) + asString += "=" + d->value; + return asString; +} + +LINPHONE_END_NAMESPACE diff --git a/src/content/header/header-param.h b/src/content/header/header-param.h new file mode 100644 index 000000000..a9471b486 --- /dev/null +++ b/src/content/header/header-param.h @@ -0,0 +1,61 @@ +/* + * header-param.h + * Copyright (C) 2010-2018 Belledonne Communications SARL + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _L_HEADER_PARAM_H_ +#define _L_HEADER_PARAM_H_ + +#include "object/clonable-object.h" + +// ============================================================================= + +LINPHONE_BEGIN_NAMESPACE + +class HeaderParamPrivate; + +class LINPHONE_PUBLIC HeaderParam : public ClonableObject { +public: + explicit HeaderParam (const std::string &header = ""); + HeaderParam (const std::string &name, const std::string &value); + HeaderParam (const HeaderParam &other); + + HeaderParam &operator= (const HeaderParam &other); + + bool operator== (const HeaderParam &other) const; + bool operator!= (const HeaderParam &other) const; + + // Delete these operators to prevent putting complicated content-type strings + // in the code. Instead define static const HeaderParam objects below. + bool operator== (const std::string &other) const = delete; + bool operator!= (const std::string &other) const = delete; + + const std::string &getName () const; + bool setName (const std::string &name); + + const std::string &getValue () const; + bool setValue (const std::string &value); + + std::string asString () const; + +private: + L_DECLARE_PRIVATE(HeaderParam); +}; + +LINPHONE_END_NAMESPACE + +#endif // ifndef _L_HEADER_PARAM_H_ diff --git a/src/content/header/header.cpp b/src/content/header/header.cpp new file mode 100644 index 000000000..5924cdf5b --- /dev/null +++ b/src/content/header/header.cpp @@ -0,0 +1,183 @@ +/* + * header.cpp + * Copyright (C) 2010-2018 Belledonne Communications SARL + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include + +#include "linphone/utils/utils.h" +#include "linphone/utils/algorithm.h" + +#include "header-p.h" +#include "header-param.h" + +// ============================================================================= + +using namespace std; + +LINPHONE_BEGIN_NAMESPACE + +// ----------------------------------------------------------------------------- + +Header::Header(HeaderPrivate &p) : ClonableObject(p) {} + +Header::Header() : ClonableObject(*new HeaderPrivate) {} + +Header::Header (const string &name, const string &value) : ClonableObject(*new HeaderPrivate) { + setName(name); + + size_t posParam = value.find(";"); + if (posParam == string::npos) { + setValue(value); + return; + } + + string parsedValue = value.substr(0, posParam); + string params = value.substr(posParam + 1); + string token; + do { + posParam = params.find(";"); + if (posParam == string::npos) { + token = params; + } else { + token = params.substr(0, posParam); + } + addParameter(HeaderParam(token)); + params.erase(0, posParam + 1); + } while (posParam != std::string::npos); + + setValue(parsedValue); +} + +Header::Header (const string &name, const string &value, const list ¶ms) : Header(name, value) { + addParameters(params); +} + +Header::Header (const Header &other) : Header(other.getName(), other.getValue(), other.getParameters()) {} + +Header &Header::operator= (const Header &other) { + if (this != &other) { + setName(other.getName()); + setValue(other.getValue()); + cleanParameters(); + addParameters(other.getParameters()); + } + + return *this; +} + +bool Header::operator== (const Header &other) const { + return getName() == other.getName() && + getValue() == other.getValue(); +} + +bool Header::operator!= (const Header &other) const { + return !(*this == other); +} + +void Header::setName (const string &name) { + L_D(); + d->name = name; +} + +string Header::getName () const { + L_D(); + return d->name; +} + +void Header::setValue (const string &value) { + L_D(); + d->value = value; +} + +string Header::getValue () const { + L_D(); + return d->value; +} + +void Header::cleanParameters () { + L_D(); + d->parameters.clear(); +} + +const list &Header::getParameters () const { + L_D(); + return d->parameters; +} + +void Header::addParameter (const string ¶mName, const string ¶mValue) { + addParameter(HeaderParam(paramName, paramValue)); +} + +void Header::addParameter (const HeaderParam ¶m) { + L_D(); + removeParameter(param); + d->parameters.push_back(param); +} + +void Header::addParameters(const list ¶ms) { + for (auto it = std::begin(params); it!=std::end(params); ++it) { + HeaderParam param = *it; + addParameter(param.getName(), param.getValue()); + } +} + +void Header::removeParameter (const string ¶mName) { + L_D(); + auto it = findParameter(paramName); + if (it != d->parameters.cend()) + d->parameters.remove(*it); +} + +void Header::removeParameter (const HeaderParam ¶m) { + removeParameter(param.getName()); +} + +list::const_iterator Header::findParameter (const string ¶mName) const { + L_D(); + return findIf(d->parameters, [¶mName](const HeaderParam ¶m) { + return param.getName() == paramName; + }); +} + +const HeaderParam &Header::getParameter (const string ¶mName) const { + L_D(); + list::const_iterator it = findParameter(paramName); + if (it != d->parameters.cend()) { + return *it; + } + return Utils::getEmptyConstRefObject(); +} + +string Header::asString () const { + stringstream asString; + if (!getName().empty()) { + asString << getName() << ":"; + } + asString << getValue(); + for (const auto ¶m : getParameters()) { + asString << param.asString(); + } + return asString.str(); +} + +ostream &operator<<(ostream& stream, const Header& header) { + stream << header.asString(); + return stream; +} + +LINPHONE_END_NAMESPACE \ No newline at end of file diff --git a/src/content/header/header.h b/src/content/header/header.h new file mode 100644 index 000000000..583572523 --- /dev/null +++ b/src/content/header/header.h @@ -0,0 +1,74 @@ +/* + * header.h + * Copyright (C) 2010-2018 Belledonne Communications SARL + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _L_HEADER_H_ +#define _L_HEADER_H_ + +#include + +#include "object/clonable-object.h" + +// ============================================================================= + +LINPHONE_BEGIN_NAMESPACE + +class HeaderPrivate; +class HeaderParam; + +class LINPHONE_PUBLIC Header : public ClonableObject { +public: + Header (); + Header (const std::string &name, const std::string &value); + Header (const std::string &name, const std::string &value, const std::list ¶ms); + Header (const Header &other); + + Header &operator= (const Header &other); + + bool operator== (const Header &other) const; + bool operator!= (const Header &other) const; + + void setName (const std::string &name); + std::string getName () const; + + void setValue (const std::string &value); + std::string getValue () const; + + void cleanParameters (); + const std::list &getParameters () const; + void addParameter (const std::string ¶mName, const std::string ¶mValue); + void addParameter (const HeaderParam ¶m); + void addParameters(const std::list ¶ms); + void removeParameter (const std::string ¶mName); + void removeParameter (const HeaderParam ¶m); + std::list::const_iterator findParameter (const std::string ¶mName) const; + const HeaderParam &getParameter (const std::string ¶mName) const; + + std::string asString () const; + friend std::ostream &operator<<(std::ostream&, const Header&); + +protected: + explicit Header (HeaderPrivate &p); + +private: + L_DECLARE_PRIVATE(Header); +}; + +LINPHONE_END_NAMESPACE + +#endif // ifndef _L_HEADER_H_ diff --git a/src/db/main-db.cpp b/src/db/main-db.cpp index f982643d2..f61f8875a 100644 --- a/src/db/main-db.cpp +++ b/src/db/main-db.cpp @@ -2267,7 +2267,7 @@ void MainDb::loadChatMessageContents (const shared_ptr &chatMessage string data; fetchContentAppData(session, *content, contentId, data); } - chatMessage->addContent(*content); + chatMessage->addContent(content); } // 2 - Load external body url from body into FileTransferContent if needed. diff --git a/src/sal/op.cpp b/src/sal/op.cpp index e5e211f3b..497a7a99b 100644 --- a/src/sal/op.cpp +++ b/src/sal/op.cpp @@ -1029,12 +1029,18 @@ void SalOp::process_incoming_message(const belle_sip_request_event_t *event) { /* if we just deciphered a message, use the deciphered part(which can be a rcs xml body pointing to the file to retreive from server)*/ salmsg.text=(!external_body)?belle_sip_message_get_body(BELLE_SIP_MESSAGE(req)):NULL; salmsg.url=NULL; - salmsg.content_type = ms_strdup_printf("%s/%s", belle_sip_header_content_type_get_type(content_type), belle_sip_header_content_type_get_subtype(content_type)); + + char buffer[1024]; + size_t offset = 0; + belle_sip_parameters_marshal(BELLE_SIP_PARAMETERS(content_type), buffer, 1024, &offset); + buffer[offset] = '\0'; + salmsg.content_type = ms_strdup_printf("%s/%s%s", belle_sip_header_content_type_get_type(content_type), belle_sip_header_content_type_get_subtype(content_type), buffer); if (external_body && belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type),"URL")) { size_t url_length=strlen(belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type),"URL")); salmsg.url = ms_strdup(belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type),"URL")+1); /* skip first "*/ ((char*)salmsg.url)[url_length-2]='\0'; /*remove trailing "*/ } + salmsg.message_id=message_id; salmsg.time=date ? belle_sip_header_date_get_time(date) : time(NULL); this->root->callbacks.message_received(this,&salmsg); diff --git a/tester/CMakeLists.txt b/tester/CMakeLists.txt index b14e28572..e07217934 100644 --- a/tester/CMakeLists.txt +++ b/tester/CMakeLists.txt @@ -199,7 +199,7 @@ set(SOURCE_FILES_C set(SOURCE_FILES_CXX clonable-object-tester.cpp conference-event-tester.cpp - content-manager-tester.cpp + contents-tester.cpp cpim-tester.cpp main-db-tester.cpp multipart-tester.cpp diff --git a/tester/content-manager-tester.cpp b/tester/contents-tester.cpp similarity index 62% rename from tester/content-manager-tester.cpp rename to tester/contents-tester.cpp index e21cc6399..99ecee08d 100644 --- a/tester/content-manager-tester.cpp +++ b/tester/contents-tester.cpp @@ -21,13 +21,15 @@ #include "content/content-manager.h" #include "content/content-type.h" #include "content/content.h" +#include "content/header/header-param.h" #include "liblinphone_tester.h" #include "tester_utils.h" +#include "logger/logger.h" using namespace LinphonePrivate; using namespace std; -static const char* multipart = \ +static const char* source_multipart = \ "-----------------------------14737809831466499882746641449\r\n" \ "Content-Type: application/rlmi+xml;charset=\"UTF-8\"\r\n\r\n" \ "" \ @@ -60,6 +62,7 @@ static const char* multipart = \ " " \ "" \ "-----------------------------14737809831466499882746641449\r\n" \ +"Content-Encoding: b64\r\n" \ "Content-Type: application/pidf+xml;charset=\"UTF-8\"\r\n\r\n" \ "" \ "" \ @@ -77,6 +80,7 @@ static const char* multipart = \ " " \ "" \ "-----------------------------14737809831466499882746641449\r\n" \ +"Content-Id: toto;param1=value1;param2;param3=value3\r\n" \ "Content-Type: application/pidf+xml;charset=\"UTF-8\"\r\n\r\n" \ "" \ "" \ @@ -95,6 +99,80 @@ static const char* multipart = \ "" \ "-----------------------------14737809831466499882746641449--\r\n"; +static const char* generated_multipart = \ +"-----------------------------14737809831466499882746641449\r\n" \ +"Content-Type: application/rlmi+xml;charset=\"UTF-8\"\r\n" \ +"Content-Length:582\r\n\r\n" \ +"" \ +"" \ +" " \ +" " \ +" " \ +" " \ +" " \ +" " \ +" " \ +" " \ +" " \ +"" \ +"-----------------------------14737809831466499882746641449\r\n" \ +"Content-Type: application/pidf+xml;charset=\"UTF-8\"\r\n" \ +"Content-Length:561\r\n\r\n" \ +"" \ +"" \ +" " \ +" " \ +" open" \ +" " \ +" sip:+YYYYYYYYYY@sip.linphone.org;user=phone" \ +" 2017-10-25T13:18:26" \ +" " \ +" " \ +" " \ +" " \ +" " \ +" " \ +"" \ +"-----------------------------14737809831466499882746641449\r\n" \ +"Content-Encoding:b64\r\n" \ +"Content-Type: application/pidf+xml;charset=\"UTF-8\"\r\n" \ +"Content-Length:561\r\n\r\n" \ +"" \ +"" \ +" " \ +" " \ +" open" \ +" " \ +" sip:+XXXXXXXXXX@sip.linphone.org;user=phone" \ +" 2017-10-25T13:18:26" \ +" " \ +" " \ +" " \ +" " \ +" " \ +" " \ +"" \ +"-----------------------------14737809831466499882746641449\r\n" \ +"Content-Id:toto;param1=value1;param2;param3=value3\r\n" \ +"Content-Type: application/pidf+xml;charset=\"UTF-8\"\r\n" \ +"Content-Length:546\r\n\r\n" \ +"" \ +"" \ +" " \ +" " \ +" open" \ +" " \ +" sip:someone@sip.linphone.org" \ +" 2017-10-25T13:18:26" \ +" " \ +" " \ +" " \ +" " \ +" " \ +" " \ +"" \ +"-----------------------------14737809831466499882746641449--\r\n"; + static const char* part1 = \ "" \ "" \ @@ -162,7 +240,7 @@ static const char* part4 = \ void multipart_to_list () { Content multipartContent; - multipartContent.setBody(multipart); + multipartContent.setBody(source_multipart); multipartContent.setContentType(ContentType("multipart", "related")); list contents = ContentManager::multipartToContentList(multipartContent); @@ -220,6 +298,7 @@ void multipart_to_list () { ms_message("\n\n----- Original part 3 -----"); ms_message("%s", originalStr3.c_str()); BC_ASSERT_TRUE(originalStr3 == generatedStr3); + BC_ASSERT_TRUE(content3.getHeader("Content-Encoding").getValue() == "b64"); Content content4 = contents.front(); contents.pop_front(); @@ -234,29 +313,43 @@ void multipart_to_list () { generatedStr4.erase(std::remove(generatedStr4.begin(), generatedStr4.end(), '\r'), generatedStr4.end()); generatedStr4.erase(std::remove(generatedStr4.begin(), generatedStr4.end(), '\n'), generatedStr4.end()); ms_message("\n\n----- Generated part 4 -----"); - ms_message("%s", generatedStr3.c_str()); + ms_message("%s", generatedStr4.c_str()); ms_message("\n\n----- Original part 4 -----"); ms_message("%s", originalStr4.c_str()); BC_ASSERT_TRUE(originalStr4 == generatedStr4); + BC_ASSERT_TRUE(content4.getHeader("Content-Id").getValue() == "toto"); + BC_ASSERT_TRUE(content4.getHeader("Content-Id").getParameter("param1").getValue() == "value1"); + BC_ASSERT_TRUE(content4.getHeader("Content-Id").getParameter("param2").getValue().empty()); + BC_ASSERT_TRUE(content4.getHeader("Content-Id").getParameter("param3").getValue() == "value3"); } void list_to_multipart () { + ContentType contentType = ContentType("application", "rlmi+xml"); + contentType.addParameter("charset", "\"UTF-8\""); Content content1; content1.setBody(part1); - content1.setContentType(ContentType("application", "rlmi+xml")); + content1.setContentType(contentType); + contentType = ContentType("application", "pidf+xml"); + contentType.addParameter("charset", "\"UTF-8\""); Content content2; content2.setBody(part2); - content2.setContentType(ContentType("application", "pidf+xml")); + content2.setContentType(contentType); Content content3; content3.setBody(part3); - content3.setContentType(ContentType("application", "pidf+xml")); + content3.addHeader("Content-Encoding", "b64"); + content3.setContentType(contentType); Content content4; + Header header = Header("Content-Id", "toto"); + header.addParameter("param1", "value1"); + header.addParameter("param2", ""); + header.addParameter("param3", "value3"); + content4.addHeader(header); content4.setBody(part4); - content4.setContentType(ContentType("application", "pidf+xml")); - list contents = {content1, content2, content3, content4}; + content4.setContentType(contentType); + list contents = {&content1, &content2, &content3, &content4}; Content multipartContent = ContentManager::contentListToMultipart(contents); - string originalStr(multipart); + string originalStr(generated_multipart); originalStr.erase(std::remove(originalStr.begin(), originalStr.end(), ' '), originalStr.end()); originalStr.erase(std::remove(originalStr.begin(), originalStr.end(), '\t'), originalStr.end()); originalStr.erase(std::remove(originalStr.begin(), originalStr.end(), '\r'), originalStr.end()); @@ -276,16 +369,67 @@ void list_to_multipart () { BC_ASSERT_TRUE(originalStr == generatedStr); } -test_t content_manager_tests[] = { +static void content_type_parsing(void) { + string type = "message/external-body;access-type=URL;URL=\"https://www.linphone.org/img/linphone-open-source-voip-projectX2.png\""; + ContentType contentType = ContentType(type); + BC_ASSERT_STRING_EQUAL("message", contentType.getType().c_str()); + BC_ASSERT_STRING_EQUAL("external-body", contentType.getSubType().c_str()); + BC_ASSERT_STRING_EQUAL("URL", contentType.getParameter("access-type").getValue().c_str()); + BC_ASSERT_STRING_EQUAL("\"https://www.linphone.org/img/linphone-open-source-voip-projectX2.png\"", contentType.getParameter("URL").getValue().c_str()); + BC_ASSERT_STRING_EQUAL("", contentType.getParameter("boundary").getValue().c_str()); + BC_ASSERT_EQUAL(2, contentType.getParameters().size(), int, "%d"); + lInfo() << "Content-Type is " << contentType; + BC_ASSERT_TRUE(type == contentType.asString()); + + type = "multipart/mixed;boundary=-----------------------------14737809831466499882746641450"; + contentType = ContentType(type); + BC_ASSERT_STRING_EQUAL("multipart", contentType.getType().c_str()); + BC_ASSERT_STRING_EQUAL("mixed", contentType.getSubType().c_str()); + BC_ASSERT_STRING_EQUAL("-----------------------------14737809831466499882746641450", contentType.getParameter("boundary").getValue().c_str()); + BC_ASSERT_STRING_EQUAL("", contentType.getParameter("access-type").getValue().c_str()); + BC_ASSERT_EQUAL(1, contentType.getParameters().size(), int, "%d"); + lInfo() << "Content-Type is " << contentType; + BC_ASSERT_TRUE(type == contentType.asString()); + + type = "plain/text"; + contentType = ContentType(type); + BC_ASSERT_STRING_EQUAL("plain", contentType.getType().c_str()); + BC_ASSERT_STRING_EQUAL("text", contentType.getSubType().c_str()); + BC_ASSERT_STRING_EQUAL("", contentType.getParameter("boundary").getValue().c_str()); + BC_ASSERT_EQUAL(0, contentType.getParameters().size(), int, "%d"); + lInfo() << "Content-Type is " << contentType; + BC_ASSERT_TRUE(type == contentType.asString()); +} + +static void content_header_parsing(void) { + string value = "toto;param1=value1;param2;param3=value3"; + Header header = Header("Content-Id", value); + BC_ASSERT_TRUE(header.getValue() == "toto"); + BC_ASSERT_TRUE(header.getParameter("param1").getValue() == "value1"); + BC_ASSERT_TRUE(header.getParameter("param2").getValue().empty()); + BC_ASSERT_TRUE(header.getParameter("param3").getValue() == "value3"); + BC_ASSERT_EQUAL(3, header.getParameters().size(), int, "%d"); + BC_ASSERT_STRING_EQUAL("", header.getParameter("encoding").getValue().c_str()); + + value = "b64"; + header = Header("Content-Encoding", value); + BC_ASSERT_TRUE(header.getValue() == value); + BC_ASSERT_EQUAL(0, header.getParameters().size(), int, "%d"); + BC_ASSERT_STRING_EQUAL("", header.getParameter("access-type").getValue().c_str()); +} + +test_t contents_tests[] = { TEST_NO_TAG("Multipart to list", multipart_to_list), - TEST_NO_TAG("List to multipart", list_to_multipart) + TEST_NO_TAG("List to multipart", list_to_multipart), + TEST_NO_TAG("Content type parsing", content_type_parsing), + TEST_NO_TAG("Content header parsing", content_header_parsing) }; -test_suite_t content_manager_test_suite = { - "Content manager", +test_suite_t contents_test_suite = { + "Contents", nullptr, nullptr, liblinphone_tester_before_each, liblinphone_tester_after_each, - sizeof(content_manager_tests) / sizeof(content_manager_tests[0]), content_manager_tests + sizeof(contents_tests) / sizeof(contents_tests[0]), contents_tests }; diff --git a/tester/cpim-tester.cpp b/tester/cpim-tester.cpp index e803ae33a..66cc661d8 100644 --- a/tester/cpim-tester.cpp +++ b/tester/cpim-tester.cpp @@ -423,12 +423,12 @@ static void cpim_chat_message_modifier_base(bool_t use_multipart) { Content *content = new Content(); content->setContentType(ContentType::PlainText); content->setBody("Hello Part 2"); - marieMessage->addContent(*content); + marieMessage->addContent(content); } marieMessage->send(); BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneMessageReceived,1)); - BC_ASSERT_STRING_EQUAL(marieMessage->getInternalContent().getContentType().asString().c_str(), ""); // Internal content is cleaned after message is sent or received + BC_ASSERT_TRUE(marieMessage->getInternalContent().getContentType().isEmpty()); // Internal content is cleaned after message is sent or received BC_ASSERT_PTR_NOT_NULL(pauline->stat.last_received_chat_message); if (pauline->stat.last_received_chat_message != NULL) { diff --git a/tester/eventapi_tester.c b/tester/eventapi_tester.c index 2119f3500..66ae0f165 100644 --- a/tester/eventapi_tester.c +++ b/tester/eventapi_tester.c @@ -41,7 +41,7 @@ void linphone_notify_received(LinphoneCore *lc, LinphoneEvent *lev, const char * if (!BC_ASSERT_PTR_NOT_NULL(content)) return; if (!linphone_content_is_multipart(content) && (!ua || !strstr(ua, "flexisip"))) { /*disable check for full presence server support*/ /*hack to disable content checking for list notify */ - BC_ASSERT_STRING_EQUAL(notify_content,(const char*)linphone_content_get_buffer(content)); + BC_ASSERT_STRING_EQUAL((const char*)linphone_content_get_buffer(content),notify_content); } mgr=get_manager(lc); mgr->stat.number_of_NotifyReceived++; diff --git a/tester/liblinphone_tester.h b/tester/liblinphone_tester.h index ac42e1714..9a7531460 100644 --- a/tester/liblinphone_tester.h +++ b/tester/liblinphone_tester.h @@ -45,7 +45,7 @@ extern test_suite_t call_video_test_suite; extern test_suite_t clonable_object_test_suite; extern test_suite_t conference_event_test_suite; extern test_suite_t conference_test_suite; -extern test_suite_t content_manager_test_suite; +extern test_suite_t contents_test_suite; extern test_suite_t cpim_test_suite; extern test_suite_t dtmf_test_suite; extern test_suite_t event_test_suite; diff --git a/tester/message_tester.c b/tester/message_tester.c index 84949db73..df264123a 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -2294,15 +2294,19 @@ void text_message_with_custom_content_type_and_lime(void) { static int im_encryption_engine_process_incoming_message_cb(LinphoneImEncryptionEngine *engine, LinphoneChatRoom *room, LinphoneChatMessage *msg) { + ms_debug("IM encryption process incoming message with content type %s", linphone_chat_message_get_content_type(msg)); if (linphone_chat_message_get_content_type(msg)) { if (strcmp(linphone_chat_message_get_content_type(msg), "cipher/b64") == 0) { size_t b64Size = 0; unsigned char *output; - bctbx_base64_decode(NULL, &b64Size, (unsigned char *)linphone_chat_message_get_text(msg), strlen(linphone_chat_message_get_text(msg))); + const char *data = linphone_chat_message_get_text(msg); + ms_debug("IM encryption process incoming message crypted message is %s", data); + bctbx_base64_decode(NULL, &b64Size, (unsigned char *)data, strlen(data)); output = (unsigned char *)ms_malloc(b64Size+1), - bctbx_base64_decode(output, &b64Size, (unsigned char *)linphone_chat_message_get_text(msg), strlen(linphone_chat_message_get_text(msg))); + bctbx_base64_decode(output, &b64Size, (unsigned char *)data, strlen(data)); output[b64Size] = '\0'; linphone_chat_message_set_text(msg, (char *)output); + ms_debug("IM encryption process incoming message decrypted message is %s", output); ms_free(output); linphone_chat_message_set_content_type(msg, "text/plain"); return 0; diff --git a/tester/multipart-tester.cpp b/tester/multipart-tester.cpp index 3fdd9073a..c94dc9a2e 100644 --- a/tester/multipart-tester.cpp +++ b/tester/multipart-tester.cpp @@ -53,13 +53,13 @@ static void chat_message_multipart_modifier_base(bool first_file_transfer, bool content->setContentType(ContentType("video/mkv")); content->setFilePath(send_filepath); content->setFileName("sintel_trailer_opus_h264.mkv"); - marieMessage->addContent(*content); + marieMessage->addContent(content); bc_free(send_filepath); } else { Content *content = new Content(); content->setContentType(ContentType::PlainText); - content->setBody("Hello Part 1"); - marieMessage->addContent(*content); + content->setBody("Hello part 1"); + marieMessage->addContent(content); } if (second_file_transfer) { @@ -68,13 +68,13 @@ static void chat_message_multipart_modifier_base(bool first_file_transfer, bool content->setContentType(ContentType("file/vcf")); content->setFilePath(send_filepath); content->setFileName("vcards.vcf"); - marieMessage->addContent(*content); + marieMessage->addContent(content); bc_free(send_filepath); } else { Content *content = new Content(); content->setContentType(ContentType::PlainText); - content->setBody("Hello Part 2"); - marieMessage->addContent(*content); + content->setBody("Hello part 2"); + marieMessage->addContent(content); } linphone_core_set_file_transfer_server(marie->lc,"https://www.linphone.org:444/lft.php"); @@ -82,7 +82,20 @@ static void chat_message_multipart_modifier_base(bool first_file_transfer, bool BC_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneMessageReceived,1)); BC_ASSERT_PTR_NOT_NULL(pauline->stat.last_received_chat_message); - BC_ASSERT_STRING_EQUAL(linphone_chat_message_get_content_type(pauline->stat.last_received_chat_message), "multipart/mixed"); + + if (first_file_transfer || second_file_transfer) { + LinphoneContent *content = linphone_chat_message_get_file_transfer_information(pauline->stat.last_received_chat_message); + BC_ASSERT_PTR_NOT_NULL(content); + linphone_content_unref(content); + } + if (!first_file_transfer || !second_file_transfer) { + const char *content = linphone_chat_message_get_text_content(pauline->stat.last_received_chat_message); + BC_ASSERT_PTR_NOT_NULL(content); + if (!first_file_transfer) + BC_ASSERT_STRING_EQUAL(content, "Hello part 1"); + else if (!second_file_transfer) + BC_ASSERT_STRING_EQUAL(content, "Hello part 2"); + } linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); diff --git a/tester/presence_server_tester.c b/tester/presence_server_tester.c index db3f0ca07..c0587fe7d 100644 --- a/tester/presence_server_tester.c +++ b/tester/presence_server_tester.c @@ -430,8 +430,10 @@ static void test_presence_list_base(bool_t enable_compression) { lcs = bctbx_list_append(lcs, pauline->lc); wait_for_list(lcs, &laure->stat.number_of_NotifyPresenceReceived, 2, 4000); - BC_ASSERT_EQUAL(laure->stat.number_of_NotifyPresenceReceived, 2, int, "%d"); - BC_ASSERT_EQUAL(linphone_friend_list_get_expected_notification_version(linphone_core_get_default_friend_list(laure->lc)), 1, int, "%d"); + BC_ASSERT_GREATER(laure->stat.number_of_NotifyPresenceReceived, 2, int, "%d"); + BC_ASSERT_LOWER(laure->stat.number_of_NotifyPresenceReceived, 3, int, "%d"); + BC_ASSERT_GREATER(linphone_friend_list_get_expected_notification_version(linphone_core_get_default_friend_list(laure->lc)), 1, int, "%d"); + BC_ASSERT_LOWER(linphone_friend_list_get_expected_notification_version(linphone_core_get_default_friend_list(laure->lc)), 2, int, "%d"); lf = linphone_friend_list_find_friend_by_address(linphone_core_get_default_friend_list(laure->lc), get_identity_address(marie)); if (!BC_ASSERT_PTR_NOT_NULL(lf)) goto end; BC_ASSERT_EQUAL(linphone_friend_get_status(lf), LinphoneStatusBusy, int, "%d"); @@ -485,7 +487,8 @@ static void test_presence_list_base(bool_t enable_compression) { /* The number of PresenceReceived events can be 3 or 4 here. TODO: ideally it should always be 3. */ BC_ASSERT_GREATER(laure->stat.number_of_NotifyPresenceReceived, 3, int, "%d"); BC_ASSERT_LOWER(laure->stat.number_of_NotifyPresenceReceived, 4, int, "%d"); - BC_ASSERT_EQUAL(linphone_friend_list_get_expected_notification_version(linphone_core_get_default_friend_list(laure->lc)), 2, int, "%d"); + BC_ASSERT_GREATER(linphone_friend_list_get_expected_notification_version(linphone_core_get_default_friend_list(laure->lc)), 2, int, "%d"); + BC_ASSERT_LOWER(linphone_friend_list_get_expected_notification_version(linphone_core_get_default_friend_list(laure->lc)), 3, int, "%d"); lf = linphone_friend_list_find_friend_by_address(linphone_core_get_default_friend_list(laure->lc), get_identity_address(marie)); BC_ASSERT_EQUAL(linphone_friend_get_status(lf), LinphoneStatusOnThePhone, int, "%d"); diff --git a/tester/tester.c b/tester/tester.c index 6eaafeab9..cd8481381 100644 --- a/tester/tester.c +++ b/tester/tester.c @@ -606,7 +606,7 @@ void liblinphone_tester_add_suites() { bc_tester_add_suite(&stun_test_suite); bc_tester_add_suite(&event_test_suite); bc_tester_add_suite(&conference_event_test_suite); - bc_tester_add_suite(&content_manager_test_suite); + bc_tester_add_suite(&contents_test_suite); bc_tester_add_suite(&flexisip_test_suite); bc_tester_add_suite(&remote_provisioning_test_suite); bc_tester_add_suite(&quality_reporting_test_suite); From 4eef6f1fcd6edebcbf71924325c43041bd886126 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 12 Apr 2018 12:10:24 +0200 Subject: [PATCH 105/121] Fix build broken by previous merge. --- src/content/content-type.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/content/content-type.cpp b/src/content/content-type.cpp index 6463a501a..b509c6ed2 100644 --- a/src/content/content-type.cpp +++ b/src/content/content-type.cpp @@ -133,7 +133,18 @@ bool ContentType::weakEqual (const ContentType &other) const { } bool ContentType::operator== (const ContentType &other) const { - return weakEqual(other) && (getParameter() == other.getParameter()); + if (!weakEqual(other)) + return false; + if (getParameters().size() != other.getParameters().size()) + return false; + for (const auto ¶m : getParameters()) { + auto it = other.findParameter(param.getName()); + if (it == other.getParameters().cend()) + return false; + if (it->getValue() != param.getValue()) + return false; + } + return true; } bool ContentType::operator!= (const ContentType &other) const { From 091a5e38aa14739b05c484930c6e881dcf0ab14c Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 12 Apr 2018 12:10:39 +0200 Subject: [PATCH 106/121] Improve content handling in local conference event handler. --- .../handlers/local-conference-event-handler.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/conference/handlers/local-conference-event-handler.cpp b/src/conference/handlers/local-conference-event-handler.cpp index a9aca08b7..fd67e2d00 100644 --- a/src/conference/handlers/local-conference-event-handler.cpp +++ b/src/conference/handlers/local-conference-event-handler.cpp @@ -107,10 +107,8 @@ string LocalConferenceEventHandlerPrivate::createNotifyMultipart (int notifyId) static_cast(notifyId) ); - list contents; + list contents; for (const auto &eventLog : events) { - Content *content = new Content(); - content->setContentType(ContentType("application","conference-info")); string body; shared_ptr notifiedEvent = static_pointer_cast(eventLog); int eventNotifyId = static_cast(notifiedEvent->getNotifyId()); @@ -180,14 +178,17 @@ string LocalConferenceEventHandlerPrivate::createNotifyMultipart (int notifyId) L_ASSERT(false); continue; } - content->setBody(body); - contents.push_back(content); + contents.emplace_back(Content()); + contents.back().setContentType(ContentType::ConferenceInfo); + contents.back().setBody(body); } if (contents.empty()) return ""; - string multipart = ContentManager::contentListToMultipart(contents).getBodyAsString(); - contents.clear(); + list contentPtrs; + for (auto &content : contents) + contentPtrs.push_back(&content); + string multipart = ContentManager::contentListToMultipart(contentPtrs).getBodyAsString(); return multipart; } From cda7797ba6e9d1106ea7ffee8737371cff0700e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Turnel?= Date: Thu, 12 Apr 2018 15:36:33 +0200 Subject: [PATCH 107/121] Add tests for sequential forking and fallback route features --- tester/flexisip_tester.c | 311 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 310 insertions(+), 1 deletion(-) diff --git a/tester/flexisip_tester.c b/tester/flexisip_tester.c index 19bdbe9d7..d2bf2bca7 100644 --- a/tester/flexisip_tester.c +++ b/tester/flexisip_tester.c @@ -1447,6 +1447,310 @@ void resend_refer_other_devices(void) { bctbx_list_free(lcs); } +void sequential_forking(void) { + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); + LinphoneCoreManager* marie2 = linphone_core_manager_create("marie_rc"); + + bctbx_list_t* lcs=bctbx_list_append(NULL,pauline->lc); + + /*we don't set marie "q" because it is by default at 1.0 if it is not present (RFC 4596)*/ + linphone_proxy_config_set_contact_parameters( + linphone_core_get_default_proxy_config(marie2->lc), + "q=0.5;"); + + linphone_core_manager_start(marie2, TRUE); + + lcs=bctbx_list_append(lcs,marie->lc); + lcs=bctbx_list_append(lcs,marie2->lc); + + linphone_core_set_user_agent(marie->lc,"Natted Linphone",NULL); + linphone_core_set_user_agent(marie2->lc,"Natted Linphone",NULL); + linphone_core_set_user_agent(pauline->lc,"Natted Linphone",NULL); + + linphone_core_invite_address(pauline->lc,marie->identity); + /*pauline should hear ringback*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallOutgoingRinging,1,3000)); + /*first device from Marie should be ringing*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallIncomingReceived,1,3000)); + /*the second should not*/ + BC_ASSERT_EQUAL(marie2->stat.number_of_LinphoneCallIncomingReceived, 0, int, "%d"); + + /*marie accepts the call on its second device*/ + linphone_call_accept(linphone_core_get_current_call(marie->lc)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallConnected,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallStreamsRunning,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallConnected,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallStreamsRunning,1,1000)); + + /*second device should have received nothing*/ + BC_ASSERT_EQUAL(marie2->stat.number_of_LinphoneCallEnd, 0, int, "%d"); + + linphone_call_terminate(linphone_core_get_current_call(pauline->lc)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallEnd,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallEnd,1,1000)); + + linphone_core_manager_destroy(pauline); + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(marie2); + bctbx_list_free(lcs); +} + +void sequential_forking_with_timeout_for_highest_priority(void) { + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); + LinphoneCoreManager* marie2 = linphone_core_manager_create("marie_rc"); + LinphoneCoreManager* marie3 = linphone_core_manager_create("marie_rc"); + + bctbx_list_t* lcs=bctbx_list_append(NULL,pauline->lc); + + /*we don't set marie "q" because it is by default at 1.0 if it is not present (RFC 4596)*/ + linphone_proxy_config_set_contact_parameters( + linphone_core_get_default_proxy_config(marie2->lc), + "q=0.5;"); + + linphone_proxy_config_set_contact_parameters( + linphone_core_get_default_proxy_config(marie3->lc), + "q=0.5;"); + + linphone_core_manager_start(marie2, TRUE); + linphone_core_manager_start(marie3, TRUE); + + lcs=bctbx_list_append(lcs,marie->lc); + lcs=bctbx_list_append(lcs,marie2->lc); + lcs=bctbx_list_append(lcs,marie3->lc); + + linphone_core_set_user_agent(marie->lc,"Natted Linphone",NULL); + linphone_core_set_user_agent(marie2->lc,"Natted Linphone",NULL); + linphone_core_set_user_agent(marie3->lc,"Natted Linphone",NULL); + linphone_core_set_user_agent(pauline->lc,"Natted Linphone",NULL); + + /*set first device not reachable*/ + linphone_core_set_network_reachable(marie->lc,FALSE); + + linphone_core_invite_address(pauline->lc,marie->identity); + + /*pauline should hear ringback*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallOutgoingRinging,1,3000)); + /*first device should receive nothing since it is disconnected*/ + BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneCallIncomingReceived, 0, int, "%d"); + /*second and third devices should have received the call*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&marie2->stat.number_of_LinphoneCallIncomingReceived,1,3000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie3->stat.number_of_LinphoneCallIncomingReceived,1,3000)); + + /*marie accepts the call on her third device*/ + linphone_call_accept(linphone_core_get_current_call(marie3->lc)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallConnected,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallStreamsRunning,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie3->stat.number_of_LinphoneCallConnected,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie3->stat.number_of_LinphoneCallStreamsRunning,1,1000)); + + /*second device should stop ringing*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&marie2->stat.number_of_LinphoneCallEnd,1,1000)); + + linphone_call_terminate(linphone_core_get_current_call(pauline->lc)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallEnd,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie3->stat.number_of_LinphoneCallEnd,1,1000)); + + /*first device should have received nothing*/ + BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneCallEnd, 0, int, "%d"); + + linphone_core_manager_destroy(pauline); + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(marie2); + linphone_core_manager_destroy(marie3); + bctbx_list_free(lcs); +} + +void sequential_forking_with_no_response_for_highest_priority(void) { + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); + LinphoneCoreManager* marie2 = linphone_core_manager_create("marie_rc"); + + bctbx_list_t* lcs=bctbx_list_append(NULL,pauline->lc); + + /*we don't set marie "q" because it is by default at 1.0 if it is not present (RFC 4596)*/ + linphone_proxy_config_set_contact_parameters( + linphone_core_get_default_proxy_config(marie2->lc), + "q=0.5;"); + + linphone_core_manager_start(marie2, TRUE); + + lcs=bctbx_list_append(lcs,marie->lc); + lcs=bctbx_list_append(lcs,marie2->lc); + + linphone_core_set_user_agent(marie->lc,"Natted Linphone",NULL); + linphone_core_set_user_agent(marie2->lc,"Natted Linphone",NULL); + linphone_core_set_user_agent(pauline->lc,"Natted Linphone",NULL); + + linphone_core_invite_address(pauline->lc,marie->identity); + + /*pauline should hear ringback*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallOutgoingRinging,1,3000)); + /*first device should receive the call*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallIncomingReceived,1,3000)); + /*second device should have not received the call yet*/ + BC_ASSERT_EQUAL(marie2->stat.number_of_LinphoneCallIncomingReceived, 0, int, "%d"); + + /*we wait for the call to try the next branches*/ + wait_for_list(lcs,NULL,0,10000); + + /*then the second device should receive the call*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&marie2->stat.number_of_LinphoneCallIncomingReceived, 1, 3000)); + + /*marie accepts the call on her second device*/ + linphone_call_accept(linphone_core_get_current_call(marie2->lc)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallConnected,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallStreamsRunning,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie2->stat.number_of_LinphoneCallConnected,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie2->stat.number_of_LinphoneCallStreamsRunning,1,1000)); + + /*the first device should finish*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallEnd, 1, 3000)); + + linphone_call_terminate(linphone_core_get_current_call(pauline->lc)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallEnd,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie2->stat.number_of_LinphoneCallEnd,1,1000)); + + linphone_core_manager_destroy(pauline); + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(marie2); + bctbx_list_free(lcs); +} + +void sequential_forking_with_insertion_of_higher_priority(void) { + LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); + LinphoneCoreManager* marie2 = linphone_core_manager_create("marie_rc"); + + bctbx_list_t* lcs=bctbx_list_append(NULL,pauline->lc); + + /*we don't set marie "q" because it is by default at 1.0 if it is not present (RFC 4596)*/ + linphone_proxy_config_set_contact_parameters( + linphone_core_get_default_proxy_config(marie2->lc), + "q=0.5;"); + + linphone_core_manager_start(marie2, TRUE); + + lcs=bctbx_list_append(lcs,marie->lc); + lcs=bctbx_list_append(lcs,marie2->lc); + + linphone_core_set_user_agent(marie->lc,"Natted Linphone",NULL); + linphone_core_set_user_agent(marie2->lc,"Natted Linphone",NULL); + linphone_core_set_user_agent(pauline->lc,"Natted Linphone",NULL); + + /*set first device not reachable*/ + linphone_core_set_network_reachable(marie->lc,FALSE); + + linphone_core_invite_address(pauline->lc,marie->identity); + + /*pauline should hear ringback*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallOutgoingRinging,1,3000)); + /*first device should receive nothing since it is disconnected*/ + BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneCallIncomingReceived, 0, int, "%d"); + /*second device should have received the call*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&marie2->stat.number_of_LinphoneCallIncomingReceived,1,3000)); + + /*we create a new device*/ + LinphoneCoreManager* marie3 = linphone_core_manager_new("marie_rc"); + lcs=bctbx_list_append(lcs,marie3->lc); + linphone_core_set_user_agent(marie3->lc,"Natted Linphone",NULL); + + /*this device should receive the call*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&marie3->stat.number_of_LinphoneCallIncomingReceived,1,3000)); + + /*marie accepts the call on her third device*/ + linphone_call_accept(linphone_core_get_current_call(marie3->lc)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallConnected,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallStreamsRunning,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie3->stat.number_of_LinphoneCallConnected,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie3->stat.number_of_LinphoneCallStreamsRunning,1,1000)); + + /*second device should stop ringing*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&marie2->stat.number_of_LinphoneCallEnd,1,1000)); + + linphone_call_terminate(linphone_core_get_current_call(pauline->lc)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallEnd,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie3->stat.number_of_LinphoneCallEnd,1,1000)); + + /*first device should have received nothing*/ + BC_ASSERT_EQUAL(marie->stat.number_of_LinphoneCallEnd, 0, int, "%d"); + + linphone_core_manager_destroy(pauline); + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(marie2); + linphone_core_manager_destroy(marie3); + bctbx_list_free(lcs); +} + +void sequential_forking_with_fallback_route(void) { + LinphoneCoreManager* pauline = linphone_core_manager_new(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); + LinphoneCoreManager* pauline2 = linphone_core_manager_create(transport_supported(LinphoneTransportTls) ? "pauline_rc" : "pauline_tcp_rc"); + LinphoneCoreManager* marie = linphone_core_manager_create("marie_rc"); + + bctbx_list_t* lcs=bctbx_list_append(NULL,pauline->lc); + + /*we set pauline2 and marie to another test server that is configured with a fallback route*/ + linphone_proxy_config_set_server_addr( + linphone_core_get_default_proxy_config(pauline2->lc), + "sip:sip2.linphone.org:5071;transport=tls"); + + linphone_proxy_config_set_route( + linphone_core_get_default_proxy_config(pauline2->lc), + "sip:sip2.linphone.org:5071;transport=tls"); + + linphone_proxy_config_set_server_addr( + linphone_core_get_default_proxy_config(marie->lc), + "sip:sip2.linphone.org:5070;transport=tcp"); + + linphone_proxy_config_set_route( + linphone_core_get_default_proxy_config(marie->lc), + "sip:sip2.linphone.org:5070;transport=tcp;lr"); + + linphone_core_manager_start(pauline2, TRUE); + linphone_core_manager_start(marie, TRUE); + + lcs=bctbx_list_append(lcs,pauline2->lc); + lcs=bctbx_list_append(lcs,marie->lc); + + linphone_core_set_user_agent(pauline->lc,"Natted Linphone",NULL); + linphone_core_set_user_agent(pauline2->lc,"Natted Linphone",NULL); + linphone_core_set_user_agent(marie->lc,"Natted Linphone",NULL); + + /*set pauline2 not reachable*/ + linphone_core_set_network_reachable(pauline2->lc,FALSE); + + /*marie invites pauline2 on the other server*/ + linphone_core_invite_address(marie->lc,pauline2->identity); + + /*marie should hear ringback*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallOutgoingRinging,1,3000)); + /*pauline2 should receive nothing since it is disconnected*/ + BC_ASSERT_EQUAL(pauline2->stat.number_of_LinphoneCallIncomingReceived, 0, int, "%d"); + + /*the call should be routed to the first server with pauline account*/ + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallIncomingReceived,1,3000)); + + /*pauline accepts the call*/ + linphone_call_accept(linphone_core_get_current_call(pauline->lc)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallConnected,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallStreamsRunning,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallConnected,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallStreamsRunning,1,1000)); + + linphone_call_terminate(linphone_core_get_current_call(marie->lc)); + BC_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallEnd,1,1000)); + BC_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallEnd,1,1000)); + + /*first device should have received nothing*/ + BC_ASSERT_EQUAL(pauline2->stat.number_of_LinphoneCallEnd, 0, int, "%d"); + + linphone_core_manager_destroy(pauline); + linphone_core_manager_destroy(pauline2); + linphone_core_manager_destroy(marie); + bctbx_list_free(lcs); +} + test_t flexisip_tests[] = { TEST_ONE_TAG("Subscribe forking", subscribe_forking, "LeaksMemory"), TEST_NO_TAG("Message forking", message_forking), @@ -1484,7 +1788,12 @@ test_t flexisip_tests[] = { TEST_NO_TAG("TLS authentication - client rejected due to unrecognized certificate chain", tls_client_auth_bad_certificate), TEST_NO_TAG("Transcoder", transcoder_tester), TEST_NO_TAG("Removing old tport on flexisip for the same client", test_removing_old_tport), - TEST_NO_TAG("Resend of REFER with other devices", resend_refer_other_devices) + TEST_NO_TAG("Resend of REFER with other devices", resend_refer_other_devices), + TEST_NO_TAG("Sequential forking", sequential_forking), + TEST_NO_TAG("Sequential forking with timeout for highest priority", sequential_forking_with_timeout_for_highest_priority), + TEST_NO_TAG("Sequential forking with no response from highest priority", sequential_forking_with_no_response_for_highest_priority), + TEST_NO_TAG("Sequential forking with insertion of higher priority", sequential_forking_with_insertion_of_higher_priority), + TEST_NO_TAG("Sequential forking with fallback route", sequential_forking_with_fallback_route) }; From bb0d2409bdac96dc5ca56b6aecaae585da0dfbdd Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 17 Nov 2017 17:04:05 +0100 Subject: [PATCH 108/121] Fix soundcard usage optimization for iOS: after a conference call the AudioUnit wasn't released, which was causing next call to have no audio. --- coreapi/conference.cc | 5 ++++- coreapi/linphonecore.c | 1 + src/core/core-call.cpp | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/coreapi/conference.cc b/coreapi/conference.cc index b9e91d4b3..06b35378a 100644 --- a/coreapi/conference.cc +++ b/coreapi/conference.cc @@ -685,9 +685,12 @@ void LocalConference::onCallTerminating (LinphoneCall *call) { ms_message("conference_check_uninit(): size=%i", getSize()); if ((remote_count == 1) && !m_terminating) convertConferenceToCall(); + if (remote_count == 0) { - if (m_localParticipantStream) + if (m_localParticipantStream){ removeLocalEndpoint(); + linphone_core_soundcard_hint_check(m_core); + } if (m_recordEndpoint) { ms_audio_conference_remove_member(m_conf, m_recordEndpoint); ms_audio_endpoint_destroy(m_recordEndpoint); diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 203d77289..0903e83a5 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -6225,6 +6225,7 @@ int linphone_core_get_calls_nb(const LinphoneCore *lc) { return (int)L_GET_CPP_PTR_FROM_C_OBJECT(lc)->getCallCount(); } + void linphone_core_soundcard_hint_check(LinphoneCore* lc) { L_GET_CPP_PTR_FROM_C_OBJECT(lc)->soundcardHintCheck(); } diff --git a/src/core/core-call.cpp b/src/core/core-call.cpp index 5bc9912a7..53d33ab35 100644 --- a/src/core/core-call.cpp +++ b/src/core/core-call.cpp @@ -27,6 +27,7 @@ // TODO: Remove me later. #include "c-wrapper/c-wrapper.h" +#include "conference_private.h" #include @@ -301,6 +302,10 @@ void Core::soundcardHintCheck () { LinphoneConfig *config = linphone_core_get_config(L_GET_C_BACK_PTR(this)); bool useRtpIo = !!lp_config_get_int(config, "sound", "rtp_io", FALSE); bool useRtpIoEnableLocalOutput = !!lp_config_get_int(config, "sound", "rtp_io_enable_local_output", FALSE); + + LinphoneConference *conf_ctx = getCCore()->conf_ctx; + if (conf_ctx && linphone_conference_get_size(conf_ctx) >= 1) return; + bool useFiles = L_GET_C_BACK_PTR(getSharedFromThis())->use_files; if ((!d->hasCalls() || noNeedForSound) && (!useFiles && (!useRtpIo || (useRtpIo && useRtpIoEnableLocalOutput)))) { From 9ffab5906bcb0a490dccf02aa4638517628925d1 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 21 Nov 2017 13:59:30 +0100 Subject: [PATCH 109/121] Fix ringstream instanciation. --- coreapi/linphonecore.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 0903e83a5..15e9e422b 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -5579,10 +5579,11 @@ static MSFilter *get_audio_resource(LinphoneCore *lc, LinphoneAudioResourceType if (rtype==LinphoneLocalPlayer) return stream->local_player; return NULL; } - if (card || lc->ringstream == NULL) { - if (lc->ringstream) + if (card && lc->ringstream && card != lc->ringstream->card){ ring_stop(lc->ringstream); - + lc->ringstream = NULL; + } + if (lc->ringstream == NULL) { float amp=lp_config_get_float(lc->config,"sound","dtmf_player_amp",0.1f); MSSndCard *ringcard=lc->sound_conf.lsd_card ? lc->sound_conf.lsd_card From 1cdc1ff07f67746c6ac627eddd97819783cc73cf Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 12 Apr 2018 17:41:55 +0200 Subject: [PATCH 110/121] Retrofit of commit 2b3d4a from master branch, fixing table overflow in ICE code. --- src/nat/ice-agent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nat/ice-agent.cpp b/src/nat/ice-agent.cpp index cbc74cd4a..167acc8b9 100644 --- a/src/nat/ice-agent.cpp +++ b/src/nat/ice-agent.cpp @@ -762,7 +762,7 @@ bool IceAgent::checkIceReinviteNeedsDeferedResponse(SalMediaDescription *md){ if (ice_check_list_state(cl) != ICL_Running) continue; - for (j = 0; j < SAL_MEDIA_DESCRIPTION_MAX_ICE_CANDIDATES; j++) { + for (j = 0; j < SAL_MEDIA_DESCRIPTION_MAX_ICE_REMOTE_CANDIDATES; j++) { const SalIceRemoteCandidate *remote_candidate = &stream->ice_remote_candidates[j]; if (remote_candidate->addr[0] != '\0') return true; From 89d43744f5bc37f68a27c1901be7b155c64771bc Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 12 Apr 2018 17:59:42 +0200 Subject: [PATCH 111/121] Rewrite of commit 419281 from master branch (fix ICE bug and leak in test) --- src/conference/session/media-session.cpp | 2 ++ tester/call_multi_tester.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/conference/session/media-session.cpp b/src/conference/session/media-session.cpp index 29beeb763..694ef27fd 100644 --- a/src/conference/session/media-session.cpp +++ b/src/conference/session/media-session.cpp @@ -279,6 +279,7 @@ void MediaSessionPrivate::remoteRinging () { getCurrentParams()->setPrivacy((LinphonePrivacyMask)op->get_privacy()); SalMediaDescription *md = op->get_final_media_description(); if (md) { + SalMediaDescription *rmd = op->get_remote_media_description(); /* Initialize the remote call params by invoking linphone_call_get_remote_params(). This is useful as the SDP may not be present in the 200Ok */ q->getRemoteParams(); /* Accept early media */ @@ -300,6 +301,7 @@ void MediaSessionPrivate::remoteRinging () { if (listener) listener->onStopRinging(q->getSharedFromThis()); lInfo() << "Doing early media..."; + iceAgent->updateFromRemoteMediaDescription(localDesc, rmd, !op->is_offerer()); updateStreams(md, state); if ((q->getCurrentParams()->getAudioDirection() == LinphoneMediaDirectionInactive) && audioStream) { if (listener) diff --git a/tester/call_multi_tester.c b/tester/call_multi_tester.c index da58f20eb..913eb43ec 100644 --- a/tester/call_multi_tester.c +++ b/tester/call_multi_tester.c @@ -1151,10 +1151,12 @@ void do_not_stop_ringing_when_declining_one_of_two_incoming_calls(void) { pauline_called_by_marie=linphone_core_get_current_call(marie->lc); linphone_call_decline(pauline_called_by_laure, LinphoneReasonDeclined); BC_ASSERT_TRUE(wait_for(laure->lc,pauline->lc,&pauline->stat.number_of_LinphoneCallEnd,1)); + BC_ASSERT_TRUE(wait_for(laure->lc,pauline->lc,&pauline->stat.number_of_LinphoneCallReleased,1)); BC_ASSERT_TRUE(linphone_ringtoneplayer_is_started(linphone_core_get_ringtoneplayer(pauline->lc))); linphone_call_terminate(pauline_called_by_marie); BC_ASSERT_TRUE(wait_for(marie->lc,pauline->lc,&pauline->stat.number_of_LinphoneCallEnd,2)); + BC_ASSERT_TRUE(wait_for(marie->lc,pauline->lc,&pauline->stat.number_of_LinphoneCallReleased,2)); linphone_core_manager_destroy(marie); linphone_core_manager_destroy(pauline); From 6581df0c4909941ed063a68d5b9dbfa681320636 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 12 Apr 2018 18:11:12 +0200 Subject: [PATCH 112/121] Rewrite of commit 20efb4 from master branch (avoid unnecessary restart of stream when ICE is deactivated) --- src/c-wrapper/internal/c-sal.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/c-wrapper/internal/c-sal.cpp b/src/c-wrapper/internal/c-sal.cpp index ac0260208..ae0ed5a2d 100644 --- a/src/c-wrapper/internal/c-sal.cpp +++ b/src/c-wrapper/internal/c-sal.cpp @@ -423,8 +423,9 @@ int sal_stream_description_equals(const SalStreamDescription *sd1, const SalStre if (sd1->dir != sd2->dir) result |= SAL_MEDIA_DESCRIPTION_CODEC_CHANGED; /* ICE */ - if (strcmp(sd1->ice_ufrag, sd2->ice_ufrag) != 0) result |= SAL_MEDIA_DESCRIPTION_ICE_RESTART_DETECTED; - if (strcmp(sd1->ice_pwd, sd2->ice_pwd) != 0) result |= SAL_MEDIA_DESCRIPTION_ICE_RESTART_DETECTED; + if (strcmp(sd1->ice_ufrag, sd2->ice_ufrag) != 0 && sd2->ice_ufrag[0] != '\0') result |= SAL_MEDIA_DESCRIPTION_ICE_RESTART_DETECTED; + if (strcmp(sd1->ice_pwd, sd2->ice_pwd) != 0 && sd2->ice_pwd[0] != '\0') result |= SAL_MEDIA_DESCRIPTION_ICE_RESTART_DETECTED; + /*DTLS*/ if (sd1->dtls_role != sd2->dtls_role) result |= SAL_MEDIA_DESCRIPTION_CRYPTO_KEYS_CHANGED; @@ -485,8 +486,8 @@ int sal_media_description_equals(const SalMediaDescription *md1, const SalMediaD if (md1->bandwidth != md2->bandwidth) result |= SAL_MEDIA_DESCRIPTION_CODEC_CHANGED; /* ICE */ - if (strcmp(md1->ice_ufrag, md2->ice_ufrag) != 0) result |= SAL_MEDIA_DESCRIPTION_ICE_RESTART_DETECTED; - if (strcmp(md1->ice_pwd, md2->ice_pwd) != 0) result |= SAL_MEDIA_DESCRIPTION_ICE_RESTART_DETECTED; + if (strcmp(md1->ice_ufrag, md2->ice_ufrag) != 0 && md2->ice_ufrag[0] != '\0') result |= SAL_MEDIA_DESCRIPTION_ICE_RESTART_DETECTED; + if (strcmp(md1->ice_pwd, md2->ice_pwd) != 0 && md2->ice_pwd[0] != '\0') result |= SAL_MEDIA_DESCRIPTION_ICE_RESTART_DETECTED; for(i = 0; i < SAL_MEDIA_DESCRIPTION_MAX_STREAMS; ++i){ if (!sal_stream_description_active(&md1->streams[i]) && !sal_stream_description_active(&md2->streams[i])) continue; From c21de55c4813e6fe128dc47bd32585bf90aa4a19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Turnel?= Date: Fri, 13 Apr 2018 10:01:03 +0200 Subject: [PATCH 113/121] Use regex function from bctoolbox (retrofit of commit 895f08) --- coreapi/account_creator.c | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/coreapi/account_creator.c b/coreapi/account_creator.c index d624aaef0..4a3f16955 100644 --- a/coreapi/account_creator.c +++ b/coreapi/account_creator.c @@ -24,11 +24,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "c-wrapper/c-wrapper.h" #include "dial-plan/dial-plan.h" -#if !_WIN32 - #include "regex.h" -#endif - #include +#include // TODO: From coreapi. Remove me later. #include "private.h" @@ -112,25 +109,6 @@ static char* _get_identity(const LinphoneAccountCreator *creator) { return identity; } -static bool_t is_matching_regex(const char *entry, const char* regex) { -#if _WIN32 - return TRUE; -#else - regex_t regex_pattern; - char err_msg[256]; - int res; - res = regcomp(®ex_pattern, regex, REG_EXTENDED | REG_NOSUB); - if(res != 0) { - regerror(res, ®ex_pattern, err_msg, sizeof(err_msg)); - ms_error("Could not compile regex '%s: %s", regex, err_msg); - return FALSE; - } - res = regexec(®ex_pattern, entry, 0, NULL, 0); - regfree(®ex_pattern); - return (res != REG_NOMATCH); -#endif -} - LinphoneProxyConfig * linphone_account_creator_create_proxy_config(const LinphoneAccountCreator *creator) { LinphoneAuthInfo *info; LinphoneProxyConfig *cfg = linphone_core_create_proxy_config(creator->core); @@ -383,7 +361,7 @@ LinphoneAccountCreatorUsernameStatus linphone_account_creator_set_username(Linph return LinphoneAccountCreatorUsernameStatusTooLong; } else if (use_phone_number && !linphone_proxy_config_is_phone_number(NULL, username)) { return LinphoneAccountCreatorUsernameStatusInvalid; - } else if (regex && !is_matching_regex(username, regex)) { + } else if (regex && !bctbx_is_matching_regex(username, regex)) { return LinphoneAccountCreatorUsernameStatusInvalidCharacters; } else if (validate_uri(username, NULL, NULL) != 0) { return LinphoneAccountCreatorUsernameStatusInvalid; @@ -506,10 +484,10 @@ const char * linphone_account_creator_get_display_name(const LinphoneAccountCrea } LinphoneAccountCreatorEmailStatus linphone_account_creator_set_email(LinphoneAccountCreator *creator, const char *email) { - if (!email || !is_matching_regex(email, "^.+@.+\\..*$")) { + if (!email || !bctbx_is_matching_regex(email, "^.+@.+\\..*$")) { return LinphoneAccountCreatorEmailStatusMalformed; } - if (!is_matching_regex(email, "^.+@.+\\.[A-Za-z]{2}[A-Za-z]*$")) { + if (!bctbx_is_matching_regex(email, "^.+@.+\\.[A-Za-z]{2}[A-Za-z]*$")) { return LinphoneAccountCreatorEmailStatusInvalidCharacters; } set_string(&creator->email, email, TRUE); From a85054581e61f3871bf3e02c0a4e4fdca1a3b1e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Turnel?= Date: Fri, 13 Apr 2018 10:10:40 +0200 Subject: [PATCH 114/121] Fix ZRTP file renaming while still in use (retrofit of commit ccb308) --- coreapi/linphonecore.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 15e9e422b..796e82d82 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -6485,10 +6485,21 @@ void linphone_core_set_zrtp_secrets_file(LinphoneCore *lc, const char* file){ /* rename the newly created sqlite3 file in to the given file name */ rename(file, bkpFile); + +#ifdef _WIN32 + /* We first have to close the file before renaming it */ + sqlite3_close(lc->zrtp_cache_db); +#endif + if (rename(tmpFile, file)==0) { /* set the flag if we were able to set the sqlite file in the correct place (even if migration failed) */ lp_config_set_int(lc->config, "sip", "zrtp_cache_migration_done", TRUE); } +#ifdef _WIN32 + /* Then reopen it */ + _linphone_sqlite3_open(file, &lc->zrtp_cache_db); +#endif + /* clean up */ bctbx_free(bkpFile); xmlFree(cacheXml); From 43f186acd56d7e122ea1492ed1bbfaacb6792913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Turnel?= Date: Fri, 13 Apr 2018 10:11:11 +0200 Subject: [PATCH 115/121] Fix incorrect test path (retrofit of commit 24156d) --- tester/call_single_tester.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tester/call_single_tester.c b/tester/call_single_tester.c index 08be21bf9..211a4086f 100644 --- a/tester/call_single_tester.c +++ b/tester/call_single_tester.c @@ -1340,7 +1340,7 @@ static void cancelled_ringing_call(void) { const bctbx_list_t * call_history; LinphoneCall* out_call; - char * db_path= bctbx_strdup_printf("%s,%s",bc_tester_get_writable_dir_prefix(),"tmp_call_log.db"); + char * db_path= bctbx_strdup_printf("%s/%s",bc_tester_get_writable_dir_prefix(),"tmp_call_log.db"); linphone_core_set_call_logs_database_path(marie->lc,db_path); From bce1930177993cb2f594f1e97d34c47be8934670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Fri, 13 Apr 2018 10:34:07 +0200 Subject: [PATCH 116/121] Dial plan modification: Indonesian number can now have until 12 significant digits. --- src/dial-plan/dial-plan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dial-plan/dial-plan.cpp b/src/dial-plan/dial-plan.cpp index c3b20a49d..9d8b64be6 100644 --- a/src/dial-plan/dial-plan.cpp +++ b/src/dial-plan/dial-plan.cpp @@ -128,7 +128,7 @@ const list DialPlanPrivate::DialPlans = { { "Hungary", "HU", "36", 9, "00" }, { "Iceland", "IS", "354", 9, "00" }, { "India", "IN", "91", 10, "00" }, - { "Indonesia", "ID", "62", 10, "001" }, + { "Indonesia", "ID", "62", 12, "001" }, { "Iran", "IR", "98", 10, "00" }, { "Iraq", "IQ", "964", 10, "00" }, { "Ireland", "IE", "353", 9, "00" }, From 1e4a5ebb50f38149090d7427bc5dea2d0c6cfa1f Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Wed, 29 Nov 2017 14:36:42 +0100 Subject: [PATCH 117/121] Adding test for regid in register response --- tester/register_tester.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tester/register_tester.c b/tester/register_tester.c index 44e83945f..8e5e9996c 100644 --- a/tester/register_tester.c +++ b/tester/register_tester.c @@ -1288,6 +1288,19 @@ static void multi_devices_register_with_gruu(void) { linphone_core_manager_destroy(marie); } +static void register_without_regid(void) { + LinphoneCoreManager *marie = ms_new0(LinphoneCoreManager, 1); + linphone_core_manager_init(marie, "marie_rc", NULL); + linphone_core_manager_start(marie,TRUE); + LinphoneProxyConfig *cfg=linphone_core_get_default_proxy_config(marie->lc); + if(cfg) { + const LinphoneAddress *addr = linphone_proxy_config_get_contact(cfg); + BC_ASSERT_PTR_NOT_NULL(addr); + BC_ASSERT_PTR_NOT_NULL(strstr(linphone_address_as_string_uri_only(addr), "regid")); + } + linphone_core_manager_destroy(marie); +} + test_t register_tests[] = { TEST_NO_TAG("Simple register", simple_register), @@ -1337,7 +1350,8 @@ test_t register_tests[] = { TEST_NO_TAG("AuthInfo TLS client certificate authentication in callback", tls_auth_info_client_cert_cb), TEST_NO_TAG("AuthInfo TLS client certificate authentication in callback 2", tls_auth_info_client_cert_cb_2), TEST_NO_TAG("Register get GRUU", register_get_gruu), - TEST_NO_TAG("Register get GRUU for multi device", multi_devices_register_with_gruu) + TEST_NO_TAG("Register get GRUU for multi device", multi_devices_register_with_gruu), + TEST_NO_TAG("Register contact do not have regid param", register_without_regid) }; test_suite_t register_test_suite = {"Register", NULL, NULL, liblinphone_tester_before_each, liblinphone_tester_after_each, From 80b369728c84e3ed09af9c0f0e73e0bc0425f784 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 13 Apr 2018 17:06:40 +0200 Subject: [PATCH 118/121] Added a setting in proxy config to tell the app whether or not to set push notification informations --- coreapi/private_structs.h | 2 ++ coreapi/proxy.c | 11 +++++++++++ include/linphone/proxy_config.h | 14 ++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/coreapi/private_structs.h b/coreapi/private_structs.h index 81dafc688..9a7da002a 100644 --- a/coreapi/private_structs.h +++ b/coreapi/private_structs.h @@ -132,6 +132,8 @@ struct _LinphoneProxyConfig char *refkey; char *sip_etag; /*publish context*/ char *conference_factory_uri; + + bool_t push_notification_allowed; }; BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneProxyConfig); diff --git a/coreapi/proxy.c b/coreapi/proxy.c index b797e1d0b..ea6bfd0fc 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -143,6 +143,7 @@ static void linphone_proxy_config_init(LinphoneCore* lc, LinphoneProxyConfig *cf cfg->avpf_rr_interval = lc ? !!lp_config_get_default_int(lc->config, "proxy", "avpf_rr_interval", 5) : 5; cfg->publish_expires= lc ? lp_config_get_default_int(lc->config, "proxy", "publish_expires", -1) : -1; cfg->publish = lc ? !!lp_config_get_default_int(lc->config, "proxy", "publish", FALSE) : FALSE; + cfg->push_notification_allowed = lc ? !!lp_config_get_default_int(lc->config, "proxy", "push_notification_allowed", TRUE) : TRUE; cfg->refkey = refkey ? ms_strdup(refkey) : NULL; if (nat_policy_ref) { LinphoneNatPolicy *policy = linphone_config_create_nat_policy_from_section(lc->config,nat_policy_ref); @@ -1190,6 +1191,7 @@ void linphone_proxy_config_write_to_config_file(LpConfig *config, LinphoneProxyC lp_config_set_int(config,key,"dial_escape_plus",cfg->dial_escape_plus); lp_config_set_string(config,key,"dial_prefix",cfg->dial_prefix); lp_config_set_int(config,key,"privacy",(int)cfg->privacy); + lp_config_set_int(config,key,"push_notification_allowed",(int)cfg->push_notification_allowed); if (cfg->refkey) lp_config_set_string(config,key,"refkey",cfg->refkey); lp_config_set_int(config, key, "publish_expires", cfg->publish_expires); @@ -1250,6 +1252,7 @@ LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LinphoneCore* lc CONFIGURE_INT_VALUE(cfg,config,key,expires,"reg_expires", int) CONFIGURE_BOOL_VALUE(cfg,config,key,register,"reg_sendregister") CONFIGURE_BOOL_VALUE(cfg,config,key,publish,"publish") + CONFIGURE_BOOL_VALUE(cfg,config,key,publish,"push_notification_allowed") linphone_proxy_config_set_avpf_mode(cfg,static_cast(lp_config_get_int(config,key,"avpf",linphone_proxy_config_get_avpf_mode(cfg)))); CONFIGURE_INT_VALUE(cfg,config,key,avpf_rr_interval,"avpf_rr_interval",uint8_t) CONFIGURE_INT_VALUE(cfg,config,key,dial_escape_plus,"dial_escape_plus",bool_t) @@ -1579,3 +1582,11 @@ void linphone_proxy_config_set_conference_factory_uri(LinphoneProxyConfig *cfg, const char * linphone_proxy_config_get_conference_factory_uri(const LinphoneProxyConfig *cfg) { return cfg->conference_factory_uri; } + +bool_t linphone_proxy_config_is_push_notification_allowed(const LinphoneProxyConfig *cfg) { + return cfg->push_notification_allowed; +} + +void linphone_proxy_config_set_push_notification_allowed(LinphoneProxyConfig *cfg, bool_t is_allowed) { + cfg->push_notification_allowed = is_allowed; +} \ No newline at end of file diff --git a/include/linphone/proxy_config.h b/include/linphone/proxy_config.h index 7214b5aa0..e65ac0803 100644 --- a/include/linphone/proxy_config.h +++ b/include/linphone/proxy_config.h @@ -617,6 +617,20 @@ void linphone_proxy_config_set_conference_factory_uri(LinphoneProxyConfig *cfg, */ const char * linphone_proxy_config_get_conference_factory_uri(const LinphoneProxyConfig *cfg); +/** + * Indicates whether to add to the contact parameters the push notification information. + * @param[in] cfg #LinphoneProxyConfig object. + * @param[in] allow True to allow push notification information, false otherwise. + */ +LINPHONE_PUBLIC void linphone_proxy_config_set_push_notification_allowed(LinphoneProxyConfig *cfg, bool_t allow); + +/** + * Indicates whether to add to the contact parameters the push notification information. + * @param[in] cfg #LinphoneProxyConfig object. + * @return True if push notification informations should be added, false otherwise. + */ +LINPHONE_PUBLIC bool_t linphone_proxy_config_is_push_notification_allowed(LinphoneProxyConfig *cfg); + /** * @} */ From ed10a8cf94445177ead7f4b55d408b652a6fa194 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 13 Apr 2018 17:19:02 +0200 Subject: [PATCH 119/121] Fixed previous commit --- include/linphone/proxy_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linphone/proxy_config.h b/include/linphone/proxy_config.h index e65ac0803..3bdd9df4b 100644 --- a/include/linphone/proxy_config.h +++ b/include/linphone/proxy_config.h @@ -629,7 +629,7 @@ LINPHONE_PUBLIC void linphone_proxy_config_set_push_notification_allowed(Linphon * @param[in] cfg #LinphoneProxyConfig object. * @return True if push notification informations should be added, false otherwise. */ -LINPHONE_PUBLIC bool_t linphone_proxy_config_is_push_notification_allowed(LinphoneProxyConfig *cfg); +LINPHONE_PUBLIC bool_t linphone_proxy_config_is_push_notification_allowed(const LinphoneProxyConfig *cfg); /** * @} From 7705ada69553c274040ce7b3164ea8c1584f7edb Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 13 Apr 2018 17:37:00 +0200 Subject: [PATCH 120/121] Push notification allowed setting for proxy config wasn't correctly read from config file --- coreapi/proxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coreapi/proxy.c b/coreapi/proxy.c index ea6bfd0fc..a49154e90 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -1252,7 +1252,7 @@ LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LinphoneCore* lc CONFIGURE_INT_VALUE(cfg,config,key,expires,"reg_expires", int) CONFIGURE_BOOL_VALUE(cfg,config,key,register,"reg_sendregister") CONFIGURE_BOOL_VALUE(cfg,config,key,publish,"publish") - CONFIGURE_BOOL_VALUE(cfg,config,key,publish,"push_notification_allowed") + linphone_proxy_config_set_push_notification_allowed(cfg, !!lp_config_get_int(config,key,"push_notification_allowed",linphone_proxy_config_is_push_notification_allowed(cfg))); linphone_proxy_config_set_avpf_mode(cfg,static_cast(lp_config_get_int(config,key,"avpf",linphone_proxy_config_get_avpf_mode(cfg)))); CONFIGURE_INT_VALUE(cfg,config,key,avpf_rr_interval,"avpf_rr_interval",uint8_t) CONFIGURE_INT_VALUE(cfg,config,key,dial_escape_plus,"dial_escape_plus",bool_t) From 9e921fa3030e92c4268e2170e00fc1f98b1d9f48 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 13 Apr 2018 18:13:33 +0200 Subject: [PATCH 121/121] Added missing enums & listeners to proguard file generated by JAVA wrapper --- wrappers/java/genwrapper.py | 25 +++++++++++++++++++++++++ wrappers/java/proguard.mustache | 12 +++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/wrappers/java/genwrapper.py b/wrappers/java/genwrapper.py index 1f00356e0..a123d2c50 100755 --- a/wrappers/java/genwrapper.py +++ b/wrappers/java/genwrapper.py @@ -654,6 +654,8 @@ class Proguard(object): def __init__(self, package): self.package = package self.classes = [] + self.enums = [] + self.listeners = [] def add_class(self, javaClass): obj = { @@ -663,6 +665,27 @@ class Proguard(object): } self.classes.append(obj) + for javaEnum in javaClass.enums: + enumObj = { + 'package': self.package, + 'className': javaClass.className + "$" + javaEnum.className, + } + self.enums.append(enumObj) + + def add_enum(self, javaEnum): + obj = { + 'package': self.package, + 'className': javaEnum.className, + } + self.enums.append(obj) + + def add_interface(self, javaInterface): + obj = { + 'package': self.package, + 'className': javaInterface.className, + } + self.listeners.append(obj) + ########################################################################## class GenWrapper(object): @@ -710,8 +733,10 @@ class GenWrapper(object): for name, value in self.enums.items(): self.render(value, self.javadir + '/' + value.filename) + self.proguard.add_enum(value) for name, value in self.interfaces.items(): self.render(value, self.javadir + '/' + value.filename) + self.proguard.add_interface(value) for name, value in self.classes.items(): self.render(value, self.javadir + '/' + value.filename) self.jni.add_object(value) diff --git a/wrappers/java/proguard.mustache b/wrappers/java/proguard.mustache index 4ba8b9d44..65dd2ed12 100644 --- a/wrappers/java/proguard.mustache +++ b/wrappers/java/proguard.mustache @@ -1,12 +1,22 @@ # Don't warn stuff that we are not "proguarding", warnings would make the build fail. -dontwarn org.linphone.** -# The following intefaces are referenced from JNI +# The following interfaces and classes are referenced from JNI {{#classes}} -keep interface {{package}}.{{className}} {*;} -keep class {{package}}.{{classImplName}} {*;} {{/classes}} +# The following enums are referenced from JNI +{{#enums}} +-keep class {{package}}.{{className}} {*;} +{{/enums}} + +# The following listeners are referenced from JNI +{{#listeners}} +-keep class {{package}}.{{className}} {*;} +{{/listeners}} + # Liblinphone tools -keep class org.linphone.core.tools.* {*;}