Lua Session creation is blocking?
I have a lua script that originate a new call creating a session as: outbound_session = freeswitch.Session(dialstring, session); The problem I have is that session creation sometimes is blocking and sometimes is not blocking. To me it seems that is related to the RTP so the session creation is blocked until early media is present or until the called answer the call. Is this true or I have miss something? There is a way to do a non blocking session creation? Stephen
Stephen, Use bgapi. David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34 Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. IPeva décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur. Le 04/02/2011 à 17:29, Stephen Wilde a écrit :
I have a lua script that originate a new call creating a session as:
outbound_session = freeswitch.Session(dialstring, session);
The problem I have is that session creation sometimes is blocking and sometimes is not blocking.
To me it seems that is related to the RTP so the session creation is blocked until early media is present or until the called answer the call.
Is this true or I have miss something?
There is a way to do a non blocking session creation?
Stephen _______________________________________________ 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
Don't think he can do that and get a session object for the call. -Steve On 4 February 2011 16:44, David Ponzone <david.ponzone@ipeva.fr> wrote:
Stephen,
Use bgapi.
David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34
Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com
*Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. **IPeva** décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur.* * *
Le 04/02/2011 à 17:29, Stephen Wilde a écrit :
I have a lua script that originate a new call creating a session as:
outbound_session = freeswitch.Session(dialstring, session);
The problem I have is that session creation sometimes is blocking and sometimes is not blocking.
To me it seems that is related to the RTP so the session creation is blocked until early media is present or until the called answer the call.
Is this true or I have miss something?
There is a way to do a non blocking session creation?
Stephen _______________________________________________ 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
Originate doesn't return until receives 18x, 200, 3xx 4xx, 5xx, or 6xx. I suspect this is the issue. Not sure what the workaround would be though... -Steve On 4 February 2011 16:29, Stephen Wilde <wstephen80@gmail.com> wrote:
I have a lua script that originate a new call creating a session as:
outbound_session = freeswitch.Session(dialstring, session);
The problem I have is that session creation sometimes is blocking and sometimes is not blocking.
To me it seems that is related to the RTP so the session creation is blocked until early media is present or until the called answer the call.
Is this true or I have miss something?
There is a way to do a non blocking session creation?
Stephen
_______________________________________________ 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
Ok, 18x will be perfect! The problem is that when the inbound call is SIP and the originated is ISDN, the originate doesn't return when a 180 ringing is received (that in ISDN is an ALERT without in band info). The originate returns when a 183 (ISDN = in band info available) or 200 (ISDN = CONNECT) is received. Stephen On Fri, Feb 4, 2011 at 5:48 PM, Steven Ayre <steveayre@gmail.com> wrote:
Originate doesn't return until receives 18x, 200, 3xx 4xx, 5xx, or 6xx. I suspect this is the issue.
Not sure what the workaround would be though...
-Steve
On 4 February 2011 16:29, Stephen Wilde <wstephen80@gmail.com> wrote:
I have a lua script that originate a new call creating a session as:
outbound_session = freeswitch.Session(dialstring, session);
The problem I have is that session creation sometimes is blocking and sometimes is not blocking.
To me it seems that is related to the RTP so the session creation is blocked until early media is present or until the called answer the call.
Is this true or I have miss something?
There is a way to do a non blocking session creation?
Stephen
_______________________________________________ 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
On Fri, Feb 4, 2011 at 10:19 AM, Stephen Wilde <wstephen80@gmail.com> wrote:
Ok, 18x will be perfect!
The problem is that when the inbound call is SIP and the originated is ISDN, the originate doesn't return when a 180 ringing is received (that in ISDN is an ALERT without in band info).
The originate returns when a 183 (ISDN = in band info available) or 200 (ISDN = CONNECT) is received.
Stephen
Could you tell us a bit more about what you're trying to accomplish? My guess is that there's a better way to do it. In most cases it is not necessary to create a new session inside of a script called from the dialplan. What is the application that you are working on? Who calls whom, etc. -MC
I have to port some applications on Freeswitch so I'm doing some preliminary learning tests on Lua scripting. The result that I would obtain is to have the full control of both inbound and originated session and to have under control their state. The script I'm running is simply: http://pastebin.freeswitch.org/15248 But its behaviour is not as I expect. Stephen On Fri, Feb 4, 2011 at 7:26 PM, Michael Collins <msc@freeswitch.org> wrote:
On Fri, Feb 4, 2011 at 10:19 AM, Stephen Wilde <wstephen80@gmail.com>wrote:
Ok, 18x will be perfect!
The problem is that when the inbound call is SIP and the originated is ISDN, the originate doesn't return when a 180 ringing is received (that in ISDN is an ALERT without in band info).
The originate returns when a 183 (ISDN = in band info available) or 200 (ISDN = CONNECT) is received.
Stephen
Could you tell us a bit more about what you're trying to accomplish? My guess is that there's a better way to do it. In most cases it is not necessary to create a new session inside of a script called from the dialplan.
What is the application that you are working on? Who calls whom, etc. -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
You could also look at ESL. -Steve On 4 February 2011 19:30, Stephen Wilde <wstephen80@gmail.com> wrote:
I have to port some applications on Freeswitch so I'm doing some preliminary learning tests on Lua scripting.
The result that I would obtain is to have the full control of both inbound and originated session and to have under control their state.
The script I'm running is simply: http://pastebin.freeswitch.org/15248
But its behaviour is not as I expect.
Stephen
On Fri, Feb 4, 2011 at 7:26 PM, Michael Collins <msc@freeswitch.org>wrote:
On Fri, Feb 4, 2011 at 10:19 AM, Stephen Wilde <wstephen80@gmail.com>wrote:
Ok, 18x will be perfect!
The problem is that when the inbound call is SIP and the originated is ISDN, the originate doesn't return when a 180 ringing is received (that in ISDN is an ALERT without in band info).
The originate returns when a 183 (ISDN = in band info available) or 200 (ISDN = CONNECT) is received.
Stephen
Could you tell us a bit more about what you're trying to accomplish? My guess is that there's a better way to do it. In most cases it is not necessary to create a new session inside of a script called from the dialplan.
What is the application that you are working on? Who calls whom, etc. -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
_______________________________________________ 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
The way you expect it to work is not the case. in embedded scripts when you create a new session you must wait for it to have media. The scripts are not asynchronous. if you want asynchronous you 100% want ESL. On Fri, Feb 4, 2011 at 1:30 PM, Stephen Wilde <wstephen80@gmail.com> wrote:
I have to port some applications on Freeswitch so I'm doing some preliminary learning tests on Lua scripting. The result that I would obtain is to have the full control of both inbound and originated session and to have under control their state. The script I'm running is simply: http://pastebin.freeswitch.org/15248 But its behaviour is not as I expect.
Stephen
On Fri, Feb 4, 2011 at 7:26 PM, Michael Collins <msc@freeswitch.org> wrote:
On Fri, Feb 4, 2011 at 10:19 AM, Stephen Wilde <wstephen80@gmail.com> wrote:
Ok, 18x will be perfect! The problem is that when the inbound call is SIP and the originated is ISDN, the originate doesn't return when a 180 ringing is received (that in ISDN is an ALERT without in band info). The originate returns when a 183 (ISDN = in band info available) or 200 (ISDN = CONNECT) is received. Stephen
Could you tell us a bit more about what you're trying to accomplish? My guess is that there's a better way to do it. In most cases it is not necessary to create a new session inside of a script called from the dialplan. What is the application that you are working on? Who calls whom, etc. -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
_______________________________________________ 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 GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@conference.freeswitch.org pstn:+19193869900
Ok, thank you, my way is ESL. ESL is less simple then embedded Lua but I understand that is the solution to my problem. Stephen On Fri, Feb 4, 2011 at 10:57 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
The way you expect it to work is not the case.
in embedded scripts when you create a new session you must wait for it to have media. The scripts are not asynchronous. if you want asynchronous you 100% want ESL.
On Fri, Feb 4, 2011 at 1:30 PM, Stephen Wilde <wstephen80@gmail.com> wrote:
I have to port some applications on Freeswitch so I'm doing some preliminary learning tests on Lua scripting. The result that I would obtain is to have the full control of both inbound and originated session and to have under control their state. The script I'm running is simply: http://pastebin.freeswitch.org/15248 But its behaviour is not as I expect.
Stephen
On Fri, Feb 4, 2011 at 7:26 PM, Michael Collins <msc@freeswitch.org> wrote:
On Fri, Feb 4, 2011 at 10:19 AM, Stephen Wilde <wstephen80@gmail.com> wrote:
Ok, 18x will be perfect! The problem is that when the inbound call is SIP and the originated is ISDN, the originate doesn't return when a 180 ringing is received (that
in
ISDN is an ALERT without in band info). The originate returns when a 183 (ISDN = in band info available) or 200 (ISDN = CONNECT) is received. Stephen
Could you tell us a bit more about what you're trying to accomplish? My guess is that there's a better way to do it. In most cases it is not necessary to create a new session inside of a script called from the dialplan. What is the application that you are working on? Who calls whom, etc. -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
_______________________________________________ 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
I have started learning ESL (using C library) and I have found this article: http://blog.godson.in/2010/12/use-of-returnringready-originate.html So I have added in my dialstring the prefix: * * * {return_ring_ready=true}* * * *and now the Lua script works as I want: the session creation returns also when a 180 ringing (with no media) is received!* Stephen On Fri, Feb 4, 2011 at 10:57 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
The way you expect it to work is not the case.
in embedded scripts when you create a new session you must wait for it to have media. The scripts are not asynchronous. if you want asynchronous you 100% want ESL.
On Fri, Feb 4, 2011 at 1:30 PM, Stephen Wilde <wstephen80@gmail.com> wrote:
I have to port some applications on Freeswitch so I'm doing some preliminary learning tests on Lua scripting. The result that I would obtain is to have the full control of both inbound and originated session and to have under control their state. The script I'm running is simply: http://pastebin.freeswitch.org/15248 But its behaviour is not as I expect.
Stephen
On Fri, Feb 4, 2011 at 7:26 PM, Michael Collins <msc@freeswitch.org> wrote:
On Fri, Feb 4, 2011 at 10:19 AM, Stephen Wilde <wstephen80@gmail.com> wrote:
Ok, 18x will be perfect! The problem is that when the inbound call is SIP and the originated is ISDN, the originate doesn't return when a 180 ringing is received (that
in
ISDN is an ALERT without in band info). The originate returns when a 183 (ISDN = in band info available) or 200 (ISDN = CONNECT) is received. Stephen
Could you tell us a bit more about what you're trying to accomplish? My guess is that there's a better way to do it. In most cases it is not necessary to create a new session inside of a script called from the dialplan. What is the application that you are working on? Who calls whom, etc. -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
_______________________________________________ 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 GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org googletalk:conf+888@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
participants (5)
-
Anthony Minessale
-
David Ponzone
-
Michael Collins
-
Stephen Wilde
-
Steven Ayre