Thanks,

actually there is an error in the freeswitch.Session method

The documentation is not complete

the correct syntax is

legB = freeswitch.Session("{ignore_early_media=true, hangup_after_bridge=true, origination_caller_id_number=1234}sofia/internal/0123456789@myserver, legA)

The last parameter is the legA session.

Using this syntax everything works fine.



Stefano Favaro
Sviluppo Servizi ed Applicazioni
_____________________



Edistar Srl

a socio unico soggetta a direzione e coordinamento di YourVoice SpA

Via Artigianato 1 – I – 31050 Vedelago (TV) Italy

Phone +39 0423 7331 – Fax +39 0423 733133


skype: stefanofavaro

www.edistar.com






Le informazioni trasmesse attraverso la presente e-mail ed i suoi allegati sono dirette esclusivamente al destinatario e devono ritenersi riservate con divieto di diffusione e di uso nei giudizi salva espressa autorizzazione; nel caso di utilizzo senza espressa autorizzazione, potrà essere effettuata denuncia alla competente Autorità. La diffusione e la comunicazione da parte di soggetto diverso dal destinatario è vietata dall’art. 616 e ss. c.p. e dal d. l.vo n. 196/03. Se la presente e-mail e i suoi allegati fossero stati ricevuti per errore da persona diversa dal destinatario preghiamo di distruggere quanto ricevuto e di rinviare al mittente con lo stesso mezzo. Grazie per la collaborazione.

This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.



Da: "Aviv Shaham" <aviv@ironsip.com>
A: freeswitch-users@lists.freeswitch.org
Inviato: Giovedì, 6 luglio 2017 15:48:19
Oggetto: Re: [Freeswitch-users] freeswitch.Session with LUA

Have you tried transfer_ringback?

https://wiki.freeswitch.org/wiki/Custom_Ring_Back_Tones#Transfer_Ringback


On Thu, Jul 6, 2017, at 03:11 AM, Stefano Favaro wrote:

Hello,

I'm writing a simple script with LUA to connect an inbound call to e new outbound call.
Everything work fine but I can't set the ringback tone nor a waiting music on the leg A and also the call_timeout variable.
The legA is in silence while the legB is ringing and the call_timeout is always the default 60 seconds.
What is wrong with this code?

Thanks 

This is the code:
...
legA:streamFile("/usr/share/freeswitch/sounds/wait.wav")

legA:setVariable("ringback", "$${uk-ring}")
legA:setVariable("call_timeout", 30)

legB = freeswitch.Session("{ignore_early_media=true, hangup_after_bridge=true, origination_caller_id_number=1234}sofia/internal/0123456789@myserver)

if legB:ready() then
freeswitch.bridge(legA, legB)
end



Stefano Favaro
Sviluppo Servizi ed Applicazioni
_____________________




_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com

Official FreeSWITCH Sites
http://www.freeswitch.org
http://confluence.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