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

Method getKeywordParam

src/message.cpp:516–547  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

514}
515
516void SendingMessage::getKeywordParam(char * src, const char * param, char * output)
517{
518 char *key, *tmp;
519 int len;
520
521 len = 0;
522 key = nullptr;
523 if ((tmp = strstr(src, param))) {
524 tmp += strlen(param);
525 key = tmp;
526 if ((*key == '0') && (*(key+1) == 'x')) {
527 key += 2;
528 getHexStringParam(output, key, &len);
529 } else if (*key == '\"') {
530 key++;
531 getQuotedParam(output, key, &len);
532 } else {
533 while (*key) {
534 if (((key - src) > KEYWORD_SIZE) || (!(key - src))) {
535 ERROR("Syntax error parsing '%s' parameter", param);
536 } else if (*key == ']' || *key < 33 || *key > 126) {
537 break;
538 }
539 key++;
540 }
541 strncpy(output, tmp, key-tmp);
542 output[key-tmp] = '\0';
543 }
544 } else {
545 output[0] = '\0';
546 }
547}
548
549void SendingMessage::parseAuthenticationKeyword(scenario *msg_scenario, struct MessageComponent *dst, char *keyword)
550{

Callers

nothing calls this directly

Calls 1

ERRORFunction · 0.85

Tested by

no test coverage detected