< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate-users] problems adding a decorator to change Via Headers for STUN


Thanks Dmytro!
i did not notice that the returned value could be modified.

On Wed, Jan 11, 2017 at 7:23 PM, Dmytro Bogovych <dmytro.bogovych@xxxxxxxxx> wrote:
I remember there was snippet on resiprocate wiki.

But here is another snippet from existing code:

#ifdef MODIFY_VIA_BEHIND_NAT
    if (msg.header(resip::h_Vias).size() > 0)
    {
      resip::Via& via = msg.header(resip::h_Vias).front();
      mViaHost = via.sentHost();
      mViaPort = via.sentPort();

      via.sentHost() = resip::Data(account->mExternalAddress.ip());
      via.sentPort() = account->mExternalAddress.port();
    }
#endif



On Wed, Jan 11, 2017 at 8:57 PM, Francesco Lamonica
<alienpenguin@xxxxxxxxx> wrote:
> Hello all,
> as per subject i am trying to add a message decorator (as suggested in the
> docs) to the user profile in order to change the Via header of my invite
> message in order to cope with STUN.
> My problem is that i did not understand how to do so,
> when i create the decorator and get the message then in the method
> decorateMessage()
> i get the Via Header with:
> Via v = msg.header(h_Via).front()
>
> however with that class how do i change the host and port values? i can only
> see getters for those members.
>
> best regards
>
> P.S. sorry if question is dumb but i am still new with resiprocate and dum.
>
> thanks
>
> _______________________________________________
> resiprocate-users mailing list
> resiprocate-users@resiprocate.org
> List Archive: http://list.resiprocate.org/archive/resiprocate-users/