Hi,
please find the attached patch.
This implemenation does work for us and for our customers.
Best regards,
Bernhard
Am Donnerstag, den 10.07.2008, 20:57 +0300 schrieb Oren Bouskila:
> Hi All
>
> We are facing the same issue using Sofia SIP (1.12.8) NUA. (100rel is
> not activated.)
>
> This feature\hack is mandatory by our customers.
> (*We understand the debate of whether is a feature or a hack. We
> still need it either way. :)
>
> We have compared the "nua_session.c" with the one in Sofia SIP (1.12.9)
> and there is no resolution for that yet.
>
> We are trying to implement "Pekka Pessi" solution:
>
> "You could hack nua_session.c not to ignore SDP, but compare it with
> previous one, and if they differ, generate new offer (and ignore it) and
> then feed new sdp as an answer to it."
>
> Well we need some urgent help here. (Thanks in advance :))
> 1) How do you compare it with the previous one, and where is the
> previous one (what are the APIs)?
> 2) How do you generate new offer and ignore it?
> 3) How do you feed new sdp as an answer?
>
>
> If someone has already implemented "Pekka" solution please post it in
> this thread.
>
>
> Many Thanks
> Oren Bouskila
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Bernhard Suttner
> Sent: Wednesday, June 04, 2008 6:47 PM
> To: sofia-sip-devel
> Subject: Re: [Sofia-sip-devel] Ignoring Duplicate SDP
>
> Hi,
>
>
> > And mixing the ringback tone into the stream that's ultimately going
> to carry voice is not an option?
>
> well, after the user agent receives the 200 OK with a new port it should
> stop sending/receiving on the old port and use the new port from 200 OK
> because the 183 Session Progress in only a early media connection which
> "went away" after the session is completly up!
>
> > Remember, each network address change brings a potential NAT traversal
> process, with associated potential for breakage.
> > So far I haven't seen any PBX changing the SDP between early and
> complete phases. Also, as Pekka has mentioned, it hits some really weird
> SOA-in-SIP scenarios; I'm not sure it's even allowed by the specs.
>
> hehe, we have such a Siemenes Hipath Gateway which use different ports
> for Session Progress and 200 OK *G*
>
>
> Best regards,
> Bernhard Suttner
>
>
>
> ------------------------------------------------------------------------
> -
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Sofia-sip-devel mailing list
> Sofia-sip-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel
>
>
>
>
>
> ************************************************************************
> ************
> This footnote confirms that this email message has been scanned by
> PineApp Mail-SeCure for the presence of malicious code, vandals &
> computer viruses.
> ************************************************************************
> ************
>
>
>
>
>
>
>
>
> ************************************************************************************
> This footnote confirms that this email message has been scanned by
> PineApp Mail-SeCure for the presence of malicious code, vandals & computer
> viruses.
> ************************************************************************************
>
>
>
--- sofia-sip-1.12.8/libsofia-sip-ua/nua/nua_session.c.orig 2008-06-05 14:03:37.000000000 +0000
+++ sofia-sip-1.12.8/libsofia-sip-ua/nua/nua_session.c 2008-06-06 09:16:27.000000000 +0000
@@ -804,9 +804,40 @@
else if (!session_get_description(sip, &sdp, &len))
/* No SDP */;
else if (cr->cr_answer_recv) {
- /* Ignore spurious answers after completing O/A */
- LOG3("ignoring duplicate");
- sdp = NULL;
+ struct sdp_session_s const *o_old_sdp = NULL;
+ const char *s_old_sdp = NULL;
+ isize_t l_old_sdp;
+
+ if ((status == 200) && (soa_get_remote_sdp(nh->nh_soa, &o_old_sdp, &s_old_sdp, &l_old_sdp) == 1)) {
+
+ if ((l_old_sdp != len) ||
+ (str0cmp(s_old_sdp, sdp) != 0)) {
+
+ SU_DEBUG_5(("Overwriting OLD SDP:\n%s\nWith new received SDP:\n%s\n",
+ s_old_sdp, sdp));
+
+ cr->cr_offer_recv = 1, cr->cr_answer_sent = 1;
+ received = Offer;
+
+ if (nh->nh_soa && soa_set_remote_sdp(nh->nh_soa, NULL, sdp, len) < 0) {
+ LOG3("error parsing SDP");
+ sdp = NULL;
+ cr->cr_graceful = 1;
+ ss->ss_reason = "SIP;cause=400;text=\"Malformed Session Description\"";
+ }
+ else
+ LOG5("got SDP");
+
+#ifdef DUPLICATE_SDP_OVERWRITE
+ struct sdp_session_s const *o_tmp_sdp = NULL;
+ const char *s_tmp_sdp = NULL;
+ isize_t l_tmp_sdp;
+
+ soa_get_remote_sdp(nh->nh_soa, &o_tmp_sdp, &s_tmp_sdp, &l_tmp_sdp);
+ SU_DEBUG_5(("NEW SDP was set to:\n%s\n", s_tmp_sdp));
+#endif
+ }
+ }
}
else if (cr->cr_offer_sent) {
/* case 1: answer to our offer */
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel