Browse code

modules/rtpproxy-ng: added setid_avp module param which can be used (instead of set_rtp_proxy_set function) to select used rtpproxy set

Juha Heinanen authored on 16/02/2014 08:56:24
Showing 4 changed files
... ...
@@ -36,15 +36,15 @@ Richard Fuchs
36 36
 
37 37
    Sipwise GmbH
38 38
 
39
-   Copyright � 2003-2008 Sippy Software, Inc.
39
+   Copyright (c) 2003-2008 Sippy Software, Inc.
40 40
 
41
-   Copyright � 2005 Voice Sistem SRL
41
+   Copyright (c) 2005 Voice Sistem SRL
42 42
 
43
-   Copyright � 2009-2012 TuTPro Inc.
43
+   Copyright (c) 2009-2014 TuTPro Inc.
44 44
 
45
-   Copyright � 2010 VoIPEmbedded Inc.
45
+   Copyright (c) 2010 VoIPEmbedded Inc.
46 46
 
47
-   Copyright � 2013 Sipwise GmbH
47
+   Copyright (c) 2013 Sipwise GmbH
48 48
      __________________________________________________________________
49 49
 
50 50
    Table of Contents
... ...
@@ -65,6 +65,7 @@ Richard Fuchs
65 65
               4.3. rtpproxy_tout (integer)
66 66
               4.4. rtpproxy_retr (integer)
67 67
               4.5. extra_id_pv (string)
68
+              4.6. setid_avp (string)
68 69
 
69 70
         5. Functions
70 71
 
... ...
@@ -94,15 +95,16 @@ Richard Fuchs
94 95
    1.3. Set rtpproxy_tout parameter
95 96
    1.4. Set rtpproxy_retr parameter
96 97
    1.5. Set extra_id_pv parameter
97
-   1.6. set_rtp_proxy_set usage
98
-   1.7. rtpproxy_offer usage
99
-   1.8. rtpproxy_answer usage
100
-   1.9. rtpproxy_destroy usage
101
-   1.10. rtpproxy_manage usage
102
-   1.11. start_recording usage
103
-   1.12. $rtpstat Usage
104
-   1.13. nh_enable_rtpp usage
105
-   1.14. nh_show_rtpp usage
98
+   1.6. Set setid_avp parameter
99
+   1.7. set_rtp_proxy_set usage
100
+   1.8. rtpproxy_offer usage
101
+   1.9. rtpproxy_answer usage
102
+   1.10. rtpproxy_destroy usage
103
+   1.11. rtpproxy_manage usage
104
+   1.12. start_recording usage
105
+   1.13. $rtpstat Usage
106
+   1.14. nh_enable_rtpp usage
107
+   1.15. nh_show_rtpp usage
106 108
 
107 109
 Chapter 1. Admin Guide
108 110
 
... ...
@@ -122,6 +124,7 @@ Chapter 1. Admin Guide
122 124
         4.3. rtpproxy_tout (integer)
123 125
         4.4. rtpproxy_retr (integer)
124 126
         4.5. extra_id_pv (string)
127
+        4.6. setid_avp (string)
125 128
 
126 129
    5. Functions
127 130
 
... ...
@@ -171,12 +174,20 @@ Chapter 1. Admin Guide
171 174
    unforce_rtp_proxy(), rtpproxy_offer() or rtpproxy_answer() functions -
172 175
    see the set_rtp_proxy_set() function.
173 176
 
177
+   Another way to select the set is to define setid_avp module parameter
178
+   and assign setid to the defined avp before calling rtpproxy_offer() or
179
+   rtpproxy_manage() function. If forwarding of the requests fails and
180
+   there is another branch to try, remember to unset the avp after calling
181
+   rtpproxy_destroy() function.
182
+
174 183
    For backward compatibility reasons, a set with no id take by default
175 184
    the id 0. Also if no set is explicitly set before unforce_rtp_proxy(),
176 185
    rtpproxy_offer() or rtpproxy_answer() the 0 id set will be used.
177 186
 
178 187
    IMPORTANT: if you use multiple sets, take care and use the same set for
179
-   both rtpproxy_offer()/rtpproxy_answer() and unforce_rtpproxy()!!
188
+   both rtpproxy_offer()/rtpproxy_answer() and unforce_rtpproxy()!! If the
189
+   set was selected using setid_avp, the avp needs to be set only once
190
+   before rtpproxy_offer() or rtpproxy_manage() call.
180 191
 
