0
votes

I currently have a setup using WebRTC -> Asterisk where I can call and send messages. When I make a call from A -> B all of B's registered devices get called (so if he is logged in several times).

However using MessageSend the SIP message is only delivered to one registered, not all. How can I make it send to all registered devices?

Is it possible, if not is there any other way it can be done inside of Asterisk?

(Using Asterisk 15.5).

Thanks!

1
Update on progress for this, tried to use MessageSend with the direct URI including port for each contact. It just sent all the messages to the same contact still, but multiple times -.-ananonposter
Why you just not send it N times for each user in list? Are you familar with loops?arheops
Hello, thanks for the reply. That's what I meant I tried with the Uri and port, but it just sent all of them to the same contact. Is it possible to send a message with Uri?ananonposter

1 Answers

0
votes

Asterisk (at least when using PJSIP) and a given endpoint strips any URI details and will only use the endpoint and does not loop over all registered contacts.

From messge.c 'msg_send_exec' Gets the outbound from res_pjsip_messaging.c 'get_outbound_endpoint'

/* attempt to extract the endpoint name */
if ((aor_uri = strchr(name, '/'))) {
    /* format was 'endpoint/(aor_name | uri)' */
    *aor_uri++ = '\0';
} else if ((aor_uri = strchr(name, '@'))) {
    /* format was 'endpoint@domain' - discard the domain */
    *aor_uri = '\0';

    /*
     * We may want to match without any user options getting
     * in the way.
     */
    AST_SIP_USER_OPTIONS_TRUNCATE_CHECK(name);
}

/* at this point, if name is not empty then it
   might be an endpoint, so try to retrieve it */
if (ast_strlen_zero(name)
    || !(endpoint = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "endpoint",
        name))) {
    /* an endpoint was not found, so assume sending directly
       to a uri and use the default outbound endpoint */
    *uri = ast_strdup(to);
    return ast_sip_default_outbound_endpoint();
}

From what I understant if you only use a URI (like pjsip:123.12.123.12:1234) it will just look for the default endpoint which will always be the same.