Re: [Opalvoip-user] Updating code from an older to a newer OPAL version
Brought to you by:
csoutheren,
rjongbloed
|
From: Robert J. <ro...@vo...> - 2014-05-06 01:05:02
|
Best and safest way is to use: if (connection.GetOtherPartyConnectionAs<SIPConnection>() == NULL) *Robert Jongbloed* /OPAL/OpenH323/PTLib Architect and Co-founder./ Commercial support at http://www.voxlucida.com.au On 6/05/2014 10:59 AM, Giovani Gracioli wrote: > Hi Robert, > > Basically, what I am doing is testing if the released connection is > not SIP connection: > > void MixerEP::OnReleased(OpalConnection& connection) { > > PString name = connection.GetRemotePartyName(); > PString number = connection.GetRemoteAddress(); > > if (!(number.Left(4) *= "sip:")) { > OpalMixerEndPoint::OnReleased(connection); > return; > } > > //does other things here > OpalMixerEndPoint::OnReleased(connection); > } > > MixerEP is an OpalMixerEndPoint. In the old code, > connection.GetRemotePartyAddress(), instead of GetRemoteAddress(), > returned a string with the sip address: "sip:..", because I am making > a SIP call. So, it was the expected behavior. > > This is what I would like to get again, but the returned value is > quite awkward, something like: Iee442e628. Sometimes it returns > mcu:number, but not the expected sip:... > > Am I doing anything wrong here? > > Giovani > > > > On Fri, Apr 11, 2014 at 8:41 PM, Robert Jongbloed > <ro...@vo... <mailto:ro...@vo...>> wrote: > > Not quite sure why you are doing this, as it would already be > happening via the infrastructure. See OpalCall:SetPartyNames() and > OpalConnection::CopyPartyNames() > > *Robert Jongbloed* > /OPAL/OpenH323/PTLib Architect and Co-founder./ > Commercial support at http://www.voxlucida.com.au > > On 12/04/2014 3:41 AM, Giovani Gracioli wrote: >> Thank for your answers. >> >> Both GetRemotePartyAddress() and SetRemotePartyAddress() were >> used inside a OpalMixerEndPoint class. More specifically, inside >> the OnEstablished(OpalConnection& connection) method. Something >> like that: >> >> PSafePtr<SIPConn> c0 = call.GetConnectionAs<SIPConn>(0); >> PString name = c0->GetRemotePartyName(); >> PString number = c0->GetRemotePartyAddress(); >> connection.SetRemotePartyName(name) >> connection.SetRemotePartyAddress(number); >> >> I replaced GetRemotePartyAddress() by GetRemoteAddress(), but I >> didnt find an alternative to SetRemotePartyAddress() in this >> case. I looked at the new API and there is no similar setX() method. >> >> Best regards, >> Giovani >> >> >> On Tue, Apr 8, 2014 at 7:49 PM, Robert Jongbloed >> <ro...@vo... <mailto:ro...@vo...>> wrote: >> >> Welcome to one of the down sides of Open Source! >> >> Unfortunately, there is simply not enough time to produce the >> sort of documentation you are after. There is the Milestones >> wiki page >> <http://wiki.opalvoip.org/index.php?n=Main.Milestones> which >> is fairly high level or the change logs >> <http://files.opalvoip.org/docs/ChangeLogs/> which are >> enormously detailed. >> >> If an API changes, or function is deprecated, look in the >> header (or HTML documentation) for something in the same >> area, that does what you want. >> >> In this case GetRemotePartyAddress() was ambiguous as to what >> it meant, was it the transport address? Or the URL address? >> And for some protocols it was one and for some it was the >> other! It was split into GetRemoteAddress() and >> GetRemotePartyURL() to be clearer. >> >> *Robert Jongbloed* >> /OPAL/OpenH323/PTLib Architect and Co-founder./ >> Commercial support at http://www.voxlucida.com.au >> >> On 9/04/2014 2:14 AM, Giovani Gracioli wrote: >>> Hello, >>> >>> I have a program originally written using OPAL 3.10. I am >>> updating OPAL for the newest stable version: 3.14.0. >>> >>> As expected, the API changed. For example, I am using >>> OpalConnection and got the following errors/warnings: >>> >>> mixer.cxx:60: warning: ‘PString >>> OpalConnection::GetRemotePartyAddress() const’ is deprecated >>> (declared at /usr/include/opal/connection.h:1713) >>> mixer.cxx:63: error: ‘class OpalConnection’ has no member >>> named ‘SetRemotePartyAddress’ >>> mixer.cxx: In member function ‘virtual void >>> MixerEP::OnReleased(OpalConnection&)’: >>> mixer.cxx:97: warning: ‘PString >>> OpalConnection::GetRemotePartyAddress() const’ is deprecated >>> (declared at /usr/include/opal/connection.h:1713) >>> >>> Is there a document describing the changes between the >>> versions and how to map an old method to a new method? >>> >>> For instance, what method should I use instead of >>> GetRemotePartyAddress and SetRemotePartyAddress? >>> >>> Best regards, >>> Giovani >>> >>> >>> ------------------------------------------------------------------------------ >>> Put Bad Developers to Shame >>> Dominate Development with Jenkins Continuous Integration >>> Continuously Automate Build, Test & Deployment >>> Start a new project now. Try Jenkins in the cloud. >>> http://p.sf.net/sfu/13600_Cloudbees >>> >>> >>> _______________________________________________ >>> Opalvoip-user mailing list >>> Opa...@li... <mailto:Opa...@li...> >>> https://lists.sourceforge.net/lists/listinfo/opalvoip-user >> >> >> ------------------------------------------------------------------------------ >> Put Bad Developers to Shame >> Dominate Development with Jenkins Continuous Integration >> Continuously Automate Build, Test & Deployment >> Start a new project now. Try Jenkins in the cloud. >> http://p.sf.net/sfu/13600_Cloudbees >> _______________________________________________ >> Opalvoip-user mailing list >> Opa...@li... >> <mailto:Opa...@li...> >> https://lists.sourceforge.net/lists/listinfo/opalvoip-user >> >> > > > ------------------------------------------------------------------------------ > Put Bad Developers to Shame > Dominate Development with Jenkins Continuous Integration > Continuously Automate Build, Test & Deployment > Start a new project now. Try Jenkins in the cloud. > http://p.sf.net/sfu/13600_Cloudbees > _______________________________________________ > Opalvoip-user mailing list > Opa...@li... > <mailto:Opa...@li...> > https://lists.sourceforge.net/lists/listinfo/opalvoip-user > > |