| 368 | } |
| 369 | |
| 370 | unsigned long int get_cseq_value(const char* msg) |
| 371 | { |
| 372 | const char* ptr1; |
| 373 | |
| 374 | // no short form for CSeq: |
| 375 | ptr1 = strstr(msg, "\r\nCSeq:"); |
| 376 | if (!ptr1) { |
| 377 | ptr1 = strstr(msg, "\r\nCSEQ:"); |
| 378 | } |
| 379 | if (!ptr1) { |
| 380 | ptr1 = strstr(msg, "\r\ncseq:"); |
| 381 | } |
| 382 | if (!ptr1) { |
| 383 | ptr1 = strstr(msg, "\r\nCseq:"); |
| 384 | } |
| 385 | if (!ptr1) { |
| 386 | WARNING("No valid Cseq header in request %s", msg); |
| 387 | return 0; |
| 388 | } |
| 389 | |
| 390 | ptr1 += 7; |
| 391 | |
| 392 | while (*ptr1 == ' ' || *ptr1 == '\t') { |
| 393 | ++ptr1; |
| 394 | } |
| 395 | |
| 396 | if (!*ptr1) { |
| 397 | WARNING("No valid Cseq data in header"); |
| 398 | return 0; |
| 399 | } |
| 400 | |
| 401 | return strtoul(ptr1, nullptr, 10); |
| 402 | } |
| 403 | |
| 404 | unsigned long get_reply_code(const char* msg) |
| 405 | { |
no test coverage detected