how do I detect a call has rung once?
I want to initiate a missed call from FS (via lua script). Is there anything in the early media I can check to see that the call has rung at the endpoint at least once? Thanks, Neil
as soon as you get the first early media signal, that is how you know. On Mon, May 10, 2010 at 4:03 PM, Neil Patel <neilp@cs.stanford.edu> wrote:
I want to initiate a missed call from FS (via lua script). Is there anything in the early media I can check to see that the call has rung at the endpoint at least once?
Thanks, Neil
_______________________________________________ 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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
Unfortunately this is a wrong assumption. You can get dead air in early media and SIP error after that. On Monday 10 May 2010, Anthony Minessale wrote:
as soon as you get the first early media signal, that is how you know.
On Mon, May 10, 2010 at 4:03 PM, Neil Patel <neilp@cs.stanford.edu> wrote:
I want to initiate a missed call from FS (via lua script). Is there anything in the early media I can check to see that the call has rung at the endpoint at least once?
Thanks, Neil
_______________________________________________ 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
Unfortunately you can never guarentee that the far end has range atleast once... Session progress (on any network topology sip, h323, ss7 or even PRI) does not guarantee the far end has rang only that the switch you sent the call to has indicated that it is attempting to ring the far end... Then on top of that add any number of different user devices (softphones, hardphones, analog cordless phones whatever) who knows when they'll actually start ringing... I have had digital cordless phones that would never ring on the first ring pulse on an analog line while the old school 500 set next to them was just ringing away... All you can do is take your best guess at it... ie: wait 4 or 5 seconds after session progress then hope that was 1 ring due to typical ring cycle length K On 5/10/10 4:34 PM, "Sergey Okhapkin" <sos@sokhapkin.dyndns.org> wrote:
Unfortunately this is a wrong assumption. You can get dead air in early media and SIP error after that.
On Monday 10 May 2010, Anthony Minessale wrote:
as soon as you get the first early media signal, that is how you know.
On Mon, May 10, 2010 at 4:03 PM, Neil Patel <neilp@cs.stanford.edu> wrote:
I want to initiate a missed call from FS (via lua script). Is there anything in the early media I can check to see that the call has rung at the endpoint at least once?
Thanks, Neil
_______________________________________________ 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
_______________________________________________ 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
Unfortunately it's not an assumption. You have to consider that things are sane. If they are. When you place a call and you get either a 180 or 183 it denotes that ringing has been indicated by the far end. If you want to get into the gory details they map over to a very specific set of ISDN signals that indicate that the phone has rung or not both with and without media. In either case both with and without audio if FreeSWITCH gets the early media indication it means someone has told us there is ringing. If things are not sane, you cannot do anything but find another route. On Mon, May 10, 2010 at 4:34 PM, Sergey Okhapkin <sos@sokhapkin.dyndns.org>wrote:
Unfortunately this is a wrong assumption. You can get dead air in early media and SIP error after that.
On Monday 10 May 2010, Anthony Minessale wrote:
as soon as you get the first early media signal, that is how you know.
On Mon, May 10, 2010 at 4:03 PM, Neil Patel <neilp@cs.stanford.edu> wrote:
I want to initiate a missed call from FS (via lua script). Is there anything in the early media I can check to see that the call has rung at the endpoint at least once?
Thanks, Neil
_______________________________________________ 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
_______________________________________________ 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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
What's the channel variable I monitor for? Is it good practice to poll for it, or is there another option? Also, does 180 and/or 183 come back for non-sip calls (I'm dialing out over PRI/openzap). Thanks, Neil On Mon, May 10, 2010 at 2:49 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
Unfortunately it's not an assumption.
You have to consider that things are sane. If they are. When you place a call and you get either a 180 or 183 it denotes that ringing has been indicated by the far end. If you want to get into the gory details they map over to a very specific set of ISDN signals that indicate that the phone has rung or not both with and without media. In either case both with and without audio if FreeSWITCH gets the early media indication it means someone has told us there is ringing.
If things are not sane, you cannot do anything but find another route.
On Mon, May 10, 2010 at 4:34 PM, Sergey Okhapkin <sos@sokhapkin.dyndns.org
wrote:
Unfortunately this is a wrong assumption. You can get dead air in early media and SIP error after that.
On Monday 10 May 2010, Anthony Minessale wrote:
as soon as you get the first early media signal, that is how you know.
On Mon, May 10, 2010 at 4:03 PM, Neil Patel <neilp@cs.stanford.edu> wrote:
I want to initiate a missed call from FS (via lua script). Is there anything in the early media I can check to see that the call has rung at the endpoint at least once?
Thanks, Neil
_______________________________________________ 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
_______________________________________________ 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
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
_______________________________________________ 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
yes you will get progressing and alerting but I no not recall which those map to. /b Sent from my iPad On May 10, 2010, at 8:35 PM, Neil Patel <neilp@cs.stanford.edu> wrote:
What's the channel variable I monitor for? Is it good practice to poll for it, or is there another option? Also, does 180 and/or 183 come back for non-sip calls (I'm dialing out over PRI/openzap).
Thanks, Neil
Off the top of my head possibly it's ${endpoint_dispostion} It's been quite a while since I did my openzap stuff... -MC On Mon, May 10, 2010 at 6:48 PM, Brian West <brian@freeswitch.org> wrote:
yes you will get progressing and alerting but I no not recall which those map to.
/b
Sent from my iPad
On May 10, 2010, at 8:35 PM, Neil Patel <neilp@cs.stanford.edu> wrote:
What's the channel variable I monitor for? Is it good practice to poll for it, or is there another option? Also, does 180 and/or 183 come back for non-sip calls (I'm dialing out over PRI/openzap).
Thanks, Neil
_______________________________________________ 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
doh I mean ${endpoint_disposition} On Mon, May 10, 2010 at 8:10 PM, Michael Collins <msc@freeswitch.org> wrote:
Off the top of my head possibly it's ${endpoint_dispostion} It's been quite a while since I did my openzap stuff... -MC
On Mon, May 10, 2010 at 6:48 PM, Brian West <brian@freeswitch.org> wrote:
yes you will get progressing and alerting but I no not recall which those map to.
/b
Sent from my iPad
On May 10, 2010, at 8:35 PM, Neil Patel <neilp@cs.stanford.edu> wrote:
What's the channel variable I monitor for? Is it good practice to poll for it, or is there another option? Also, does 180 and/or 183 come back for non-sip calls (I'm dialing out over PRI/openzap).
Thanks, Neil
_______________________________________________ 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
you don't poll for it you wait for the events. polling variables is horribly inefficient On Mon, May 10, 2010 at 10:11 PM, Michael Collins <msc@freeswitch.org>wrote:
doh I mean ${endpoint_disposition}
On Mon, May 10, 2010 at 8:10 PM, Michael Collins <msc@freeswitch.org>wrote:
Off the top of my head possibly it's ${endpoint_dispostion} It's been quite a while since I did my openzap stuff... -MC
On Mon, May 10, 2010 at 6:48 PM, Brian West <brian@freeswitch.org> wrote:
yes you will get progressing and alerting but I no not recall which those map to.
/b
Sent from my iPad
On May 10, 2010, at 8:35 PM, Neil Patel <neilp@cs.stanford.edu> wrote:
What's the channel variable I monitor for? Is it good practice to poll for it, or is there another option? Also, does 180 and/or 183 come back for non-sip calls (I'm dialing out over PRI/openzap).
Thanks, Neil
_______________________________________________ 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
_______________________________________________ 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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
Thanks for the tips. Where are there examples of using ESL to register and handle events? For e.g. I don't see any example of how to register for a change in channel variable endpoint_disposition. Or even to check the CHANNEL_STATE event. -Neil On Tue, May 11, 2010 at 8:35 AM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
you don't poll for it you wait for the events. polling variables is horribly inefficient
On Mon, May 10, 2010 at 10:11 PM, Michael Collins <msc@freeswitch.org>wrote:
doh I mean ${endpoint_disposition}
On Mon, May 10, 2010 at 8:10 PM, Michael Collins <msc@freeswitch.org>wrote:
Off the top of my head possibly it's ${endpoint_dispostion} It's been quite a while since I did my openzap stuff... -MC
On Mon, May 10, 2010 at 6:48 PM, Brian West <brian@freeswitch.org>wrote:
yes you will get progressing and alerting but I no not recall which those map to.
/b
Sent from my iPad
On May 10, 2010, at 8:35 PM, Neil Patel <neilp@cs.stanford.edu> wrote:
What's the channel variable I monitor for? Is it good practice to poll for it, or is there another option? Also, does 180 and/or 183 come back for non-sip calls (I'm dialing out over PRI/openzap).
Thanks, Neil
_______________________________________________ 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
_______________________________________________ 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
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
_______________________________________________ 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
On Wed, May 12, 2010 at 11:59 AM, Neil Patel <neilp@cs.stanford.edu> wrote:
Thanks for the tips.
Where are there examples of using ESL to register and handle events? For e.g. I don't see any example of how to register for a change in channel variable endpoint_disposition. Or even to check the CHANNEL_STATE event.
-Neil
Neil,
Check out the event socket documentation, specifically the "events plain all" and "filter" commands. You can listen to all events or just specific ones: http://wiki.freeswitch.org/wiki/Event_socket If you want to experiment with the event socket and the various events then use fs_cli. Connect with fs_cli and then issue "/log 0" which turns off all debug messages. Now you have basically a raw event socket. Try some of these commands: /event plain all watch the fun messages fly. :) You can filter them as well: /filter Event-Name CHANNEL_STATE /filter Event-Name CHANNEL_HANGUP when you apply a filter you will receive only those things you choose. A it's a "filter in" not filter out. Another way of saying it is "show me events named CHANNEL_STATE" and "show me events named CHANNEL_HANGUP" just note that in your script you will be using the ESL abstractions for these: http://wiki.freeswitch.org/wiki/Esl#ESLconnection_Object I hope that helps! Have fun. -MC
Thanks Michael, I was looking for code examples to receive events over ESL, and found them in libs/esl/. I'm still not clear on the following: 1. I have a controller script that originates calls; it runs "show channels" between calls and parses out the number of active channels. If below threshold, originate next call. If not, wait a couple seconds and run "show channels" again, repeating till below threshold. Is this the best way? Can this be done more efficiently through events? How? 2. For placing missed calls to SIP endpoints, it sounds like* *I can wait for a signal 180 or 183 to know when to hang up. How do I check for those signals? Is this another job for events? 3. For placing missed calls over openzap/PRI, it sounds like I can check for call states PROGRESS or ALERTING? Where are those states from, and how do I check them? Again, can I use events? The other option you gave is checking for endpoint_disposition. This is in the cdr, but how do I use it for detecting when I should hang up for a missed call? Is there an event associated with it? What are the call states it goes through? -Neil On Wed, May 12, 2010 at 2:47 PM, Michael Collins <msc@freeswitch.org> wrote:
On Wed, May 12, 2010 at 11:59 AM, Neil Patel <neilp@cs.stanford.edu>wrote:
Thanks for the tips.
Where are there examples of using ESL to register and handle events? For e.g. I don't see any example of how to register for a change in channel variable endpoint_disposition. Or even to check the CHANNEL_STATE event.
-Neil
Neil,
Check out the event socket documentation, specifically the "events plain all" and "filter" commands. You can listen to all events or just specific ones: http://wiki.freeswitch.org/wiki/Event_socket
If you want to experiment with the event socket and the various events then use fs_cli. Connect with fs_cli and then issue "/log 0" which turns off all debug messages. Now you have basically a raw event socket. Try some of these commands:
/event plain all
watch the fun messages fly. :)
You can filter them as well:
/filter Event-Name CHANNEL_STATE /filter Event-Name CHANNEL_HANGUP
when you apply a filter you will receive only those things you choose. A it's a "filter in" not filter out. Another way of saying it is "show me events named CHANNEL_STATE" and "show me events named CHANNEL_HANGUP"
just note that in your script you will be using the ESL abstractions for these:
http://wiki.freeswitch.org/wiki/Esl#ESLconnection_Object
I hope that helps! Have fun. -MC
_______________________________________________ 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
I played around with a couple options and found that issuing a hupall normal_clearing on the initiated call after a few seconds was the most reliable way to do this. The next best option I found was hanging up after a few seconds of receiving CS_EXECUTE state update, though this seemed to cause the timing to vary. Are there other events that come over ESL on a PRI call that are good to anchor to? For some of the suggestions above like "progressing", it isn't clear what event that corresponds to. On Thu, May 13, 2010 at 5:14 PM, Neil Patel <neilp@cs.stanford.edu> wrote:
Thanks Michael, I was looking for code examples to receive events over ESL, and found them in libs/esl/.
I'm still not clear on the following:
1. I have a controller script that originates calls; it runs "show channels" between calls and parses out the number of active channels. If below threshold, originate next call. If not, wait a couple seconds and run "show channels" again, repeating till below threshold. Is this the best way? Can this be done more efficiently through events? How? 2. For placing missed calls to SIP endpoints, it sounds like* *I can wait for a signal 180 or 183 to know when to hang up. How do I check for those signals? Is this another job for events? 3. For placing missed calls over openzap/PRI, it sounds like I can check for call states PROGRESS or ALERTING? Where are those states from, and how do I check them? Again, can I use events? The other option you gave is checking for endpoint_disposition. This is in the cdr, but how do I use it for detecting when I should hang up for a missed call? Is there an event associated with it? What are the call states it goes through?
-Neil
On Wed, May 12, 2010 at 2:47 PM, Michael Collins <msc@freeswitch.org>wrote:
On Wed, May 12, 2010 at 11:59 AM, Neil Patel <neilp@cs.stanford.edu>wrote:
Thanks for the tips.
Where are there examples of using ESL to register and handle events? For e.g. I don't see any example of how to register for a change in channel variable endpoint_disposition. Or even to check the CHANNEL_STATE event.
-Neil
Neil,
Check out the event socket documentation, specifically the "events plain all" and "filter" commands. You can listen to all events or just specific ones: http://wiki.freeswitch.org/wiki/Event_socket
If you want to experiment with the event socket and the various events then use fs_cli. Connect with fs_cli and then issue "/log 0" which turns off all debug messages. Now you have basically a raw event socket. Try some of these commands:
/event plain all
watch the fun messages fly. :)
You can filter them as well:
/filter Event-Name CHANNEL_STATE /filter Event-Name CHANNEL_HANGUP
when you apply a filter you will receive only those things you choose. A it's a "filter in" not filter out. Another way of saying it is "show me events named CHANNEL_STATE" and "show me events named CHANNEL_HANGUP"
just note that in your script you will be using the ESL abstractions for these:
http://wiki.freeswitch.org/wiki/Esl#ESLconnection_Object
I hope that helps! Have fun. -MC
_______________________________________________ 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
participants (6)
-
Anthony Minessale
-
Brian West
-
Ken Rice
-
Michael Collins
-
Neil Patel
-
Sergey Okhapkin