This file is indexed.

/usr/include/sipwitch/cdr.h is in libsipwitch-dev 1.6.1-2build2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
// Copyright (C) 2009-2010 David Sugar, Tycho Softworks.
//
// This program 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 3 of the License, or
// (at your option) any later version.
//
// This program 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, see <http://www.gnu.org/licenses/>.

/**
 * Basic server call detail record.
 * This provides an interface for creating call detail objects which can be
 * logged through plugins.  The cdr system has it's own thread context and
 * buffering, so cdr records can be disposed without delaying calls processing.
 * @file sipwitch/cdr.h
 */

#ifndef _SIPWITCH_CDR_H_
#define _SIPWITCH_CDR_H_

#ifndef _UCOMMON_LINKED_H_
#include <ucommon/linked.h>
#endif

#ifndef _UCOMMON_THREAD_H_
#include <ucommon/thread.h>
#endif

#ifndef _UCOMMON_STRING_H_
#include <ucommon/string.h>
#endif

#ifndef _SIPWITCH_NAMESPACE_H_
#include <sipwitch/namespace.h>
#endif

#ifndef _SIPWITCH_MAPPED_H_
#include <sipwitch/mapped.h>
#endif

NAMESPACE_SIPWITCH
using namespace UCOMMON_NAMESPACE;

/**
 * Interface class for call detail records.  This is passed internally to
 * plugins via callbacks and can be logged to a database through one.  A
 * more limited subset of the cdr is passed via the events stream also.
 * @author David Sugar <dyfet@gnutelephony.org>
 */
class __EXPORT cdr : public LinkedObject
{
public:
    /**
     * Start or end of call?
     */
    enum {START, STOP} type;

    /**
     * A unique identifier for each and every call.
     */
    char uuid[48];

    /**
     * Ident of calling parting.
     */
    char ident[MAX_IDENT_SIZE];

    /**
     * Destination requested on our switch.
     */
    char dialed[MAX_IDENT_SIZE];

    /**
     * Call destination eventually joined to.
     */
    char joined[MAX_IDENT_SIZE];

    /**
     * Display name of calling party.
     */
    char display[MAX_DISPLAY_SIZE];

    /**
     * Subnet interface the caller appeared on.
     */
    char network[MAX_NETWORK_SIZE * 2];

    /**
     * Reason the call was terminated.
     */
    char reason[16];

    /**
     * Internal call sequence identifiers.
     */
    unsigned cid, sequence;

    /**
     * Time the call was received.
     */
    time_t starting;

    /**
     * Total duration of the call in seconds.
     */
    unsigned long duration;

    /**
     * Get a free cdr node to fill from the cdr memory pool.  To maximize
     * performance and allow parallel operation a memory pool of cdr objects
     * is used.
     * @return free record to fill.
     */
    static cdr *get(void);

    /**
     * Post cdr record to callbacks through the cdr thread queue.  This
     * returns the cdr object to the mem and then return to free list.
     * @param cdr record to post.
     */
    static void post(cdr *cdr);

    /**
     * Start cdr subsystem and que dispatch thread.
     */
    static void start(void);

    /**
     * Stop cdr subsystem.
     */
    static void stop(void);
};

END_NAMESPACE

#endif