[OpenSIPS-Users] media_exchange

Răzvan Crainea razvan at opensips.org
Thu Oct 9 12:26:02 UTC 2025


Pretty sure the lock is not needed at all - can you please open a BUG 
report, so we can investigate a bit how to properly handle the 
termination case?

Best regards,

Răzvan Crainea
OpenSIPS Core Developer / SIPhub CTO
http://www.opensips-solutions.com / https://www.siphub.com

On 10/6/25 1:27 PM, M S wrote:
> Hi Opensips developers,
> While going through media_exchang.c code:
> 
> static int b2b_media_notify(struct sip_msg *msg, str *key, int type,
>                  str *logic_key, void *param, int flags)
> {
> ....
> terminate:
>          *MEDIA_LEG_LOCK(msl);*
>          if (initial_state == MEDIA_SESSION_STATE_INIT) {
>                  /* this is the initial leg, not a re-invite */
>                  *MEDIA_LEG_UNLOCK(msl);*
>                  handle_media_session_negative(msl);
>          } else {
>                  *MEDIA_LEG_UNLOCK(msl);*
>          }
>          return -1;
> }
> 
> there is no point in lock and unlock above.... unless the first unlock is
> supposed to be after handle_media_session_negative(msl);?
> 
> Thanks!
> 
> 
> Hi Opensips developers,
> While going through media_exchang.c code:
> 
> static int b2b_media_notify(struct sip_msg *msg, str *key, int type,
>                  str *logic_key, void *param, int flags)
> {
> ....
> terminate:
> *MEDIA_LEG_LOCK(msl);*
>          if (initial_state == MEDIA_SESSION_STATE_INIT) {
>                  /* this is the initial leg, not a re-invite */
> *MEDIA_LEG_UNLOCK(msl);*
>                  handle_media_session_negative(msl);
>          } else {
> *MEDIA_LEG_UNLOCK(msl);*
>          }
>          return -1;
> }
> 
> there is no point in lock and unlock above.... unless the first 
> unlock is supposed to be after handle_media_session_negative(msl);?
> 
> Thanks!
> 
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users




More information about the Users mailing list