2 The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
3 Copyright (C) 2001,2002,2003 Aymeric MOIZARD jack@atosc.org
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include <osipparser2/osip_port.h>
24 #include <osipparser2/osip_message.h>
25 #include <osipparser2/osip_parser.h>
29 osip_message_set_error_info (osip_message_t * sip, const char *hvalue)
31 osip_error_info_t *error_info;
34 if (hvalue == NULL || hvalue[0] == '\0')
37 i = osip_error_info_init (&error_info);
40 i = osip_error_info_parse (error_info, hvalue);
43 osip_error_info_free (error_info);
46 sip->message_property = 2;
47 osip_list_add (sip->error_infos, error_info, -1);
52 osip_message_get_error_info (const osip_message_t * sip, int pos,
53 osip_error_info_t ** dest)
55 osip_error_info_t *error_info;
58 if (osip_list_size (sip->error_infos) <= pos)
59 return -1; /* does not exist */
60 error_info = (osip_error_info_t *) osip_list_get (sip->error_infos, pos);