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="
| 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=" |
| 313 | static 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 | |
| 324 | void SipPreposition::rebuild() |
| 325 | { |