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

Function extractParam

SIP/SIPParse.cpp:313–322  ·  view source on GitHub ↗

Extract a SIP parameter from a string containing a list of parameters. They look like ;param1=value;param2=value ... The input string need not start exactly at the beginning of the list. The paramid is specified with the semi-colon and =, example: ";tag="

Source from the content-addressed store, hash-verified

311// The input string need not start exactly at the beginning of the list.
312// The paramid is specified with the semi-colon and =, example: ";tag="
313static string extractParam(const char *pp, const char *paramid)
314{
315 const int taghdrlen = strlen(paramid); // strlen(";tag=");
316 if (const char *tp = strstr(pp,paramid)) {
317 pp += taghdrlen;
318 const char *ep = strchr(pp,';');
319 return ep ? string(pp,ep-tp) : string(pp);
320 }
321 return string(""); // Not found.
322}
323
324void SipPreposition::rebuild()
325{

Callers 1

prepSetMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected