calculate characteristic value of a message -- this value is used to identify a transaction during the process of reply matching */
| 398 | reply matching |
| 399 | */ |
| 400 | inline static int char_msg_val( struct sip_msg *msg, char *cv ) |
| 401 | { |
| 402 | str src[8]; |
| 403 | |
| 404 | if (!check_transaction_quadruple(msg)) { |
| 405 | LM_ERR("can't calculate char_value due to a parsing error\n"); |
| 406 | memset( cv, '0', MD5_LEN ); |
| 407 | return 0; |
| 408 | } |
| 409 | |
| 410 | src[0]= msg->from->body; |
| 411 | src[1]= msg->to->body; |
| 412 | src[2]= msg->callid->body; |
| 413 | src[3]= msg->first_line.u.request.uri; |
| 414 | src[4]= get_cseq( msg )->number; |
| 415 | |
| 416 | /* topmost Via is part of transaction key as well ! */ |
| 417 | src[5]= msg->via1->host; |
| 418 | src[6]= msg->via1->port_str; |
| 419 | if (msg->via1->branch) { |
| 420 | src[7]= msg->via1->branch->value; |
| 421 | MD5StringArray ( cv, src, 8 ); |
| 422 | } else { |
| 423 | MD5StringArray( cv, src, 7 ); |
| 424 | } |
| 425 | return 1; |
| 426 | } |
| 427 | |
| 428 | |
| 429 | /* returns the body of the SIP message (if none, an empty body will be returned) |
no test coverage detected