return -1;
}
+int select_dst_uri(str* res, select_t* s, struct sip_msg* msg)
+{
+ if (msg->first_line.type!=SIP_REQUEST)
+ return -1;
+ RETURN0_res(msg->dst_uri);
+}
+
+int select_next_hop(str* res, select_t* s, struct sip_msg* msg)
+{
+ if (msg->first_line.type==SIP_REQUEST) {
+ if(msg->dst_uri.s) {
+ RETURN0_res(msg->dst_uri);
+ }
+ else if(msg->new_uri.s) {
+ RETURN0_res(msg->new_uri);
+ }
+ else {
+ RETURN0_res(msg->first_line.u.request.uri);
+ }
+ }
+ return -1;
+}
+
int select_from(str* res, select_t* s, struct sip_msg* msg)
{
if (parse_from_header(msg)<0)
SELECT_F(select_method)
SELECT_F(select_ruri)
+SELECT_F(select_dst_uri)
+SELECT_F(select_next_hop)
SELECT_F(select_from)
SELECT_F(select_from_uri)
SELECT_F(select_from_tag)
{ NULL, SEL_PARAM_STR, STR_STATIC_INIT("method"), select_method, 0},
{ NULL, SEL_PARAM_STR, STR_STATIC_INIT("ruri"), select_ruri, 0},
{ select_ruri, SEL_PARAM_STR, STR_NULL, select_any_uri, NESTED},
+ { NULL, SEL_PARAM_STR, STR_STATIC_INIT("dst_uri"), select_dst_uri, 0},
+ { select_dst_uri, SEL_PARAM_STR, STR_NULL, select_any_uri, NESTED},
+ { NULL, SEL_PARAM_STR, STR_STATIC_INIT("next_hop"), select_next_hop, 0},
+ { select_next_hop, SEL_PARAM_STR, STR_NULL, select_any_uri, NESTED},
{ NULL, SEL_PARAM_STR, STR_STATIC_INIT("from"), select_from, 0},
{ NULL, SEL_PARAM_STR, STR_STATIC_INIT("f"), select_from, 0},
{ select_from, SEL_PARAM_STR, STR_STATIC_INIT("uri"), select_from_uri, 0},