sl_api.h

Go to the documentation of this file.
00001 /*
00002  * $Id: sl_api.h 5347 2008-12-13 18:56:49Z miconda $
00003  *
00004  * Copyright (C) 2007 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 modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (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 /*!
00024  * \file
00025  * \brief SL :: API
00026  * \ingroup sl
00027  * - Module: \ref sl
00028  */
00029 
00030 #ifndef _SL_API_H_
00031 #define _SL_API_H_
00032 
00033 #include "../../sr_module.h"
00034 #include "../../dprint.h"
00035 
00036 typedef int (*get_reply_totag_f)(struct sip_msg *msg, str *tag);
00037 typedef int (*send_reply_f)(struct sip_msg *msg, int code, str *reason);
00038 typedef int (*sl_get_reply_totag_f)(struct sip_msg *msg, str *tag);
00039 typedef int (*sl_send_reply_f)(struct sip_msg *msg, int code, str *reason);
00040 typedef int (*sl_send_reply_dlg_f)(struct sip_msg *msg, int code, str *reason,
00041       str *tag);
00042 
00043 /*! SL API bindings */
00044 struct sl_binds {
00045    sl_send_reply_f reply;
00046    sl_send_reply_dlg_f reply_dlg;
00047    sl_get_reply_totag_f sl_get_reply_totag;
00048    send_reply_f send_reply;
00049    get_reply_totag_f get_reply_totag;
00050 };
00051 
00052 typedef int(*load_sl_f)(struct sl_binds *slb);
00053 
00054 int load_sl(struct sl_binds *slb);
00055 
00056 /*!
00057  * \brief Load the SL API
00058  */
00059 static inline int load_sl_api( struct sl_binds *slb )
00060 {
00061    load_sl_f load_sl;
00062 
00063    /* import the SL auto-loading function */
00064    if ( !(load_sl=(load_sl_f)find_export("load_sl", 0, 0))) {
00065       LM_ERR("can't import load_sl\n");
00066       return -1;
00067    }
00068    /* let the auto-loading function load all TM stuff */
00069    if (load_sl( slb )==-1)
00070       return -1;
00071 
00072    return 0;
00073 }
00074 
00075 
00076 #endif

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