MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / ds_update_dst

Function ds_update_dst

modules/dispatcher/dispatch.c:1637–1672  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1635
1636
1637int ds_update_dst(struct sip_msg *msg, str *uri, const struct socket_info *sock,
1638 int mode)
1639{
1640 uri_type utype;
1641 int typelen;
1642 str s;
1643
1644 switch(mode)
1645 {
1646 case 1:
1647 utype = str2uri_type(uri->s);
1648 if (utype == ERROR_URI_T) {
1649 LM_ERR("Unknown uri type\n");
1650 return -1;
1651 }
1652 typelen = uri_typestrlen(utype);
1653 s.s = uri->s + typelen + 1;
1654 s.len = uri->len - typelen - 1;
1655
1656 if (rewrite_ruri(msg, &s, 0, RW_RURI_HOSTPORT) < 0) {
1657 LM_ERR("error while setting host\n");
1658 return -1;
1659 }
1660
1661 break;
1662 default:
1663 if (set_dst_uri(msg, uri) < 0) {
1664 LM_ERR("error while setting dst uri\n");
1665 return -1;
1666 }
1667 break;
1668 }
1669 if (sock)
1670 msg->force_send_socket = sock;
1671 return 0;
1672}
1673
1674static int is_default_destination_entry(ds_set_p idx,int i, int ds_use_default)
1675{

Callers 3

ds_select_dstFunction · 0.85
ds_next_dstFunction · 0.85
w_ds_selectFunction · 0.85

Calls 4

str2uri_typeFunction · 0.85
uri_typestrlenFunction · 0.85
rewrite_ruriFunction · 0.85
set_dst_uriFunction · 0.85

Tested by

no test coverage detected