Merge branch 'mob' of git+ssh://localhost/srv/git/siplcs into mob
[siplcs.git] / src / core / sip-csta.h
blob8ab0c4271efb91970945e58c920e3aa4cde24e27
1 /**
2 * @file sip-csta.h
4 * pidgin-sipe
6 * Copyright (C) 2009 pier11 <pier11@operamail.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 /** Data model for interaction with SIP/CSTA Gateway */
24 struct sip_csta {
25 gchar *line_uri;
26 /** SIP/CSTA Gateway's SIP URI */
27 gchar *gateway_uri;
28 /** dialog with SIP/CSTA Gateway */
29 struct sip_dialog *dialog;
31 gchar *gateway_status;
32 gchar *monitor_cross_ref_id;
34 gchar *line_status;
35 /** destination tel: URI */
36 gchar *to_tel_uri;
37 gchar *call_id;
38 /* our device ID as reported by SIP/CSTA gateway */
39 gchar *device_id;
42 /** Transform telephone number representation
43 * to tel: URI form.
44 * Removes white space, parenthesis ( ), hyphen - symbols
46 * Must be g_free()'d after use.
48 * @param phone Ex. +32 2 245 00 00
49 * @return Ex. tel:+3222450000 or NULL
51 gchar *
52 sip_to_tel_uri(const gchar *phone);
55 /** Transform telephone number from tel: URI representation
56 * to more human readable form.
57 * Removes tel: prefix if such exist.
58 * (Maybe will add spaces in the future according to local
59 * phone patterns.)
61 * Must be g_free()'d after use.
63 * @param tel_uri Ex. tel:+3222450000
64 * @return Ex. +3222450000
66 gchar *
67 sip_tel_uri_denormalize(const gchar *tel_uri);
69 /** Initializes GSTA
70 * @param line_uri (in) our line tel URI. Ex.: tel:73124;phone-context=dialstring;partition=BE_BRS_INT
71 * @param server (in) SIP URI of SIP/CSTA Gateway. Ex.: sip:73124@euuklhccups01.eu.company.local
73 void
74 sip_csta_open(struct sipe_account_data *sip,
75 const gchar *line_uri,
76 const gchar *server);
78 /** Closes GSTA */
79 void
80 sip_csta_close(struct sipe_account_data *sip);
82 /** Makes Call
83 * @param to_tel_uri (in) tel URI of called party. Ex.: tel:+3222220220
85 void
86 sip_csta_make_call(struct sipe_account_data *sip,
87 const gchar* to_tel_uri);
89 /** Processes incoming CSTA commands
90 */
91 void
92 process_incoming_info_csta(struct sipe_account_data *sip,
93 struct sipmsg *msg);