MCPcopy Create free account
hub / github.com/SIPp/sipp / get_cseq_value

Function get_cseq_value

src/sip_parser.cpp:370–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368}
369
370unsigned 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
404unsigned long get_reply_code(const char* msg)
405{

Callers 2

checkAckCSeqMethod · 0.85
process_incomingMethod · 0.85

Calls 1

WARNINGFunction · 0.85

Tested by

no test coverage detected