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 --> PJNATH Reference

#include <stun_transaction.h>

Data Fields

void(* on_complete )(pj_stun_client_tsx *tsx, pj_status_t status, const pj_stun_msg *response, const pj_sockaddr_t *src_addr, unsigned src_addr_len)
 
pj_status_t(* on_send_msg )(pj_stun_client_tsx *tsx, const void *stun_pkt, pj_size_t pkt_size)
 
void(* on_destroy )(pj_stun_client_tsx *tsx)
 

Detailed Description

STUN client transaction callback.

Field Documentation

◆ on_complete

void(* pj_stun_tsx_cb::on_complete) (pj_stun_client_tsx *tsx, pj_status_t status, const pj_stun_msg *response, const pj_sockaddr_t *src_addr, unsigned src_addr_len)

This callback is called when the STUN transaction completed.

Parameters
tsxThe STUN transaction.
statusStatus of the transaction. Status PJ_SUCCESS means that the request has received a successful response.
responseThe STUN response, which value may be NULL if status is not PJ_SUCCESS.
src_addrThe source address of the response, if response is not NULL.
src_addr_lenThe length of the source address.

◆ on_destroy

void(* pj_stun_tsx_cb::on_destroy) (pj_stun_client_tsx *tsx)

This callback is called after the timer that was scheduled by pj_stun_client_tsx_schedule_destroy() has elapsed. Application should call pj_stun_client_tsx_destroy() upon receiving this callback.

This callback is optional if application will not call pj_stun_client_tsx_schedule_destroy().

Parameters
tsxThe STUN transaction instance.

◆ on_send_msg

pj_status_t(* pj_stun_tsx_cb::on_send_msg) (pj_stun_client_tsx *tsx, const void *stun_pkt, pj_size_t pkt_size)

This callback is called by the STUN transaction when it wants to send outgoing message.

Parameters
tsxThe STUN transaction instance.
stun_pktThe STUN packet to be sent.
pkt_sizeSize of the STUN packet.
Returns
If return value of the callback is not PJ_SUCCESS, the transaction will fail. Application MUST return PJNATH_ESTUNDESTROYED if it has destroyed the transaction in this callback.

The documentation for this struct was generated from the following file:

 


PJNATH - Open Source NAT traversal helper library supporting STUN, TURN, and ICE
Copyright (C) 2006-2009 Teluu Inc.