00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #if 0
00030
00031 #include "defs.h"
00032
00033
00034 #include "../../hash_func.h"
00035 #include "t_funcs.h"
00036 #include "../../dprint.h"
00037 #include "../../config.h"
00038 #include "../../parser/parser_f.h"
00039 #include "../../data_lump.h"
00040 #include "../../ut.h"
00041 #include "../../timer.h"
00042 #include "../../data_lump.h"
00043
00044 #include "t_hooks.h"
00045
00046 int _test_insert_to_reply( struct sip_msg *msg, char *str )
00047 {
00048 struct lump* anchor;
00049 char *buf;
00050 int len;
00051
00052 len=strlen( str );
00053 buf=pkg_malloc( len );
00054 if (!buf) {
00055 LOG(L_ERR, "_test_insert_to_reply: no mem\n");
00056 return 0;
00057 }
00058 memcpy( buf, str, len );
00059
00060 anchor = anchor_lump(msg, msg->headers->name.s - msg->buf, 0 , 0);
00061 if (anchor == NULL) {
00062 LOG(L_ERR, "_test_insert_to_reply: anchor_lump failed\n");
00063 return 0;
00064 }
00065 if (insert_new_lump_before(anchor,buf, len, 0)==0) {
00066 LOG(L_ERR, "_test_insert_to_reply: insert_new_lump failed\n");
00067 return 0;
00068 }
00069 return 1;
00070 }
00071
00072 #endif