[pjsip] Repeated MESSAGE packets

Benny Prijono bennylp at pjsip.org
Thu May 29 06:00:44 EDT 2008


On Thu, May 29, 2008 at 9:44 AM, Nuno Costa <ncosta at wit-software.com> wrote:
> Hi,
>
> I'm having a problem using PJSIP to receive MESSAGE packets.
> When I'm using a low-bandwidth network (like 3G, for instance) and multiple
> MESSAGE packets are transmitted, I'm receive multiple events for the same
> packet.
> Should this re-transmissions be detected by the stack, preventing this?
>
> ## CODE #####################################
> if (pjsip_method_cmp(&rdata->msg_info.msg->line.req.method,
> &pjsip_message_method) == 0) {
>
>         /* Should not have any transaction attached to rdata. */
>         PJ_ASSERT_RETURN(pjsip_rdata_get_tsx(rdata) == NULL, PJ_FALSE);
>
>         /* Should not have any dialog attached to rdata. */
>         PJ_ASSERT_RETURN(pjsip_rdata_get_dlg(rdata) == NULL, PJ_FALSE);
>
>         // Reply with 200 OK
>         pjsip_endpt_respond_stateless(SIPEngine::instance->sip_endpt, rdata,
> PJSIP_SC_OK, NULL, NULL, NULL);


Since you are responding statelessly, you will get notified on
subsequent receipts of the same request (retransmissions). If you want
to get notified only once, use pjsip_endpt_respond() instead to
respond the request statefully.

Cheers
 Benny




More information about the pjsip mailing list