Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00041 #ifndef RR_API_H_
00042 #define RR_API_H_
00043
00044 #include "../../str.h"
00045 #include "../../sr_module.h"
00046 #include "loose.h"
00047 #include "rr_cb.h"
00048
00049 typedef int (*add_rr_param_t)(struct sip_msg*, str*);
00050 typedef int (*check_route_param_t)(struct sip_msg*, regex_t*);
00051 typedef int (*is_direction_t)(struct sip_msg*, int);
00052 typedef int (*get_route_param_t)(struct sip_msg*, str*, str*);
00053 typedef int (*record_route_f)(struct sip_msg*, str*);
00054 typedef int (*loose_route_f)(struct sip_msg*);
00055
00057 typedef struct rr_binds {
00058 record_route_f record_route;
00059 record_route_f record_route_preset;
00060 record_route_f record_route_advertised_address;
00061 loose_route_f loose_route;
00062 add_rr_param_t add_rr_param;
00063 check_route_param_t check_route_param;
00064 is_direction_t is_direction;
00065 get_route_param_t get_route_param;
00066 register_rrcb_t register_rrcb;
00067 int append_fromtag;
00068 } rr_api_t;
00069
00070 typedef int (*load_rr_f)( struct rr_binds* );
00071
00077 int load_rr( struct rr_binds *rrb );
00078
00079
00085 inline static int load_rr_api( struct rr_binds *rrb )
00086 {
00087 load_rr_f load_rr_v;
00088
00089
00090 if ( !(load_rr_v=(load_rr_f)find_export("load_rr", 0, 0))) {
00091 LM_ERR("failed to import load_rr\n");
00092 return -1;
00093 }
00094
00095 load_rr_v( rrb );
00096
00097 return 0;
00098 }
00099
00103 inline static int rr_load_api( rr_api_t *rrb )
00104 {
00105 return load_rr_api(rrb);
00106 }
00107
00108 #endif