[Freeswitch-users] mod_loopback pre answer

Spencer Thomason spencer at 5ninesolutions.com
Thu Jul 26 21:02:08 MSD 2012

I have a small multi-tenant installation where I need a hunt group where a user can do server side call forwarding on a per extension basis.  I'd also like the huntgroup to send a 180 instead of 183 with SDP when ringing.  I've currently solved this problem by constructing the bridge in a lua script like this:

if session:ready() then

	session:execute("bridge", "[leg_timeout=30]user/1002@"..domain_name..",[leg_timeout=30]user/1003@"..domain_name..",[leg_timeout=30]user/1004@"..domain_name..",[leg_timeout=30]user/1005@"..domain_name..",[leg_timeout=25]loopback/1001");

	originate_disposition = session:getVariable("originate_disposition");
	if originate_disposition ~= "SUCCESS" then
			session:execute("transfer", "900");

This allows extension 1001 to forward their calls by inserting the appropriate dialplan entry prior to the bridge to the local user.  My problem is that when using loopback, ring_ready does not work because of a hard coded pre answer in mod loopback at line 969: switch_channel_pre_answer(channel);.  

So I have a few questions:
Is there a better way to construct this kind of call forwarding/follow me without loopback at all? i.e. is there any way to set user defined call forwarding when do a bridge to a local user?

If not, what are the implications of commenting this line in the code?  Would I then be able to send a 180 w/o SDP when using loopback?

Thanks for your help!

Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list