MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / scanGenericParam

Method scanGenericParam

SIP/SIPParse.cpp:250–266  ·  view source on GitHub ↗

The generic param is token = token or quoted string, with optional space around the '='. The name is defined as a token, but this is not significant in the grammar; name is terminated by space or '='. pp may point to space, scan past that first. Leave pp pointing at the char immediately after the param, which may be a space or separator.

Source from the content-addressed store, hash-verified

248 // pp may point to space, scan past that first.
249 // Leave pp pointing at the char immediately after the param, which may be a space or separator.
250 bool scanGenericParam(SipParam &param)
251 {
252 const char *start = pp;
253 param.mName = scanToken();
254 if (scanChar('=')) {
255 param.mValue = scanTokenOrQuotedString();
256 if (param.mName.empty()) {
257 LOG(NOTICE) << "empty parameter ignored in:"<<currentLine;
258 return false;
259 }
260 } else {
261 param.mValue.clear();
262 }
263 // not needed: skipSpace();
264 LOG(DEBUG)<< LOGVAR(param.mName)<<LOGVAR(param.mValue)<<LOGVAR(start);
265 return ! param.mName.empty();
266 }
267
268 // The URI may have almost any chars except it may not have embedded space.
269 string parseLineURI(SipParamList &params, SipParamList &headers)

Callers 3

parseToParamsFunction · 0.80
parseAuthenticateFunction · 0.80
viaParseMethod · 0.80

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected