sip_pref_util.c File Reference


Detailed Description

SIP callercaps and callerprefs utility functions.

Author:
Pekka Pessi <Pekka.Pessi@nokia-email.address.hidden>.
Date:
Created: Tue Nov 2 16:39:33 EET 2004 ppessi

#include "config.h"
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <float.h>
#include "sofia-sip/sip_parser.h"
#include <sofia-sip/sip_header.h>
#include <sofia-sip/sip_util.h>
#include <sofia-sip/sip_status.h>

Include dependency graph for sip_pref_util.c:


Functions

int sip_prefs_parse (union sip_pref *sp, char const **in_out_s, int *return_negation)
 Parse a single preference.
int sip_prefs_match (union sip_pref const *a, union sip_pref const *b)
 Match preferences.
int sip_prefs_matching (char const *pvalue, char const *nvalue, int *return_parse_error)
 Check callerprefs.
int sip_is_callerpref (char const *param)
 Check if the parameter is a valid feature tag.
int sip_contact_immune (sip_contact_t const *m)
 Check if Contact is immune to callerprefs.
int sip_contact_accept (sip_contact_t const *m, sip_accept_contact_t const *cp, unsigned *return_S, unsigned *return_N, int *return_error)
 Check if Contact matches by Accept-Contact.
int sip_contact_reject (sip_contact_t const *m, sip_reject_contact_t const *reject)
 Check if Contact can be rejected by Reject-Contact.
sip_contact_tsip_contact_immunize (su_home_t *home, sip_contact_t const *m)
 Immunize Contact is to callerprefs.
int sip_contact_score (sip_contact_t const *m, sip_accept_contact_t const *ac, sip_reject_contact_t const *rc)
 Calculate score for contact.

Function Documentation

int sip_contact_accept ( sip_contact_t const *  m,
sip_accept_contact_t const *  cp,
unsigned *  return_S,
unsigned *  return_N,
int *  return_error 
)

Check if Contact matches by Accept-Contact.

Return values:
1 if successful
0 if an error occurs

int sip_prefs_matching ( char const *  pvalue,
char const *  nvalue,
int *  return_parse_error 
)

Check callerprefs.

The function sip_prefs_matching() checks if the given feature values match with each other.

Parameters:
pvalue first feature parameter
nvalue second feature parameter
return_parse_error return-value parameter for error (may be NULL)
Returns:
The function sip_prefs_match() returns 1, if given feature parameters match. The function sip_prefs_match() returns 0, if there is no match or a parse or type error occurred.
If there is a parsing or type error, 0 is returned and return_parse_error is set to -1.


Sofia-SIP 1.12.1 - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.