[Freeswitch-dev] mod_httapi

Karl Seacrest karlseacrest at yahoo.com
Fri Feb 3 00:08:34 MSK 2012


Thanks Michael Collins,
I am still laughing about your point: Me you telling Anthony what early media is kind of like telling a neurosurgeon that a person's brain is inside the cranium. :P
Seeing the way you put it makes me laugh. sorry  Anthony, i am not trying to educated you about Early Media.

Michael  as regards your question, i am developing a premium customer support application whereby registered members can call-in and the customer support staffs will pick the call. But before the call will connect with to live support. I want the caller id to be checked from the database if it's registered and active or not. if registered, call is connect to live support but if not, an audio will be played to the caller telling them they are not registered for the service and disconnect without the caller being charged.


The only time the call will be charged is when the call connected to live support. so i am thinking using the early media mode will help me achieve this but i am not sure how to go about it using the  mod_httapi.

My second question is, is there any performance benefit for using  mod_httapi over a framework like Plivo that provide RESTFul features to FreeSWITCH?

Karl C.




________________________________
 From: "freeswitch-dev-request at lists.freeswitch.org" <freeswitch-dev-request at lists.freeswitch.org>
To: freeswitch-dev at lists.freeswitch.org 
Sent: Thursday, February 2, 2012 9:43 PM
Subject: FreeSWITCH-dev Digest, Vol 68, Issue 6
 
----- Forwarded Message -----

Send FreeSWITCH-dev mailing list submissions to
    freeswitch-dev at lists.freeswitch.org

To subscribe or unsubscribe via the World Wide Web, visit
    http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
or, via email, send a message with subject or body 'help' to
    freeswitch-dev-request at lists.freeswitch.org

You can reach the person managing the list at
    freeswitch-dev-owner at lists.freeswitch.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of FreeSWITCH-dev digest..."

Today's Topics:

   1. Re: mod_httapi (Michael Collins)
   2. switch_ivr_bridge.c question (teldev)
   3. Re: switch_ivr_bridge.c question (Anthony Minessale)
   4. mod_httapi (Karl Seacrest)

Actually, Anthony understood your question and gave you a solution with bonus information. I especially liked the part where you tell Anthony what early media is. That's kind of like telling a neurosurgeon that a person's brain is inside the cranium. :P

If you issue a playback without actually answering the call then the net effect is that you are pre_answering the call and the file you are playing is in early media, i.e. you have not actually "answered" the call from a billing perspective. From the caller perspective the file you play is the ringback that they will hear.

Is there something you were curious about beyond sending audio to the caller in early media mode?

-MC


On Thu, Feb 2, 2012 at 1:15 AM, Karl Seacrest <karlseacrest at yahoo.com> wrote:

Thanks for your reply Anthony, 
>
>But i think you didn't quite understand my question. Custom Ring Back Tones (Early Media) is one of the features listed in FreeSWITCH features page and details of  FreeSWITCH Early Media mode is detailed in FreeSWITCH wiki : http://wiki.freeswitch.org/wiki/Early_Media
>
>
>By pre-answer i mean picking a call in
Early Media mode (Early media is the exchange of information before establishment of a connection) which mean on early media mode, even though an audio is playing like Custom Ring Back Tones, the call is not connected so the caller is not billed.
>
>
>The question again is how can the FreeSWITCH Early Media feature be used from mod_httapi?
>
>
>Also, is there any performance benefit for using  mod_httapi over a framework like Plivo that provide RESTFul features to FreeSWITCH?
>
>
>Regards
>
>
>Karl C.
>
>
>
>
>
>
>
>
>
>
>
>
>
>________________________________
> 
>On Wed, Feb 1, 2012 at 16:05, Anthony Minessale <anthony.minessale at gmail.com>wrote:
>
>
>
>if you try to play a file it will pre-answer by itselfyou can send anything you want via the dialplan inside the {foo=bar}
>var expressions and if you enable the permissions you can get the full
>call data
>
>On Wed, Feb 1, 2012 at 10:41 AM, Karl Seacrest <karlseacrest at yahoo.com> wrote:
>> Hello,
>> I will like to know how i can use Pre-Answer feature using the
 mod_httapi.
