can mod_httapi decide if the call should be answerred?
Hi, I've got a simple question to you: can I use httapi before a call is answerred and, for example, hang up/reject the call if my application decides it doesn't want to handle it? I'd like to give the caller a 'busy' signal as a feedback or something like this. Thanks, RG
On Wed, Jun 26, 2013 at 1:39 PM, Rafal Gwizdala <rafal.gwizdala@gmail.com>wrote:
Hi, I've got a simple question to you: can I use httapi before a call is answerred and, for example, hang up/reject the call if my application decides it doesn't want to handle it? I'd like to give the caller a 'busy' signal as a feedback or something like this.
I would give it a try. Call the httapi app in the dialplan without doing an answer app. See if you can control it the way you want. I don't see an explicit "answer" work tag so you'll probably need to use the "execute" work tag and have "answer" be the app you use. Let us know if it works and then you can put the instructions up on the mod_httapi wiki page! :D -MC
Thanks, RG
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org
Thanks, Michael, for prompting me to do some homework I made some tests and the conclusions are: 1. You don't need to answer the call in the dialplan before calling into httapi Both extensions below will make httapi requests to my application: <extension name="test1"> <condition field="destination_number" expression="^6622$"> <action application="httapi" data="{url= http://localhost/simver/FSHttApi/Test}" /> </condition> </extension> <extension name="test2"> <condition field="destination_number" expression="^6621$"> <action application="answer" /> <action application="httapi" data="{url= http://localhost/simver/FSHttApi/Test}" /> </condition> </extension> 2. You don't need to answer the call in the httapi script This one looks quite strange but I think I finally understood it - I can play back sounds or 'say' something without explicitly 'answerring' the call. But the call is 'pre-answerred' only and in this state you won't be able to collect dtmf, for example. I don't know what is the exact difference between a pre-answerred and answerred call but one nice thing is that when you <hangup /> or <break /> in this state the call will be rejected and the caller will hear a 'busy' signal. 3. Answerring the call You can answer the call with <application name="answer"/> but by default there's no permission to run the 'answer' application from httapi script so you need to enable it in httapi.conf.xml
From now on the call is answerred and everything runs as usual.
Best regards Rafal
oops, I meant <execute application="answer" /> in (3) On Thu, Jun 27, 2013 at 12:49 PM, Rafal Gwizdala <rafal.gwizdala@gmail.com>wrote:
Thanks, Michael, for prompting me to do some homework
I made some tests and the conclusions are:
1. You don't need to answer the call in the dialplan before calling into httapi Both extensions below will make httapi requests to my application:
<extension name="test1"> <condition field="destination_number" expression="^6622$"> <action application="httapi" data="{url= http://localhost/simver/FSHttApi/Test}" /> </condition> </extension>
<extension name="test2"> <condition field="destination_number" expression="^6621$"> <action application="answer" /> <action application="httapi" data="{url= http://localhost/simver/FSHttApi/Test}" /> </condition> </extension>
2. You don't need to answer the call in the httapi script This one looks quite strange but I think I finally understood it - I can play back sounds or 'say' something without explicitly 'answerring' the call. But the call is 'pre-answerred' only and in this state you won't be able to collect dtmf, for example. I don't know what is the exact difference between a pre-answerred and answerred call but one nice thing is that when you <hangup /> or <break /> in this state the call will be rejected and the caller will hear a 'busy' signal.
3. Answerring the call You can answer the call with <application name="answer"/> but by default there's no permission to run the 'answer' application from httapi script so you need to enable it in httapi.conf.xml From now on the call is answerred and everything runs as usual.
Best regards Rafal
Hello Rafal. By This /I don't know what is the exact difference between a pre-answerred and answerred call but one nice thing is that when you <hangup /> or <break /> in this state the call will be rejected and the caller will hear a 'busy' signal.// / /You are dealing with early_media./ https://wiki.freeswitch.org/wiki/Early_Media This is what "normally" your mobile operator uses to say stuff like , your are low on credit or , voicemail like messages at least here in Europe is pretty common. You can generally "play" with this feature inside the LAN but it your are using PSTN / GSM Networks take into consideration that the provider will generally drop your early media . Again this depends on your provider Config if its Tier 1 , 2 ,3 .... Antonio On 6/27/13 11:52 AM, Rafal Gwizdala wrote:
I don't know what is the exact difference between a pre-answerred and answerred call but one nice thing is that when you <hangup /> or <break /> in this state the call will be rejected and the caller will hear a 'busy' signal.
This could also be of your interest https://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_pre_answer On 6/27/13 11:52 AM, Rafal Gwizdala wrote:
I don't know what is the exact difference between a pre-answerred and answerred call but one nice thing is that when you <hangup /> or <break /> in this state the call will be rejected and the caller will hear a 'busy' signal.
On Thu, Jun 27, 2013 at 3:49 AM, Rafal Gwizdala <rafal.gwizdala@gmail.com>wrote:
Thanks, Michael, for prompting me to do some homework
I made some tests and the conclusions are:
1. You don't need to answer the call in the dialplan before calling into httapi Both extensions below will make httapi requests to my application:
<extension name="test1"> <condition field="destination_number" expression="^6622$"> <action application="httapi" data="{url= http://localhost/simver/FSHttApi/Test}" /> </condition> </extension>
<extension name="test2"> <condition field="destination_number" expression="^6621$"> <action application="answer" /> <action application="httapi" data="{url= http://localhost/simver/FSHttApi/Test}" /> </condition> </extension>
2. You don't need to answer the call in the httapi script This one looks quite strange but I think I finally understood it - I can play back sounds or 'say' something without explicitly 'answerring' the call. But the call is 'pre-answerred' only and in this state you won't be able to collect dtmf, for example. I don't know what is the exact difference between a pre-answerred and answerred call but one nice thing is that when you <hangup /> or <break /> in this state the call will be rejected and the caller will hear a 'busy' signal.
3. Answerring the call You can answer the call with <application name="answer"/> but by default there's no permission to run the 'answer' application from httapi script so you need to enable it in httapi.conf.xml From now on the call is answerred and everything runs as usual.
Best regards Rafal
Thanks for sharing your research with us - it is much appreciated. I've added this to the HTTAPI wiki page<http://wiki.freeswitch.org/wiki/Mod_httapi#Answer_and_pre-answer_before_httapi>. If you don't mind please request a wiki account (done at the wiki login page) and you can add to/edit the wiki also. -MC
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org
participants (3)
-
Antonio Teixeira
-
Michael Collins
-
Rafal Gwizdala