When the caller to the offline user (connected to SEMS) hungup first the BYE message must be sent to SEMS for release the call.
How i can send the BYE to SEMS only if the user that hungup are talking to SEMS ?
 
Ex:
 
if ( BYE or CANCEL ) {
   if (for established SEMS session) {
    vm("/tmp/am_fifo","bye")
   } else {
    end_media_session();
    t_relay();
   };
break;
};
 
Thanks
Ezequiel Colombo