sl_cb.h

Go to the documentation of this file.
00001 /*
00002  * $Id: sl_cb.h 5003 2008-09-26 11:01:51Z henningw $
00003  *
00004  * Copyright (C) 2006 Voice Sistem SRL
00005  *
00006  * This file is part of Kamailio, a free SIP server.
00007  *
00008  * Kamailio is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU General Public License
00010  * as published by the Free Software Foundation; either version 2
00011  * of the License, or (at your option) any later version.
00012  *
00013  * Kamailio is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00021  *
00022  *
00023  * History:
00024  * ---------
00025  *  2006-03-29  first version (bogdan)
00026  */
00027 
00028 /*!
00029  * \file
00030  * \brief SL :: callbacks
00031  * \ingroup sl
00032  * - Module: \ref sl
00033  */
00034 
00035 #ifndef SL_CB_H_
00036 #define SL_CB_H_
00037 
00038 #include "../../str.h"
00039 #include "../../ip_addr.h"
00040 #include "../../parser/msg_parser.h"
00041 
00042 
00043 struct sl_cb_param {
00044    str  *buffer;
00045    int  code;
00046    str  *reason;
00047    union sockaddr_union *dst;
00048    void *param;
00049 };
00050 
00051 /*! callback function prototype */
00052 typedef void (sl_cb_t) (unsigned int types, struct sip_msg* req,
00053       struct sl_cb_param *sl_param);
00054 /*! register callback function prototype */
00055 typedef int (*register_slcb_t)(unsigned int types, sl_cb_t f, void *param);
00056 
00057 
00058 
00059 /*! SL callback definition */
00060 struct sl_callback {
00061    int id;                    /* id of this callback - useless */
00062    unsigned int types;        /* maks of types */
00063    sl_cb_t* callback;         /* callback function */
00064    void* param;               /* param to be passed to callback function */
00065    struct sl_callback* next;  /* next callback element*/
00066 };
00067 
00068 
00069 #define SLCB_REPLY_OUT       (1<<0)
00070 #define SLCB_ACK_IN          (1<<1)
00071 
00072 /*! cleanup callback list */
00073 void destroy_slcb_lists(void);
00074 
00075 
00076 /*! register a SL callback */
00077 int register_slcb(unsigned int types, sl_cb_t f, void *param );
00078 
00079 /*! run SL callbacks */
00080 void run_sl_callbacks( unsigned int types, struct sip_msg *req, str *buffer,
00081       int code, str *reason, union sockaddr_union *to);
00082 
00083 
00084 #endif
00085 
00086 

Generated on Thu May 24 12:00:30 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6