Debian Codegraph @

Xpjproject/pjsip-apps/src/pjsua/pjsua_app.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19 #ifndef __PJSUA_APP_H__
20 #define __PJSUA_APP_H__
21
22 /**
23 * Interface for user application to use pjsua with CLI/menu based UI.
24 */
25
26 #include "pjsua_app_common.h"
27
28 PJ_BEGIN_DECL
29
30 /**
31 * This structure contains the configuration of application.
32 */
33 typedef struct pjsua_app_cfg_t
34 {
35 /**
36 * The number of runtime arguments passed to the application.
37 */
38 int argc;
39
40 /**
41 * The array of arguments string passed to the application.
42 */
43 char **argv;
44
45 /**
46 * Tell app that CLI (and pjsua) is (re)started.
47 * msg will contain start error message such as "Telnet to X:Y",
48 * "failed to start pjsua lib", "port busy"..
49 */
50 void (*on_started)(pj_status_t status, const char* title);
51
52 /**
53 * Tell app that library request to stopped/restart.
54 * GUI app needs to use a timer mechanism to wait before invoking the
55 * cleanup procedure.
56 */
57 void (*on_stopped)(pj_bool_t restart, int argc, char** argv);
58
59 /**
60 * This will enable application to supply customize configuration other than
61 * the basic configuration provided by pjsua.
62 */
63 void (*on_config_init)(pjsua_app_config *cfg);
64 } pjsua_app_cfg_t;
65
66 /**
67 * This will initiate the pjsua and the user interface (CLI/menu UI) based on
68 * the provided configuration.
69 */
70 pj_status_t pjsua_app_init(const pjsua_app_cfg_t *app_cfg);
71
72 /**
73 * This will run the CLI/menu based UI.
74 * wait_telnet_cli is used for CLI based UI. It will tell the library to block
75 * or wait until user invoke the "shutdown"/"restart" command. GUI based app
76 * should define this param as PJ_FALSE.
77 */
78 pj_status_t pjsua_app_run(pj_bool_t wait_telnet_cli);
79
80 /**
81 * This will destroy/cleanup the application library.
82 */
83 pj_status_t pjsua_app_destroy(void);
84
85 PJ_END_DECL
86
87 #endif /* __PJSUA_APP_H__ */