MANGLING EXAMPLE */ ================================================================= */
| 133 | /* MANGLING EXAMPLE */ |
| 134 | /* ================================================================= */ |
| 135 | static void func_invite(struct cell *t,struct sip_msg *msg,int code,void *param) |
| 136 | { |
| 137 | int i; |
| 138 | //callback function |
| 139 | if (!check_transaction_quadruple(msg)) |
| 140 | { |
| 141 | //we do not have a correct message from/callid/cseq/to |
| 142 | return; |
| 143 | } |
| 144 | i = encode_contact(msg,"enc_prefix","193.175.135.38"); |
| 145 | fprintf(stdout,"decode/encode = returned %d\n",i);fflush(stdout); |
| 146 | |
| 147 | if (t->is_invite) |
| 148 | { |
| 149 | if (msg->buf != NULL) |
| 150 | { |
| 151 | fprintf(stdout,"INVITE:received \n%s\n",msg->buf);fflush(stdout); |
| 152 | i = sdp_mangle_port(msg,"1000",NULL); |
| 153 | fprintf(stdout,"sdp_mangle_port returned %d\n",i);fflush(stdout); |
| 154 | i = sdp_mangle_ip(msg,"10.0.0.0/16","123.124.125.126"); |
| 155 | fprintf(stdout,"sdp_mangle_ip returned %d\n",i);fflush(stdout); |
| 156 | |
| 157 | } |
| 158 | else fprintf(stdout,"INVITE:received NULL\n");fflush(stdout); |
| 159 | } |
| 160 | else |
| 161 | { |
| 162 | fprintf(stdout,"NOT INVITE(REGISTER?) received \n%s\n",msg->buf);fflush(stdout); |
| 163 | //i = decode_contact(msg,NULL,NULL); |
| 164 | //fprintf(stdout,"decode/encode = returned %d\n",i);fflush(stdout); |
| 165 | } |
| 166 | fflush(stdout); |
| 167 | } |
| 168 | |
| 169 | #endif |
| 170 |
nothing calls this directly
no test coverage detected