eXinsubscription_api.c
19.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
/*
eXosip - This is the eXtended osip library.
Copyright (C) 2001-2020 Aymeric MOIZARD amoizard@antisip.com
eXosip is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
eXosip is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
In addition, as a special exception, the copyright holders give
permission to link the code of portions of this program with the
OpenSSL library under certain conditions as described in each
individual source file, and distribute linked combinations
including the two.
You must obey the GNU General Public License in all respects
for all of the code used other than OpenSSL. If you modify
file(s) with this exception, you may extend this exception to your
version of the file(s), but you are not obligated to do so. If you
do not wish to do so, delete this exception statement from your
version. If you delete this exception statement from all source
files in the program, then also delete it here.
*/
#include "eXosip2.h"
#ifndef MINISIZE
int _eXosip_insubscription_transaction_find(struct eXosip_t *excontext, int tid, eXosip_notify_t **jn, eXosip_dialog_t **jd, osip_transaction_t **tr) {
for (*jn = excontext->j_notifies; *jn != NULL; *jn = (*jn)->next) {
if ((*jn)->n_inc_tr != NULL && (*jn)->n_inc_tr->transactionid == tid) {
*tr = (*jn)->n_inc_tr;
*jd = (*jn)->n_dialogs;
return OSIP_SUCCESS;
}
if ((*jn)->n_out_tr != NULL && (*jn)->n_out_tr->transactionid == tid) {
*tr = (*jn)->n_out_tr;
*jd = (*jn)->n_dialogs;
return OSIP_SUCCESS;
}
for (*jd = (*jn)->n_dialogs; *jd != NULL; *jd = (*jd)->next) {
osip_list_iterator_t it;
osip_transaction_t *transaction;
transaction = (osip_transaction_t *) osip_list_get_first((*jd)->d_inc_trs, &it);
while (transaction != OSIP_SUCCESS) {
if (transaction != NULL && transaction->transactionid == tid) {
*tr = transaction;
return OSIP_SUCCESS;
}
transaction = (osip_transaction_t *) osip_list_get_next(&it);
}
transaction = (osip_transaction_t *) osip_list_get_first((*jd)->d_out_trs, &it);
while (transaction != OSIP_SUCCESS) {
if (transaction != NULL && transaction->transactionid == tid) {
*tr = transaction;
return OSIP_SUCCESS;
}
transaction = (osip_transaction_t *) osip_list_get_next(&it);
}
}
}
*jd = NULL;
*jn = NULL;
return OSIP_NOTFOUND;
}
int eXosip_insubscription_remove(struct eXosip_t *excontext, int did) {
eXosip_dialog_t *jd = NULL;
eXosip_notify_t *jn = NULL;
if (did <= 0)
return OSIP_BADPARAMETER;
if (did > 0) {
_eXosip_notify_dialog_find(excontext, did, &jn, &jd);
}
if (jd == NULL || jn == NULL) {
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] no incoming subscription here\n"));
return OSIP_NOTFOUND;
}
REMOVE_ELEMENT(excontext->j_notifies, jn);
_eXosip_notify_free(excontext, jn);
return OSIP_SUCCESS;
}
int eXosip_insubscription_build_answer(struct eXosip_t *excontext, int tid, int status, osip_message_t **answer) {
int i = -1;
eXosip_dialog_t *jd = NULL;
eXosip_notify_t *jn = NULL;
osip_transaction_t *tr = NULL;
*answer = NULL;
if (tid <= 0)
return OSIP_BADPARAMETER;
if (tid > 0) {
_eXosip_insubscription_transaction_find(excontext, tid, &jn, &jd, &tr);
}
if (tr == NULL || jd == NULL || jn == NULL) {
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] no incoming subscription here\n"));
return OSIP_NOTFOUND;
}
if (status < 101 || status > 699) {
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] wrong status code (101<status<699)\n"));
return OSIP_BADPARAMETER;
}
i = _eXosip_build_response_default(excontext, answer, jd->d_dialog, status, tr->orig_request);
if (i != 0) {
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] cannot create response for [%s]\n", tr->orig_request->sip_method));
return i;
}
if (status >= 200 && status <= 299)
_eXosip_notify_add_expires_in_2XX_for_subscribe(jn, *answer);
if (status < 300)
i = _eXosip_complete_answer_that_establish_a_dialog(excontext, *answer, tr->orig_request);
return i;
}
int eXosip_insubscription_send_answer(struct eXosip_t *excontext, int tid, int status, osip_message_t *answer) {
int i = -1;
eXosip_dialog_t *jd = NULL;
eXosip_notify_t *jn = NULL;
osip_transaction_t *tr = NULL;
osip_event_t *evt_answer;
if (tid <= 0) {
osip_message_free(answer);
return OSIP_BADPARAMETER;
}
if (tid > 0) {
_eXosip_insubscription_transaction_find(excontext, tid, &jn, &jd, &tr);
}
if (jd == NULL || tr == NULL || tr->orig_request == NULL || tr->orig_request->sip_method == NULL) {
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] no incoming subscription here\n"));
osip_message_free(answer);
return OSIP_NOTFOUND;
}
if (answer == NULL) {
if (0 == osip_strcasecmp(tr->orig_request->sip_method, "SUBSCRIBE") || 0 == osip_strcasecmp(tr->orig_request->sip_method, "REFER")) {
if (status >= 200 && status <= 299) {
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] provide a prepared answer\n"));
return OSIP_BADPARAMETER;
}
}
}
/* is the transaction already answered? */
if (tr->state == NIST_COMPLETED || tr->state == NIST_TERMINATED) {
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] transaction already answered\n"));
osip_message_free(answer);
return OSIP_WRONG_STATE;
}
if (answer == NULL) {
if (0 == osip_strcasecmp(tr->orig_request->sip_method, "SUBSCRIBE") || 0 == osip_strcasecmp(tr->orig_request->sip_method, "REFER")) {
if (status < 200)
i = _eXosip_insubscription_answer_1xx(excontext, jn, jd, status);
else
i = _eXosip_insubscription_answer_3456xx(excontext, jn, jd, status);
if (i != 0) {
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] cannot send response\n"));
return i;
}
} else {
/* TODO */
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] a response must be given\n"));
return OSIP_BADPARAMETER;
}
return OSIP_SUCCESS;
} else {
i = 0;
}
if (0 == osip_strcasecmp(tr->orig_request->sip_method, "SUBSCRIBE") || 0 == osip_strcasecmp(tr->orig_request->sip_method, "REFER")) {
if (MSG_IS_STATUS_1XX(answer)) {
} else if (MSG_IS_STATUS_2XX(answer)) {
_eXosip_dialog_set_200ok(jd, answer);
osip_dialog_set_state(jd->d_dialog, DIALOG_CONFIRMED);
} else if (answer->status_code >= 300 && answer->status_code <= 699) {
i = 0;
} else {
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] wrong status code (101<status<699)\n"));
osip_message_free(answer);
return OSIP_BADPARAMETER;
}
}
evt_answer = osip_new_outgoing_sipmessage(answer);
evt_answer->transactionid = tr->transactionid;
osip_transaction_add_event(tr, evt_answer);
_eXosip_update(excontext);
_eXosip_wakeup(excontext);
return OSIP_SUCCESS;
}
int eXosip_insubscription_build_notify(struct eXosip_t *excontext, int did, int subscription_status, int subscription_reason, osip_message_t **request) {
eXosip_dialog_t *jd = NULL;
eXosip_notify_t *jn = NULL;
char subscription_state[50];
char *tmp;
time_t now = osip_getsystemtime(NULL);
int i;
*request = NULL;
if (did <= 0)
return OSIP_BADPARAMETER;
if (did > 0) {
_eXosip_notify_dialog_find(excontext, did, &jn, &jd);
}
if (jd == NULL || jn == NULL) {
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] no incoming subscription here\n"));
return OSIP_NOTFOUND;
}
i = eXosip_insubscription_build_request(excontext, did, "NOTIFY", request);
if (i != 0) {
return i;
}
#ifndef SUPPORT_MSN
if (subscription_status == EXOSIP_SUBCRSTATE_PENDING)
osip_strncpy(subscription_state, "pending;expires=", 16);
else if (subscription_status == EXOSIP_SUBCRSTATE_ACTIVE)
osip_strncpy(subscription_state, "active;expires=", 15);
else if (subscription_status == EXOSIP_SUBCRSTATE_TERMINATED) {
if (subscription_reason == DEACTIVATED)
osip_strncpy(subscription_state, "terminated;reason=deactivated", 29);
else if (subscription_reason == PROBATION)
osip_strncpy(subscription_state, "terminated;reason=probation", 27);
else if (subscription_reason == REJECTED)
osip_strncpy(subscription_state, "terminated;reason=rejected", 26);
else if (subscription_reason == TIMEOUT)
osip_strncpy(subscription_state, "terminated;reason=timeout", 25);
else if (subscription_reason == GIVEUP)
osip_strncpy(subscription_state, "terminated;reason=giveup", 24);
else if (subscription_reason == NORESOURCE)
osip_strncpy(subscription_state, "terminated;reason=noresource", 28);
else
osip_strncpy(subscription_state, "terminated;reason=noresource", 28);
} else
osip_strncpy(subscription_state, "pending;expires=", 16);
tmp = subscription_state + strlen(subscription_state);
if (subscription_status != EXOSIP_SUBCRSTATE_TERMINATED)
snprintf(tmp, 50 - (tmp - subscription_state), "%li", (long) (jn->n_ss_expires - now));
osip_message_set_header(*request, "Subscription-State", subscription_state);
#endif
return OSIP_SUCCESS;
}
int eXosip_insubscription_build_request(struct eXosip_t *excontext, int did, const char *method, osip_message_t **request) {
eXosip_dialog_t *jd = NULL;
eXosip_notify_t *jn = NULL;
osip_transaction_t *transaction;
int i;
*request = NULL;
if (method == NULL || method[0] == '\0')
return OSIP_BADPARAMETER;
if (did <= 0)
return OSIP_BADPARAMETER;
_eXosip_notify_dialog_find(excontext, did, &jn, &jd);
if (jd == NULL || jn == NULL) {
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] no incoming subscription here\n"));
return OSIP_NOTFOUND;
}
transaction = _eXosip_find_last_out_notify(jd);
if (transaction != NULL) {
if (transaction->state != NICT_TERMINATED && transaction->state != NIST_TERMINATED && transaction->state != NICT_COMPLETED && transaction->state != NIST_COMPLETED)
return OSIP_WRONG_STATE;
}
i = _eXosip_build_request_within_dialog(excontext, request, method, jd->d_dialog);
if (i != 0)
return i;
return OSIP_SUCCESS;
}
int eXosip_insubscription_send_request(struct eXosip_t *excontext, int did, osip_message_t *request) {
eXosip_dialog_t *jd = NULL;
eXosip_notify_t *jn = NULL;
osip_transaction_t *transaction;
osip_event_t *sipevent;
int i;
if (request == NULL)
return OSIP_BADPARAMETER;
if (did <= 0) {
osip_message_free(request);
return OSIP_BADPARAMETER;
}
if (did > 0) {
_eXosip_notify_dialog_find(excontext, did, &jn, &jd);
}
if (jd == NULL || jn == NULL) {
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] no incoming subscription here\n"));
osip_message_free(request);
return OSIP_NOTFOUND;
}
transaction = _eXosip_find_last_out_notify(jd);
if (transaction != NULL) {
if (transaction->state != NICT_TERMINATED && transaction->state != NIST_TERMINATED && transaction->state != NICT_COMPLETED && transaction->state != NIST_COMPLETED) {
osip_message_free(request);
return OSIP_WRONG_STATE;
}
transaction = NULL;
}
i = _eXosip_transaction_init(excontext, &transaction, NICT, excontext->j_osip, request);
if (i != 0) {
osip_message_free(request);
return i;
}
osip_list_add(jd->d_out_trs, transaction, 0);
sipevent = osip_new_outgoing_sipmessage(request);
sipevent->transactionid = transaction->transactionid;
osip_transaction_set_reserved4(transaction, jn);
osip_transaction_set_reserved3(transaction, jd);
osip_transaction_add_event(transaction, sipevent);
_eXosip_wakeup(excontext);
return OSIP_SUCCESS;
}
int _eXosip_insubscription_send_request_with_credential(struct eXosip_t *excontext, eXosip_notify_t *jn, eXosip_dialog_t *jd, osip_transaction_t *out_tr) {
osip_transaction_t *tr = NULL;
osip_message_t *msg = NULL;
osip_event_t *sipevent;
int cseq;
osip_via_t *via;
int i;
if (jn == NULL)
return OSIP_BADPARAMETER;
if (jd != NULL) {
if (jd->d_out_trs == NULL)
return OSIP_BADPARAMETER;
}
if (out_tr == NULL) {
out_tr = _eXosip_find_last_out_notify(jd);
}
if (out_tr == NULL || out_tr->orig_request == NULL || out_tr->last_response == NULL)
return OSIP_NOTFOUND;
i = osip_message_clone(out_tr->orig_request, &msg);
if (i != 0) {
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] cannot clone msg for authentication\n"));
return i;
}
via = (osip_via_t *) osip_list_get(&msg->vias, 0);
if (via == NULL || msg->cseq == NULL || msg->cseq->number == NULL) {
osip_message_free(msg);
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] missing via or cseq header\n"));
return OSIP_SYNTAXERROR;
}
/* increment cseq */
cseq = atoi(msg->cseq->number);
osip_free(msg->cseq->number);
msg->cseq->number = _eXosip_strdup_printf("%i", cseq + 1);
if (msg->cseq->number == NULL) {
osip_message_free(msg);
return OSIP_NOMEM;
}
if (jd != NULL && jd->d_dialog != NULL) {
jd->d_dialog->local_cseq++;
}
i = _eXosip_update_top_via(msg);
if (i != 0) {
osip_message_free(msg);
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] unsupported protocol\n"));
return i;
}
if (out_tr->last_response->status_code == 401 || out_tr->last_response->status_code == 407)
_eXosip_add_authentication_information(excontext, msg, out_tr->last_response);
else
_eXosip_add_authentication_information(excontext, msg, NULL);
osip_message_force_update(msg);
i = _eXosip_transaction_init(excontext, &tr, NICT, excontext->j_osip, msg);
if (i != 0) {
osip_message_free(msg);
return i;
}
/* add the new tr for the current dialog */
osip_list_add(jd->d_out_trs, tr, 0);
sipevent = osip_new_outgoing_sipmessage(msg);
osip_transaction_set_reserved4(tr, jn);
osip_transaction_set_reserved3(tr, jd);
osip_transaction_add_event(tr, sipevent);
_eXosip_update(excontext); /* fixed? */
_eXosip_wakeup(excontext);
return OSIP_SUCCESS;
}
static int _eXosip_insubscription_auto_send_notify(struct eXosip_t *excontext, int did, int subscription_status, int subscription_reason) {
osip_message_t *notify;
int i;
char xml[4096];
char *entity;
eXosip_call_t *jc;
eXosip_dialog_t *jd;
if (did <= 0)
return OSIP_BADPARAMETER;
i = eXosip_insubscription_build_notify(excontext, did, subscription_status, subscription_reason, ¬ify);
if (i != 0) {
return i;
}
/* build dialog xml state */
memset(xml, 0, sizeof(xml));
i = osip_uri_to_str(notify->from->url, &entity);
if (i != 0 || entity == NULL) {
osip_message_free(notify);
return i;
}
snprintf(xml, sizeof(xml),
"<?xml version=\"1.0\"?>"
"\r\n"
"<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\""
"\r\n"
" version=\"2\" state=\"full\""
"\r\n"
" entity=\"%s\">"
"\r\n",
entity);
osip_free(entity);
/* loop over all jc/jd */
for (jc = excontext->j_calls; jc != NULL; jc = jc->next) {
for (jd = jc->c_dialogs; jd != NULL; jd = jd->next) {
if (jd->d_dialog == NULL) { /* finished call */
} else {
char tmp_dialog[2048];
char direction[20];
char dlg_state[20];
char *remote_uri = NULL;
if (jd->d_dialog->type == CALLER)
strcpy(direction, "initiator");
else
strcpy(direction, "recipient");
if (jd->d_dialog->state == DIALOG_CONFIRMED)
strcpy(dlg_state, "confirmed");
else
strcpy(dlg_state, "early");
if (jd->d_dialog->remote_uri != NULL && jd->d_dialog->remote_uri->url != NULL) {
osip_uri_to_str(jd->d_dialog->remote_uri->url, &remote_uri);
}
if (remote_uri != NULL) {
/* add dialog info */
snprintf(tmp_dialog, sizeof(tmp_dialog),
" <dialog id=\"%s\" call-id=\"%s\""
"\r\n"
" local-tag=\"%s\" remote-tag=\"%s\""
"\r\n"
" direction=\"%s\">"
"\r\n"
" <state>%s</state>"
"\r\n"
" <remote>"
"\r\n"
" <identity>%s</identity>"
"\r\n"
" </remote>"
"\r\n"
" </dialog>"
"\r\n",
jd->d_dialog->call_id, jd->d_dialog->call_id, jd->d_dialog->local_tag, jd->d_dialog->remote_tag, direction, dlg_state, remote_uri);
if (strlen(xml) + strlen(tmp_dialog) < sizeof(xml))
strcat(xml, tmp_dialog);
}
}
}
}
if (strlen(xml) + 16 < sizeof(xml))
strcat(xml,
"</dialog-info>"
"\r\n");
osip_message_set_content_type(notify, "application/dialog-info+xml");
osip_message_set_body(notify, xml, strlen(xml));
return eXosip_insubscription_send_request(excontext, did, notify);
}
int eXosip_insubscription_automatic(struct eXosip_t *excontext, eXosip_event_t *evt) {
eXosip_dialog_t *jd = NULL;
eXosip_notify_t *jn = NULL;
osip_header_t *event_header;
if (evt->did <= 0 || evt->nid <= 0)
return OSIP_BADPARAMETER;
if (evt->request == NULL)
return OSIP_BADPARAMETER;
_eXosip_notify_dialog_find(excontext, evt->did, &jn, &jd);
if (jd == NULL || jn == NULL) {
OSIP_TRACE(osip_trace(__FILE__, __LINE__, OSIP_ERROR, NULL, "[eXosip] no incoming subscription here\n"));
return OSIP_NOTFOUND;
}
osip_message_header_get_byname(evt->request, "event", 0, &event_header);
if (event_header == NULL || event_header->hvalue == NULL) {
eXosip_insubscription_send_answer(excontext, evt->tid, 400, NULL);
return OSIP_SUCCESS;
}
/* this event should be handled internally */
if (osip_strcasecmp(event_header->hvalue, "dialog") == 0) {
/* send 200 ok to SUBSCRIBEs */
if (evt->type == EXOSIP_IN_SUBSCRIPTION_NEW) {
osip_message_t *answer;
int i;
i = eXosip_insubscription_build_answer(excontext, evt->tid, 202, &answer);
if (i == 0) {
i = eXosip_insubscription_send_answer(excontext, evt->tid, 202, answer);
}
if (i != 0) {
i = eXosip_insubscription_send_answer(excontext, evt->tid, 400, NULL);
return OSIP_SUCCESS;
}
/* send initial notify */
i = _eXosip_insubscription_auto_send_notify(excontext, evt->did, EXOSIP_SUBCRSTATE_ACTIVE, PROBATION);
if (i != 0) {
/* delete subscription... */
return OSIP_SUCCESS;
}
}
} else {
if (evt->type == EXOSIP_IN_SUBSCRIPTION_NEW) {
eXosip_insubscription_send_answer(excontext, evt->tid, 489, NULL);
}
}
return OSIP_SUCCESS;
}
#endif