>> This is useful to perform operations like playing playing custom caller
>> tunes or validate the callers phone number from database before the call is
>> answered.
>>
>> How can i achieve this using the FreeSWITCH mod_httapi?
>>
>> Also does mod_httapi send caller information (Caller ID, etc) along when
>> requesting a URI?
>>
>>
>> Regards
>> Karl C.
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> 
>> 
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://wiki.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-dev mailing list
>> FreeSWITCH-dev at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
>> http://www.freeswitch.org
>>
>
>
>
>-- 
>Anthony Minessale II
>
>FreeSWITCH http://www.freeswitch.org/
>ClueCon http://www.cluecon.com/
>Twitter: http://twitter.com/FreeSWITCH_wire
>
>AIM: anthm
>MSN:anthony_minessale at hotmail.com
>GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
>IRC: irc.freenode.net #freeswitch
>
>FreeSWITCH Developer Conference
>sip:888 at conference.freeswitch.org
>googletalk:conf+888 at conference.freeswitch.org
>pstn:+19193869900
>
>
>
>Hi team,
>
>
>I am trying to get these values from the lua script for custom CDR report, I am able to get few values but many variables are missing or getting null value. Any help would be appreciated.
>
>
>local aa=session:getVariable("context");
>local bb=session:getVariable("destination_number");
>local cc=session:getVariable("caller_id_name");
>local dd=session:getVariable("caller_id_number");
>local ee=session:getVariable("network_addr");
>local ff=session:getVariable("ani");
>local ii=session:getVariable("source");
>local jj=session:getVariable("chan_name");
>local kk=session:getVariable("uuid");
>local ll=session:getVariable("created_time");
>local aa1=session:getVariable("direction");
>local bb1=session:getVariable("username");
>local cc1=session:getVariable("dialplan");
>local dd1=session:getVariable("caller_id_number");
>local ee1=session:getVariable("unique_id");
>
>
>session:execute("bridge","user/601");
>session:hangup();
>
>
>local ff1=session:getVariable("answered_time");
>local hh1=session:getVariable("created_time");
>local gg1=session:getVariable("hangup_time");
>local gg2=session:getVariable("end_stamp");
>
>
>I am getting values for all the above variables except end_stamp, hangup_time, duration, billsec,hangup_cause.
>
>
>
>
>Thanks for your time.
>
>
>Thanks,
>Bala
>
>
>
>
>
>
>_______________________________________________
>FreeSWITCH-dev mailing list
>FreeSWITCH-dev at lists.freeswitch.org
>http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
>http://www.freeswitch.org
>
>
>
>_________________________________________________________________________
>Professional FreeSWITCH Consulting Services:
>consulting at freeswitch.org
>http://www.freeswitchsolutions.com
>
>
>
>
>Official FreeSWITCH Sites
>http://www.freeswitch.org
>http://wiki.freeswitch.org
>http://www.cluecon.com
>
>FreeSWITCH-dev mailing list
>FreeSWITCH-dev at lists.freeswitch.org
>http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
>UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
>http://www.freeswitch.org
>
>
Re-worded my original post a bit, sorry if it becomes a new thread...having
Nabble issues.

In switch_ivr_bridge.c on line 1474, we have the following lines of code:

1474                  
switch_channel_clear_state_handler(originator_channel, NULL);
1475                  
switch_channel_clear_state_handler(originatee_channel, NULL);
1476                    switch_channel_set_state_flag(originator_channel,
CF_BRIDGE_ORIGINATOR);
1477                  
switch_channel_clear_flag_recursive(originatee_channel,
CF_BRIDGE_ORIGINATOR);
1478                  
switch_channel_add_state_handler(originator_channel,
&uuid_bridge_state_handlers);
1479                  
switch_channel_add_state_handler(originatee_channel,
&uuid_bridge_state_handlers);

Is the call to “switch_channel_set_state_flag” a typo? Since line 1476
triggers an asynchronous flag change, and line 1477 changes the same flag
synchronously, on line 1478 the value of the flag becomes unpredictable
since the asynchronous change from line 1476 can happen before or after line
1477 (mostly after, of course).

Thanks again.

--
View this message in context: http://freeswitch-dev.4355.n6.nabble.com/switch-ivr-bridge-c-question-tp4359635p4359635.html
Sent from the FreeSWITCH-dev mailing list archive at Nabble.com.


The code is not the same on the latest.
Look closer ;)

You should probably keep yourself on the latest for this deep of an examination.



On Thu, Feb 2, 2012 at 11:43 AM, teldev <ustcorporation at yahoo.com> wrote:
> Re-worded my original post a bit, sorry if it becomes a new thread...having
> Nabble issues.
>
> In switch_ivr_bridge.c on line 1474, we have the following lines of code:
>
>  1474
> switch_channel_clear_state_handler(originator_channel, NULL);
>  1475
> switch_channel_clear_state_handler(originatee_channel, NULL);
>  1476                    switch_channel_set_state_flag(originator_channel,
> CF_BRIDGE_ORIGINATOR);
>  1477
> switch_channel_clear_flag_recursive(originatee_channel,
> CF_BRIDGE_ORIGINATOR);
>  1478
> switch_channel_add_state_handler(originator_channel,
> &uuid_bridge_state_handlers);
>  1479
> switch_channel_add_state_handler(originatee_channel,
> &uuid_bridge_state_handlers);
>
> Is the call to “switch_channel_set_state_flag” a typo? Since line 1476
> triggers an asynchronous flag change, and line 1477 changes the same flag
> synchronously, on line 1478 the value of the flag becomes unpredictable
> since the asynchronous change from line 1476 can happen before or after line
> 1477 (mostly after, of course).
>
> Thanks again.
>
> --
> View this message in context: http://freeswitch-dev.4355.n6.nabble.com/switch-ivr-bridge-c-question-tp4359635p4359635.html
> Sent from the FreeSWITCH-dev mailing list archive at Nabble.com.
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-dev mailing list
> FreeSWITCH-dev at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
> http://www.freeswitch.org



-- 
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/
Twitter: http://twitter.com/FreeSWITCH_wire

AIM: anthm
MSN:anthony_minessale at hotmail.com
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org
googletalk:conf+888 at conference.freeswitch.org
pstn:+19193869900



Thanks for your reply Anthony, 

But i think you didn't quite understand my question. Custom Ring Back Tones (Early Media) is one of the features listed in FreeSWITCH features page and details of  FreeSWITCH Early Media mode is detailed in FreeSWITCH wiki : http://wiki.freeswitch.org/wiki/Early_Media

By pre-answer i mean picking a call in Early Media mode (Early media is the exchange of information before establishment of a connection) which mean on early media mode, even though an audio is playing like Custom Ring Back Tones, the call is not connected so the caller is not billed.

The question again is how can the FreeSWITCH Early Media feature be used from mod_httapi?

Also, is there any performance benefit for using  mod_httapi over a framework like Plivo that provide RESTFul features to FreeSWITCH?

Regards

Karl C.
_______________________________________________
FreeSWITCH-dev mailing list
FreeSWITCH-dev at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
http://www.freeswitch.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20120202/632fb57c/attachment-0001.html 


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