lua session() is blocking...

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

lua session() is blocking...

Antonio Silva
Hi all,

I was trying from a lua script call a remote destination and when it starts ringing i want to bridged it with another destination.

The problem is that the freswitch.session is blocking and it only returns when the call is already answer...

Is there a way, beside doing it by events, to get the complete status of a session?


the lua script:

dialstring = "{ignore_early_media=true}loopback/100/outgoing"
session = freeswitch.Session(dialstring);
-- check if is ringing...
uuid = session:getVariable('uuid')
state = api:executeString('eval uuid:' .. uuid .. ' ${Channel-Call-State}')
mlog.warning(state)
while (session:ready() == true) do
session:sleep(500)
mlog.debug('in session')
end
_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: lua session() is blocking...

Brian West
You told it to do exactly that when you said ignore_early_media=true

--
Brian West
[hidden email]
FreeSWITCH Solutions, LLC
PO BOX PO BOX 2531
Brookfield, WI 53008-2531
Twitter: @FreeSWITCH_Wire , @briankwest
http://www.freeswitchbook.com
http://www.freeswitchcookbook.com

T: +1.918.420.9001  |  F: +1.918.420.9002  |  M: +1.918.424.WEST
iNUM: +883 5100 1420 9001
ISN: 410*543
Skype:briankwest
PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED)











On Sep 30, 2013, at 7:31 AM, Antonio Silva <[hidden email]> wrote:

> The problem is that the freswitch.session is blocking and it only returns when the call is already answer...


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

signature.asc (858 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: lua session() is blocking...

Antonio Silva
hum...

just try without ignore_early_media=true... same behaviour...

then i tried with a minimum FS configuration and it work with and without ignore_early_media=true... so it's a different problem...

I'm trying to figure out... but thanks for the tip.


Regards,
António




On Mon, 2013-09-30 at 07:48 -0500, Brian West wrote:
You told it to do exactly that when you said ignore_early_media=true

--
Brian West
[hidden email]
FreeSWITCH Solutions, LLC
PO BOX PO BOX 2531
Brookfield, WI 53008-2531
Twitter: @FreeSWITCH_Wire , @briankwest
http://www.freeswitchbook.com
http://www.freeswitchcookbook.com

T: +1.918.420.9001  |  F: +1.918.420.9002  |  M: +1.918.424.WEST
iNUM: +883 5100 1420 9001
ISN: 410*543
Skype:briankwest
PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED)











On Sep 30, 2013, at 7:31 AM, Antonio Silva <[hidden email]> wrote:

> The problem is that the freswitch.session is blocking and it only returns when the call is already answer...

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: lua session() is blocking...

Antonio Silva
I found it..

it's always blocking if no media is received... in this case the destination reply with a SIP/180 and the session is waiting for media to continue in the script...

I put a pastebin where you can see the output and the lua script, http://pastebin.freeswitch.org/21474

(in my minimum configuration i had the action answer before doing the bridge... my bad...)


Regards,
António

On Mon, 2013-09-30 at 16:14 +0200, Antonio Silva wrote:
hum...

just try without ignore_early_media=true... same behaviour...

then i tried with a minimum FS configuration and it work with and without ignore_early_media=true... so it's a different problem...

I'm trying to figure out... but thanks for the tip.


Regards,
António




On Mon, 2013-09-30 at 07:48 -0500, Brian West wrote:
You told it to do exactly that when you said ignore_early_media=true

--
Brian West
[hidden email]
FreeSWITCH Solutions, LLC
PO BOX PO BOX 2531
Brookfield, WI 53008-2531
Twitter: @FreeSWITCH_Wire , @briankwest
http://www.freeswitchbook.com
http://www.freeswitchcookbook.com

T: +1.918.420.9001  |  F: +1.918.420.9002  |  M: +1.918.424.WEST
iNUM: +883 5100 1420 9001
ISN: 410*543
Skype:briankwest
PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED)











On Sep 30, 2013, at 7:31 AM, Antonio Silva <[hidden email]> wrote:

