* Try to find out parameter name, recognized parameters * are q, expires and methods */
| 41 | * are q, expires and methods |
| 42 | */ |
| 43 | static inline void parse_contact_class(param_hooks_t* _h, param_t* _p) |
| 44 | { |
| 45 | |
| 46 | if (!_p->name.s) { |
| 47 | LM_ERR("empty value\n"); |
| 48 | return; |
| 49 | } |
| 50 | switch(_p->name.s[0]) { |
| 51 | case 'q': |
| 52 | case 'Q': |
| 53 | if (_p->name.len == 1) { |
| 54 | _p->type = P_Q; |
| 55 | _h->contact.q = _p; |
| 56 | } |
| 57 | break; |
| 58 | |
| 59 | case 'e': |
| 60 | case 'E': |
| 61 | if ((_p->name.len == 7) && |
| 62 | (!strncasecmp(_p->name.s + 1, "xpires", 6))) { |
| 63 | _p->type = P_EXPIRES; |
| 64 | _h->contact.expires = _p; |
| 65 | } |
| 66 | break; |
| 67 | |
| 68 | case 'm': |
| 69 | case 'M': |
| 70 | if ((_p->name.len == 7) && |
| 71 | (!strncasecmp(_p->name.s + 1, "ethods", 6))) { |
| 72 | _p->type = P_METHODS; |
| 73 | _h->contact.methods = _p; |
| 74 | } |
| 75 | break; |
| 76 | |
| 77 | case 'r': |
| 78 | case 'R': |
| 79 | if ((_p->name.len == 8) && |
| 80 | (!strncasecmp(_p->name.s + 1, "eceived", 7))) { |
| 81 | _p->type = P_RECEIVED; |
| 82 | _h->contact.received = _p; |
| 83 | } |
| 84 | break; |
| 85 | case '+': |
| 86 | if ((_p->name.len == 13) && |
| 87 | (!strncasecmp(_p->name.s + 1, "sip.instance", 12))) { |
| 88 | _p->type = P_INSTANCE; |
| 89 | _h->contact.instance = _p; |
| 90 | } |
| 91 | break; |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | |
| 96 | /* |