* Parse and set the RPID AVP specs */
| 53 | * Parse and set the RPID AVP specs |
| 54 | */ |
| 55 | int init_rpid_avp(char *rpid_avp_param) |
| 56 | { |
| 57 | pv_spec_t avp_spec; |
| 58 | str stmp; |
| 59 | if (rpid_avp_param && *rpid_avp_param) { |
| 60 | stmp.s = rpid_avp_param; stmp.len = strlen(stmp.s); |
| 61 | if (pv_parse_spec(&stmp, &avp_spec)==0 |
| 62 | || avp_spec.type!=PVT_AVP) { |
| 63 | LM_ERR("malformed or non AVP %s AVP definition\n", rpid_avp_param); |
| 64 | return -1; |
| 65 | } |
| 66 | |
| 67 | if(pv_get_avp_name(0, &(avp_spec.pvp), &rpid_avp_name, |
| 68 | &rpid_avp_type)!=0) |
| 69 | { |
| 70 | LM_ERR("[%s]- invalid AVP definition\n", rpid_avp_param); |
| 71 | return -1; |
| 72 | } |
| 73 | } else { |
| 74 | rpid_avp_name = -1; |
| 75 | rpid_avp_type = 0; |
| 76 | } |
| 77 | |
| 78 | return 0; |
| 79 | } |
| 80 | |
| 81 | |
| 82 | /* |
no test coverage detected