<HTML>
<HEAD>
<TITLE>Answering a call...</TITLE>
</HEAD>
<BODY>
<FONT FACE="Geneva, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'><BR>
Guys,<BR>
<BR>
In my module (written in C), I have a call answering edge case that I think there must be an easier way than what I’m doing. Or, more correctly, a right way to do this and I’m currently not doing that.<BR>
<BR>
I have an active/established call. An incoming SIP call arrives and I send it off to switch_ivr_originate to ring my endpoints. Based on action outside of Freeswitch, I want to stop the ringing and have an endpoint from the established call answer this ringing call. I have a custom FS event generated to indicate this condition. In this event handler I want to take a channel from the active call and answer this incoming call. <BR>
<BR>
Here’s what I’m currently doing. <BR>
<BR>
In my event handler I’m taking the endpoint of the active call and sending to a specific dialplan<BR>
This dialplan has it call my C application.<BR>
At this point the application is the session of the endpoint and it can get the session that’s currently ringing.<BR>
It gets the session of the ringing channel<BR>
It uses switch_channel_answer to answer the ringing channel.<BR>
Then it uses switch_ivr_uuid_bridge to bridge these two endpoints.<BR>
<BR>
Seems simple enough but it’s not working. <BR>
<BR>
<BR>
The problems I have are:<BR>
<BR>
Doing this seems to make the switch_ivr_originate that was ringing the endpoints fail with ORIGINATOR_CANCEL. I special case this but it leads me to believe I’m going about this the wrong way. I’m not trying to cancel it, I want to answer it. <BR>
<BR>
I’m not breaking the bridge of the original established call. That too seems wrong. I think I should be doing something there but it’s not clear what.<BR>
<BR>
<BR>
Is there a better way to handle this?<BR>
<BR>
<BR>
Thanks<BR>
<BR>
Kevin Snow<BR>
<BR>
<BR>
<BR>
</SPAN></FONT>
</BODY>
</HTML>