t_msgbuilder.h

Go to the documentation of this file.
00001 /*
00002  * $Id: t_msgbuilder.h 5119 2008-10-23 10:14:16Z miconda $
00003  *
00004  * Copyright (C) 2001-2003 FhG Fokus
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  * History:
00023  * --------
00024  *  2004-02-11  FIFO/CANCEL + alignments (hash=f(callid,cseq)) (uli+jiri)
00025  */
00026 
00027 /*! \file
00028  * \brief TM :: Message printing
00029  *
00030  * \ingroup tm
00031  * - Module: \ref tm
00032  */
00033 
00034 #ifndef _MSGBUILDER_H
00035 #define _MSGBUILDER_H
00036 
00037 #include "../../ip_addr.h"
00038 #include "dlg.h"
00039 
00040 
00041 #define CSEQ "CSeq: "
00042 #define CSEQ_LEN (sizeof(CSEQ)-1)
00043 #define TO "To: "
00044 #define TO_LEN (sizeof(TO)-1)
00045 #define CALLID "Call-ID: "
00046 #define CALLID_LEN (sizeof(CALLID)-1)
00047 #define FROM "From: "
00048 #define FROM_LEN (sizeof(FROM)-1)
00049 #define FROMTAG ";tag="
00050 #define FROMTAG_LEN (sizeof(FROMTAG)-1)
00051 #define TOTAG ";tag="
00052 #define TOTAG_LEN (sizeof(TOTAG)-1)
00053 #define LOCAL_MAXFWD_VALUE "70"
00054 
00055 char *build_local(struct cell *Trans, unsigned int branch,
00056    unsigned int *len, char *method, int method_len, str *to);
00057 
00058 char *build_uac_request(  str msg_type, str dst, str from,
00059    str fromtag, int cseq, str callid, str headers, 
00060    str body, int branch,
00061    struct cell *t, unsigned int *len);
00062 
00063 char *build_uac_cancel(str *headers,str *body,struct cell *Trans,
00064    unsigned int branch, unsigned int *len);
00065 
00066 /*
00067  * The function creates an ACK to 200 OK. Route set will be created
00068  * and parsed. The function is used by tm when it generates
00069  * local ACK to 200 OK (on behalf of applications using uac
00070  */
00071 char *build_dlg_ack(struct sip_msg* rpl, struct cell *Trans, unsigned int branch,
00072       str* to, unsigned int *len);
00073 
00074 
00075 /*
00076  * Create a request
00077  */
00078 char* build_uac_req(str* method, str* headers, str* body, dlg_t* dialog,
00079       int branch, struct cell *t, int* len);
00080 
00081 
00082 int t_calc_branch(struct cell *t,
00083    int b, char *branch, int *branch_len);
00084 
00085 /* exported minimum functions for use in t_cancel */
00086 char* print_callid_mini(char* target, str callid);
00087 char* print_cseq_mini(char* target, str* cseq, str* method);
00088 
00089 /* check if changes affect important hdrs: To/From/CSeq */
00090 void check_hdrs_changes(struct sip_msg *msg);
00091 
00092 #endif

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