181 192
 3. Dependencies
182 193
 
... ...
@@ -202,6 +213,7 @@ Chapter 1. Admin Guide
202 213
    4.3. rtpproxy_tout (integer)
203 214
    4.4. rtpproxy_retr (integer)
204 215
    4.5. extra_id_pv (string)
216
+   4.6. setid_avp (string)
205 217
 
206 218
 4.1. rtpproxy_sock (string)
207 219
 
... ...
@@ -273,6 +285,19 @@ modparam("rtpproxy-ng", "rtpproxy_retr", 2)
273 285
 modparam("rtpproxy-ng", "extra_id_pv", "$avp(extra_id)")
274 286
 ...
275 287
 
288
+4.6. setid_avp (string)
289
+
290
+   The parameter defines an AVP that, if set, determines which rtpproxy
291
+   set rtpproxy_offer(), rtpproxy_answer(), rtpproxy_destroy(), and
292
+   rtpproxy_manage() functions use.
293
+
294
+   There is no default value.
295
+
296
+   Example 1.6. Set setid_avp parameter
297
+...
298
+modparam("rtpproxy-ng", "setid_avp", "$avp(setid)")
299
+...
300
+
276 301
 5. Functions
277 302
 
278 303
    5.1. set_rtp_proxy_set(setid)
... ...
@@ -283,7 +308,7 @@ modparam("rtpproxy-ng", "extra_id_pv", "$avp(extra_id)")
283 308
    5.6. rtpproxy_manage([flags [, ip_address]])
284 309
    5.7. start_recording()
285 310
 
286
-5.1. set_rtp_proxy_set(setid)
311
+5.1.  set_rtp_proxy_set(setid)
287 312
 
288 313
    Sets the Id of the rtpproxy set to be used for the next
289 314
    unforce_rtp_proxy(), rtpproxy_offer(), rtpproxy_answer() or
... ...
@@ -293,13 +318,13 @@ modparam("rtpproxy-ng", "extra_id_pv", "$avp(extra_id)")
293 318
    This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
294 319
    BRANCH_ROUTE.
295 320
 
296
-   Example 1.6. set_rtp_proxy_set usage
321
+   Example 1.7. set_rtp_proxy_set usage
297 322
 ...
298 323
 set_rtp_proxy_set("2");
299 324
 rtpproxy_offer();
300 325
 ...
301 326
 
302
-5.2. rtpproxy_offer([flags [, ip_address]])
327
+5.2.  rtpproxy_offer([flags [, ip_address]])
303 328
 
304 329
    Rewrites SDP body to ensure that media is passed through an RTP proxy.
305 330
    To be invoked on INVITE for the cases the SDPs are in INVITE and 200 OK
... ...
@@ -423,7 +448,7 @@ rtpproxy_offer();
423 448
 
424 449
    This function can be used from ANY_ROUTE.
425 450
 
