the patch below adds 't' flag to rtpproxy_destroy flags. if 't' flag is present when rtpproxy_destroy is called, to tag is not included in D command sent to rtpproxy thus causing destroy of the full call.
't' flag can be used to avoid piling up of unused rtpproxy calls by making it possible to call rtpproxy_destroy when 200 ok is received from a branch where rtpproxy is not used.
is it ok for me to commit this patch or do long term rtpproxy users have a better idea?
it would still make sense to include a timer in rtpproxy that cleans up un-used calls at an interval that corresponds to sip proxy's invite timeout.
-- juha
*** /usr/src/orig/sip-router/modules/rtpproxy/rtpproxy.c 2012-10-19 14:31:27.658485534 +0300 --- modules/rtpproxy/rtpproxy.c 2012-10-20 09:52:10.308389743 +0300 *************** *** 1678,1683 **** --- 1678,1684 ---- str callid, from_tag, to_tag, viabranch; char *cp; int via = 0; + int to = 1; int ret; struct rtpp_node *node; struct iovec v[1 + 4 + 3 + 2] = {{NULL, 0}, {"D", 1}, {" ", 1}, {NULL, 0}, {NULL, 0}, {NULL, 0}, {" ", 1}, {NULL, 0}, {" ", 1}, {NULL, 0}}; *************** *** 1700,1705 **** --- 1701,1710 ---- via = 1; break;
+ case 't': + case 'T': + to = 0; + break; case 'a': case 'A': case 'i': *************** *** 1736,1742 **** return -1; } to_tag.s = 0; ! if (get_to_tag(msg, &to_tag) == -1) { LM_ERR("can't get To tag\n"); return -1; } --- 1741,1748 ---- return -1; } to_tag.s = 0; ! to_tag.len = 0; ! if ((to == 1) && get_to_tag(msg, &to_tag) == -1) { LM_ERR("can't get To tag\n"); return -1; }