blob: d52b6d52f7ae07e7c19d0b95c588dba230277985 [file] [log] [blame]
Benny Prijonoeebe9af2006-06-13 22:57:13 +00001/* $Id$ */
2/*
Benny Prijono32177c02008-06-20 22:44:47 +00003 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
Benny Prijonoeebe9af2006-06-13 22:57:13 +00004 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19#ifndef __PJSUA_INTERNAL_H__
20#define __PJSUA_INTERNAL_H__
21
22/**
23 * This is the private header used by pjsua library implementation.
24 * Applications should not include this file.
25 */
26
27PJ_BEGIN_DECL
28
29/**
Benny Prijono224b4e22008-06-19 14:10:28 +000030 * Media transport state.
31 */
32typedef enum pjsua_med_tp_st
33{
34 /** Not initialized */
35 PJSUA_MED_TP_IDLE,
36
37 /** Initialized (media_create() has been called) */
38 PJSUA_MED_TP_INIT,
39
40 /** Running (media_start() has been called) */
41 PJSUA_MED_TP_RUNNING
42
43} pjsua_med_tp_st;
44
45/**
Benny Prijonoeebe9af2006-06-13 22:57:13 +000046 * Structure to be attached to invite dialog.
47 * Given a dialog "dlg", application can retrieve this structure
48 * by accessing dlg->mod_data[pjsua.mod.id].
49 */
50typedef struct pjsua_call
51{
52 unsigned index; /**< Index in pjsua array. */
53 pjsip_inv_session *inv; /**< The invite session. */
54 void *user_data; /**< User/application data. */
55 pjsip_status_code last_code; /**< Last status code seen. */
56 pj_str_t last_text; /**< Last status text seen. */
57 pj_time_val start_time;/**< First INVITE sent/received. */
58 pj_time_val res_time; /**< First response sent/received. */
59 pj_time_val conn_time; /**< Connected/confirmed time. */
60 pj_time_val dis_time; /**< Disconnect time. */
61 pjsua_acc_id acc_id; /**< Account index being used. */
Benny Prijonodb844a42008-02-02 17:07:18 +000062 int secure_level;/**< Signaling security level. */
Nanang Izzuddin99d69522008-08-04 15:01:38 +000063 pj_bool_t local_hold;/**< Flag for call-hold by local. */
Benny Prijonoeebe9af2006-06-13 22:57:13 +000064 pjsua_call_media_status media_st;/**< Media state. */
65 pjmedia_dir media_dir; /**< Media direction. */
66 pjmedia_session *session; /**< The media session. */
Benny Prijonoa310bd22008-06-27 21:19:44 +000067 int audio_idx; /**< Index of m=audio in SDP. */
Benny Prijono8147f402007-11-21 14:50:07 +000068 pj_uint32_t ssrc; /**< RTP SSRC */
Nanang Izzuddina815ceb2008-08-26 16:51:28 +000069 pj_uint32_t rtp_tx_ts; /**< Initial RTP timestamp for sender. */
70 pj_uint16_t rtp_tx_seq;/**< Initial RTP sequence for sender. */
71 pj_uint8_t rtp_tx_seq_ts_set;
72 /**< Bitmask flags if initial RTP sequence
73 and/or timestamp for sender are set.
74 bit 0/LSB : sequence flag
75 bit 1 : timestamp flag */
Benny Prijonoeebe9af2006-06-13 22:57:13 +000076 int conf_slot; /**< Slot # in conference bridge. */
77 pjsip_evsub *xfer_sub; /**< Xfer server subscription, if this
78 call was triggered by xfer. */
Benny Prijonod8179652008-01-23 20:39:07 +000079 pjmedia_transport *med_tp; /**< Current media transport. */
Benny Prijono224b4e22008-06-19 14:10:28 +000080 pj_status_t med_tp_ready;/**< Media transport status. */
Benny Prijonod8179652008-01-23 20:39:07 +000081 pjmedia_transport *med_orig; /**< Original media transport */
Benny Prijono40860c32008-09-04 13:55:33 +000082 pj_bool_t med_tp_auto_del; /**< May delete media transport */
Benny Prijono224b4e22008-06-19 14:10:28 +000083 pjsua_med_tp_st med_tp_st; /**< Media transport state */
Benny Prijonoeebe9af2006-06-13 22:57:13 +000084 pj_timer_entry refresh_tm;/**< Timer to send re-INVITE. */
85 pj_timer_entry hangup_tm; /**< Timer to hangup call. */
Benny Prijono91a6a172007-10-31 08:59:29 +000086 pj_stun_nat_type rem_nat_type; /**< NAT type of remote endpoint. */
Nanang Izzuddin4375f902008-06-26 19:12:09 +000087 pjmedia_srtp_use rem_srtp_use; /**< Remote's SRTP usage policy. */
Benny Prijonoeebe9af2006-06-13 22:57:13 +000088
89 char last_text_buf_[128]; /**< Buffer for last_text. */
90
91} pjsua_call;
92
93
94/**
95 * Server presence subscription list head.
96 */
Benny Prijono63fba012008-07-17 14:19:10 +000097struct pjsua_srv_pres
Benny Prijonoeebe9af2006-06-13 22:57:13 +000098{
99 PJ_DECL_LIST_MEMBER(struct pjsua_srv_pres);
Benny Prijono63fba012008-07-17 14:19:10 +0000100 pjsip_evsub *sub; /**< The evsub. */
101 char *remote; /**< Remote URI. */
102 int acc_id; /**< Account ID. */
103 pjsip_dialog *dlg; /**< Dialog. */
104 int expires; /**< "expires" value in the request. */
105};
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000106
107
108/**
109 * Account
110 */
111typedef struct pjsua_acc
112{
Benny Prijonoc91ed8d2008-07-13 12:24:55 +0000113 pj_pool_t *pool; /**< Pool for this account. */
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000114 pjsua_acc_config cfg; /**< Account configuration. */
115 pj_bool_t valid; /**< Is this account valid? */
116
117 int index; /**< Index in accounts array. */
Benny Prijonoc570f2d2006-07-18 00:33:02 +0000118 pj_str_t display; /**< Display name, if any. */
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000119 pj_str_t user_part; /**< User part of local URI. */
Benny Prijonoe8554ef2008-03-22 09:33:52 +0000120 pj_str_t contact; /**< Our Contact URI for REGISTER */
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000121
Benny Prijonob4a17c92006-07-10 14:40:21 +0000122 pj_str_t srv_domain; /**< Host part of reg server. */
123 int srv_port; /**< Port number of reg server. */
124
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000125 pjsip_regc *regc; /**< Client registration session. */
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000126 pj_status_t reg_last_err; /**< Last registration error. */
127 int reg_last_code; /**< Last status last register. */
128
Benny Prijonobddef2c2007-10-31 13:28:08 +0000129 pj_timer_entry ka_timer; /**< Keep-alive timer for UDP. */
130 pjsip_transport *ka_transport; /**< Transport for keep-alive. */
131 pj_sockaddr ka_target; /**< Destination address for K-A */
132 unsigned ka_target_len; /**< Length of ka_target. */
133
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000134 pjsip_route_hdr route_set; /**< Complete route set inc. outbnd.*/
135
136 unsigned cred_cnt; /**< Number of credentials. */
137 pjsip_cred_info cred[PJSUA_ACC_MAX_PROXIES]; /**< Complete creds. */
138
139 pj_bool_t online_status; /**< Our online status. */
Benny Prijono4461c7d2007-08-25 13:36:15 +0000140 pjrpid_element rpid; /**< RPID element information. */
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000141 pjsua_srv_pres pres_srv_list; /**< Server subscription list. */
Benny Prijono3a5e1ab2006-08-15 20:26:34 +0000142 pjsip_publishc *publish_sess; /**< Client publication session. */
143 pj_bool_t publish_state; /**< Last published online status */
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000144
145} pjsua_acc;
146
147
148/**
149 *Transport.
150 */
Benny Prijono62c5c5b2007-01-13 23:22:40 +0000151typedef struct pjsua_transport_data
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000152{
Benny Prijonoe93e2872006-06-28 16:46:49 +0000153 int index;
154 pjsip_transport_type_e type;
155 pjsip_host_port local_name;
156
157 union {
158 pjsip_transport *tp;
159 pjsip_tpfactory *factory;
160 void *ptr;
161 } data;
162
Benny Prijono62c5c5b2007-01-13 23:22:40 +0000163} pjsua_transport_data;
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000164
165
Benny Prijono63fba012008-07-17 14:19:10 +0000166/** Maximum length of subscription termination reason. */
167#define PJSUA_BUDDY_SUB_TERM_REASON_LEN 32
168
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000169/**
170 * Buddy data.
171 */
172typedef struct pjsua_buddy
173{
Benny Prijonoc91ed8d2008-07-13 12:24:55 +0000174 pj_pool_t *pool; /**< Pool for this buddy. */
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000175 unsigned index; /**< Buddy index. */
Benny Prijono705e7842008-07-21 18:12:51 +0000176 void *user_data; /**< Application data. */
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000177 pj_str_t uri; /**< Buddy URI. */
178 pj_str_t contact; /**< Contact learned from subscrp. */
179 pj_str_t name; /**< Buddy name. */
180 pj_str_t display; /**< Buddy display name. */
181 pj_str_t host; /**< Buddy host. */
182 unsigned port; /**< Buddy port. */
183 pj_bool_t monitor; /**< Should we monitor? */
Benny Prijonof9c40c32007-06-28 07:20:26 +0000184 pjsip_dialog *dlg; /**< The underlying dialog. */
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000185 pjsip_evsub *sub; /**< Buddy presence subscription */
Benny Prijono63fba012008-07-17 14:19:10 +0000186 pj_str_t term_reason;/**< Subscription termination reason */
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000187 pjsip_pres_status status; /**< Buddy presence status. */
188
189} pjsua_buddy;
190
191
192/**
193 * File player/recorder data.
194 */
195typedef struct pjsua_file_data
196{
Benny Prijonoa66c3312007-01-21 23:12:40 +0000197 pj_bool_t type; /* 0=player, 1=playlist */
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000198 pjmedia_port *port;
Benny Prijonod5696da2007-07-17 16:25:45 +0000199 pj_pool_t *pool;
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000200 unsigned slot;
201} pjsua_file_data;
202
203
204/**
205 * Additional parameters for conference bridge.
206 */
207typedef struct pjsua_conf_setting
208{
209 unsigned channel_count;
210 unsigned samples_per_frame;
211 unsigned bits_per_sample;
212} pjsua_conf_setting;
213
214
215/**
216 * Global pjsua application data.
217 */
218struct pjsua_data
219{
220
221 /* Control: */
222 pj_caching_pool cp; /**< Global pool factory. */
223 pj_pool_t *pool; /**< pjsua's private pool. */
224 pj_mutex_t *mutex; /**< Mutex protection for this data */
225
226 /* Logging: */
227 pjsua_logging_config log_cfg; /**< Current logging config. */
228 pj_oshandle_t log_file; /**<Output log file handle */
229
230 /* SIP: */
231 pjsip_endpoint *endpt; /**< Global endpoint. */
232 pjsip_module mod; /**< pjsua's PJSIP module. */
Benny Prijono62c5c5b2007-01-13 23:22:40 +0000233 pjsua_transport_data tpdata[8]; /**< Array of transports. */
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000234
235 /* Threading: */
236 pj_bool_t thread_quit_flag; /**< Thread quit flag. */
237 pj_thread_t *thread[4]; /**< Array of threads. */
238
Benny Prijonoc97608e2007-03-23 16:34:20 +0000239 /* STUN and resolver */
240 pj_stun_config stun_cfg; /**< Global STUN settings. */
241 pj_sockaddr stun_srv; /**< Resolved STUN server address */
242 pj_status_t stun_status; /**< STUN server status. */
243 pj_dns_resolver *resolver; /**< DNS resolver. */
244
Benny Prijono6ba8c542007-10-16 01:34:14 +0000245 /* Detected NAT type */
246 pj_stun_nat_type nat_type; /**< NAT type. */
247 pj_status_t nat_status; /**< Detection status. */
248 pj_bool_t nat_in_progress; /**< Detection in progress */
249
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000250 /* Account: */
251 unsigned acc_cnt; /**< Number of accounts. */
252 pjsua_acc_id default_acc; /**< Default account ID */
253 pjsua_acc acc[PJSUA_MAX_ACC]; /**< Account array. */
Benny Prijono093d3022006-09-24 00:07:11 +0000254 pjsua_acc_id acc_ids[PJSUA_MAX_ACC]; /**< Acc sorted by prio*/
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000255
256 /* Calls: */
257 pjsua_config ua_cfg; /**< UA config. */
258 unsigned call_cnt; /**< Call counter. */
259 pjsua_call calls[PJSUA_MAX_CALLS];/**< Calls array. */
Benny Prijono5773cd62008-01-19 13:01:42 +0000260 pjsua_call_id next_call_id; /**< Next call id to use*/
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000261
262 /* Buddy; */
263 unsigned buddy_cnt; /**< Buddy count. */
264 pjsua_buddy buddy[PJSUA_MAX_BUDDIES]; /**< Buddy array. */
265
Benny Prijono7a5f5102007-05-29 00:33:09 +0000266 /* Presence: */
267 pj_timer_entry pres_timer;/**< Presence refresh timer. */
268
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000269 /* Media: */
270 pjsua_media_config media_cfg; /**< Media config. */
271 pjmedia_endpt *med_endpt; /**< Media endpoint. */
272 pjsua_conf_setting mconf_cfg; /**< Additionan conf. bridge. param */
273 pjmedia_conf *mconf; /**< Conference bridge. */
274 int cap_dev; /**< Capture device ID. */
275 int play_dev; /**< Playback device ID. */
Benny Prijonoe909eac2006-07-27 22:04:56 +0000276 pj_bool_t no_snd; /**< No sound (app will manage it) */
Nanang Izzuddin68559c32008-06-13 17:01:46 +0000277 pj_pool_t *snd_pool; /**< Sound's private pool. */
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000278 pjmedia_snd_port *snd_port; /**< Sound port. */
Nanang Izzuddin68559c32008-06-13 17:01:46 +0000279 pj_timer_entry snd_idle_timer;/**< Sound device idle timer. */
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000280 pjmedia_master_port *null_snd; /**< Master port for null sound. */
281 pjmedia_port *null_port; /**< Null port. */
282
283
284 /* File players: */
285 unsigned player_cnt;/**< Number of file players. */
Benny Prijonocba59d92007-02-16 09:22:56 +0000286 pjsua_file_data player[PJSUA_MAX_PLAYERS];/**< Array of players.*/
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000287
288 /* File recorders: */
289 unsigned rec_cnt; /**< Number of file recorders. */
Benny Prijonocba59d92007-02-16 09:22:56 +0000290 pjsua_file_data recorder[PJSUA_MAX_RECORDERS];/**< Array of recs.*/
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000291};
292
293
294extern struct pjsua_data pjsua_var;
295
Benny Prijono44e88ea2007-10-30 15:42:35 +0000296/**
297 * Get the instance of pjsua
298 */
299PJ_DECL(struct pjsua_data*) pjsua_get_var(void);
300
301
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000302
303/**
304 * IM callback data.
305 */
306typedef struct pjsua_im_data
307{
308 pjsua_acc_id acc_id;
309 pjsua_call_id call_id;
310 pj_str_t to;
311 pj_str_t body;
312 void *user_data;
313} pjsua_im_data;
314
315
316/**
317 * Duplicate IM data.
318 */
319PJ_INLINE(pjsua_im_data*) pjsua_im_data_dup(pj_pool_t *pool,
320 const pjsua_im_data *src)
321{
322 pjsua_im_data *dst;
323
Benny Prijono07113c92006-11-21 08:38:00 +0000324 dst = (pjsua_im_data*) pj_pool_alloc(pool, sizeof(*dst));
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000325 dst->acc_id = src->acc_id;
326 dst->call_id = src->call_id;
327 pj_strdup_with_null(pool, &dst->to, &src->to);
328 dst->user_data = src->user_data;
329 pj_strdup_with_null(pool, &dst->body, &src->body);
330
331 return dst;
332}
333
334
Benny Prijono148c9dd2006-09-19 13:37:53 +0000335#if 1
336#define PJSUA_LOCK() pj_mutex_lock(pjsua_var.mutex)
337#define PJSUA_TRY_LOCK() pj_mutex_trylock(pjsua_var.mutex)
338#define PJSUA_UNLOCK() pj_mutex_unlock(pjsua_var.mutex)
Benny Prijono3a5e1ab2006-08-15 20:26:34 +0000339#else
340#define PJSUA_LOCK()
Benny Prijono148c9dd2006-09-19 13:37:53 +0000341#define PJSUA_TRY_LOCK() PJ_SUCCESS
Benny Prijono3a5e1ab2006-08-15 20:26:34 +0000342#define PJSUA_UNLOCK()
343#endif
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000344
345
Benny Prijonoc97608e2007-03-23 16:34:20 +0000346/**
347 * Resolve STUN server.
348 */
349pj_status_t pjsua_resolve_stun_server(pj_bool_t wait);
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000350
351/**
352 * Handle incoming invite request.
353 */
354pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata);
355
Benny Prijonoc97608e2007-03-23 16:34:20 +0000356/*
357 * Media channel.
358 */
359pj_status_t pjsua_media_channel_init(pjsua_call_id call_id,
Benny Prijonod8179652008-01-23 20:39:07 +0000360 pjsip_role_e role,
Benny Prijono25b2ea12008-01-24 19:20:54 +0000361 int security_level,
Benny Prijono224b4e22008-06-19 14:10:28 +0000362 pj_pool_t *tmp_pool,
363 const pjmedia_sdp_session *rem_sdp,
Benny Prijono25b2ea12008-01-24 19:20:54 +0000364 int *sip_err_code);
Benny Prijonoc97608e2007-03-23 16:34:20 +0000365pj_status_t pjsua_media_channel_create_sdp(pjsua_call_id call_id,
366 pj_pool_t *pool,
Benny Prijonod8179652008-01-23 20:39:07 +0000367 const pjmedia_sdp_session *rem_sdp,
Benny Prijono25b2ea12008-01-24 19:20:54 +0000368 pjmedia_sdp_session **p_sdp,
369 int *sip_err_code);
Benny Prijonoc97608e2007-03-23 16:34:20 +0000370pj_status_t pjsua_media_channel_update(pjsua_call_id call_id,
Benny Prijono224b4e22008-06-19 14:10:28 +0000371 const pjmedia_sdp_session *local_sdp,
Benny Prijonodbce2cf2007-03-28 16:24:00 +0000372 const pjmedia_sdp_session *remote_sdp);
Benny Prijonoc97608e2007-03-23 16:34:20 +0000373pj_status_t pjsua_media_channel_deinit(pjsua_call_id call_id);
374
375
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000376/**
377 * Init presence.
378 */
379pj_status_t pjsua_pres_init();
380
381/*
382 * Start presence subsystem.
383 */
384pj_status_t pjsua_pres_start(void);
385
386/**
387 * Refresh presence subscriptions
388 */
389void pjsua_pres_refresh(void);
390
391/*
Benny Prijono4461c7d2007-08-25 13:36:15 +0000392 * Update server subscription (e.g. when our online status has changed)
393 */
394void pjsua_pres_update_acc(int acc_id, pj_bool_t force);
395
396/*
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000397 * Shutdown presence.
398 */
399void pjsua_pres_shutdown(void);
400
401/**
Benny Prijono3a5e1ab2006-08-15 20:26:34 +0000402 * Init presence for aoocunt.
403 */
404pj_status_t pjsua_pres_init_acc(int acc_id);
405
406/**
Benny Prijono8b6834f2007-02-24 13:29:22 +0000407 * Send PUBLISH
408 */
409pj_status_t pjsua_pres_init_publish_acc(int acc_id);
410
411/**
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000412 * Terminate server subscription for the account
413 */
414void pjsua_pres_delete_acc(int acc_id);
415
416/**
417 * Init IM module handler to handle incoming MESSAGE outside dialog.
418 */
419pj_status_t pjsua_im_init(void);
420
421/**
422 * Init call subsystem.
423 */
424pj_status_t pjsua_call_subsys_init(const pjsua_config *cfg);
425
426/**
427 * Start call subsystem.
428 */
429pj_status_t pjsua_call_subsys_start(void);
430
431/**
432 * Init media subsystems.
433 */
434pj_status_t pjsua_media_subsys_init(const pjsua_media_config *cfg);
435
436/**
437 * Start pjsua media subsystem.
438 */
439pj_status_t pjsua_media_subsys_start(void);
440
441/**
442 * Destroy pjsua media subsystem.
443 */
444pj_status_t pjsua_media_subsys_destroy(void);
445
446/**
447 * Private: check if we can accept the message.
448 * If not, then p_accept header will be filled with a valid
449 * Accept header.
450 */
451pj_bool_t pjsua_im_accept_pager(pjsip_rx_data *rdata,
452 pjsip_accept_hdr **p_accept_hdr);
453
454/**
455 * Private: process pager message.
456 * This may trigger pjsua_ui_on_pager() or pjsua_ui_on_typing().
457 */
458void pjsua_im_process_pager(int call_id, const pj_str_t *from,
459 const pj_str_t *to, pjsip_rx_data *rdata);
460
461
462/**
463 * Create Accept header for MESSAGE.
464 */
465pjsip_accept_hdr* pjsua_im_create_accept(pj_pool_t *pool);
466
467/*
468 * Add additional headers etc in msg_data specified by application
469 * when sending requests.
470 */
471void pjsua_process_msg_data(pjsip_tx_data *tdata,
472 const pjsua_msg_data *msg_data);
473
474
475/*
476 * Add route_set to outgoing requests
477 */
478void pjsua_set_msg_route_set( pjsip_tx_data *tdata,
479 const pjsip_route_hdr *route_set );
480
481
482/*
483 * Simple version of MIME type parsing (it doesn't support parameters)
484 */
485void pjsua_parse_media_type( pj_pool_t *pool,
486 const pj_str_t *mime,
487 pjsip_media_type *media_type);
488
489
Benny Prijono62c5c5b2007-01-13 23:22:40 +0000490/*
491 * Internal function to init transport selector from transport id.
492 */
493void pjsua_init_tpselector(pjsua_transport_id tp_id,
494 pjsip_tpselector *sel);
495
496
Benny Prijono627cbb42007-09-25 20:48:49 +0000497pj_status_t acquire_call(const char *title,
498 pjsua_call_id call_id,
499 pjsua_call **p_call,
500 pjsip_dialog **p_dlg);
501const char *good_number(char *buf, pj_int32_t val);
502void print_call(const char *title,
503 int call_id,
504 char *buf, pj_size_t size);
505
Benny Prijono62c5c5b2007-01-13 23:22:40 +0000506
Benny Prijonoeebe9af2006-06-13 22:57:13 +0000507PJ_END_DECL
508
509#endif /* __PJSUA_INTERNAL_H__ */
510