[sr-dev] git:master: modules_k/rtpproxy: fix rtpproxy_offer/ answer when called with a second parameter
Ovidiu Sas
osas at voipembedded.com
Mon Oct 11 18:43:30 CEST 2010
Hello Alex,
Are you referring to the issue that you had in the past with
rtpproxy_offer/answer?
The second param for rtpproxy_offer/answer _and_ force_rtp_proxy was
ignored in previous versions.
Regards,
Ovidiu Sas
On Mon, Oct 11, 2010 at 11:40 AM, Alex Balashov
<abalashov at evaristesys.com> wrote:
> Maybe it is precisely this that I meant to allege was not working.
>
> --
> Alex Balashov - Principal
> Evariste Systems LLC
> 1170 Peachtree Street
> 12th Floor, Suite 1200
> Atlanta, GA 30309
> Tel: +1-678-954-0670
> Fax: +1-404-961-1892
> Web: http://www.evaristesys.com/
>
> On Oct 11, 2010, at 11:29 AM, Ovidiu Sas <osas at voipembedded.com> wrote:
>
>> Module: sip-router
>> Branch: master
>> Commit: 0af3944586c881f5d3ea0be19242cdf84906269e
>> URL:
>> http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0af3944586c881f5d3ea0be19242cdf84906269e
>>
>> Author: Ovidiu Sas <osas at voipembedded.com>
>> Committer: Ovidiu Sas <osas at voipembedded.com>
>> Date: Fri Oct 8 12:02:30 2010 -0400
>>
>> modules_k/rtpproxy: fix rtpproxy_offer/answer when called with a second
>> parameter
>>
>> - closes FS#69
>> - nathelper.c: rtpproxy_offer / rtpproxy_answer (str2 parameter ignored)
>> - reported by Marc Villacorta
>>
>> ---
>>
>> modules_k/rtpproxy/rtpproxy.c | 28 ++++++++++++++++++++--------
>> 1 files changed, 20 insertions(+), 8 deletions(-)
>>
>> diff --git a/modules_k/rtpproxy/rtpproxy.c b/modules_k/rtpproxy/rtpproxy.c
>> index e9a0832..920bdd6 100644
>> --- a/modules_k/rtpproxy/rtpproxy.c
>> +++ b/modules_k/rtpproxy/rtpproxy.c
>> @@ -284,7 +284,7 @@ static int alter_rtcp(struct sip_msg *msg, str *body,
>> str *oldport, str *newport
>> static char *gencookie();
>> static int rtpp_test(struct rtpp_node*, int, int);
>> static int unforce_rtp_proxy_f(struct sip_msg *, char *, char *);
>> -static int force_rtp_proxy(struct sip_msg *, char *, char *, int);
>> +static int force_rtp_proxy(struct sip_msg *, char *, char *, int, int);
>> static int start_recording_f(struct sip_msg *, char *, char *);
>> static int rtpproxy_answer1_f(struct sip_msg *, char *, char *);
>> static int rtpproxy_answer2_f(struct sip_msg *, char *, char *);
>> @@ -1672,13 +1672,13 @@ rtpproxy_offer1_f(struct sip_msg *msg, char *str1,
>> char *str2)
>>
>> cp = ip_addr2a(&msg->rcv.dst_ip);
>> strcpy(newip, cp);
>> - return rtpproxy_offer2_f(msg, str1, newip);
>> + return force_rtp_proxy(msg, str1, newip, 1, 0);
>> }
>>
>> static int
>> rtpproxy_offer2_f(struct sip_msg *msg, char *param1, char *param2)
>> {
>> - return force_rtp_proxy(msg, param1, param2, 1);
>> + return force_rtp_proxy(msg, param1, param2, 1, 1);
>> }
>>
>> static int
>> @@ -1687,9 +1687,13 @@ rtpproxy_answer1_f(struct sip_msg *msg, char *str1,
>> char *str2)
>> char *cp;
>> char newip[IP_ADDR_MAX_STR_SIZE];
>>
>> + if (msg->first_line.type == SIP_REQUEST)
>> + if (msg->first_line.u.request.method_value != METHOD_ACK)
>> + return -1;
>> +
>> cp = ip_addr2a(&msg->rcv.dst_ip);
>> strcpy(newip, cp);
>> - return rtpproxy_answer2_f(msg, str1, newip);
>> + return force_rtp_proxy(msg, str1, newip, 0, 0);
>> }
>>
>> static int
>> @@ -1700,7 +1704,7 @@ rtpproxy_answer2_f(struct sip_msg *msg, char
>> *param1, char *param2)
>> if (msg->first_line.u.request.method_value != METHOD_ACK)
>> return -1;
>>
>> - return force_rtp_proxy(msg, param1, param2, 0);
>> + return force_rtp_proxy(msg, param1, param2, 0, 1);
>> }
>>
>>
>> @@ -1751,7 +1755,7 @@ free_opts(struct options *op1, struct options *op2,
>> struct options *op3)
>> } while (0);
>>
>> static int
>> -force_rtp_proxy(struct sip_msg* msg, char* str1, char* str2, int offer)
>> +force_rtp_proxy(struct sip_msg* msg, char* str1, char* str2, int offer,
>> int forcedIP)
>> {
>> str body, body1, oldport, oldip, newport, newip;
>> str callid, from_tag, to_tag, tmp, payload_types;
>> @@ -2165,8 +2169,16 @@ force_rtp_proxy(struct sip_msg* msg, char* str1,
>> char* str2, int offer)
>> newip.len = 7;
>> }
>> } else {
>> - newip.s = (argc < 2) ? str2 : argv[1];
>> - newip.len = strlen(newip.s);
>> + if (forcedIP) {
>> + newip.s = str2;
>> + newip.len = strlen(newip.s);
>> +#ifdef EXTRA_DEBUG
>> + LM_DBG("forcing IP='%.*s'\n", newip.len, newip.s);
>> +#endif
>> + } else {
>> + newip.s = (argc < 2) ? str2 : argv[1];
>> + newip.len = strlen(newip.s);
>> + }
>> }
>> /* marker to double check : newport goes: str -> int -> str ?!?!
>> */
>> newport.s = int2str(port, &newport.len); /* beware static buffer
>> */
>>
>>
>> _______________________________________________
>> sr-dev mailing list
>> sr-dev at lists.sip-router.org
>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev
>
More information about the sr-dev
mailing list