[Freeswitch-dev] Mod_commands, originate, and existing sessions

Kurtis Heimerl kheimerl at cs.berkeley.edu
Sun Jul 24 02:36:35 MSD 2011


Hello freeswitch-dev!

I've got my chat dialplan working, and set about creating a simple
"callback" dialplan. Basically, a chat comes in at a number (e.g.,
5000) and the dialplan immediately originates a call between that user
and that phone number. This didn't work, as the originate command (in
mod_commands) does not allow it to operate when an existing session is
active. I've modified it to allow this, and it works great. Callbacks
happen, a new session is created, and I see no crashing or major
issues.

Line ~3400 in mod_command.c

	//kurtis
	//if (session || zstr(cmd)) {
	if (zstr(cmd)) {
		stream->write_function(stream, "-USAGE %s\n", ORIGINATE_SYNTAX);
		return SWITCH_STATUS_SUCCESS;
	}

I'd like to have as few distinct blocks of code from vanilla FS as
possible, so I was thinking of pushing this change upstream. Would any
of the core developers tell me why this particular solution is a bad
idea, and why originate disallowed operation in an existing session?
If it's benign, I'll submit a patch. If not, I'll try to figure out
another way to do this.

Thanks!



More information about the FreeSWITCH-dev mailing list