modules/tm/t_msgbuilder.h
caf80ae6
 /*
84d8e165
  * Copyright (C) 2001-2003 FhG Fokus
7dd0b342
  *
f1b15228
  * This file is part of Kamailio, a free SIP server.
7dd0b342
  *
f1b15228
  * Kamailio is free software; you can redistribute it and/or modify
7dd0b342
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version
  *
f1b15228
  * Kamailio is distributed in the hope that it will be useful,
7dd0b342
  * 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, write to the Free Software 
9e1ff448
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
c2ea965c
  *
caf80ae6
  */
 
7dd0b342
 
caf80ae6
 #ifndef _MSGBUILDER_H
 #define _MSGBUILDER_H
 
f7576304
 #include "../../ip_addr.h"
ff979952
 #include "defs.h"
c5867ab3
 #include "dlg.h"
bf5d1d6f
 #include "h_table.h"
3957db5f
 #include "t_reply.h"
ff979952
 
 
caf80ae6
 #define CSEQ "CSeq: "
82802743
 #define CSEQ_LEN (sizeof(CSEQ)-1)
caf80ae6
 #define TO "To: "
82802743
 #define TO_LEN (sizeof(TO)-1)
caf80ae6
 #define CALLID "Call-ID: "
82802743
 #define CALLID_LEN (sizeof(CALLID)-1)
caf80ae6
 #define FROM "From: "
82802743
 #define FROM_LEN (sizeof(FROM)-1)
caf80ae6
 #define FROMTAG ";tag="
82802743
 #define FROMTAG_LEN (sizeof(FROMTAG)-1)
27c28ba1
 #define TOTAG ";tag="
 #define TOTAG_LEN (sizeof(TOTAG)-1)
77f99fc7
 #define MAXFWD_VALUE "70"
 #define MAXFWD_HEADER "Max-Forwards: " MAXFWD_VALUE CRLF
 #define MAXFWD_HEADER_LEN (sizeof(MAXFWD_HEADER) - 1)
caf80ae6
 
 
 char *build_local(struct cell *Trans, unsigned int branch,
bf5d1d6f
 	unsigned int *len, char *method, int method_len, str *to
 #ifdef CANCEL_REASON_SUPPORT
 	, struct cancel_reason* reason
 #endif /* CANCEL_REASON_SUPPORT */
 	);
344c31a9
 
 char *build_local_reparse(struct cell *Trans, unsigned int branch,
bf5d1d6f
 	unsigned int *len, char *method, int method_len, str *to
 #ifdef CANCEL_REASON_SUPPORT
 	, struct cancel_reason* reason
 #endif /* CANCEL_REASON_SUPPORT */
 	);
caf80ae6
 
c430ed7b
 char *build_uac_request(  str msg_type, str dst, str from,
82802743
 	str fromtag, int cseq, str callid, str headers, 
 	str body, int branch,
04813d14
 	struct cell *t, unsigned int *len);
caf80ae6
 
b51171b5
 /*
  * The function creates an UAC CANCEL
  */
 char *build_uac_cancel(str *headers,str *body,struct cell *cancelledT,
 		unsigned int branch, unsigned int *len, struct dest_info* dst);
27c28ba1
 
c5867ab3
 /*
beb00b8e
  * The function creates an ACK to 200 OK. Route set will be created
33f7438a
  * and parsed and the dst parameter will contain the destination to which the
beb00b8e
  * request should be send. The function is used by tm when it generates
  * local ACK to 200 OK (on behalf of applications using uac
  */
33f7438a
 char *build_dlg_ack(struct sip_msg* rpl, struct cell *Trans, 
d65cdd3f
 					unsigned int branch, str *hdrs, str *body,
 					unsigned int *len, struct dest_info* dst);
beb00b8e
 
 
 /*
c5867ab3
  * Create a request
  */
 char* build_uac_req(str* method, str* headers, str* body, dlg_t* dialog, int branch, 
7a068ff3
 		    struct cell *t, int* len, struct dest_info* dst);
27c28ba1
 
 
caf80ae6
 int t_calc_branch(struct cell *t,
 	int b, char *branch, int *branch_len);
 
c2ea965c
 /* exported minimum functions for use in t_cancel */
 char* print_callid_mini(char* target, str callid);
 char* print_cseq_mini(char* target, str* cseq, str* method);
caf80ae6
 
 #endif