2006-06-13 22:57:13 +00:00
|
|
|
/* $Id$ */
|
|
|
|
/*
|
2011-05-05 06:14:19 +00:00
|
|
|
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
|
2008-06-20 22:44:47 +00:00
|
|
|
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
|
2006-06-13 22:57:13 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
#ifndef __PJSUA_INTERNAL_H__
|
|
|
|
#define __PJSUA_INTERNAL_H__
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is the private header used by pjsua library implementation.
|
|
|
|
* Applications should not include this file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
PJ_BEGIN_DECL
|
|
|
|
|
2011-03-17 04:34:43 +00:00
|
|
|
/** Forward decl of pjsua call */
|
|
|
|
typedef struct pjsua_call pjsua_call;
|
|
|
|
|
2011-09-21 10:20:01 +00:00
|
|
|
/** Forward decl of pjsua call media */
|
|
|
|
typedef struct pjsua_call_media pjsua_call_media;
|
|
|
|
|
2011-07-12 11:08:32 +00:00
|
|
|
|
2011-03-17 04:34:43 +00:00
|
|
|
/**
|
|
|
|
* Call's media stream.
|
|
|
|
*/
|
2011-09-21 11:21:33 +00:00
|
|
|
struct pjsua_call_media
|
2011-03-17 04:34:43 +00:00
|
|
|
{
|
|
|
|
pjsua_call *call; /**< Parent call. */
|
|
|
|
pjmedia_type type; /**< Media type. */
|
|
|
|
unsigned idx; /**< This media index in parent call. */
|
|
|
|
pjsua_call_media_status state; /**< Media state. */
|
2011-10-24 09:28:13 +00:00
|
|
|
pjsua_call_media_status prev_state;/**< Previous media state. */
|
2011-03-17 04:34:43 +00:00
|
|
|
pjmedia_dir dir; /**< Media direction. */
|
|
|
|
|
|
|
|
/** The stream */
|
2011-03-18 09:55:48 +00:00
|
|
|
struct {
|
2011-03-17 04:34:43 +00:00
|
|
|
/** Audio stream */
|
|
|
|
struct {
|
2011-03-18 07:54:50 +00:00
|
|
|
pjmedia_stream *stream; /**< The audio stream. */
|
2011-03-17 04:34:43 +00:00
|
|
|
int conf_slot; /**< Slot # in conference bridge. */
|
|
|
|
} a;
|
|
|
|
|
|
|
|
/** Video stream */
|
|
|
|
struct {
|
2011-03-18 07:54:50 +00:00
|
|
|
pjmedia_vid_stream *stream; /**< The video stream. */
|
2011-07-12 11:08:32 +00:00
|
|
|
pjsua_vid_win_id cap_win_id;/**< The video capture window */
|
|
|
|
pjsua_vid_win_id rdr_win_id;/**< The video render window */
|
2011-07-13 08:51:10 +00:00
|
|
|
pjmedia_vid_dev_index cap_dev; /**< The video capture device */
|
|
|
|
pjmedia_vid_dev_index rdr_dev; /**< The video-in render device */
|
2011-03-17 04:34:43 +00:00
|
|
|
} v;
|
|
|
|
|
|
|
|
} strm;
|
|
|
|
|
|
|
|
pj_uint32_t ssrc; /**< RTP SSRC */
|
|
|
|
pj_uint32_t rtp_tx_ts; /**< Initial RTP timestamp for sender. */
|
|
|
|
pj_uint16_t rtp_tx_seq;/**< Initial RTP sequence for sender. */
|
|
|
|
pj_uint8_t rtp_tx_seq_ts_set;
|
|
|
|
/**< Bitmask flags if initial RTP sequence
|
|
|
|
and/or timestamp for sender are set.
|
|
|
|
bit 0/LSB : sequence flag
|
|
|
|
bit 1 : timestamp flag */
|
|
|
|
|
|
|
|
pjmedia_transport *tp; /**< Current media transport (can be 0) */
|
|
|
|
pj_status_t tp_ready; /**< Media transport status. */
|
2012-01-09 11:51:56 +00:00
|
|
|
pj_status_t tp_result; /**< Media transport creation result. */
|
2011-03-17 04:34:43 +00:00
|
|
|
pjmedia_transport *tp_orig; /**< Original media transport */
|
2011-09-21 10:20:01 +00:00
|
|
|
pj_bool_t tp_auto_del; /**< May delete media transport */
|
2011-03-17 04:34:43 +00:00
|
|
|
pjsua_med_tp_st tp_st; /**< Media transport state */
|
2011-10-24 09:28:13 +00:00
|
|
|
pj_bool_t use_custom_med_tp;/**< Use custom media transport? */
|
2011-03-17 04:34:43 +00:00
|
|
|
pj_sockaddr rtp_addr; /**< Current RTP source address
|
|
|
|
(used to update ICE default
|
|
|
|
address) */
|
|
|
|
pjmedia_srtp_use rem_srtp_use; /**< Remote's SRTP usage policy. */
|
2011-12-07 10:43:28 +00:00
|
|
|
pj_timestamp last_req_keyframe;/**< Last TX keyframe request. */
|
2011-07-15 06:18:29 +00:00
|
|
|
|
2011-09-21 10:20:01 +00:00
|
|
|
pjsua_med_tp_state_cb med_init_cb;/**< Media transport
|
|
|
|
initialization callback. */
|
|
|
|
|
|
|
|
/** Media transport creation callback. */
|
|
|
|
pj_status_t (*med_create_cb)(pjsua_call_media *call_med,
|
|
|
|
pj_status_t status, int security_level,
|
|
|
|
int *sip_err_code);
|
2011-09-21 11:21:33 +00:00
|
|
|
};
|
2011-03-17 04:34:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Maximum number of SDP "m=" lines to be supported.
|
|
|
|
*/
|
|
|
|
#define PJSUA_MAX_CALL_MEDIA PJMEDIA_MAX_SDP_MEDIA
|
|
|
|
|
2011-10-03 02:04:36 +00:00
|
|
|
/* Call answer's list. */
|
|
|
|
typedef struct call_answer
|
|
|
|
{
|
|
|
|
PJ_DECL_LIST_MEMBER(struct call_answer);
|
|
|
|
pjsua_msg_data *msg_data; /**< Answer's headers list. */
|
|
|
|
pj_str_t *reason; /**< Answer's reason phrase. */
|
|
|
|
unsigned code; /**< Answer's status code. */
|
2012-06-22 08:53:11 +00:00
|
|
|
pjsua_call_setting *opt; /**< Answer's call setting. */
|
2011-10-03 02:04:36 +00:00
|
|
|
} call_answer;
|
|
|
|
|
|
|
|
|
2006-06-13 22:57:13 +00:00
|
|
|
/**
|
|
|
|
* Structure to be attached to invite dialog.
|
|
|
|
* Given a dialog "dlg", application can retrieve this structure
|
|
|
|
* by accessing dlg->mod_data[pjsua.mod.id].
|
|
|
|
*/
|
2011-03-17 04:34:43 +00:00
|
|
|
struct pjsua_call
|
2006-06-13 22:57:13 +00:00
|
|
|
{
|
|
|
|
unsigned index; /**< Index in pjsua array. */
|
2011-12-01 09:06:14 +00:00
|
|
|
pjsua_call_setting opt; /**< Call setting. */
|
2012-06-22 08:53:11 +00:00
|
|
|
pj_bool_t opt_inited;/**< Initial call setting has been set,
|
|
|
|
to avoid different opt in answer. */
|
2006-06-13 22:57:13 +00:00
|
|
|
pjsip_inv_session *inv; /**< The invite session. */
|
|
|
|
void *user_data; /**< User/application data. */
|
|
|
|
pjsip_status_code last_code; /**< Last status code seen. */
|
|
|
|
pj_str_t last_text; /**< Last status text seen. */
|
|
|
|
pj_time_val start_time;/**< First INVITE sent/received. */
|
|
|
|
pj_time_val res_time; /**< First response sent/received. */
|
|
|
|
pj_time_val conn_time; /**< Connected/confirmed time. */
|
|
|
|
pj_time_val dis_time; /**< Disconnect time. */
|
|
|
|
pjsua_acc_id acc_id; /**< Account index being used. */
|
2008-02-02 17:07:18 +00:00
|
|
|
int secure_level;/**< Signaling security level. */
|
2010-10-01 02:03:42 +00:00
|
|
|
pjsua_call_hold_type call_hold_type; /**< How to do call hold. */
|
2008-08-04 15:01:38 +00:00
|
|
|
pj_bool_t local_hold;/**< Flag for call-hold by local. */
|
2011-10-24 09:28:13 +00:00
|
|
|
void *hold_msg; /**< Outgoing hold tx_data. */
|
2011-03-17 04:34:43 +00:00
|
|
|
|
|
|
|
unsigned med_cnt; /**< Number of media in SDP. */
|
|
|
|
pjsua_call_media media[PJSUA_MAX_CALL_MEDIA]; /**< Array of media */
|
2012-04-24 05:40:32 +00:00
|
|
|
unsigned med_prov_cnt;/**< Number of provisional media. */
|
|
|
|
pjsua_call_media media_prov[PJSUA_MAX_CALL_MEDIA];
|
|
|
|
/**< Array of provisional media. */
|
|
|
|
|
2011-03-18 07:54:50 +00:00
|
|
|
int audio_idx; /**< First active audio media. */
|
2011-09-21 10:20:01 +00:00
|
|
|
pj_mutex_t *med_ch_mutex;/**< Media channel callback's mutex. */
|
|
|
|
pjsua_med_tp_state_cb med_ch_cb;/**< Media channel callback. */
|
|
|
|
pjsua_med_tp_state_info med_ch_info;/**< Media channel info. */
|
2011-03-17 04:34:43 +00:00
|
|
|
|
2006-06-13 22:57:13 +00:00
|
|
|
pjsip_evsub *xfer_sub; /**< Xfer server subscription, if this
|
|
|
|
call was triggered by xfer. */
|
2007-10-31 08:59:29 +00:00
|
|
|
pj_stun_nat_type rem_nat_type; /**< NAT type of remote endpoint. */
|
2006-06-13 22:57:13 +00:00
|
|
|
|
|
|
|
char last_text_buf_[128]; /**< Buffer for last_text. */
|
|
|
|
|
2010-06-15 09:56:39 +00:00
|
|
|
struct {
|
2010-10-20 05:31:08 +00:00
|
|
|
int retry_cnt; /**< Retry count. */
|
2010-06-15 09:56:39 +00:00
|
|
|
} lock_codec; /**< Data for codec locking when answer
|
|
|
|
contains multiple codecs. */
|
|
|
|
|
2011-09-21 10:20:01 +00:00
|
|
|
struct {
|
|
|
|
pjsip_dialog *dlg; /**< Call dialog. */
|
|
|
|
pjmedia_sdp_session *rem_sdp;/**< Remote SDP. */
|
2011-09-22 04:24:56 +00:00
|
|
|
pj_pool_t *pool_prov;/**< Provisional pool. */
|
2011-10-03 08:22:48 +00:00
|
|
|
pj_bool_t med_ch_deinit;/**< Media channel de-init-ed? */
|
2011-09-21 10:20:01 +00:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
pjsua_msg_data *msg_data;/**< Headers for outgoing INVITE. */
|
2012-11-26 02:04:17 +00:00
|
|
|
pj_bool_t hangup; /**< Call is hangup? */
|
2011-09-21 10:20:01 +00:00
|
|
|
} out_call;
|
2011-10-03 02:04:36 +00:00
|
|
|
struct {
|
|
|
|
call_answer answers;/**< A list of call answers. */
|
2012-06-22 08:53:11 +00:00
|
|
|
pjsip_dialog *replaced_dlg; /**< Replaced dialog. */
|
2011-10-03 02:04:36 +00:00
|
|
|
} inc_call;
|
2011-09-21 10:20:01 +00:00
|
|
|
} call_var;
|
|
|
|
} async_call; /**< Temporary storage for async
|
|
|
|
outgoing/incoming call. */
|
2011-12-01 09:06:14 +00:00
|
|
|
|
|
|
|
pj_bool_t rem_offerer; /**< Was remote SDP offerer? */
|
|
|
|
unsigned rem_aud_cnt; /**< No of active audio in last remote
|
|
|
|
offer. */
|
|
|
|
unsigned rem_vid_cnt; /**< No of active video in last remote
|
|
|
|
offer. */
|
2013-02-06 13:48:45 +00:00
|
|
|
|
|
|
|
pj_timer_entry reinv_timer; /**< Reinvite retry timer. */
|
|
|
|
pj_bool_t reinv_pending;/**< Pending until CONFIRMED state. */
|
|
|
|
pj_bool_t reinv_ice_sent;/**< Has reinvite for ICE upd sent? */
|
2011-03-17 04:34:43 +00:00
|
|
|
};
|
2006-06-13 22:57:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Server presence subscription list head.
|
|
|
|
*/
|
2008-07-17 14:19:10 +00:00
|
|
|
struct pjsua_srv_pres
|
2006-06-13 22:57:13 +00:00
|
|
|
{
|
|
|
|
PJ_DECL_LIST_MEMBER(struct pjsua_srv_pres);
|
2008-07-17 14:19:10 +00:00
|
|
|
pjsip_evsub *sub; /**< The evsub. */
|
|
|
|
char *remote; /**< Remote URI. */
|
|
|
|
int acc_id; /**< Account ID. */
|
|
|
|
pjsip_dialog *dlg; /**< Dialog. */
|
|
|
|
int expires; /**< "expires" value in the request. */
|
|
|
|
};
|
2006-06-13 22:57:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Account
|
|
|
|
*/
|
|
|
|
typedef struct pjsua_acc
|
|
|
|
{
|
2008-07-13 12:24:55 +00:00
|
|
|
pj_pool_t *pool; /**< Pool for this account. */
|
2006-06-13 22:57:13 +00:00
|
|
|
pjsua_acc_config cfg; /**< Account configuration. */
|
|
|
|
pj_bool_t valid; /**< Is this account valid? */
|
|
|
|
|
|
|
|
int index; /**< Index in accounts array. */
|
2006-07-18 00:33:02 +00:00
|
|
|
pj_str_t display; /**< Display name, if any. */
|
2006-06-13 22:57:13 +00:00
|
|
|
pj_str_t user_part; /**< User part of local URI. */
|
2013-09-06 10:04:39 +00:00
|
|
|
pj_bool_t is_sips; /**< Local URI uses "sips"? */
|
2009-08-05 18:41:23 +00:00
|
|
|
pj_str_t contact; /**< Our Contact header. */
|
2010-11-16 03:07:46 +00:00
|
|
|
pj_str_t reg_contact; /**< Contact header for REGISTER.
|
|
|
|
It may be different than acc
|
|
|
|
contact if outbound is used */
|
2012-06-20 10:39:05 +00:00
|
|
|
pjsip_host_port via_addr; /**< Address for Via header */
|
|
|
|
pjsip_transport *via_tp; /**< Transport associated with
|
|
|
|
the Via address */
|
2006-06-13 22:57:13 +00:00
|
|
|
|
2006-07-10 14:40:21 +00:00
|
|
|
pj_str_t srv_domain; /**< Host part of reg server. */
|
|
|
|
int srv_port; /**< Port number of reg server. */
|
|
|
|
|
2006-06-13 22:57:13 +00:00
|
|
|
pjsip_regc *regc; /**< Client registration session. */
|
|
|
|
pj_status_t reg_last_err; /**< Last registration error. */
|
|
|
|
int reg_last_code; /**< Last status last register. */
|
|
|
|
|
2013-06-24 09:53:16 +00:00
|
|
|
pj_str_t reg_mapped_addr;/**< Our addr as seen by reg srv.
|
|
|
|
Only if allow_sdp_nat_rewrite
|
|
|
|
is set */
|
|
|
|
|
2010-03-30 11:13:59 +00:00
|
|
|
struct {
|
|
|
|
pj_bool_t active; /**< Flag of reregister status. */
|
|
|
|
pj_timer_entry timer; /**< Timer for reregistration. */
|
|
|
|
void *reg_tp; /**< Transport for registration. */
|
|
|
|
unsigned attempt_cnt; /**< Attempt counter. */
|
|
|
|
} auto_rereg; /**< Reregister/reconnect data. */
|
|
|
|
|
2007-10-31 13:28:08 +00:00
|
|
|
pj_timer_entry ka_timer; /**< Keep-alive timer for UDP. */
|
|
|
|
pjsip_transport *ka_transport; /**< Transport for keep-alive. */
|
|
|
|
pj_sockaddr ka_target; /**< Destination address for K-A */
|
|
|
|
unsigned ka_target_len; /**< Length of ka_target. */
|
|
|
|
|
2006-06-13 22:57:13 +00:00
|
|
|
pjsip_route_hdr route_set; /**< Complete route set inc. outbnd.*/
|
2010-04-20 14:36:38 +00:00
|
|
|
pj_uint32_t global_route_crc; /** CRC of global route setting. */
|
|
|
|
pj_uint32_t local_route_crc; /** CRC of account route setting.*/
|
2006-06-13 22:57:13 +00:00
|
|
|
|
2010-11-16 03:07:46 +00:00
|
|
|
unsigned rfc5626_status;/**< SIP outbound status:
|
|
|
|
0: not used
|
|
|
|
1: requested
|
|
|
|
2: acknowledged by servers */
|
|
|
|
pj_str_t rfc5626_instprm;/**< SIP outbound instance param. */
|
|
|
|
pj_str_t rfc5626_regprm;/**< SIP outbound reg param. */
|
|
|
|
|
2006-06-13 22:57:13 +00:00
|
|
|
unsigned cred_cnt; /**< Number of credentials. */
|
|
|
|
pjsip_cred_info cred[PJSUA_ACC_MAX_PROXIES]; /**< Complete creds. */
|
|
|
|
|
|
|
|
pj_bool_t online_status; /**< Our online status. */
|
2007-08-25 13:36:15 +00:00
|
|
|
pjrpid_element rpid; /**< RPID element information. */
|
2006-06-13 22:57:13 +00:00
|
|
|
pjsua_srv_pres pres_srv_list; /**< Server subscription list. */
|
2006-08-15 20:26:34 +00:00
|
|
|
pjsip_publishc *publish_sess; /**< Client publication session. */
|
|
|
|
pj_bool_t publish_state; /**< Last published online status */
|
2006-06-13 22:57:13 +00:00
|
|
|
|
2009-10-26 11:21:37 +00:00
|
|
|
pjsip_evsub *mwi_sub; /**< MWI client subscription */
|
|
|
|
pjsip_dialog *mwi_dlg; /**< Dialog for MWI sub. */
|
2013-06-21 07:47:41 +00:00
|
|
|
|
|
|
|
pj_uint16_t next_rtp_port; /**< Next RTP port to be used. */
|
2006-06-13 22:57:13 +00:00
|
|
|
} pjsua_acc;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
*Transport.
|
|
|
|
*/
|
2007-01-13 23:22:40 +00:00
|
|
|
typedef struct pjsua_transport_data
|
2006-06-13 22:57:13 +00:00
|
|
|
{
|
2006-06-28 16:46:49 +00:00
|
|
|
int index;
|
|
|
|
pjsip_transport_type_e type;
|
|
|
|
pjsip_host_port local_name;
|
|
|
|
|
|
|
|
union {
|
|
|
|
pjsip_transport *tp;
|
|
|
|
pjsip_tpfactory *factory;
|
|
|
|
void *ptr;
|
|
|
|
} data;
|
|
|
|
|
2007-01-13 23:22:40 +00:00
|
|
|
} pjsua_transport_data;
|
2006-06-13 22:57:13 +00:00
|
|
|
|
|
|
|
|
2008-07-17 14:19:10 +00:00
|
|
|
/** Maximum length of subscription termination reason. */
|
|
|
|
#define PJSUA_BUDDY_SUB_TERM_REASON_LEN 32
|
|
|
|
|
2006-06-13 22:57:13 +00:00
|
|
|
/**
|
|
|
|
* Buddy data.
|
|
|
|
*/
|
|
|
|
typedef struct pjsua_buddy
|
|
|
|
{
|
2008-07-13 12:24:55 +00:00
|
|
|
pj_pool_t *pool; /**< Pool for this buddy. */
|
2006-06-13 22:57:13 +00:00
|
|
|
unsigned index; /**< Buddy index. */
|
2008-07-21 18:12:51 +00:00
|
|
|
void *user_data; /**< Application data. */
|
2006-06-13 22:57:13 +00:00
|
|
|
pj_str_t uri; /**< Buddy URI. */
|
|
|
|
pj_str_t contact; /**< Contact learned from subscrp. */
|
|
|
|
pj_str_t name; /**< Buddy name. */
|
|
|
|
pj_str_t display; /**< Buddy display name. */
|
|
|
|
pj_str_t host; /**< Buddy host. */
|
|
|
|
unsigned port; /**< Buddy port. */
|
|
|
|
pj_bool_t monitor; /**< Should we monitor? */
|
2007-06-28 07:20:26 +00:00
|
|
|
pjsip_dialog *dlg; /**< The underlying dialog. */
|
2006-06-13 22:57:13 +00:00
|
|
|
pjsip_evsub *sub; /**< Buddy presence subscription */
|
2009-10-20 13:56:26 +00:00
|
|
|
unsigned term_code; /**< Subscription termination code */
|
2008-07-17 14:19:10 +00:00
|
|
|
pj_str_t term_reason;/**< Subscription termination reason */
|
2006-06-13 22:57:13 +00:00
|
|
|
pjsip_pres_status status; /**< Buddy presence status. */
|
2009-10-20 13:56:26 +00:00
|
|
|
pj_timer_entry timer; /**< Resubscription timer */
|
2006-06-13 22:57:13 +00:00
|
|
|
} pjsua_buddy;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* File player/recorder data.
|
|
|
|
*/
|
|
|
|
typedef struct pjsua_file_data
|
|
|
|
{
|
2007-01-21 23:12:40 +00:00
|
|
|
pj_bool_t type; /* 0=player, 1=playlist */
|
2006-06-13 22:57:13 +00:00
|
|
|
pjmedia_port *port;
|
2007-07-17 16:25:45 +00:00
|
|
|
pj_pool_t *pool;
|
2006-06-13 22:57:13 +00:00
|
|
|
unsigned slot;
|
|
|
|
} pjsua_file_data;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Additional parameters for conference bridge.
|
|
|
|
*/
|
|
|
|
typedef struct pjsua_conf_setting
|
|
|
|
{
|
|
|
|
unsigned channel_count;
|
|
|
|
unsigned samples_per_frame;
|
|
|
|
unsigned bits_per_sample;
|
|
|
|
} pjsua_conf_setting;
|
|
|
|
|
2009-08-12 11:03:23 +00:00
|
|
|
typedef struct pjsua_stun_resolve
|
|
|
|
{
|
|
|
|
PJ_DECL_LIST_MEMBER(struct pjsua_stun_resolve);
|
|
|
|
|
|
|
|
pj_pool_t *pool; /**< Pool */
|
2012-08-07 02:53:03 +00:00
|
|
|
int ref_cnt; /**< Reference count */
|
|
|
|
pj_bool_t destroy_flag; /**< To be destroyed */
|
|
|
|
pj_bool_t has_result;
|
2009-08-12 11:03:23 +00:00
|
|
|
unsigned count; /**< # of entries */
|
|
|
|
pj_str_t *srv; /**< Array of entries */
|
|
|
|
unsigned idx; /**< Current index */
|
|
|
|
void *token; /**< App token */
|
|
|
|
pj_stun_resolve_cb cb; /**< App callback */
|
|
|
|
pj_bool_t blocking; /**< Blocking? */
|
|
|
|
pj_status_t status; /**< Session status */
|
|
|
|
pj_sockaddr addr; /**< Result */
|
|
|
|
pj_stun_sock *stun_sock; /**< Testing STUN sock */
|
|
|
|
} pjsua_stun_resolve;
|
|
|
|
|
2011-09-19 08:26:35 +00:00
|
|
|
/* See also pjsua_vid_win_type_name() */
|
2011-07-07 07:46:33 +00:00
|
|
|
typedef enum pjsua_vid_win_type
|
|
|
|
{
|
|
|
|
PJSUA_WND_TYPE_NONE,
|
|
|
|
PJSUA_WND_TYPE_PREVIEW,
|
|
|
|
PJSUA_WND_TYPE_STREAM
|
|
|
|
} pjsua_vid_win_type;
|
|
|
|
|
|
|
|
typedef struct pjsua_vid_win
|
|
|
|
{
|
|
|
|
pjsua_vid_win_type type; /**< Type. */
|
|
|
|
pj_pool_t *pool; /**< Own pool. */
|
2011-07-12 11:08:32 +00:00
|
|
|
unsigned ref_cnt; /**< Reference counter. */
|
2011-07-07 07:46:33 +00:00
|
|
|
pjmedia_vid_port *vp_cap; /**< Capture vidport. */
|
|
|
|
pjmedia_vid_port *vp_rend; /**< Renderer vidport */
|
2011-07-12 11:08:32 +00:00
|
|
|
pjmedia_port *tee; /**< Video tee */
|
2011-09-19 08:26:35 +00:00
|
|
|
pjmedia_vid_dev_index preview_cap_id;/**< Capture dev id */
|
2011-09-20 10:07:55 +00:00
|
|
|
pj_bool_t preview_running;/**< Preview is started*/
|
2011-09-19 08:26:35 +00:00
|
|
|
pj_bool_t is_native; /**< Preview is by dev */
|
2011-07-07 07:46:33 +00:00
|
|
|
} pjsua_vid_win;
|
2006-06-13 22:57:13 +00:00
|
|
|
|
2012-04-26 16:46:27 +00:00
|
|
|
|
|
|
|
typedef struct pjsua_timer_list
|
|
|
|
{
|
|
|
|
PJ_DECL_LIST_MEMBER(struct pjsua_timer_list);
|
|
|
|
pj_timer_entry entry;
|
|
|
|
void (*cb)(void *user_data);
|
|
|
|
void *user_data;
|
|
|
|
} pjsua_timer_list;
|
|
|
|
|
|
|
|
|
2006-06-13 22:57:13 +00:00
|
|
|
/**
|
|
|
|
* Global pjsua application data.
|
|
|
|
*/
|
|
|
|
struct pjsua_data
|
|
|
|
{
|
|
|
|
|
|
|
|
/* Control: */
|
|
|
|
pj_caching_pool cp; /**< Global pool factory. */
|
|
|
|
pj_pool_t *pool; /**< pjsua's private pool. */
|
|
|
|
pj_mutex_t *mutex; /**< Mutex protection for this data */
|
2011-12-28 09:49:24 +00:00
|
|
|
unsigned mutex_nesting_level; /**< Mutex nesting level. */
|
|
|
|
pj_thread_t *mutex_owner; /**< Mutex owner. */
|
2011-03-17 04:34:43 +00:00
|
|
|
pjsua_state state; /**< Library state. */
|
2006-06-13 22:57:13 +00:00
|
|
|
|
|
|
|
/* Logging: */
|
|
|
|
pjsua_logging_config log_cfg; /**< Current logging config. */
|
|
|
|
pj_oshandle_t log_file; /**<Output log file handle */
|
|
|
|
|
|
|
|
/* SIP: */
|
|
|
|
pjsip_endpoint *endpt; /**< Global endpoint. */
|
|
|
|
pjsip_module mod; /**< pjsua's PJSIP module. */
|
2007-01-13 23:22:40 +00:00
|
|
|
pjsua_transport_data tpdata[8]; /**< Array of transports. */
|
2010-03-10 13:33:25 +00:00
|
|
|
pjsip_tp_state_callback old_tp_cb; /**< Old transport callback. */
|
2006-06-13 22:57:13 +00:00
|
|
|
|
|
|
|
/* Threading: */
|
|
|
|
pj_bool_t thread_quit_flag; /**< Thread quit flag. */
|
|
|
|
pj_thread_t *thread[4]; /**< Array of threads. */
|
|
|
|
|
2007-03-23 16:34:20 +00:00
|
|
|
/* STUN and resolver */
|
|
|
|
pj_stun_config stun_cfg; /**< Global STUN settings. */
|
|
|
|
pj_sockaddr stun_srv; /**< Resolved STUN server address */
|
|
|
|
pj_status_t stun_status; /**< STUN server status. */
|
2009-08-12 11:03:23 +00:00
|
|
|
pjsua_stun_resolve stun_res; /**< List of pending STUN resolution*/
|
2007-03-23 16:34:20 +00:00
|
|
|
pj_dns_resolver *resolver; /**< DNS resolver. */
|
|
|
|
|
2007-10-16 01:34:14 +00:00
|
|
|
/* Detected NAT type */
|
|
|
|
pj_stun_nat_type nat_type; /**< NAT type. */
|
|
|
|
pj_status_t nat_status; /**< Detection status. */
|
|
|
|
pj_bool_t nat_in_progress; /**< Detection in progress */
|
|
|
|
|
2010-06-22 06:02:13 +00:00
|
|
|
/* List of outbound proxies: */
|
|
|
|
pjsip_route_hdr outbound_proxy;
|
|
|
|
|
2006-06-13 22:57:13 +00:00
|
|
|
/* Account: */
|
|
|
|
unsigned acc_cnt; /**< Number of accounts. */
|
|
|
|
pjsua_acc_id default_acc; /**< Default account ID */
|
|
|
|
pjsua_acc acc[PJSUA_MAX_ACC]; /**< Account array. */
|
2006-09-24 00:07:11 +00:00
|
|
|
pjsua_acc_id acc_ids[PJSUA_MAX_ACC]; /**< Acc sorted by prio*/
|
2006-06-13 22:57:13 +00:00
|
|
|
|
|
|
|
/* Calls: */
|
|
|
|
pjsua_config ua_cfg; /**< UA config. */
|
|
|
|
unsigned call_cnt; /**< Call counter. */
|
|
|
|
pjsua_call calls[PJSUA_MAX_CALLS];/**< Calls array. */
|
2008-01-19 13:01:42 +00:00
|
|
|
pjsua_call_id next_call_id; /**< Next call id to use*/
|
2006-06-13 22:57:13 +00:00
|
|
|
|
|
|
|
/* Buddy; */
|
|
|
|
unsigned buddy_cnt; /**< Buddy count. */
|
|
|
|
pjsua_buddy buddy[PJSUA_MAX_BUDDIES]; /**< Buddy array. */
|
|
|
|
|
2007-05-29 00:33:09 +00:00
|
|
|
/* Presence: */
|
|
|
|
pj_timer_entry pres_timer;/**< Presence refresh timer. */
|
|
|
|
|
2006-06-13 22:57:13 +00:00
|
|
|
/* Media: */
|
|
|
|
pjsua_media_config media_cfg; /**< Media config. */
|
|
|
|
pjmedia_endpt *med_endpt; /**< Media endpoint. */
|
|
|
|
pjsua_conf_setting mconf_cfg; /**< Additionan conf. bridge. param */
|
|
|
|
pjmedia_conf *mconf; /**< Conference bridge. */
|
2009-03-09 13:08:16 +00:00
|
|
|
pj_bool_t is_mswitch;/**< Are we using audio switchboard
|
|
|
|
(a.k.a APS-Direct) */
|
|
|
|
|
|
|
|
/* Sound device */
|
|
|
|
pjmedia_aud_dev_index cap_dev; /**< Capture device ID. */
|
|
|
|
pjmedia_aud_dev_index play_dev; /**< Playback device ID. */
|
|
|
|
pj_uint32_t aud_svmask;/**< Which settings to save */
|
|
|
|
pjmedia_aud_param aud_param; /**< User settings to sound dev */
|
|
|
|
pj_bool_t aud_open_cnt;/**< How many # device is opened */
|
2006-07-27 22:04:56 +00:00
|
|
|
pj_bool_t no_snd; /**< No sound (app will manage it) */
|
2008-06-13 17:01:46 +00:00
|
|
|
pj_pool_t *snd_pool; /**< Sound's private pool. */
|
2006-06-13 22:57:13 +00:00
|
|
|
pjmedia_snd_port *snd_port; /**< Sound port. */
|
2008-06-13 17:01:46 +00:00
|
|
|
pj_timer_entry snd_idle_timer;/**< Sound device idle timer. */
|
2006-06-13 22:57:13 +00:00
|
|
|
pjmedia_master_port *null_snd; /**< Master port for null sound. */
|
|
|
|
pjmedia_port *null_port; /**< Null port. */
|
2011-07-13 03:05:22 +00:00
|
|
|
pj_bool_t snd_is_on; /**< Media flow is currently active */
|
2006-06-13 22:57:13 +00:00
|
|
|
|
2011-03-22 09:49:23 +00:00
|
|
|
/* Video device */
|
|
|
|
pjmedia_vid_dev_index vcap_dev; /**< Capture device ID. */
|
|
|
|
pjmedia_vid_dev_index vrdr_dev; /**< Playback device ID. */
|
2006-06-13 22:57:13 +00:00
|
|
|
|
|
|
|
/* File players: */
|
|
|
|
unsigned player_cnt;/**< Number of file players. */
|
2007-02-16 09:22:56 +00:00
|
|
|
pjsua_file_data player[PJSUA_MAX_PLAYERS];/**< Array of players.*/
|
2006-06-13 22:57:13 +00:00
|
|
|
|
|
|
|
/* File recorders: */
|
|
|
|
unsigned rec_cnt; /**< Number of file recorders. */
|
2007-02-16 09:22:56 +00:00
|
|
|
pjsua_file_data recorder[PJSUA_MAX_RECORDERS];/**< Array of recs.*/
|
2011-07-07 07:46:33 +00:00
|
|
|
|
|
|
|
/* Video windows */
|
|
|
|
#if PJSUA_HAS_VIDEO
|
|
|
|
pjsua_vid_win win[PJSUA_MAX_VID_WINS]; /**< Array of windows */
|
|
|
|
#endif
|
2012-01-09 11:51:56 +00:00
|
|
|
|
|
|
|
/* Timer entry list */
|
2012-04-26 16:46:27 +00:00
|
|
|
pjsua_timer_list timer_list;
|
2012-01-09 11:51:56 +00:00
|
|
|
pj_mutex_t *timer_mutex;
|
2006-06-13 22:57:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
extern struct pjsua_data pjsua_var;
|
|
|
|
|
2007-10-30 15:42:35 +00:00
|
|
|
/**
|
|
|
|
* Get the instance of pjsua
|
|
|
|
*/
|
|
|
|
PJ_DECL(struct pjsua_data*) pjsua_get_var(void);
|
|
|
|
|
|
|
|
|
2006-06-13 22:57:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* IM callback data.
|
|
|
|
*/
|
|
|
|
typedef struct pjsua_im_data
|
|
|
|
{
|
|
|
|
pjsua_acc_id acc_id;
|
|
|
|
pjsua_call_id call_id;
|
|
|
|
pj_str_t to;
|
|
|
|
pj_str_t body;
|
|
|
|
void *user_data;
|
|
|
|
} pjsua_im_data;
|
|
|
|
|
2011-12-07 10:43:28 +00:00
|
|
|
pj_status_t pjsua_media_apply_xml_control(pjsua_call_id call_id,
|
|
|
|
const pj_str_t *xml_st);
|
|
|
|
|
2006-06-13 22:57:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Duplicate IM data.
|
|
|
|
*/
|
|
|
|
PJ_INLINE(pjsua_im_data*) pjsua_im_data_dup(pj_pool_t *pool,
|
|
|
|
const pjsua_im_data *src)
|
|
|
|
{
|
|
|
|
pjsua_im_data *dst;
|
|
|
|
|
2006-11-21 08:38:00 +00:00
|
|
|
dst = (pjsua_im_data*) pj_pool_alloc(pool, sizeof(*dst));
|
2006-06-13 22:57:13 +00:00
|
|
|
dst->acc_id = src->acc_id;
|
|
|
|
dst->call_id = src->call_id;
|
|
|
|
pj_strdup_with_null(pool, &dst->to, &src->to);
|
|
|
|
dst->user_data = src->user_data;
|
|
|
|
pj_strdup_with_null(pool, &dst->body, &src->body);
|
|
|
|
|
|
|
|
return dst;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2006-09-19 13:37:53 +00:00
|
|
|
#if 1
|
2011-12-28 09:49:24 +00:00
|
|
|
|
|
|
|
PJ_INLINE(void) PJSUA_LOCK()
|
|
|
|
{
|
|
|
|
pj_mutex_lock(pjsua_var.mutex);
|
|
|
|
pjsua_var.mutex_owner = pj_thread_this();
|
|
|
|
++pjsua_var.mutex_nesting_level;
|
|
|
|
}
|
|
|
|
|
|
|
|
PJ_INLINE(void) PJSUA_UNLOCK()
|
|
|
|
{
|
|
|
|
if (--pjsua_var.mutex_nesting_level == 0)
|
|
|
|
pjsua_var.mutex_owner = NULL;
|
|
|
|
pj_mutex_unlock(pjsua_var.mutex);
|
|
|
|
}
|
|
|
|
|
|
|
|
PJ_INLINE(pj_status_t) PJSUA_TRY_LOCK()
|
|
|
|
{
|
|
|
|
pj_status_t status;
|
|
|
|
status = pj_mutex_trylock(pjsua_var.mutex);
|
|
|
|
if (status == PJ_SUCCESS) {
|
|
|
|
pjsua_var.mutex_owner = pj_thread_this();
|
|
|
|
++pjsua_var.mutex_nesting_level;
|
|
|
|
}
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
|
|
|
PJ_INLINE(pj_bool_t) PJSUA_LOCK_IS_LOCKED()
|
|
|
|
{
|
|
|
|
return pjsua_var.mutex_owner == pj_thread_this();
|
|
|
|
}
|
|
|
|
|
2006-08-15 20:26:34 +00:00
|
|
|
#else
|
|
|
|
#define PJSUA_LOCK()
|
2011-12-28 09:49:24 +00:00
|
|
|
#define PJSUA_TRY_LOCK() PJ_SUCCESS
|
2006-08-15 20:26:34 +00:00
|
|
|
#define PJSUA_UNLOCK()
|
2011-12-28 09:49:24 +00:00
|
|
|
#define PJSUA_LOCK_IS_LOCKED() PJ_TRUE
|
2006-08-15 20:26:34 +00:00
|
|
|
#endif
|
2006-06-13 22:57:13 +00:00
|
|
|
|
2011-03-17 04:34:43 +00:00
|
|
|
/* Core */
|
|
|
|
void pjsua_set_state(pjsua_state new_state);
|
|
|
|
|
2009-08-12 11:03:23 +00:00
|
|
|
/******
|
|
|
|
* STUN resolution
|
|
|
|
*/
|
|
|
|
/* Resolve the STUN server */
|
|
|
|
pj_status_t resolve_stun_server(pj_bool_t wait);
|
|
|
|
|
2008-09-20 12:16:56 +00:00
|
|
|
/**
|
|
|
|
* Normalize route URI (check for ";lr" and append one if it doesn't
|
|
|
|
* exist and pjsua_config.force_lr is set.
|
|
|
|
*/
|
|
|
|
pj_status_t normalize_route_uri(pj_pool_t *pool, pj_str_t *uri);
|
2006-06-13 22:57:13 +00:00
|
|
|
|
2012-08-07 02:18:15 +00:00
|
|
|
/* acc use stun? */
|
|
|
|
pj_bool_t pjsua_sip_acc_is_using_stun(pjsua_acc_id acc_id);
|
|
|
|
|
|
|
|
/* Get local transport address suitable to be used for Via or Contact address
|
|
|
|
* to send request to the specified destination URI.
|
|
|
|
*/
|
|
|
|
pj_status_t pjsua_acc_get_uac_addr(pjsua_acc_id acc_id,
|
|
|
|
pj_pool_t *pool,
|
|
|
|
const pj_str_t *dst_uri,
|
|
|
|
pjsip_host_port *addr,
|
|
|
|
pjsip_transport_type_e *p_tp_type,
|
|
|
|
int *p_secure,
|
|
|
|
const void **p_tp);
|
|
|
|
|
2006-06-13 22:57:13 +00:00
|
|
|
/**
|
|
|
|
* Handle incoming invite request.
|
|
|
|
*/
|
|
|
|
pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata);
|
|
|
|
|
2007-03-23 16:34:20 +00:00
|
|
|
/*
|
|
|
|
* Media channel.
|
|
|
|
*/
|
|
|
|
pj_status_t pjsua_media_channel_init(pjsua_call_id call_id,
|
2008-01-23 20:39:07 +00:00
|
|
|
pjsip_role_e role,
|
2008-01-24 19:20:54 +00:00
|
|
|
int security_level,
|
2008-06-19 14:10:28 +00:00
|
|
|
pj_pool_t *tmp_pool,
|
|
|
|
const pjmedia_sdp_session *rem_sdp,
|
2011-09-21 10:20:01 +00:00
|
|
|
int *sip_err_code,
|
|
|
|
pj_bool_t async,
|
|
|
|
pjsua_med_tp_state_cb cb);
|
2007-03-23 16:34:20 +00:00
|
|
|
pj_status_t pjsua_media_channel_create_sdp(pjsua_call_id call_id,
|
|
|
|
pj_pool_t *pool,
|
2008-01-23 20:39:07 +00:00
|
|
|
const pjmedia_sdp_session *rem_sdp,
|
2008-01-24 19:20:54 +00:00
|
|
|
pjmedia_sdp_session **p_sdp,
|
|
|
|
int *sip_err_code);
|
2007-03-23 16:34:20 +00:00
|
|
|
pj_status_t pjsua_media_channel_update(pjsua_call_id call_id,
|
2008-06-19 14:10:28 +00:00
|
|
|
const pjmedia_sdp_session *local_sdp,
|
2007-03-28 16:24:00 +00:00
|
|
|
const pjmedia_sdp_session *remote_sdp);
|
2007-03-23 16:34:20 +00:00
|
|
|
pj_status_t pjsua_media_channel_deinit(pjsua_call_id call_id);
|
|
|
|
|
2011-07-15 06:18:29 +00:00
|
|
|
pj_status_t pjsua_call_media_init(pjsua_call_media *call_med,
|
|
|
|
pjmedia_type type,
|
|
|
|
const pjsua_transport_config *tcfg,
|
|
|
|
int security_level,
|
2011-09-21 10:20:01 +00:00
|
|
|
int *sip_err_code,
|
|
|
|
pj_bool_t async,
|
|
|
|
pjsua_med_tp_state_cb cb);
|
2012-03-22 09:56:52 +00:00
|
|
|
void pjsua_set_media_tp_state(pjsua_call_media *call_med, pjsua_med_tp_st tp_st);
|
2011-07-15 06:18:29 +00:00
|
|
|
|
2012-04-24 05:40:32 +00:00
|
|
|
void pjsua_media_prov_clean_up(pjsua_call_id call_id);
|
|
|
|
|
2011-12-01 10:49:07 +00:00
|
|
|
/* Callback to receive media events */
|
|
|
|
pj_status_t call_media_on_event(pjmedia_event *event,
|
|
|
|
void *user_data);
|
2007-03-23 16:34:20 +00:00
|
|
|
|
2006-06-13 22:57:13 +00:00
|
|
|
/**
|
|
|
|
* Init presence.
|
|
|
|
*/
|
|
|
|
pj_status_t pjsua_pres_init();
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Start presence subsystem.
|
|
|
|
*/
|
|
|
|
pj_status_t pjsua_pres_start(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Refresh presence subscriptions
|
|
|
|
*/
|
|
|
|
void pjsua_pres_refresh(void);
|
|
|
|
|
2007-08-25 13:36:15 +00:00
|
|
|
/*
|
|
|
|
* Update server subscription (e.g. when our online status has changed)
|
|
|
|
*/
|
|
|
|
void pjsua_pres_update_acc(int acc_id, pj_bool_t force);
|
|
|
|
|
2006-06-13 22:57:13 +00:00
|
|
|
/*
|
|
|
|
* Shutdown presence.
|
|
|
|
*/
|
2011-10-24 09:28:13 +00:00
|
|
|
void pjsua_pres_shutdown(unsigned flags);
|
2006-06-13 22:57:13 +00:00
|
|
|
|
2006-08-15 20:26:34 +00:00
|
|
|
/**
|
|
|
|
* Init presence for aoocunt.
|
|
|
|
*/
|
|
|
|
pj_status_t pjsua_pres_init_acc(int acc_id);
|
|
|
|
|
2007-02-24 13:29:22 +00:00
|
|
|
/**
|
|
|
|
* Send PUBLISH
|
|
|
|
*/
|
|
|
|
pj_status_t pjsua_pres_init_publish_acc(int acc_id);
|
|
|
|
|
2010-02-10 14:24:48 +00:00
|
|
|
/**
|
|
|
|
* Send un-PUBLISH
|
|
|
|
*/
|
2011-10-24 09:28:13 +00:00
|
|
|
void pjsua_pres_unpublish(pjsua_acc *acc, unsigned flags);
|
2010-02-10 14:24:48 +00:00
|
|
|
|
2006-06-13 22:57:13 +00:00
|
|
|
/**
|
|
|
|
* Terminate server subscription for the account
|
|
|
|
*/
|
2011-10-24 09:28:13 +00:00
|
|
|
void pjsua_pres_delete_acc(int acc_id, unsigned flags);
|
2006-06-13 22:57:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Init IM module handler to handle incoming MESSAGE outside dialog.
|
|
|
|
*/
|
|
|
|
pj_status_t pjsua_im_init(void);
|
|
|
|
|
2009-10-26 11:21:37 +00:00
|
|
|
/**
|
|
|
|
* Start MWI subscription
|
|
|
|
*/
|
2012-06-19 14:35:18 +00:00
|
|
|
pj_status_t pjsua_start_mwi(pjsua_acc_id acc_id, pj_bool_t force_renew);
|
2009-10-26 11:21:37 +00:00
|
|
|
|
2006-06-13 22:57:13 +00:00
|
|
|
/**
|
|
|
|
* Init call subsystem.
|
|
|
|
*/
|
|
|
|
pj_status_t pjsua_call_subsys_init(const pjsua_config *cfg);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Start call subsystem.
|
|
|
|
*/
|
|
|
|
pj_status_t pjsua_call_subsys_start(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Init media subsystems.
|
|
|
|
*/
|
|
|
|
pj_status_t pjsua_media_subsys_init(const pjsua_media_config *cfg);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Start pjsua media subsystem.
|
|
|
|
*/
|
|
|
|
pj_status_t pjsua_media_subsys_start(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Destroy pjsua media subsystem.
|
|
|
|
*/
|
2011-10-24 09:28:13 +00:00
|
|
|
pj_status_t pjsua_media_subsys_destroy(unsigned flags);
|
2006-06-13 22:57:13 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Private: check if we can accept the message.
|
|
|
|
* If not, then p_accept header will be filled with a valid
|
|
|
|
* Accept header.
|
|
|
|
*/
|
|
|
|
pj_bool_t pjsua_im_accept_pager(pjsip_rx_data *rdata,
|
|
|
|
pjsip_accept_hdr **p_accept_hdr);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Private: process pager message.
|
|
|
|
* This may trigger pjsua_ui_on_pager() or pjsua_ui_on_typing().
|
|
|
|
*/
|
|
|
|
void pjsua_im_process_pager(int call_id, const pj_str_t *from,
|
|
|
|
const pj_str_t *to, pjsip_rx_data *rdata);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create Accept header for MESSAGE.
|
|
|
|
*/
|
|
|
|
pjsip_accept_hdr* pjsua_im_create_accept(pj_pool_t *pool);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Add additional headers etc in msg_data specified by application
|
|
|
|
* when sending requests.
|
|
|
|
*/
|
|
|
|
void pjsua_process_msg_data(pjsip_tx_data *tdata,
|
|
|
|
const pjsua_msg_data *msg_data);
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Add route_set to outgoing requests
|
|
|
|
*/
|
|
|
|
void pjsua_set_msg_route_set( pjsip_tx_data *tdata,
|
|
|
|
const pjsip_route_hdr *route_set );
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Simple version of MIME type parsing (it doesn't support parameters)
|
|
|
|
*/
|
|
|
|
void pjsua_parse_media_type( pj_pool_t *pool,
|
|
|
|
const pj_str_t *mime,
|
|
|
|
pjsip_media_type *media_type);
|
|
|
|
|
|
|
|
|
2007-01-13 23:22:40 +00:00
|
|
|
/*
|
|
|
|
* Internal function to init transport selector from transport id.
|
|
|
|
*/
|
|
|
|
void pjsua_init_tpselector(pjsua_transport_id tp_id,
|
|
|
|
pjsip_tpselector *sel);
|
|
|
|
|
2008-09-24 10:10:15 +00:00
|
|
|
pjsip_dialog* on_dlg_forked(pjsip_dialog *first_set, pjsip_rx_data *res);
|
2007-09-25 20:48:49 +00:00
|
|
|
pj_status_t acquire_call(const char *title,
|
|
|
|
pjsua_call_id call_id,
|
|
|
|
pjsua_call **p_call,
|
|
|
|
pjsip_dialog **p_dlg);
|
|
|
|
const char *good_number(char *buf, pj_int32_t val);
|
|
|
|
void print_call(const char *title,
|
|
|
|
int call_id,
|
|
|
|
char *buf, pj_size_t size);
|
|
|
|
|
2012-03-22 09:56:52 +00:00
|
|
|
/*
|
|
|
|
* Audio
|
|
|
|
*/
|
|
|
|
pj_status_t pjsua_aud_subsys_init(void);
|
|
|
|
pj_status_t pjsua_aud_subsys_start(void);
|
|
|
|
pj_status_t pjsua_aud_subsys_destroy(void);
|
|
|
|
void pjsua_aud_stop_stream(pjsua_call_media *call_med);
|
|
|
|
pj_status_t pjsua_aud_channel_update(pjsua_call_media *call_med,
|
|
|
|
pj_pool_t *tmp_pool,
|
|
|
|
pjmedia_stream_info *si,
|
|
|
|
const pjmedia_sdp_session *local_sdp,
|
|
|
|
const pjmedia_sdp_session *remote_sdp);
|
2012-05-22 23:13:22 +00:00
|
|
|
void pjsua_check_snd_dev_idle();
|
2012-03-22 09:56:52 +00:00
|
|
|
|
2011-07-07 07:46:33 +00:00
|
|
|
/*
|
|
|
|
* Video
|
|
|
|
*/
|
|
|
|
pj_status_t pjsua_vid_subsys_init(void);
|
|
|
|
pj_status_t pjsua_vid_subsys_start(void);
|
|
|
|
pj_status_t pjsua_vid_subsys_destroy(void);
|
2012-03-22 09:56:52 +00:00
|
|
|
void pjsua_vid_stop_stream(pjsua_call_media *call_med);
|
|
|
|
pj_status_t pjsua_vid_channel_init(pjsua_call_media *call_med);
|
|
|
|
pj_status_t pjsua_vid_channel_update(pjsua_call_media *call_med,
|
|
|
|
pj_pool_t *tmp_pool,
|
|
|
|
pjmedia_vid_stream_info *si,
|
|
|
|
const pjmedia_sdp_session *local_sdp,
|
|
|
|
const pjmedia_sdp_session *remote_sdp);
|
2011-07-07 07:46:33 +00:00
|
|
|
|
|
|
|
#if PJSUA_HAS_VIDEO
|
2011-09-19 08:26:35 +00:00
|
|
|
PJ_DECL(void) pjsua_vid_win_reset(pjsua_vid_win_id wid);
|
2011-07-19 08:40:20 +00:00
|
|
|
#else
|
2011-09-19 08:26:35 +00:00
|
|
|
# define pjsua_vid_win_reset(wid)
|
2011-07-07 07:46:33 +00:00
|
|
|
#endif
|
|
|
|
|
2013-02-06 13:48:45 +00:00
|
|
|
/*
|
|
|
|
* Schedule check for the need of re-INVITE/UPDATE after media update
|
|
|
|
*/
|
|
|
|
void pjsua_call_schedule_reinvite_check(pjsua_call *call, unsigned delay_ms);
|
2007-01-13 23:22:40 +00:00
|
|
|
|
2006-06-13 22:57:13 +00:00
|
|
|
PJ_END_DECL
|
|
|
|
|
|
|
|
#endif /* __PJSUA_INTERNAL_H__ */
|
|
|
|
|