source: mediastreamer2/p2pproxy/launcher/src/p2pproxy.h @ 165:2e2a5c0b5533

Last change on this file since 165:2e2a5c0b5533 was 165:2e2a5c0b5533, checked in by jehan <jehan@…>, 5 years ago

update p2pproxy.h with lookup media resource

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@168 3f6dc0c8-ddfe-455d-9043-3cd528dc4637

File size: 4.8 KB
Line 
1/*
2p2pproxy Copyright (C) 2007  Jehan Monnier ()
3
4p2pproxy.h - sip proxy.
5
6This program is free software; you can redistribute it and/or
7modify it under the terms of the GNU General Public License
8as published by the Free Software Foundation; either version 2
9of the License, or (at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program; if not, write to the Free Software
18Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19*/
20#ifndef P2PPROXY_LAUNCHER_H_
21#define P2PPROXY_LAUNCHER_H_
22
23#include <stdio.h>
24#ifdef SWIG
25%module P2pProxylauncher
26%javaconst(1);
27%include "p2pproxy.h"
28#endif /*SWIG*/
29
30#define P2PPROXY_ACCOUNTMGT_USER_EXIST 1
31#define P2PPROXY_ACCOUNTMGT_USER_NOT_EXIST 0
32#define P2PPROXY_RESOURCEMGT_SERVER_NOT_FOUND  3
33/* state code*/
34#define P2PPROXY_CONNECTED 2
35#define P2PPROXY_NOT_CONNECTED 1
36/* status code*/
37#define P2PPROXY_NO_ERROR 0
38/*error codes*/
39#define P2PPROXY_ERROR -1
40#define P2PPROXY_ERROR_APPLICATION_NOT_STARTED  -2
41#define P2PPROXY_ERROR_APPLICATION_ALREADY_STARTED  -3
42#define P2PPROXY_ERROR_ACCOUNTMGT_USER_ALREADY_EXIST  -4
43#define P2PPROXY_ERROR_ACCOUNTMGT_BAD_SIP_URI  -5
44#define P2PPROXY_ERROR_RESOURCEMGT_SERVER_NOT_FOUND  -6
45
46#ifndef SWIG
47/**
48 *  start p2pproxy application
49 *  blocking call
50 *  @param argc number of argument
51 *  @param argv arguments
52 *      @return status code
53 *
54 */
55int p2pproxy_application_start(int argc, char **argv);
56
57/**
58 *  return status
59 *      @return P2PPROXY_CONNECTED, P2PPROXY_NOT_ERROR
60 *
61 */
62int p2pproxy_application_get_state(void);
63
64/**
65 *  stop p2pproxy application
66 *
67 */
68int p2pproxy_application_stop(void);
69
70/**
71 * return the status string corresponding to the status code
72 */
73/*const char* p2pproxy_status_string(int status_code);*/
74
75/************************/
76/***account management***/
77/************************/
78
79/**
80* create an account with the given name (must be unique)
81* @param user_name user sip uri (sip:joe@p2p.linphone.org)
82
83* @return  P2PPROXY_NO_ERROR, P2PPROXY_ERROR_APPLICATIONNOTSTARTED, P2PPROXY_ERROR_ACCOUNTMGT_USERALREADYEXIST, P2PPROXY_ERROR_ACCOUNTMGT_BADSIPURI
84*/
85int p2pproxy_accountmgt_createAccount(const char* user_name);
86/**
87* check if a user name has been already created
88* @param user_name user sip uri (sip:joe@p2p.linphone.org)
89* @return P2PPROXY_ACCOUNTMGT_USEREXIST, P2PPROXY_ACCOUNTMGT_USERNOTEXIST , P2PPROXY_ERROR_APPLICATIONNOTSTARTED
90*/
91int p2pproxy_accountmgt_isValidAccount(const char* user_name);
92
93/**
94* delete an account with the given name
95* @param user_name  user sip uri (sip:joe@p2p.linphone.org)
96* @return P2PPROXY_NO_ERROR, P2PPROXY_ERROR_APPLICATIONNOTSTARTED
97*/
98int p2pproxy_accountmgt_deleteAccount(const char* user_name);
99
100/****************************/
101/***resource management******/
102/****************************/
103/**
104 * Structure to store resource list, must be instanciated by
105 * p2pproxy_resourcemgt_new_resource_list and deleted by p2pproxy_resourcemgt_delete_resource_list.
106 *
107 */
108struct p2pproxy_resourcemgt_resource_list {
109        char[]* resource_uri; /* uri list*/
110        unsigned char size;   /*number of element in the list*/
111} p2pproxy_resourcemgt_resource_list_t;
112
113/**
114 * Instanciate a p2pproxy_resourcemgt_resource_list
115 */
116p2pproxy_resourcemgt_resource_list_t* p2pproxy_resourcemgt_new_resource_list();
117/**
118 * delete a p2pproxy_resourcemgt_resource_list
119 */
120void p2pproxy_resourcemgt_delete_resource_list(p2pproxy_resourcemgt_resource_list_t* resource_list);
121
122/**
123* access a proxy registrar sip addreess for a given domaine name
124* @param [out] proxy_uri buffer allocated by the user
125* @param [in] size buffer size
126* @param [in] domaine name
127* @return status code P2PPROXY_NO_ERROR, P2PPROXY_ERROR_RESOURCELOCATOR_SERVER_NOT_FOUND
128*/
129int p2pproxy_resourcemgt_lookup_sip_proxy(char* proxy_uri,size_t size, char* domaine) ;
130/**
131* access a media ressource addresses for a given domaine name
132* @param [out] p2pproxy_resourcemgt_resource_list_t  allocated by the user
133* @param [in] domaine name
134* @return status code P2PPROXY_NO_ERROR, P2PPROXY_ERROR_RESOURCELOCATOR_SERVER_NOT_FOUND
135*/
136int p2pproxy_resourcemgt_lookup_media_resource(p2pproxy_resourcemgt_resource_list_t* resource_list, char* domaine) ;
137/*
138 * notify the library at a given proxy is no longuer reachable
139* @param [in] proxy sip uri
140* @return status code P2PPROXY_NO_ERROR
141*/
142int p2pproxy_resourcemgt_revoke_sip_proxy(char* proxy_uri);
143
144/*
145 * notify the library at a given Media resoure is no longuer reachable
146* @param [in] media resource uri (udp://hostname:port)
147* @return status code P2PPROXY_NO_ERROR
148*/
149int p2pproxy_resourcemgt_revoke_media_resource(char* resource_uri);
150
151#endif /*SWIG*/
152
153#endif /*P2PPROXY_LAUNCHER_H_*/
Note: See TracBrowser for help on using the repository browser.