WARNING: The online documentation has moved to https://docs.pjsip.org.

Visit the new documentation at https://docs.pjsip.org:

BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJSIP Reference

Loopback transport (for testing purposes).The loopback transport simply bounce back outgoing messages as incoming messages. This feature is used mostly during automated testing, to provide controlled behavior. More...

Functions

pj_status_t pjsip_loop_start (pjsip_endpoint *endpt, pjsip_transport **transport)
 
pj_status_t pjsip_loop_set_discard (pjsip_transport *tp, pj_bool_t discard, pj_bool_t *prev_value)
 
pj_status_t pjsip_loop_set_failure (pjsip_transport *tp, int fail_flag, int *prev_value)
 
pj_status_t pjsip_loop_set_recv_delay (pjsip_transport *tp, unsigned delay, unsigned *prev_value)
 
pj_status_t pjsip_loop_set_send_callback_delay (pjsip_transport *tp, unsigned delay, unsigned *prev_value)
 
pj_status_t pjsip_loop_set_delay (pjsip_transport *tp, unsigned delay)
 

Detailed Description

Function Documentation

◆ pjsip_loop_start()

pj_status_t pjsip_loop_start ( pjsip_endpoint endpt,
pjsip_transport **  transport 
)

Create and start datagram loop transport.

Parameters
endptThe endpoint instance.
transportPointer to receive the transport instance.
Returns
PJ_SUCCESS on success.

◆ pjsip_loop_set_discard()

pj_status_t pjsip_loop_set_discard ( pjsip_transport tp,
pj_bool_t  discard,
pj_bool_t prev_value 
)

Enable/disable flag to discard any packets sent using the specified loop transport.

Parameters
tpThe loop transport.
discardIf non-zero, any outgoing packets will be discarded.
prev_valueOptional argument to receive previous value of the discard flag.
Returns
PJ_SUCCESS on success.

◆ pjsip_loop_set_failure()

pj_status_t pjsip_loop_set_failure ( pjsip_transport tp,
int  fail_flag,
int *  prev_value 
)

Enable/disable flag to simulate network error. When this flag is set, outgoing transmission will return either immediate error or error via callback. If error is to be notified via callback, then the notification will occur after some delay, which is controlled by pjsip_loop_set_delay().

Parameters
tpThe loop transport.
fail_flagIf set to 1, the transport will return fail to deliver the message. If delay is zero, failure will occur immediately; otherwise it will be reported in callback. If set to zero, the transport will successfully deliver the packet.
prev_valueOptional argument to receive previous value of the failure flag.
Returns
PJ_SUCCESS on success.

◆ pjsip_loop_set_recv_delay()

pj_status_t pjsip_loop_set_recv_delay ( pjsip_transport tp,
unsigned  delay,
unsigned *  prev_value 
)

Set delay (in miliseconds) before packet is received by the other end of the loop transport. This will also control the delay for error notification callback.

Parameters
tpThe loop transport.
delayDelay, in miliseconds.
prev_valueOptional argument to receive previous value of the delay.
Returns
PJ_SUCCESS on success.

◆ pjsip_loop_set_send_callback_delay()

pj_status_t pjsip_loop_set_send_callback_delay ( pjsip_transport tp,
unsigned  delay,
unsigned *  prev_value 
)

Set delay (in miliseconds) before send notification is delivered to sender. This will also control the delay for error notification callback.

Parameters
tpThe loop transport.
delayDelay, in miliseconds.
prev_valueOptional argument to receive previous value of the delay.
Returns
PJ_SUCCESS on success.

◆ pjsip_loop_set_delay()

pj_status_t pjsip_loop_set_delay ( pjsip_transport tp,
unsigned  delay 
)

Set both receive and send notification delay.

Parameters
tpThe loop transport.
delayDelay, in miliseconds.
Returns
PJ_SUCCESS on success.

References PJ_END_DECL.

 


PJSIP Open Source, high performance, small footprint, and very very portable SIP stack
Copyright (C) 2006-2008 Teluu Inc.