426
-   Example 1.7. rtpproxy_offer usage
451
+   Example 1.8. rtpproxy_offer usage
427 452
 route {
428 453
 ...
429 454
     if (is_method("INVITE")) {
... ...
@@ -455,7 +480,7 @@ onreply_route[2]
455 480
 ...
456 481
 }
457 482
 
458
-5.3. rtpproxy_answer([flags [, ip_address]])
483
+5.3.  rtpproxy_answer([flags [, ip_address]])
459 484
 
460 485
    Rewrites SDP body to ensure that media is passed through an RTP proxy.
461 486
    To be invoked on 200 OK for the cases the SDPs are in INVITE and 200 OK
... ...
@@ -467,11 +492,11 @@ onreply_route[2]
467 492
    This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE,
468 493
    FAILURE_ROUTE, BRANCH_ROUTE.
469 494
 
470
-   Example 1.8. rtpproxy_answer usage
495
+   Example 1.9. rtpproxy_answer usage
471 496
 
472 497
    See rtpproxy_offer() function example above for example.
473 498
 
474
-5.4. rtpproxy_destroy([flags])
499
+5.4.  rtpproxy_destroy([flags])
475 500
 
476 501
    Tears down the RTPProxy session for the current call.
477 502
 
... ...
@@ -503,16 +528,16 @@ onreply_route[2]
503 528
             rtpproxy call when 200 OK is received on a branch, where
504 529
             rtpproxy is not needed.
505 530
 
506
-   Example 1.9. rtpproxy_destroy usage
531
+   Example 1.10. rtpproxy_destroy usage
507 532
 ...
508 533
 rtpproxy_destroy();
509 534
 ...
510 535
 
511
-5.5. unforce_rtp_proxy()
536
+5.5.  unforce_rtp_proxy()
512 537
 
513 538
    Same as rtpproxy_destroy().
514 539
 
515
-5.6. rtpproxy_manage([flags [, ip_address]])
540
+5.6.  rtpproxy_manage([flags [, ip_address]])
516 541
 
517 542
    Manage the RTPProxy session - it combines the functionality of
518 543
    rtpproxy_offer(), rtpproxy_answer() and unforce_rtpproxy(), detecting
... ...
@@ -537,12 +562,12 @@ rtpproxy_destroy();
537 562
 
538 563
    This function can be used from ANY_ROUTE.
539 564
 
540
-   Example 1.10. rtpproxy_manage usage
565
+   Example 1.11. rtpproxy_manage usage
541 566
 ...
542 567
 rtpproxy_manage();
543 568
 ...
544 569
 
545
-5.7. start_recording()
570
+5.7.  start_recording()
546 571
 
547 572
    This function will send a signal to the RTP Proxy to record the RTP
548 573
    stream on the RTP Proxy. This function is not supported by
... ...
@@ -550,7 +575,7 @@ rtpproxy_manage();
550 575
 
551 576
    This function can be used from REQUEST_ROUTE and ONREPLY_ROUTE.
552 577
 
553
-   Example 1.11. start_recording usage
578
+   Example 1.12. start_recording usage
554 579
 ...
555 580
 start_recording();
556 581
 ...
... ...
@@ -566,7 +591,7 @@ start_recording();
566 591
    packet counters. The statistics must be retrieved before the session is
567 592
    deleted (before unforce_rtpproxy()).
568 593
 
569
-   Example 1.12. $rtpstat Usage
594
+   Example 1.13. $rtpstat Usage
570 595
 ...
571 596
     append_hf("X-RTP-Statistics: $rtpstat\r\n");
572 597
 ...
... ...
@@ -589,7 +614,7 @@ start_recording();
589 614
    NOTE: if a rtpproxy is defined multiple times (in the same or diferente
590 615
    sete), all of its instances will be enables/disabled.
591 616
 
592
-   Example 1.13. nh_enable_rtpp usage
617
+   Example 1.14.  nh_enable_rtpp usage
593 618
 ...
594 619
 $ kamctl fifo nh_enable_rtpp udp:192.168.2.133:8081 0
595 620
 ...
... ...
@@ -601,7 +626,7 @@ $ kamctl fifo nh_enable_rtpp udp:192.168.2.133:8081 0
601 626
 
602 627
    No parameter.
603 628
 
604
-   Example 1.14. nh_show_rtpp usage
629
+   Example 1.15.  nh_show_rtpp usage
605 630
 ...
606 631
 $ kamctl fifo nh_show_rtpp
607 632
 ...
... ...
@@ -615,38 +640,38 @@ Chapter 2. Frequently Asked Questions
615 640
 
616 641
    2.1.
617 642
 
618
-   What happend with "rtpproxy_disable" parameter?
643
+       What happend with "rtpproxy_disable" parameter?
619 644
 
620
-   It was removed as it became obsolete - now "rtpproxy_sock" can take
621
-   empty value to disable the rtpproxy functionality.
645
+       It was removed as it became obsolete - now "rtpproxy_sock" can take
646
+       empty value to disable the rtpproxy functionality.
622 647
 
623 648
    2.2.
624 649
 
625
-   Where can I find more about Kamailio?
650
+       Where can I find more about Kamailio?
626 651
 
627
-   Take a look at http://www.kamailio.org/.
652
+       Take a look at http://www.kamailio.org/.
628 653
 
629 654
    2.3.
630 655
 
631
-   Where can I post a question about this module?
656
+       Where can I post a question about this module?
632 657
 
633
-   First at all check if your question was already answered on one of our
634
-   mailing lists:
635
-     * User Mailing List -
636
-       http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
637
-     * Developer Mailing List -
638
-       http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
658
+       First at all check if your question was already answered on one of our
659
+       mailing lists:
660
+         * User Mailing List -
661
+           http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
662
+         * Developer Mailing List -
663
+           http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
639 664
 
640
-   E-mails regarding any stable Kamailio release should be sent to
641
-   <sr-users@lists.sip-router.org> and e-mails regarding development
642
-   versions should be sent to <sr-dev@lists.sip-router.org>.
665
+       E-mails regarding any stable Kamailio release should be sent to
666
+       <sr-users@lists.sip-router.org> and e-mails regarding development
667
+       versions should be sent to <sr-dev@lists.sip-router.org>.
643 668
 
644
-   If you want to keep the mail private, send it to
645
-   <sr-users@lists.sip-router.org>.
669
+       If you want to keep the mail private, send it to
670
+       <sr-users@lists.sip-router.org>.
646 671
 
647 672
    2.4.
648 673
 
649
-   How can I report a bug?
674
+       How can I report a bug?
650 675
 
651
-   Please follow the guidelines provided at:
652
-   http://sip-router.org/tracker.
676
+       Please follow the guidelines provided at:
677
+       http://sip-router.org/tracker.
... ...
@@ -83,7 +83,7 @@
83 83
 		<holder>Voice Sistem SRL</holder>
84 84
 	</copyright>
85 85
 	<copyright>
86
-		<year>2009-2012</year>
86
+		<year>2009-2014</year>
87 87
 		<holder>TuTPro Inc.</holder>
88 88
 	</copyright>
89 89
 	<copyright>
... ...
@@ -53,6 +53,14 @@
53 53
 		unforce_rtp_proxy(), rtpproxy_offer() or rtpproxy_answer()
54 54
 		functions - see the set_rtp_proxy_set() function.
55 55
 	</para>
56
+	<para>
57
+	        Another way to select the set is to define setid_avp
58
+	        module parameter and assign setid to the defined avp
59
+	        before calling rtpproxy_offer() or rtpproxy_manage()
60
+	        function.  If forwarding of the requests fails and
61
+	        there is another branch to try, remember to unset the
62
+	        avp after calling rtpproxy_destroy() function.
63
+	</para>
56 64
 	<para>
57 65
 		For backward compatibility reasons, a set with no id take by default
58 66
 		the id 0. Also if no set is explicitly set before
... ...
@@ -62,6 +70,8 @@
62 70
 	<para>
63 71
 		IMPORTANT: if you use multiple sets, take care and use the same set for
64 72
 		both rtpproxy_offer()/rtpproxy_answer() and unforce_rtpproxy()!!
73
+		If the set was selected using setid_avp, the avp needs to be
74
+		set only once before rtpproxy_offer() or rtpproxy_manage() call.
65 75
 	</para>
66 76
 	</section>
67 77
 
... ...
@@ -232,6 +242,29 @@ modparam("rtpproxy-ng", "extra_id_pv", "$avp(extra_id)")
232 242
 </programlisting>
233 243
 		</example>
234 244
 	</section>
245
+
246
+	<section id="rtpproxy-ng.p.setid_pv">
247
+		<title><varname>setid_avp</varname> (string)</title>
248
+		<para>
249
+			The parameter defines an AVP that, if set,
250
+			determines which rtpproxy set
251
+			rtpproxy_offer(), rtpproxy_answer(),
252
+			rtpproxy_destroy(), and rtpproxy_manage()
253
+			functions use.
254
+		</para>
255
+		<para>
256
+			There is no default value.
257
+		</para>
258
+		<example>
259
+		<title>Set <varname>setid_avp</varname> parameter</title>
260
+<programlisting format="linespecific">
261
+...
262
+modparam("rtpproxy-ng", "setid_avp", "$avp(setid)")
263
+...
264
+</programlisting>
265
+		</example>
266
+	</section>
267
+
235 268
 	</section>
236 269
 
237 270
 	<section>
... ...
@@ -339,6 +339,7 @@ static int rtpproxy_tout = 1;
339 339
 static pid_t mypid;
340 340
 static unsigned int myseqn = 0;
341 341
 static str extra_id_pv_param = {NULL, 0};
342
+static char *setid_avp_param = NULL;
342 343
 
343 344
 static char ** rtpp_strings=0;
344 345
 static int rtpp_sets=0; /*used in rtpproxy_set_store()*/
... ...
@@ -353,6 +354,8 @@ struct rtpp_set * default_rtpp_set=0;
353 354
 static unsigned int rtpp_no = 0;
354 355
 static int *rtpp_socks = 0;
355 356
 
357
+static int     setid_avp_type;
358
+static int_str setid_avp;
356 359
 
357 360
 typedef struct rtpp_set_link {
358 361
 	struct rtpp_set *rset;
... ...
@@ -449,6 +452,7 @@ static param_export_t params[] = {
449 452
 	{"timeout_socket",    	  STR_PARAM, &timeout_socket_str.s  },
450 453
 #endif
451 454
 	{"extra_id_pv",           STR_PARAM, &extra_id_pv_param.s },
455
+	{"setid_avp",             STR_PARAM, &setid_avp_param },
452 456
 	{0, 0, 0}
453 457
 };
454 458
 
... ...
@@ -892,6 +896,9 @@ static int
892 896
 mod_init(void)
893 897
 {
894 898
 	int i;
899
+	pv_spec_t *avp_spec;
900
+	unsigned short avp_flags;
901
+	str s;
895 902
 
896 903
 	if(register_mi_mod(exports.name, mi_cmds)!=0)
897 904
 	{
... ...
@@ -934,6 +941,22 @@ mod_init(void)
934 941
 		extra_id_pv = NULL;
935 942
 	}
936 943
 
944
+	if (setid_avp_param) {
945
+	    s.s = setid_avp_param; s.len = strlen(s.s);
946
+	    avp_spec = pv_cache_get(&s);
947
+	    if (avp_spec==NULL || (avp_spec->type != PVT_AVP)) {
948
+		LM_ERR("malformed or non AVP definition <%s>\n",
949
+		       setid_avp_param);
950
+		return -1;
951
+	    }
952
+	    if (pv_get_avp_name(0, &(avp_spec->pvp), &setid_avp,
953
+				&avp_flags) != 0) {
954
+		LM_ERR("invalid AVP definition <%s>\n", setid_avp_param);
955
+		return -1;
956
+	    }
957
+	    setid_avp_type = avp_flags;
958
+	}
959
+
937 960
 	if (rtpp_strings)
938 961
 		pkg_free(rtpp_strings);
939 962
 
... ...
@@ -1665,11 +1688,41 @@ get_extra_id(struct sip_msg* msg, str *id_str) {
1665 1688
 
1666 1689
 }
1667 1690
 
1691
+static int
1692
+set_rtp_proxy_set_from_avp(struct sip_msg *msg)
1693
+{
1694
+    struct usr_avp *avp;
1695
+    int_str setid_val;
1696
+
1697
+    if ((setid_avp_param == NULL) ||
1698
+	(avp = search_first_avp(setid_avp_type, setid_avp, &setid_val, 0))
1699
+	== NULL)
1700
+	return 1;
1668 1701
 
1702
+    if (avp->flags&AVP_VAL_STR) {
1703
+	LM_ERR("setid_avp must hold an integer value\n");
1704
+	return -1;
1705
+    }
1706
+    
1707
+    selected_rtpp_set = select_rtpp_set(setid_val.n);
1708
+    if(selected_rtpp_set == NULL) {
1709
+	LM_ERR("could not locate rtpproxy set %d\n", setid_val.n);
1710
+	return -1;
1711
+    }
1712
+
1713
+    LM_DBG("using rtpproxy set %d\n", setid_val.n);
1714
+
1715
+    current_msg_id = msg->id;
1716
+    
1717
+    return 1;
1718
+}
1669 1719
 
1670 1720
 static int
1671 1721
 unforce_rtp_proxy_f(struct sip_msg* msg, const char* str1, char* str2)
1672 1722
 {
1723
+	if (set_rtp_proxy_set_from_avp(msg) == -1)
1724
+	    return -1;
1725
+
1673 1726
 	return rtpp_function_call_simple(msg, OP_DELETE, str1);
1674 1727
 }
1675 1728
 
... ...
@@ -1677,6 +1730,10 @@ static int
1677 1730
 unforce_rtp_proxy1_f(struct sip_msg* msg, char* str1, char* str2)
1678 1731
 {
1679 1732
 	str flags;
1733
+
1734
+	if (set_rtp_proxy_set_from_avp(msg) == -1)
1735
+	    return -1;
1736
+
1680 1737
 	get_str_fparam(&flags, msg, (fparam_t *) str1);
1681 1738
 	return rtpp_function_call_simple(msg, OP_DELETE, flags.s);
1682 1739
 }
... ...
@@ -1777,6 +1834,10 @@ rtpproxy_manage(struct sip_msg *msg, const char *flags, const str *force_addr)
1777 1834
 static int
1778 1835
 rtpproxy_manage0(struct sip_msg *msg, char *flags, char *ip)
1779 1836
 {
1837
+
1838
+	if (set_rtp_proxy_set_from_avp(msg) == -1)
1839
+	    return -1;
1840
+
1780 1841
 	return rtpproxy_manage(msg, 0, 0);
1781 1842
 }
1782 1843
 
... ...
@@ -1784,6 +1845,10 @@ static int
1784 1845
 rtpproxy_manage1(struct sip_msg *msg, char *flags, char *ip)
1785 1846
 {
1786 1847
 	str flag_str;
1848
+
1849
+	if (set_rtp_proxy_set_from_avp(msg) == -1)
1850
+	    return -1;
1851
+
1787 1852
 	fixup_get_svalue(msg, (gparam_p)flags, &flag_str);
1788 1853
 	return rtpproxy_manage(msg, flag_str.s, 0);
1789 1854
 }
... ...
@@ -1793,6 +1858,10 @@ rtpproxy_manage2(struct sip_msg *msg, char *flags, char *ip)
1793 1858
 {
1794 1859
 	str flag_str;
1795 1860
 	str ip_str;
1861
+
1862
+	if (set_rtp_proxy_set_from_avp(msg) == -1)
1863
+	    return -1;
1864
+
1796 1865
 	fixup_get_svalue(msg, (gparam_p)flags, &flag_str);
1797 1866
 	fixup_get_svalue(msg, (gparam_p)ip, &ip_str);
1798 1867
 	return rtpproxy_manage(msg, flag_str.s, &ip_str);
... ...
@@ -1803,6 +1872,9 @@ rtpproxy_offer1_f(struct sip_msg *msg, char *str1, char *str2)
1803 1872
 {
1804 1873
 	str flags;
1805 1874
 
1875
+	if (set_rtp_proxy_set_from_avp(msg) == -1)
1876
+	    return -1;
1877
+
1806 1878
 	if (str1)
1807 1879
 		get_str_fparam(&flags, msg, (fparam_t *) str1);
1808 1880
 	else
... ...
@@ -1815,6 +1887,9 @@ rtpproxy_offer2_f(struct sip_msg *msg, char *param1, char *param2)
1815 1887
 {
1816 1888
 	str flags, new_ip;
1817 1889
 
1890
+	if (set_rtp_proxy_set_from_avp(msg) == -1)
1891
+	    return -1;
1892
+
1818 1893
 	get_str_fparam(&flags, msg, (fparam_t *) param1);
1819 1894
 	get_str_fparam(&new_ip, msg, (fparam_t *) param2);
1820 1895
 	return force_rtp_proxy(msg, flags.s, &new_ip, OP_OFFER);
... ...
@@ -1825,6 +1900,9 @@ rtpproxy_answer1_f(struct sip_msg *msg, char *str1, char *str2)
1825 1900
 {
1826 1901
 	str flags;
1827 1902
 
1903
+	if (set_rtp_proxy_set_from_avp(msg) == -1)
1904
+	    return -1;
1905
+
1828 1906
 	if (msg->first_line.type == SIP_REQUEST)
1829 1907
 		if (msg->first_line.u.request.method_value != METHOD_ACK)
1830 1908
 			return -1;
... ...
@@ -1842,6 +1920,9 @@ rtpproxy_answer2_f(struct sip_msg *msg, char *param1, char *param2)
1842 1920
 
1843 1921
 	str flags, new_ip;
1844 1922
 
1923
+	if (set_rtp_proxy_set_from_avp(msg) == -1)
1924
+	    return -1;
1925
+
1845 1926
 	if (msg->first_line.type == SIP_REQUEST)
1846 1927
 		if (msg->first_line.u.request.method_value != METHOD_ACK)
1847 1928
 			return -1;