[SR-Users] Calling end_media_session twice

Teddy Rabary shinikage.r at gmail.com
Mon Dec 16 16:51:59 CET 2013


Hi all,

I see this discussion about mediaproxy and it's the same what happens to me
http://opensips.org/pipermail/users/2010-August/013997.html

Indeed in my kamailio.cfg, I call twice end_media_session on "bye" and
on "cancel"
route[CANCEL] {
        if (is_method("CANCEL"))
        {
                end_media_session();
		if (t_check_trans())
			t_relay();
		exit;
        }
}

and
route[WITHINDLG] {
	if (has_totag()) {
		# sequential request withing a dialog should
                # take the path determined by record-routing
                if (loose_route()) {
                        if (is_method("BYE")) {
                                end_media_session();
		                setflag(FLT_ACC); # do accounting ...
			        setflag(FLT_ACCFAILED); # ... even if the transaction fails
		                $avp(s:can_uri) = $ru;
                        }
                        if ( is_method("ACK") ) {
				# ACK is forwarded statelessy
                                route(NATMANAGE);
                        }
                        route(RELAY);
		} else {
...

I thought both are necessary, so can I make something like this at
route[WITHINDLG] ?
...
 if (is_method("BYE|CANCEL")) {
                                end_media_session();
		                setflag(FLT_ACC); # do accounting ...
			        setflag(FLT_ACCFAILED); # ... even if the transaction fails
		                $avp(s:can_uri) = $ru;
                        }
...

and then remove end_media_session at route[CANCEL] ?

Regards.



More information about the sr-users mailing list