blob: dc179cb3001afe56ff10a4559f70691f11f8a225 [file] [log] [blame]
Benny Prijono268ca612006-02-07 12:34:11 +00001/* $Id$ */
2/*
3 * Copyright (C) 2003-2006 Benny Prijono <benny@prijono.org>
4 *
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_H__
20#define __PJSUA_H__
21
22/* Include all PJSIP core headers. */
23#include <pjsip.h>
24
25/* Include all PJMEDIA headers. */
26#include <pjmedia.h>
27
Benny Prijono1f9afba2006-02-10 15:57:32 +000028/* Include all PJMEDIA-CODEC headers. */
29#include <pjmedia-codec.h>
30
Benny Prijono268ca612006-02-07 12:34:11 +000031/* Include all PJSIP-UA headers */
32#include <pjsip_ua.h>
33
Benny Prijono834aee32006-02-19 01:38:06 +000034/* Include all PJSIP-SIMPLE headers */
35#include <pjsip_simple.h>
36
Benny Prijono268ca612006-02-07 12:34:11 +000037/* Include all PJLIB-UTIL headers. */
38#include <pjlib-util.h>
39
40/* Include all PJLIB headers. */
41#include <pjlib.h>
42
43
Benny Prijono1a01ad32006-02-07 21:13:28 +000044PJ_BEGIN_DECL
45
Benny Prijono632ce712006-02-09 14:01:40 +000046
Benny Prijonof3195072006-02-14 21:15:30 +000047/**
48 * Max buddies in buddy list.
49 */
Benny Prijonoa91a0032006-02-26 21:23:45 +000050#ifndef PJSUA_MAX_BUDDIES
51# define PJSUA_MAX_BUDDIES 32
52#endif
53
Benny Prijonof3195072006-02-14 21:15:30 +000054
Benny Prijonof04ffdd2006-02-21 00:11:18 +000055/**
56 * Max simultaneous calls.
57 */
Benny Prijonoa91a0032006-02-26 21:23:45 +000058#ifndef PJSUA_MAX_CALLS
59# define PJSUA_MAX_CALLS 256
60#endif
61
62
63/**
64 * Aditional ports to be allocated in the conference ports for non-call
65 * streams.
66 */
Benny Prijonode380582006-03-15 19:32:41 +000067#define PJSUA_CONF_MORE_PORTS 3
Benny Prijonoa91a0032006-02-26 21:23:45 +000068
69
70/**
71 * Maximum accounts.
72 */
73#ifndef PJSUA_MAX_ACC
74# define PJSUA_MAX_ACC 8
75#endif
76
77
78/**
79 * Maximum credentials.
80 */
81#ifndef PJSUA_MAX_CRED
82# define PJSUA_MAX_CRED PJSUA_MAX_ACC
83#endif
Benny Prijonof04ffdd2006-02-21 00:11:18 +000084
85
Benny Prijono632ce712006-02-09 14:01:40 +000086/**
Benny Prijonoa91a0032006-02-26 21:23:45 +000087 * Structure to be attached to invite dialog.
Benny Prijono632ce712006-02-09 14:01:40 +000088 * Given a dialog "dlg", application can retrieve this structure
89 * by accessing dlg->mod_data[pjsua.mod.id].
90 */
Benny Prijonoa91a0032006-02-26 21:23:45 +000091struct pjsua_call
Benny Prijono632ce712006-02-09 14:01:40 +000092{
Benny Prijonoa91a0032006-02-26 21:23:45 +000093 unsigned index; /**< Index in pjsua array. */
Benny Prijonof04ffdd2006-02-21 00:11:18 +000094 pjsip_inv_session *inv; /**< The invite session. */
Benny Prijonoe21e7842006-04-09 16:46:05 +000095 pj_time_val start_time;/**< First INVITE sent/received. */
96 pj_time_val res_time; /**< First response sent/received. */
97 pj_time_val conn_time; /**< Connected/confirmed time. */
98 pj_time_val dis_time; /**< Disconnect time. */
Benny Prijonoa91a0032006-02-26 21:23:45 +000099 int acc_index; /**< Account index being used. */
Benny Prijonof04ffdd2006-02-21 00:11:18 +0000100 pjmedia_session *session; /**< The media session. */
101 unsigned conf_slot; /**< Slot # in conference bridge. */
Benny Prijono26ff9062006-02-21 23:47:00 +0000102 pjsip_evsub *xfer_sub; /**< Xfer server subscription, if this
103 call was triggered by xfer. */
Benny Prijonoa91a0032006-02-26 21:23:45 +0000104 pjmedia_sock_info skinfo; /**< Preallocated media sockets. */
Benny Prijonoa91a0032006-02-26 21:23:45 +0000105 void *app_data; /**< Application data. */
Benny Prijono105217f2006-03-06 16:25:59 +0000106 pj_timer_entry refresh_tm;/**< Timer to send re-INVITE. */
107 pj_timer_entry hangup_tm; /**< Timer to hangup call. */
Benny Prijono632ce712006-02-09 14:01:40 +0000108};
109
Benny Prijonoa91a0032006-02-26 21:23:45 +0000110typedef struct pjsua_call pjsua_call;
111
Benny Prijono632ce712006-02-09 14:01:40 +0000112
Benny Prijono834aee32006-02-19 01:38:06 +0000113/**
114 * Buddy data.
115 */
116struct pjsua_buddy
117{
118 pj_str_t uri; /**< Buddy URI */
Benny Prijonoa91a0032006-02-26 21:23:45 +0000119 int acc_index; /**< Which account to use. */
Benny Prijono834aee32006-02-19 01:38:06 +0000120 pj_bool_t monitor; /**< Should we monitor? */
121 pjsip_evsub *sub; /**< Buddy presence subscription */
122 pjsip_pres_status status; /**< Buddy presence status. */
123};
124
125typedef struct pjsua_buddy pjsua_buddy;
126
127
128/**
129 * Server presence subscription list head.
130 */
131struct pjsua_srv_pres
132{
133 PJ_DECL_LIST_MEMBER(struct pjsua_srv_pres);
134 pjsip_evsub *sub;
135 char *remote;
136};
137
138typedef struct pjsua_srv_pres pjsua_srv_pres;
139
140
Benny Prijonoa91a0032006-02-26 21:23:45 +0000141/**
142 * Account
143 */
144struct pjsua_acc
145{
146 int index; /**< Index in accounts array. */
147 pj_str_t local_uri; /**< Uri in From: header. */
148 pj_str_t user_part; /**< User part of local URI. */
149 pj_str_t host_part; /**< Host part of local URI. */
150 pj_str_t contact_uri; /**< Uri in Contact: header. */
151
152 pj_str_t reg_uri; /**< Registrar URI. */
153 pjsip_regc *regc; /**< Client registration session. */
154 pj_int32_t reg_timeout; /**< Default timeout. */
155 pj_timer_entry reg_timer; /**< Registration timer. */
156 pj_status_t reg_last_err; /**< Last registration error. */
157 int reg_last_code; /**< Last status last register. */
158
159 pj_str_t proxy; /**< Proxy URL. */
160 pjsip_route_hdr route_set; /**< Route set. */
161
162 pj_bool_t online_status; /**< Our online status. */
163 pjsua_srv_pres pres_srv_list; /**< Server subscription list. */
164
165 void *app_data; /**< Application data. */
166};
167
168
169typedef struct pjsua_acc pjsua_acc;
170
Benny Prijono632ce712006-02-09 14:01:40 +0000171
Benny Prijono268ca612006-02-07 12:34:11 +0000172/* PJSUA application variables. */
Benny Prijono95196582006-02-09 00:13:40 +0000173struct pjsua
Benny Prijono268ca612006-02-07 12:34:11 +0000174{
175 /* Control: */
Benny Prijono95196582006-02-09 00:13:40 +0000176 pj_caching_pool cp; /**< Global pool factory. */
177 pjsip_endpoint *endpt; /**< Global endpoint. */
178 pj_pool_t *pool; /**< pjsua's private pool. */
179 pjsip_module mod; /**< pjsua's PJSIP module. */
Benny Prijono268ca612006-02-07 12:34:11 +0000180
181
Benny Prijono95196582006-02-09 00:13:40 +0000182 /* Media: */
Benny Prijonocbf37402006-03-01 19:29:10 +0000183 int start_rtp_port;/**< Start of RTP port to try. */
Benny Prijonof04ffdd2006-02-21 00:11:18 +0000184 pjmedia_endpt *med_endpt; /**< Media endpoint. */
Benny Prijono08e0d062006-03-04 14:52:44 +0000185 unsigned clock_rate; /**< Internal clock rate. */
Benny Prijonofa137ca2006-03-20 17:42:37 +0000186 pj_bool_t has_wb; /**< Include wideband codecs */
187 pj_bool_t has_uwb; /**< Include ultra-wideband codecs */
Benny Prijonof04ffdd2006-02-21 00:11:18 +0000188 pjmedia_conf *mconf; /**< Media conference. */
189 pj_bool_t null_audio; /**< Null audio flag. */
Benny Prijono8e3344c2006-03-08 12:37:22 +0000190 pj_bool_t no_mic; /**< Disable microphone. */
Benny Prijono39879152006-02-23 02:09:10 +0000191 char *wav_file; /**< WAV file name to play. */
192 unsigned wav_slot; /**< WAV player slot in bridge */
Benny Prijonode380582006-03-15 19:32:41 +0000193 pjmedia_port *file_port; /**< WAV player port. */
194 pjmedia_port *null_port; /**< NULL port. */
Benny Prijonoa91a0032006-02-26 21:23:45 +0000195 pj_bool_t auto_play; /**< Auto play file for calls? */
196 pj_bool_t auto_loop; /**< Auto loop RTP stream? */
197 pj_bool_t auto_conf; /**< Auto put to conference? */
Benny Prijono1c2bf462006-03-05 11:54:02 +0000198 int complexity; /**< Codec complexity. */
199 int quality; /**< Codec quality. */
200
Benny Prijonoa91a0032006-02-26 21:23:45 +0000201
Benny Prijonoeb30bf52006-03-04 20:43:52 +0000202 /* Codec arguments: */
203 int codec_cnt; /**< Number of --add-codec args. */
204 pj_str_t codec_arg[32]; /**< Array of --add-codec args. */
205 pj_status_t (*codec_deinit[32])(void); /**< Array of funcs. */
Benny Prijonof04ffdd2006-02-21 00:11:18 +0000206
Benny Prijono64f851e2006-02-23 13:49:28 +0000207 /* User Agent behaviour: */
Benny Prijono64f851e2006-02-23 13:49:28 +0000208 int auto_answer; /**< Automatically answer in calls. */
Benny Prijono105217f2006-03-06 16:25:59 +0000209 int uas_refresh; /**< Time to re-INVITE. */
210 int uas_duration; /**< Max call duration. */
Benny Prijono64f851e2006-02-23 13:49:28 +0000211
Benny Prijonoa91a0032006-02-26 21:23:45 +0000212 /* Account: */
Benny Prijonoccb03fa2006-03-06 13:35:47 +0000213 pj_bool_t has_acc; /**< Any --id cmdline? */
Benny Prijonoa91a0032006-02-26 21:23:45 +0000214 int acc_cnt; /**< Number of client registrations */
215 pjsua_acc acc[PJSUA_MAX_ACC]; /** Client regs array. */
Benny Prijonoccf95622006-02-07 18:48:01 +0000216
217
218 /* Authentication credentials: */
219
Benny Prijonoa91a0032006-02-26 21:23:45 +0000220 int cred_count; /**< Number of credentials. */
221 pjsip_cred_info cred_info[10]; /**< Array of credentials. */
Benny Prijonoccf95622006-02-07 18:48:01 +0000222
223
Benny Prijonof04ffdd2006-02-21 00:11:18 +0000224 /* Threading (optional): */
Benny Prijono268ca612006-02-07 12:34:11 +0000225 int thread_cnt; /**< Thread count. */
226 pj_thread_t *threads[8]; /**< Thread instances. */
227 pj_bool_t quit_flag; /**< To signal thread to quit. */
228
229 /* Transport (UDP): */
Benny Prijono268ca612006-02-07 12:34:11 +0000230 pj_uint16_t sip_port; /**< SIP signaling port. */
231 pj_sock_t sip_sock; /**< SIP UDP socket. */
232 pj_sockaddr_in sip_sock_name; /**< Public/STUN UDP socket addr. */
Benny Prijono268ca612006-02-07 12:34:11 +0000233
Benny Prijonoa91a0032006-02-26 21:23:45 +0000234 pj_str_t outbound_proxy;/**< Outbound proxy. */
Benny Prijono268ca612006-02-07 12:34:11 +0000235
236
237 /* STUN: */
Benny Prijono268ca612006-02-07 12:34:11 +0000238 pj_str_t stun_srv1;
239 int stun_port1;
240 pj_str_t stun_srv2;
241 int stun_port2;
242
243
Benny Prijonoa91a0032006-02-26 21:23:45 +0000244 /* Logging: */
Benny Prijono268ca612006-02-07 12:34:11 +0000245 int log_level; /**< Logging verbosity. */
246 int app_log_level; /**< stdout log verbosity. */
247 unsigned log_decor; /**< Log decoration. */
Benny Prijonoccf95622006-02-07 18:48:01 +0000248 char *log_filename; /**< Log filename. */
Benny Prijono268ca612006-02-07 12:34:11 +0000249
Benny Prijonof3195072006-02-14 21:15:30 +0000250
Benny Prijonoa91a0032006-02-26 21:23:45 +0000251 /* PJSUA Calls: */
252 int max_calls; /**< Max nb of calls. */
253 int call_cnt; /**< Number of calls. */
254 pjsua_call calls[PJSUA_MAX_CALLS]; /** Calls array. */
Benny Prijonof3195072006-02-14 21:15:30 +0000255
256
Benny Prijono834aee32006-02-19 01:38:06 +0000257 /* SIMPLE and buddy status: */
Benny Prijonoa91a0032006-02-26 21:23:45 +0000258 int buddy_cnt;
259 pjsua_buddy buddies[PJSUA_MAX_BUDDIES];
Benny Prijono1a01ad32006-02-07 21:13:28 +0000260};
Benny Prijono268ca612006-02-07 12:34:11 +0000261
Benny Prijono95196582006-02-09 00:13:40 +0000262
263/** PJSUA instance. */
264extern struct pjsua pjsua;
265
266
Benny Prijono268ca612006-02-07 12:34:11 +0000267
268/*****************************************************************************
Benny Prijono84126ab2006-02-09 09:30:09 +0000269 * PJSUA API (defined in pjsua_core.c).
Benny Prijono268ca612006-02-07 12:34:11 +0000270 */
271
272/**
273 * Initialize pjsua settings with default parameters.
274 */
275void pjsua_default(void);
276
277
278/**
279 * Display error message for the specified error code.
280 */
Benny Prijonobcaed6c2006-02-19 15:37:19 +0000281void pjsua_perror(const char *sender, const char *title,
282 pj_status_t status);
Benny Prijono268ca612006-02-07 12:34:11 +0000283
284
285/**
Benny Prijonoccf95622006-02-07 18:48:01 +0000286 * Initialize pjsua application. Application can call this before parsing
287 * application settings.
288 *
289 * This will initialize all libraries, create endpoint instance, and register
290 * pjsip modules. Transport will NOT be created however.
291 *
292 * Application may register module after calling this function.
Benny Prijono268ca612006-02-07 12:34:11 +0000293 */
294pj_status_t pjsua_init(void);
295
296
297/**
Benny Prijonoccf95622006-02-07 18:48:01 +0000298 * Start pjsua stack. Application calls this after pjsua settings has been
299 * configured.
300 *
301 * This will start the transport, worker threads (if any), and registration
302 * process, if registration is configured.
303 */
304pj_status_t pjsua_start(void);
305
306
307/**
Benny Prijono268ca612006-02-07 12:34:11 +0000308 * Destroy pjsua.
309 */
310pj_status_t pjsua_destroy(void);
311
312
Benny Prijonoa91a0032006-02-26 21:23:45 +0000313/**
314 * Find account for incoming request.
Benny Prijono84126ab2006-02-09 09:30:09 +0000315 */
Benny Prijonoa91a0032006-02-26 21:23:45 +0000316int pjsua_find_account_for_incoming(pjsip_rx_data *rdata);
317
318
319/**
320 * Find account for outgoing request.
321 */
322int pjsua_find_account_for_outgoing(const pj_str_t *url);
323
324
325/*****************************************************************************
326 * PJSUA Call API (defined in pjsua_call.c).
327 */
328
329/**
330 * Init pjsua call module.
331 */
332pj_status_t pjsua_call_init(void);
Benny Prijono84126ab2006-02-09 09:30:09 +0000333
Benny Prijono268ca612006-02-07 12:34:11 +0000334/**
335 * Make outgoing call.
336 */
Benny Prijonoa91a0032006-02-26 21:23:45 +0000337pj_status_t pjsua_make_call(int acc_index,
338 const char *cstr_dest_uri,
339 int *p_call_index);
Benny Prijono268ca612006-02-07 12:34:11 +0000340
341
Benny Prijono84126ab2006-02-09 09:30:09 +0000342/**
343 * Handle incoming invite request.
344 */
Benny Prijonoa91a0032006-02-26 21:23:45 +0000345pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata);
Benny Prijono84126ab2006-02-09 09:30:09 +0000346
347
348/**
Benny Prijonoa91a0032006-02-26 21:23:45 +0000349 * Answer call.
350 */
351void pjsua_call_answer(int call_index, int code);
352
353/**
Benny Prijono26ff9062006-02-21 23:47:00 +0000354 * Hangup call.
355 */
Benny Prijono1c2bf462006-03-05 11:54:02 +0000356void pjsua_call_hangup(int call_index);
Benny Prijono26ff9062006-02-21 23:47:00 +0000357
358
359/**
360 * Put call on-hold.
361 */
Benny Prijonoa91a0032006-02-26 21:23:45 +0000362void pjsua_call_set_hold(int call_index);
Benny Prijono26ff9062006-02-21 23:47:00 +0000363
364
365/**
366 * Send re-INVITE (to release hold).
367 */
Benny Prijonoa91a0032006-02-26 21:23:45 +0000368void pjsua_call_reinvite(int call_index);
Benny Prijono26ff9062006-02-21 23:47:00 +0000369
370
371/**
372 * Transfer call.
373 */
Benny Prijonoa91a0032006-02-26 21:23:45 +0000374void pjsua_call_xfer(int call_index, const char *dest);
Benny Prijono26ff9062006-02-21 23:47:00 +0000375
376
377/**
Benny Prijonob0808372006-03-02 21:18:58 +0000378 * Send instant messaging inside INVITE session.
379 */
380void pjsua_call_send_im(int call_index, const char *text);
381
382
383/**
384 * Send IM typing indication inside INVITE session.
385 */
386void pjsua_call_typing(int call_index, pj_bool_t is_typing);
387
388/**
Benny Prijono834aee32006-02-19 01:38:06 +0000389 * Terminate all calls.
390 */
Benny Prijono1a174142006-03-01 20:46:13 +0000391void pjsua_call_hangup_all(void);
Benny Prijono834aee32006-02-19 01:38:06 +0000392
393
Benny Prijono268ca612006-02-07 12:34:11 +0000394/*****************************************************************************
Benny Prijono84126ab2006-02-09 09:30:09 +0000395 * PJSUA Client Registration API (defined in pjsua_reg.c).
Benny Prijonoccf95622006-02-07 18:48:01 +0000396 */
397
398/**
399 * Initialize client registration session.
400 *
401 * @param app_callback Optional callback
402 */
Benny Prijonoa91a0032006-02-26 21:23:45 +0000403pj_status_t pjsua_regc_init(int acc_index);
Benny Prijonoccf95622006-02-07 18:48:01 +0000404
405/**
406 * Update registration or perform unregistration. If renew argument is zero,
407 * this will start unregistration process.
408 */
Benny Prijonoa91a0032006-02-26 21:23:45 +0000409void pjsua_regc_update(int acc_index, pj_bool_t renew);
Benny Prijonoccf95622006-02-07 18:48:01 +0000410
411
Benny Prijono834aee32006-02-19 01:38:06 +0000412
413
414/*****************************************************************************
415 * PJSUA Presence (pjsua_pres.c)
416 */
417
418/**
419 * Init presence.
420 */
421pj_status_t pjsua_pres_init();
422
423/**
424 * Refresh both presence client and server subscriptions.
425 */
Benny Prijonoa91a0032006-02-26 21:23:45 +0000426void pjsua_pres_refresh(int acc_index);
Benny Prijono834aee32006-02-19 01:38:06 +0000427
428/**
429 * Terminate all subscriptions
430 */
431void pjsua_pres_shutdown(void);
432
433/**
434 * Dump presence subscriptions.
435 */
Benny Prijono1a174142006-03-01 20:46:13 +0000436void pjsua_pres_dump(pj_bool_t detail);
Benny Prijono834aee32006-02-19 01:38:06 +0000437
438
Benny Prijonoccf95622006-02-07 18:48:01 +0000439/*****************************************************************************
Benny Prijonob0808372006-03-02 21:18:58 +0000440 * PJSUA Instant Messaging (pjsua_im.c)
441 */
442
443/**
444 * The MESSAGE method (defined in pjsua_im.c)
445 */
446extern const pjsip_method pjsip_message_method;
447
448
449/**
450 * Init IM module handler to handle incoming MESSAGE outside dialog.
451 */
452pj_status_t pjsua_im_init();
453
454
455/**
456 * Create Accept header for MESSAGE.
457 */
458pjsip_accept_hdr* pjsua_im_create_accept(pj_pool_t *pool);
459
460/**
461 * Send IM outside dialog.
462 */
463pj_status_t pjsua_im_send(int acc_index, const char *dst_uri,
464 const char *text);
465
466
467/**
468 * Send typing indication outside dialog.
469 */
470pj_status_t pjsua_im_typing(int acc_index, const char *dst_uri,
471 pj_bool_t is_typing);
472
473
474/**
475 * Private: check if we can accept the message.
476 * If not, then p_accept header will be filled with a valid
477 * Accept header.
478 */
479pj_bool_t pjsua_im_accept_pager(pjsip_rx_data *rdata,
Benny Prijonof9c668f2006-03-06 15:14:59 +0000480 pjsip_accept_hdr **p_accept_hdr);
Benny Prijonob0808372006-03-02 21:18:58 +0000481
482/**
483 * Private: process pager message.
484 * This may trigger pjsua_ui_on_pager() or pjsua_ui_on_typing().
485 */
486void pjsua_im_process_pager(int call_id, const pj_str_t *from,
487 const pj_str_t *to, pjsip_rx_data *rdata);
488
489
490/*****************************************************************************
Benny Prijono268ca612006-02-07 12:34:11 +0000491 * User Interface API.
Benny Prijono84126ab2006-02-09 09:30:09 +0000492 *
Benny Prijono268ca612006-02-07 12:34:11 +0000493 * The UI API specifies functions that will be called by pjsua upon
494 * occurence of various events.
495 */
496
497/**
498 * Notify UI when invite state has changed.
499 */
Benny Prijonob0808372006-03-02 21:18:58 +0000500void pjsua_ui_on_call_state(int call_index, pjsip_event *e);
Benny Prijono268ca612006-02-07 12:34:11 +0000501
Benny Prijonof3195072006-02-14 21:15:30 +0000502/**
503 * Notify UI when registration status has changed.
504 */
Benny Prijonob0808372006-03-02 21:18:58 +0000505void pjsua_ui_on_reg_state(int acc_index);
506
507/**
508 * Notify UI on incoming pager (i.e. MESSAGE request).
509 * Argument call_index will be -1 if MESSAGE request is not related to an
510 * existing call.
511 */
512void pjsua_ui_on_pager(int call_index, const pj_str_t *from,
513 const pj_str_t *to, const pj_str_t *txt);
514
515
516/**
517 * Notify UI about typing indication.
518 */
519void pjsua_ui_on_typing(int call_index, const pj_str_t *from,
520 const pj_str_t *to, pj_bool_t is_typing);
Benny Prijonof3195072006-02-14 21:15:30 +0000521
522
523/*****************************************************************************
524 * Utilities.
525 *
526 */
527
528/** String to describe invite session states */
529extern const char *pjsua_inv_state_names[];
530
531/**
532 * Parse arguments (pjsua_opt.c).
533 */
534pj_status_t pjsua_parse_args(int argc, char *argv[]);
535
536/**
537 * Load settings from a file.
538 */
539pj_status_t pjsua_load_settings(const char *filename);
540
541/**
Benny Prijonoa91a0032006-02-26 21:23:45 +0000542 * Dump settings.
543 */
544int pjsua_dump_settings(char *buf, pj_size_t max);
545
546/**
Benny Prijonof3195072006-02-14 21:15:30 +0000547 * Save settings to a file.
548 */
549pj_status_t pjsua_save_settings(const char *filename);
550
551
552/*
553 * Verify that valid SIP url is given.
554 * @return PJ_SUCCESS if valid.
555 */
556pj_status_t pjsua_verify_sip_url(const char *c_url);
557
558/*
559 * Dump application states.
560 */
Benny Prijono1a174142006-03-01 20:46:13 +0000561void pjsua_dump(pj_bool_t detail);
Benny Prijonof3195072006-02-14 21:15:30 +0000562
Benny Prijono268ca612006-02-07 12:34:11 +0000563
Benny Prijono1a01ad32006-02-07 21:13:28 +0000564PJ_END_DECL
565
Benny Prijonof3195072006-02-14 21:15:30 +0000566
Benny Prijono268ca612006-02-07 12:34:11 +0000567#endif /* __PJSUA_H__ */