> The problem is that the freswitch.session is blocking and it only returns when the call is already answer...

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: lua session() is blocking...

Peter Olsson-3
Yes, this is expected, that's that way it works.

/Peter


2013/9/30 Antonio Silva <[hidden email]>
I found it..

it's always blocking if no media is received... in this case the destination reply with a SIP/180 and the session is waiting for media to continue in the script...

I put a pastebin where you can see the output and the lua script, http://pastebin.freeswitch.org/21474

(in my minimum configuration i had the action answer before doing the bridge... my bad...)


Regards,
António

On Mon, 2013-09-30 at 16:14 +0200, Antonio Silva wrote:
hum...

just try without ignore_early_media=true... same behaviour...

then i tried with a minimum FS configuration and it work with and without ignore_early_media=true... so it's a different problem...

I'm trying to figure out... but thanks for the tip.


Regards,
António




On Mon, 2013-09-30 at 07:48 -0500, Brian West wrote:
You told it to do exactly that when you said ignore_early_media=true

--
Brian West
[hidden email]
FreeSWITCH Solutions, LLC
PO BOX PO BOX 2531
Brookfield, WI 53008-2531
Twitter: @FreeSWITCH_Wire , @briankwest
http://www.freeswitchbook.com
http://www.freeswitchcookbook.com

T: <a href="tel:%2B1.918.420.9001" value="+19184209001" target="_blank">+1.918.420.9001  |  F: <a href="tel:%2B1.918.420.9002" value="+19184209002" target="_blank">+1.918.420.9002  |  M: +1.918.424.WEST
iNUM: <a href="tel:%2B883%205100%201420%209001" value="+883510014209001" target="_blank">+883 5100 1420 9001
ISN: 410*543
Skype:briankwest
PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED)











On Sep 30, 2013, at 7:31 AM, Antonio Silva <[hidden email]> wrote:

> The problem is that the freswitch.session is blocking and it only returns when the call is already answer...

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Reply | Threaded
Open this post in threaded view
|

Re: lua session() is blocking...

Antonio Silva
Ok...

so the only way to trigger a second call from the ringing state is doing it with events... or is there another way?


On Tue, 2013-10-01 at 08:38 +0200, Peter Olsson wrote:
Yes, this is expected, that's that way it works.


/Peter


2013/9/30 Antonio Silva <[hidden email]>
I found it..

it's always blocking if no media is received... in this case the destination reply with a SIP/180 and the session is waiting for media to continue in the script...

I put a pastebin where you can see the output and the lua script, http://pastebin.freeswitch.org/21474

(in my minimum configuration i had the action answer before doing the bridge... my bad...)


Regards,
António

On Mon, 2013-09-30 at 16:14 +0200, Antonio Silva wrote:
hum...

just try without ignore_early_media=true... same behaviour...

then i tried with a minimum FS configuration and it work with and without ignore_early_media=true... so it's a different problem...

I'm trying to figure out... but thanks for the tip.


Regards,
António




On Mon, 2013-09-30 at 07:48 -0500, Brian West wrote:
You told it to do exactly that when you said ignore_early_media=true

--
Brian West
[hidden email]
FreeSWITCH Solutions, LLC
PO BOX PO BOX 2531
Brookfield, WI 53008-2531
Twitter: @FreeSWITCH_Wire , @briankwest
http://www.freeswitchbook.com
http://www.freeswitchcookbook.com

T: <A HREF="tel:%2B1.918.420.9001">+1.918.420.9001  |  F: <A HREF="tel:%2B1.918.420.9002">+1.918.420.9002  |  M: +1.918.424.WEST
iNUM: <A HREF="tel:%2B883%205100%201420%209001">+883 5100 1420 9001
ISN: 410*543
Skype:briankwest
PGP Key: http://www.bkw.org/key.txt (AB93356707C76CED)











On Sep 30, 2013, at 7:31 AM, Antonio Silva <[hidden email]> wrote:

> The problem is that the freswitch.session is blocking and it only returns when the call is already answer...

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
[hidden email]
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
[hidden email]
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org