diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c index 3e5b97f60cdc9a383a0cd4563b60d41e7a0db5dc..2a173dabd9885f871a6f6ef80262e468cc49c856 100644 --- a/res/res_pjsip/location.c +++ b/res/res_pjsip/location.c @@ -1046,7 +1046,11 @@ static struct ao2_container *cli_contact_get_container(const char *regex) return NULL; } - contacts_container = ao2_container_alloc_list(AO2_ALLOC_OPT_LOCK_NOLOCK, 0, + /* Retrieving all the contacts may result in finding the same contact multiple + * times. So that they don't get displayed multiple times we only allow a + * single one to be placed into the container. + */ + contacts_container = ao2_container_alloc_list(AO2_ALLOC_OPT_LOCK_NOLOCK, AO2_CONTAINER_ALLOC_OPT_DUPS_REJECT, cli_contact_sort, cli_contact_compare); if (!contacts_container) { return NULL;