* Path must be available. Function returns the first uri * from Path without any duplication. */
| 478 | * from Path without any duplication. |
| 479 | */ |
| 480 | int get_path_dst_uri(str *_p, str *_dst) |
| 481 | { |
| 482 | rr_t *route = 0; |
| 483 | |
| 484 | LM_DBG("path for branch: '%.*s'\n", _p->len, _p->s); |
| 485 | |
| 486 | if(parse_rr_body(_p->s, _p->len, &route) < 0) { |
| 487 | LM_ERR("failed to parse Path body\n"); |
| 488 | return -1; |
| 489 | } |
| 490 | if(!route) { |
| 491 | LM_ERR("failed to parse Path body no head found\n"); |
| 492 | return -1; |
| 493 | } |
| 494 | |
| 495 | *_dst = route->nameaddr.uri; |
| 496 | free_rr(&route); |
| 497 | |
| 498 | return 0; |
| 499 | } |
no test coverage detected