You can do the actual sdp structure as well.  For sure you will need the m 
lines in the sdp, if you do the structure, it can be sparse just like the 
string.

On Sep 4, 2014, at 2:11 AM, Andreas Wehrmann <a.wehrm...@yandex.com> wrote:

> Alright, from the beginning:
> 
> ---------------------------------------------------
> That's how I create the stack:
> 
> sip_stack = nua_create( sip_root,
>                        sip_evt_dispatcher,
>                        reinterpret_cast< nua_magic_t* >( this ),
>                        TAG_IF( (! uas_id.empty()), SIPTAG_USER_AGENT_STR( 
> uas_id.c_str() ) ),
>                        SIPTAG_ALLOW_STR( 
> "INVITE,ACK,CANCEL,BYE,OPTIONS,PRACK,UPDATE,MESSAGE" ),
>                        NUTAG_URL( my_url.c_str() ),
>                        TAG_END() );
> 
> ---------------------------------------------------
> Placing a call involves these calls:
> 
> nh = nua_handle( sip_stack, reinterpret_cast< nua_hmagic_t* >( this ),
>                     SIPTAG_TO( to ),
>                     TAG_IF( (NULL != from), SIPTAG_FROM( from ) ),
>                     TAG_IF( ((NULL == from) && (strlen(from_user ? from_user 
> : "") > 0)), NUTAG_M_USERNAME( from_user ) ),
>                     TAG_IF( session_timer.useSessionTimer(), 
> NUTAG_SESSION_REFRESHER( nua_local_refresher ) ),
>                     TAG_IF( session_timer.useSessionTimer(), NUTAG_MIN_SE( 
> session_timer.minimumSessionExpires() ) ),
>                     TAG_IF( session_timer.useSessionTimer(), 
> NUTAG_SESSION_TIMER( session_timer.sessionExpires() ) ),
>                     TAG_IF( session_timer.useSessionTimer(), 
> NUTAG_REFRESH_WITHOUT_SDP( 1 ) ),
>                     TAG_END() );
> <some other stuff (i.e. generation of SDP string)>
> 
> nua_invite( nh,
>                TAG_IF( (! additional_header_str.empty()), SIPTAG_HEADER_STR( 
> additional_header_str.c_str() ) ),
>                SOATAG_USER_SDP_STR( sdp_os.str().c_str() ),
>                SOATAG_RTP_SELECT( SOA_RTP_SELECT_COMMON ),
>                TAG_END() );
> 
> ---------------------------------------------------
> Accepting a call looks like this:
> 
> nua_respond( reinterpret_cast< nua_handle_t* >( call_id() ),
>                 status_code,
>                 sip_status_phrase( status_code ),
>                 TAG_IF( strlen( sdp_str ), SOATAG_USER_SDP_STR( sdp_str ) ),
>                 TAG_IF( (! aux_codecs.empty()), SOATAG_AUDIO_AUX( 
> aux_codecs.c_str() ) ),
>                 TAG_IF( strlen( reason_str ), SIPTAG_REASON_STR( reason_str ) 
> ),
>                 TAG_IF( use_session_timer, NUTAG_SESSION_REFRESHER( 
> nua_local_refresher ) ),
>                 TAG_IF( use_session_timer, NUTAG_MIN_SE( 
> session_timer.minimumSessionExpires() ) ),
>                 TAG_IF( use_session_timer, NUTAG_SESSION_TIMER( 
> session_timer.sessionExpires() ) ),
>                 TAG_IF( use_session_timer, NUTAG_REFRESH_WITHOUT_SDP( 1 ) ),
>                 TAG_END() );
> 
> ---------------------------------------------------
> My first (naive) attempt was trying to update the media mode like so:
> 
> std::string sdp_media_mode_line( "a=" );
> sdp_media_mode_line.append( media_mode.sdp_str() );
> nua_invite( reinterpret_cast< nua_handle_t* >( call_id() ),
>               SOATAG_USER_SDP_STR( sdp_media_mode_line.c_str() ),
>               TAG_END() );
> 
> Of course this doesn't work since SOA doesn't know what media that attribute 
> belongs to...
> I didn't try to include the media line (yet).
> 
> What I'm basically trying to do is to change a certain attribute for all 
> media of a certain type at once.
> Is there a more elegant way than USER_SDP_STR, or is it the recommended way 
> to go?
> 
> 
> Regards,
> 
> Andreas
> 
> 
> 03.09.2014, 15:23, "Michael Jerris" <m...@jerris.com>:
>>  I know it works with USER_SDP_STR, what exactly is your call to 
>> update/invite?  are you doing ACTIVE_AUDIO(1) ?
>> 
>>  On Sep 3, 2014, at 9:13 AM, Andreas Wehrmann <a.wehrm...@yandex.com> wrote:
>>>   Hi!
>>> 
>>>   I'm somewhat at a loss here.
>>>   I'm in a SIP call that I made or accepted with one of
>>>   a=[inactive|recvonly|sendonly|sendrecv] in the SDP.
>>>   There is only one media (audio).
>>>   When I make or answer a call, I create the complete SDP and provide it
>>>   to nua with SOATAG_USER_SDP_STR which is working just fine.
>>> 
>>>   Now I would like to be able to change the media mode mid-call using the
>>>   same SDP as before with a new media mode setting, but how do I do that?
>>>   I tried calling nua_update/nua_invite using SOATAG_ACTIVE_AUDIO but it
>>>   was to no avail.
>>> 
>>>   Is SOATAG_ACTIVE_AUDIO the way to go or should I be doing something
>>>   different?
>>> 
>>>   Any help is appreciated.
>>> 
>>>   Best regards,
>>>   Andreas


------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to