Mercurial > hg > freeDiameter
annotate extensions/test_sip/test_sip.c @ 639:95a784729cac
Added new opaque pointer to fd_sess_handler_create and fd_disp_register for usability. Bumped API version number.
author | Sebastien Decugis <sdecugis@nict.go.jp> |
---|---|
date | Mon, 20 Dec 2010 13:07:06 +0900 |
parents | 9493b8d8a35f |
children | f198d16fa7f4 |
rev | line source |
---|---|
392
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
1 /********************************************************************************************************* |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
2 * Software License Agreement (BSD License) * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
3 * Author: Alexandre Westfahl <awestfahl@freediameter.net> * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
4 * * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
5 * Copyright (c) 2010, Alexandre Westfahl, Teraoka Laboratory (Keio University), and the WIDE Project. * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
6 * * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
7 * All rights reserved. * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
8 * * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
9 * Redistribution and use of this software in source and binary forms, with or without modification, are * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
10 * permitted provided that the following conditions are met: * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
11 * * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
12 * * Redistributions of source code must retain the above * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
13 * copyright notice, this list of conditions and the * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
14 * following disclaimer. * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
15 * * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
16 * * Redistributions in binary form must reproduce the above * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
17 * copyright notice, this list of conditions and the * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
18 * following disclaimer in the documentation and/or other * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
19 * materials provided with the distribution. * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
20 * * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
21 * * Neither the name of the Teraoka Laboratory nor the * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
22 * names of its contributors may be used to endorse or * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
23 * promote products derived from this software without * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
24 * specific prior written permission of Teraoka Laboratory * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
25 * * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
26 * * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
28 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
29 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
30 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
31 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
33 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
34 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
35 *********************************************************************************************************/ |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
36 |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
37 |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
38 #include"test_sip.h" |
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
39 |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
40 struct disp_hdl * test_sip_MAR_hdl=NULL; |
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
41 struct disp_hdl * test_sip_LIR_hdl=NULL; |
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
42 struct disp_hdl * test_sip_UAR_hdl=NULL; |
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
43 struct disp_hdl * test_sip_SAR_hdl=NULL; |
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
44 struct disp_hdl * test_sip_PPA_hdl=NULL; |
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
45 struct disp_hdl * test_sip_RTA_hdl=NULL; |
392
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
46 |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
47 struct disp_hdl * test_sip_MAA_hdl=NULL; |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
48 struct disp_hdl * test_sip_LIA_hdl=NULL; |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
49 struct disp_hdl * test_sip_UAA_hdl=NULL; |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
50 struct disp_hdl * test_sip_SAA_hdl=NULL; |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
51 struct disp_hdl * test_sip_PPR_hdl=NULL; |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
52 struct disp_hdl * test_sip_RTR_hdl=NULL; |
392
8e260030f32c
Added configuration file for app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
381
diff
changeset
|
53 |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
54 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
55 struct disp_hdl * test_sip_default_hdl=NULL; |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
56 struct session_handler * ts_sess_hdl; |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
57 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
58 //configuration stucture |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
59 struct ts_conf * ts_conf=NULL; |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
60 static struct ts_conf test_sip_conf; |
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
61 |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
62 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
63 //dictionary of SIP |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
64 struct sip_dict sip_dict; |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
65 |
639
95a784729cac
Added new opaque pointer to fd_sess_handler_create and fd_disp_register for usability. Bumped API version number.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
448
diff
changeset
|
66 int test_sip_default_cb( struct msg ** msg, struct avp * avp, struct session * sess, void * opaque, enum disp_action * act) |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
67 { |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
68 TRACE_ENTRY("%p %p %p %p", msg, avp, sess, act); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
69 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
70 return 0; |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
71 } |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
72 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
73 |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
74 /* |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
75 void dump_config() |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
76 { |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
77 TRACE_DEBUG(FULL,"***Configuration of TEST Diameter-SIP extension***"); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
78 TRACE_DEBUG(FULL,"# username: *%s*",ts_conf->username); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
79 TRACE_DEBUG(FULL,"# password: *%s*",ts_conf->password); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
80 TRACE_DEBUG(FULL,"# sip_aor: *%s*",ts_conf->sip_aor); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
81 TRACE_DEBUG(FULL,"# destination_realm: *%s*",ts_conf->destination_realm); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
82 TRACE_DEBUG(FULL,"# destination_sip: *%s*",ts_conf->destination_sip); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
83 TRACE_DEBUG(FULL,"***End of TEST Diameter-SIP configuration extension***"); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
84 } |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
85 */ |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
86 static int ts_conf_init(void) |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
87 { |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
88 ts_conf=&test_sip_conf; |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
89 //memset(app_sip_conf, 0, sizeof(struct ts_conf)); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
90 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
91 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
92 return 0; |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
93 } |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
94 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
95 /* entry point */ |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
96 int ts_entry(char * conffile) |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
97 { |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
98 TRACE_ENTRY("%p", conffile); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
99 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
100 struct dict_object * app=NULL; |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
101 struct disp_when data; |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
102 |
430
f77fc3a97287
Corrected compilation warnings on app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
427
diff
changeset
|
103 |
f77fc3a97287
Corrected compilation warnings on app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
427
diff
changeset
|
104 //TODO: activate again configuration file |
f77fc3a97287
Corrected compilation warnings on app_sip and test_sip
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
427
diff
changeset
|
105 CHECK_FCT( ts_conf_init() ); |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
106 /* Initialize configuration |
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
107 //CHECK_FCT( ts_conf_init() ); |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
108 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
109 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
110 //We parse the configuration file |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
111 if (conffile != NULL) { |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
112 CHECK_FCT( ts_conf_handle(conffile) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
113 } |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
114 else |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
115 { |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
116 TRACE_DEBUG(INFO, "We need a configuration file for Diameter-SIP extension. See doc/ for an example."); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
117 } |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
118 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
119 //We can dump the configuration extracted from app_sip.conf |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
120 dump_config(); |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
121 */ |
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
122 |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
123 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
124 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_APPLICATION, APPLICATION_BY_NAME, "Diameter Session Initiation Protocol (SIP) Application", &app, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
125 CHECK_FCT( fd_disp_app_support ( app, NULL, 1, 0 ) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
126 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
127 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
128 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
129 //We set usefull AVPs |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
130 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Auth-Session-State", &sip_dict.Auth_Session_State, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
131 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Auth-Application-Id", &sip_dict.Auth_Application_Id, ENOENT) ); |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
132 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Destination-Host", &sip_dict.Destination_Host, ENOENT) ); |
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
133 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Destination-Realm", &sip_dict.Destination_Realm, ENOENT) ); |
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
134 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Session-Id", &sip_dict.Session_Id, ENOENT) ); |
427
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
135 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Redirect-Host", &sip_dict.Redirect_Host, ENOENT) ); |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
136 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Redirect-Host-Usage", &sip_dict.Redirect_Host_Usage, ENOENT) ); |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
137 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Auth-Data-Item", &sip_dict.SIP_Auth_Data_Item, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
138 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Authorization", &sip_dict.SIP_Authorization, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
139 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Authenticate", &sip_dict.SIP_Authenticate, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
140 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Number-Auth-Items", &sip_dict.SIP_Number_Auth_Items, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
141 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Authentication-Scheme", &sip_dict.SIP_Authentication_Scheme, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
142 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Authentication-Info", &sip_dict.SIP_Authentication_Info, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
143 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Server-URI", &sip_dict.SIP_Server_URI, ENOENT) ); |
427
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
144 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Server-Capabilities", &sip_dict.SIP_Server_Capabilities, ENOENT) ); |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
145 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Mandatory-Capability", &sip_dict.SIP_Mandatory_Capability, ENOENT) ); |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
146 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Optional-Capability", &sip_dict.SIP_Optional_Capability, ENOENT) ); |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
147 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Method", &sip_dict.SIP_Method, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
148 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-AOR", &sip_dict.SIP_AOR, ENOENT) ); |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
149 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Deregistration-Reason", &sip_dict.SIP_Deregistration_Reason, ENOENT) ); |
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
150 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Reason-Code", &sip_dict.SIP_Reason_Code, ENOENT) ); |
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
151 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Reason-Info", &sip_dict.SIP_Reason_Info, ENOENT) ); |
427
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
152 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Accounting-Information", &sip_dict.SIP_Accounting_Information, ENOENT) ); |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
153 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Accounting-Server-URI", &sip_dict.SIP_Accounting_Server_URI, ENOENT) ); |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
154 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Credit-Control-Server-URI", &sip_dict.SIP_Credit_Control_Server_URI, ENOENT) ); |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
155 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Server-Assignment-Type", &sip_dict.SIP_Server_Assignment_Type, ENOENT) ); |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
156 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Item-Number", &sip_dict.SIP_Item_Number, ENOENT) ); |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
157 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-User-Authorization-Type", &sip_dict.SIP_User_Authorization_Type, ENOENT) ); |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
158 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Supported-User-Data-Type", &sip_dict.SIP_Supported_User_Data_Type, ENOENT) ); |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
159 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-User-Data", &sip_dict.SIP_User_Data, ENOENT) ); |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
160 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-User-Data-Type", &sip_dict.SIP_User_Data_Type, ENOENT) ); |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
161 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-User-Data-Contents", &sip_dict.SIP_User_Data_Contents, ENOENT) ); |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
162 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-User-Data-Already-Available", &sip_dict.SIP_User_Data_Already_Available, ENOENT) ); |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
163 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "SIP-Visited-Network-Id", &sip_dict.SIP_Visited_Network_Id, ENOENT) ); |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
164 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Digest-Realm", &sip_dict.Digest_Realm, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
165 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Digest-URI", &sip_dict.Digest_URI, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
166 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Digest-Nonce", &sip_dict.Digest_Nonce, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
167 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Digest-CNonce", &sip_dict.Digest_CNonce, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
168 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Digest-Method", &sip_dict.Digest_Method, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
169 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Digest-Nonce-Count", &sip_dict.Digest_Nonce_Count, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
170 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Digest-Realm", &sip_dict.Digest_Realm, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
171 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Digest-Response", &sip_dict.Digest_Response, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
172 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Digest-Response-Auth", &sip_dict.Digest_Response_Auth, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
173 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Digest-Username", &sip_dict.Digest_Username, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
174 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Digest-Algorithm", &sip_dict.Digest_Algorithm, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
175 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Digest-QoP", &sip_dict.Digest_QOP, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
176 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "User-Name", &sip_dict.User_Name, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
177 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME, "Digest-HA1", &sip_dict.Digest_HA1, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
178 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
179 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
180 //Register Application |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
181 memset(&data, 0, sizeof(data)); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
182 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_APPLICATION, APPLICATION_BY_NAME, "Diameter Session Initiation Protocol (SIP) Application", &data.app, ENOENT) ); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
183 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
184 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
185 //**Command Codes |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
186 /**/ |
427
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
187 //MAA |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
188 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_COMMAND, CMD_BY_NAME, "Multimedia-Auth-Answer", &data.command, ENOENT) ); |
639
95a784729cac
Added new opaque pointer to fd_sess_handler_create and fd_disp_register for usability. Bumped API version number.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
448
diff
changeset
|
189 CHECK_FCT( fd_disp_register( test_sip_MAA_cb, DISP_HOW_CC, &data, NULL, &test_sip_MAA_hdl ) ); |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
190 |
427
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
191 //UAA |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
192 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_COMMAND, CMD_BY_NAME, "User-Authorization-Answer", &data.command, ENOENT) ); |
639
95a784729cac
Added new opaque pointer to fd_sess_handler_create and fd_disp_register for usability. Bumped API version number.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
448
diff
changeset
|
193 CHECK_FCT( fd_disp_register( test_sip_UAA_cb, DISP_HOW_CC, &data, NULL, &test_sip_UAA_hdl ) ); |
427
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
194 |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
195 //RTR |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
196 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_COMMAND, CMD_BY_NAME, "Registration-Termination-Request", &data.command, ENOENT) ); |
639
95a784729cac
Added new opaque pointer to fd_sess_handler_create and fd_disp_register for usability. Bumped API version number.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
448
diff
changeset
|
197 CHECK_FCT( fd_disp_register( test_sip_RTR_cb, DISP_HOW_CC, &data, NULL, &test_sip_RTR_hdl ) ); |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
198 |
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
199 //LIA |
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
200 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_COMMAND, CMD_BY_NAME, "Location-Info-Answer", &data.command, ENOENT) ); |
639
95a784729cac
Added new opaque pointer to fd_sess_handler_create and fd_disp_register for usability. Bumped API version number.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
448
diff
changeset
|
201 CHECK_FCT( fd_disp_register( test_sip_LIA_cb, DISP_HOW_CC, &data, NULL, &test_sip_LIA_hdl ) ); |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
202 |
427
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
203 //LIA |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
204 CHECK_FCT( fd_dict_search( fd_g_config->cnf_dict, DICT_COMMAND, CMD_BY_NAME, "Server-Assignment-Answer", &data.command, ENOENT) ); |
639
95a784729cac
Added new opaque pointer to fd_sess_handler_create and fd_disp_register for usability. Bumped API version number.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
448
diff
changeset
|
205 CHECK_FCT( fd_disp_register( test_sip_SAA_cb, DISP_HOW_CC, &data, NULL, &test_sip_SAA_hdl ) ); |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
206 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
207 //Callback for unexpected messages |
639
95a784729cac
Added new opaque pointer to fd_sess_handler_create and fd_disp_register for usability. Bumped API version number.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
448
diff
changeset
|
208 CHECK_FCT( fd_disp_register( test_sip_default_cb, DISP_HOW_APPID, &data, NULL, &test_sip_default_hdl ) ); |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
209 |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
210 /* |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
211 //We start database connection |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
212 if(start_mysql_connection()) |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
213 return 1; |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
214 */ |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
215 |
639
95a784729cac
Added new opaque pointer to fd_sess_handler_create and fd_disp_register for usability. Bumped API version number.
Sebastien Decugis <sdecugis@nict.go.jp>
parents:
448
diff
changeset
|
216 CHECK_FCT(fd_sess_handler_create(&ts_sess_hdl, free, NULL)); |
427
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
217 //CHECK_FCT( fd_sig_register(30, "test_sip", (void *)test_sipSL_LIR_cb ) ); |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
218 CHECK_FCT( fd_sig_register(30, "test_sip", (void *)test_sip_SAR_cb ) ); |
3d9f300f3b49
Added SAR/SAA and UAR/UAA
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
420
diff
changeset
|
219 CHECK_FCT( fd_sig_register(31, "test_sip", (void *)test_sip_LIR_cb ) ); |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
220 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
221 return 0; |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
222 } |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
223 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
224 //Cleanup callback |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
225 void fd_ext_fini(void) |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
226 { |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
227 /* |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
228 if (test_sip_MAR_cb) { |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
229 (void) fd_disp_unregister(&test_sip_MAR_hdl); |
448 | 230 CHECK_FCT_DO( fd_sess_handler_destroy(&ts_sess_hdl),return); |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
231 } |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
232 */ |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
233 //We close database connection |
420
c8a61dabea55
app_sip:Added LIR/LIA for SL
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
409
diff
changeset
|
234 //close_mysql_connection(); |
409
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
235 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
236 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
237 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
238 TRACE_ENTRY(); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
239 return ; |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
240 } |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
241 |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
242 EXTENSION_ENTRY("test_sip", ts_entry); |
c2fb5b26bfcb
Fix for ticket 8
Alexandre Westfahl <awestfahl@freediameter.net>
parents:
392
diff
changeset
|
243 |