seas_action.h

00001 /* $Id$
00002  *
00003  * Copyright (C) 2006-2007 VozTelecom Sistemas S.L
00004  *
00005  * This file is part of Kamailio, a free SIP server.
00006  *
00007  * Kamailio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version
00011  *
00012  * Kamailio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License 
00018  * along with this program; if not, write to the Free Software 
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  */
00021 
00022 
00023 #include "seas.h"/*as_p*/
00024 
00025 #define REPLY_PROV 1
00026 #define REPLY_FIN  2
00027 #define REPLY_FIN_DLG  3
00028 #define UAC_REQ  4
00029 #define AC_RES_FAIL 5
00030 #define SL_MSG  6
00031 #define AC_CANCEL 7
00032 #define JAIN_PONG 8
00033 
00034 
00035 #define AC_FAIL_UNKNOWN 0x01
00036 
00037 #define FAKED_REPLY_FLAG 0x02
00038 
00039 struct as_uac_param{
00040    struct as_entry *who;
00041    int uac_id;
00042    unsigned int label;
00043    char processor_id;
00044    char destroy_cb_set;
00045    struct cell* inviteT;
00046 };
00047 
00048 
00052 int ac_reply(as_p the_as,unsigned char processor_id,unsigned int flags,char *action,int len);
00053 int ac_sl_msg(as_p the_as,unsigned char processor_id,unsigned int flags,char *action,int len);
00054 int ac_uac_req(as_p the_as,unsigned char processor_id,unsigned int flags,char *action,int len);
00055 int ac_encode_msg(as_p the_as,unsigned char processor_id,unsigned int flags,char *action,int len);
00056 int ac_cancel(as_p the_as,unsigned char processor_id,unsigned int flags,char *action,int len);
00057 
00061 int forward_sl_request(struct sip_msg *msg,str *uri,int proto);
00062 int extract_allowed_headers(struct sip_msg *my_msg,int allow_vias,int allow_Rroutes,hdr_flags_t forbidden_hdrs,char *headers,int headers_len);
00063 
00067 int dispatch_actions(void);
00068 int process_action(as_p my_as);
00069 
00073 void uac_cb(struct cell* t, int type, struct tmcb_params*);
00074 void uac_cleanup_cb(struct cell* t, int type, struct tmcb_params*);
00075 
00079 int as_action_fail_resp(int uac_id,int sip_error,char *err_buf,int err_len);
00080 char* create_as_action_reply(struct cell *c,struct tmcb_params *params,int uac_id,char processor_id,int *evt_len);