Re: BUG: pjsip_endpt_send_raw doesn't call pjsip_tp_send_callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


at first check, that pjsip_endpt_send_raw return PJ_SUCCESS.
If not, check the return value.
Because the function passed the cb along to send_msg, check the source code snippet taken from pjsip_transport.c
/* Send to transport */
    status = tr->send_msg(tr, tdata, addr, addr_len,
              tdata, &send_raw_callback);

    if (status != PJ_EPENDING) {
    /* callback will not be called, so destroy tdata now. */

So, when reading the docs (

it's clearly stated: (check the Returns section)
This is a low-level function to send raw data to a destination.

See also pjsip_endpt_send_raw_to_uri().

    endpt	The SIP endpoint instance.
    tp_type	Transport type.
    sel	Optional pointer to transport selector instance if application wants to use a specific transport instance rather then letting transport manager finds the suitable transport..
    raw_data	The data to be sent.
    data_len	The length of the data.
    addr	Destination address.
    addr_len	Length of destination address.
    token	Arbitrary token to be returned back to callback.
    cb	Optional callback to be called to notify caller about the completion status of the pending send operation.

    If the message has been sent successfully, this function will return PJ_SUCCESS and the callback will not be called. If message cannot be sent immediately, this function will return PJ_EPENDING, and application will be notified later about the completion via the callback. Any statuses other than PJ_SUCCESS or PJ_EPENDING indicates immediate failure, and in this case the callback will not be called. 

So, you have to check the return value.
If you get "PJ_SUCCESS", then the callback won't be called !


Von: pjsip <pjsip-bounces@xxxxxxxxxxxxxxx> im Auftrag von Oleg Linkin <oleg.linkin@xxxxxxx>
Gesendet: Mittwoch, 22. Jänner 2020 15:14
An: pjsip@xxxxxxxxxxxxxxx
Betreff:  BUG: pjsip_endpt_send_raw doesn't call pjsip_tp_send_callback

Hello, developers

I try to use pjsip_endpt_send_raw with last callback parameter:
pjsip_tp_send_callback but this callback is never called.

void TransportPjSipImpl_send_callback(void *token, pjsip_tx_data *tdata,
pj_ssize_t bytes_sent)
        csDebug(0, "AAAAAA");
status = pjsip_endpt_send_raw(m_Endpoint, transportType, &selector, szSip,
length, addr, addrLen, reinterpret_cast<void*>(nCallId),

Could you possibly help me with this situation?

Oleg Linkin

Visit our blog:

pjsip mailing list

Visit our blog:

pjsip mailing list

[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux