Originate call into conference - no early media
Hi, I'm using the following dialplan snippet to call new parties into a conference (see : http://wiki.freeswitch.org/wiki/Conference_Add_Call_Example): <condition field="destination_number" expression="^ADD_CALL_TO_CONF__(1\d{3}|11\d{4})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid}}user/$1 &conference(${conference_name})}"/> </condition> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__(2\d{2})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid}}sofia/gateway/om.net/$1 &conference(${conference_name})}"/> </condition> The page referenced implies I should get early media when I call someone into the conference, but when I try (either for local endpoints or those on a remote server via a gateway) I don't hear any ringing. I do if I call via a PSTN gateway. Any ideas? Cheers Alex -- This message is intended only for the addressee and may contain confidential information. Unless you are that person, you may not disclose its contents or use it in any way and are requested to delete the message along with any attachments and notify us immediately. "Transact" is operated by Integrated Financial Arrangements plc Domain House, 5-7 Singer Street, London EC2A 4BQ Tel: (020) 7608 4900 Fax: (020) 7608 5300 (Registered office: as above; Registered in England and Wales under number: 3727592) Authorised and regulated by the Financial Services Authority (entered on the FSA Register; number: 190856)
You only get it when you actually are being sent early media. Probably the ones that dont have any sound are only sending 180 so there is nothing you can do about it. On Wed, Apr 18, 2012 at 1:22 PM, Alex Crow <acrow@integrafin.co.uk> wrote:
Hi,
I'm using the following dialplan snippet to call new parties into a conference (see : http://wiki.freeswitch.org/wiki/Conference_Add_Call_Example):
<condition field="destination_number" expression="^ADD_CALL_TO_CONF__(1\d{3}|11\d{4})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid}}user/$1 &conference(${conference_name})}"/> </condition>
<condition field="destination_number" expression="^ADD_CALL_TO_CONF__(2\d{2})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid}}sofia/gateway/om.net/$1 &conference(${conference_name})}"/> </condition>
The page referenced implies I should get early media when I call someone into the conference, but when I try (either for local endpoints or those on a remote server via a gateway) I don't hear any ringing. I do if I call via a PSTN gateway.
Any ideas?
Cheers
Alex
-- This message is intended only for the addressee and may contain confidential information. Unless you are that person, you may not disclose its contents or use it in any way and are requested to delete the message along with any attachments and notify us immediately.
"Transact" is operated by Integrated Financial Arrangements plc Domain House, 5-7 Singer Street, London EC2A 4BQ Tel: (020) 7608 4900 Fax: (020) 7608 5300 (Registered office: as above; Registered in England and Wales under number: 3727592) Authorised and regulated by the Financial Services Authority (entered on the FSA Register; number: 190856)
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org 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 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
On 20/04/12 01:37, Anthony Minessale wrote:
You only get it when you actually are being sent early media. Probably the ones that dont have any sound are only sending 180 so there is nothing you can do about it.
Anthony, Thanks - would this only be "unfixable" for internal phones, as I'm sure I could change at least my other freeswitch boxes I am gatewaying to to send early media? Cheers Alex
On 20/04/12 09:07, Alex Crow wrote:
On 20/04/12 01:37, Anthony Minessale wrote:
You only get it when you actually are being sent early media. Probably the ones that dont have any sound are only sending 180 so there is nothing you can do about it.
Anthony,
Thanks - would this only be "unfixable" for internal phones, as I'm sure I could change at least my other freeswitch boxes I am gatewaying to to send early media?
Cheers
Alex
Anthony, I've managed to fix this for calling out to my FS gateways by correcting a mistake on their Local_Extensions (ring_ready=${uk-ring}, should have been ringback=${uk-ring}) However I am suprised there is no way to fake ringback for a conference dialout to endpoints that only reply with 180. Is there no workaround for this? I've tried using the conference dial api command and I get the same result. Cheers Alex
On 20/04/12 01:37, Anthony Minessale wrote:
You only get it when you actually are being sent early media. Probably the ones that dont have any sound are only sending 180 so there is nothing you can do about it.
Anthony, Thanks, I figured out how to fake ringback for endpoints that only send 180: <condition field="destination_number" expression="^ADD_CALL_TO_CONF__(1\d{3}|11\d{4})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="set" data="pb_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${pb_uuid}}loopback/*9181 &conference(${conference_name})}"/> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid},api_on_answer='uuid_kill ${pb_uuid}'}user/$1 &conference(${conference_name})}"/> </condition> where *9181 is an extension that does a 183 with ringback of ${uk-ring}. Do I really need the inline=true on setting pb_uuid by the way? The reason I didn't do the whole thing using loopback is that even when the parties called into the conference support wideband codecs (eg G722), the loopback always uses L16/8000, and so the audio is squeezed through a 4khz B/W channel even if the phones involved are using wideband codecs. If I originate into the conference I don't have that issue, I get HD audio all the way. Is that expected or is there a way around it? eg: <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid}}loopback/$1/default &conference(${conference_name})}"/> Produces PSTN quality audio on dialed-in parties even though they negotiated G722. Many thanks for your help Alex
If you originate loopback channels in that manner it chooses raw PCM (L16) because it has no idea what other codec to use. You want to avoid loopback unless its absolutely necessary since it adds extra resource consumption dynamically allocating the audio for each frame. I suggest you study the books we have (not a plug, just that's where its best documented) To get the full descriptions of how the dialplan and codec stuff works. It's very complicated and hard to describe in a simple reply. On Sat, Apr 21, 2012 at 1:10 PM, Alex Crow <acrow@integrafin.co.uk> wrote:
On 20/04/12 01:37, Anthony Minessale wrote:
You only get it when you actually are being sent early media. Probably the ones that dont have any sound are only sending 180 so there is nothing you can do about it.
Anthony,
Thanks, I figured out how to fake ringback for endpoints that only send 180:
<condition field="destination_number" expression="^ADD_CALL_TO_CONF__(1\d{3}|11\d{4})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="set" data="pb_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${pb_uuid}}loopback/*9181 &conference(${conference_name})}"/> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid},api_on_answer='uuid_kill ${pb_uuid}'}user/$1 &conference(${conference_name})}"/> </condition>
where *9181 is an extension that does a 183 with ringback of ${uk-ring}.
Do I really need the inline=true on setting pb_uuid by the way?
The reason I didn't do the whole thing using loopback is that even when the parties called into the conference support wideband codecs (eg G722), the loopback always uses L16/8000, and so the audio is squeezed through a 4khz B/W channel even if the phones involved are using wideband codecs. If I originate into the conference I don't have that issue, I get HD audio all the way. Is that expected or is there a way around it?
eg:
<action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid}}loopback/$1/default &conference(${conference_name})}"/>
Produces PSTN quality audio on dialed-in parties even though they negotiated G722.
Many thanks for your help
Alex
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org 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 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
On 23/04/12 16:09, Anthony Minessale wrote:
If you originate loopback channels in that manner it chooses raw PCM (L16) because it has no idea what other codec to use. You want to avoid loopback unless its absolutely necessary since it adds extra resource consumption dynamically allocating the audio for each frame.
I suggest you study the books we have (not a plug, just that's where its best documented) To get the full descriptions of how the dialplan and codec stuff works. It's very complicated and hard to describe in a simple reply.
Thanks Anthony, I do have the FreeSwitch book and just got the cookbook. However I'd not come across any docs stating that loopback defaults to L16/8000 so far, so perhaps I should reread them. Is there any reason why loopback can't use L16/16000 or higher so HD codecs can be of advantage? Just curious as my new dialplan seems to have solved the problem. For anyone else that is interested I have pasted it below (it is slightly adapted from the example): <extension name="confringback"> <condition field="destination_number" expression="^confringback$"> <action application="set" data="ringback=$${uk-ring}"/> <action application="bridge" data="{ignore_early_media=true}loopback/confringback_media"/> </condition> </extension> <extension name="confringback_media"> <condition field="destination_number" expression="^confringback_media$"> <action application="pre_answer"/> <action application="sleep" data="200000"/> <action application="hangup"/> </condition> </extension> <extension name="Add new OB call to conference"> <condition field="destination_number" expression="^add_a_call$"> <!-- ask caller for a number + #, collect into ${target_num} variable --> <action application="play_and_get_digits" data="3 13 4 5000 # file_string://ivr/ivr-please_enter_the_phone_number.wav!ivr/ivr-followed_by_pound.wav ivr/ivr-that_was_an_invalid_entry.wav target_num \d+"/> <!-- add this call to the conference --> <action application="execute_extension" data="ADD_CALL_TO_CONF__${target_num}"/> </condition> </extension> <extension name="Remove last OB call added to conference"> <condition field="destination_number" expression="^remove_a_call$"> <!-- remove a call from the conference --> <action application="play_and_get_digits" data="3 13 1 5000 # file_string://ivr/ivr-please_enter_the_phone_number.wav!ivr/ivr-followed_by_pound.wav ivr/ivr-that_was_an_invalid_entry.wav target_num \d+"/> <action application="set" data="res=${uuid_kill ${hash(select/domain-${domain_name}/last_user_${target_num})}}"/> <action application="set" data="res=${uuid_kill ${hash(select/domain-${domain_name}/last_user_ring_${target_num})}}"/> </condition> </extension> <extension name="add that call"> <!-- if we have a four-digit number then attempt to dial it as a user ... --> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__(2\d{2})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="set" data="pb_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="hash" data="insert/domain-${domain_name}/last_user_ring_$1/${pb_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${pb_uuid}}loopback/confringback &conference(${conference_name})}"/> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid}}sofia/gateway/om.net/$1 &conference(${conference_name})}"/> </condition> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__(6\d{2})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid}}sofia/gateway/192.168.44.43/$1 &conference(${conference_name})}"/> </condition> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__(49\d\d|5[3-4]\d\d|74\d\d|8\d{3}|0|9\d{3,13}|0\d{10,12})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="set" data="pb_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="hash" data="insert/domain-${domain_name}/last_user_ring_$1/${pb_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${pb_uuid}}loopback/*9181 &conference(${conference_name})}"/> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid},api_on_answer='uuid_kill ${pb_uuid}'}sofia/gateway/10.10.0.2/$1 &conference(${conference_name})}"/> </condition> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__(3\d{2})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid}}sofia/gateway/192.168.44.15/$1 &conference(${conference_name})}"/> </condition> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__(1\d{3}|11\d{4})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="set" data="pb_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="hash" data="insert/domain-${domain_name}/last_user_ring_$1/${pb_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${pb_uuid}}loopback/confringback &conference(${conference_name})}"/> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid},api_on_answer='uuid_kill ${pb_uuid}'}user/$1 &conference(${conference_name})}"/> </condition> <!-- ... otherwise inform moderator that the operation was not exactly successful --> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__$"> <action application="playback" data="ivr/ivr-please_try_again.wav"/> </condition> </extension> So for 3 destinations (1st local extensions at 1xxx or 11xxxx, 2nd 350-399 and 3rd 600-649) we don't need to fake it, for the other 2 gateways we do. Seems to work pretty well for now. Would it be worth getting Wiki write access to add that to the article about joining members by calling out from a conference? Cheers Alex
You should definitely help on the wiki. It's always worth it. I did not mean that the book would teach you about L16 on loopback but codecs and setting up calls. Since you said you cannot understand why there is no early media in your conference I thought you might benefit but studying the nuances of call origination. As for loopback, if its important enough to you to get that ring sound, its really the only choice you have. I check and it's easy enough to add a patch to let you specify the initial codec so try out git HEAD and use the new variable loopback_initial_codec you can specify it in the originate string like originate {loopback_initial_codec=L16@16000h}loopback/1234 4321 Transcoding fees may apply. On Mon, Apr 23, 2012 at 12:29 PM, Alex Crow <acrow@integrafin.co.uk> wrote:
On 23/04/12 16:09, Anthony Minessale wrote:
If you originate loopback channels in that manner it chooses raw PCM (L16) because it has no idea what other codec to use. You want to avoid loopback unless its absolutely necessary since it adds extra resource consumption dynamically allocating the audio for each frame.
I suggest you study the books we have (not a plug, just that's where its best documented) To get the full descriptions of how the dialplan and codec stuff works. It's very complicated and hard to describe in a simple reply.
Thanks Anthony,
I do have the FreeSwitch book and just got the cookbook. However I'd not come across any docs stating that loopback defaults to L16/8000 so far, so perhaps I should reread them.
Is there any reason why loopback can't use L16/16000 or higher so HD codecs can be of advantage? Just curious as my new dialplan seems to have solved the problem. For anyone else that is interested I have pasted it below (it is slightly adapted from the example):
<extension name="confringback"> <condition field="destination_number" expression="^confringback$"> <action application="set" data="ringback=$${uk-ring}"/> <action application="bridge" data="{ignore_early_media=true}loopback/confringback_media"/> </condition> </extension>
<extension name="confringback_media"> <condition field="destination_number" expression="^confringback_media$"> <action application="pre_answer"/> <action application="sleep" data="200000"/> <action application="hangup"/> </condition> </extension>
<extension name="Add new OB call to conference"> <condition field="destination_number" expression="^add_a_call$"> <!-- ask caller for a number + #, collect into ${target_num} variable --> <action application="play_and_get_digits" data="3 13 4 5000 # file_string://ivr/ivr-please_enter_the_phone_number.wav!ivr/ivr-followed_by_pound.wav ivr/ivr-that_was_an_invalid_entry.wav target_num \d+"/> <!-- add this call to the conference --> <action application="execute_extension" data="ADD_CALL_TO_CONF__${target_num}"/> </condition> </extension>
<extension name="Remove last OB call added to conference"> <condition field="destination_number" expression="^remove_a_call$"> <!-- remove a call from the conference --> <action application="play_and_get_digits" data="3 13 1 5000 # file_string://ivr/ivr-please_enter_the_phone_number.wav!ivr/ivr-followed_by_pound.wav ivr/ivr-that_was_an_invalid_entry.wav target_num \d+"/> <action application="set" data="res=${uuid_kill ${hash(select/domain-${domain_name}/last_user_${target_num})}}"/> <action application="set" data="res=${uuid_kill ${hash(select/domain-${domain_name}/last_user_ring_${target_num})}}"/> </condition> </extension>
<extension name="add that call"> <!-- if we have a four-digit number then attempt to dial it as a user ... --> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__(2\d{2})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="set" data="pb_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="hash" data="insert/domain-${domain_name}/last_user_ring_$1/${pb_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${pb_uuid}}loopback/confringback &conference(${conference_name})}"/> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid}}sofia/gateway/om.net/$1 &conference(${conference_name})}"/> </condition> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__(6\d{2})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid}}sofia/gateway/192.168.44.43/$1 &conference(${conference_name})}"/> </condition> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__(49\d\d|5[3-4]\d\d|74\d\d|8\d{3}|0|9\d{3,13}|0\d{10,12})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="set" data="pb_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="hash" data="insert/domain-${domain_name}/last_user_ring_$1/${pb_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${pb_uuid}}loopback/*9181 &conference(${conference_name})}"/> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid},api_on_answer='uuid_kill ${pb_uuid}'}sofia/gateway/10.10.0.2/$1 &conference(${conference_name})}"/> </condition> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__(3\d{2})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid}}sofia/gateway/192.168.44.15/$1 &conference(${conference_name})}"/> </condition> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__(1\d{3}|11\d{4})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="set" data="pb_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="hash" data="insert/domain-${domain_name}/last_user_ring_$1/${pb_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${pb_uuid}}loopback/confringback &conference(${conference_name})}"/> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid},api_on_answer='uuid_kill ${pb_uuid}'}user/$1 &conference(${conference_name})}"/> </condition> <!-- ... otherwise inform moderator that the operation was not exactly successful --> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__$"> <action application="playback" data="ivr/ivr-please_try_again.wav"/> </condition> </extension>
So for 3 destinations (1st local extensions at 1xxx or 11xxxx, 2nd 350-399 and 3rd 600-649) we don't need to fake it, for the other 2 gateways we do.
Seems to work pretty well for now. Would it be worth getting Wiki write access to add that to the article about joining members by calling out from a conference?
Cheers
Alex
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org 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 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
Excellent description and cool new chan var. Alex, this is definitely something you should put on the wiki. If you need any help please let me know. Don't forget that we have a template that you can use to add a channel variable: http://wiki.freeswitch.org/wiki/Variable_skeleton The rest of the documentation can go in http://wiki.freeswitch.org/wiki/Mod_loopback. For bonus points you can use the wiki {{:foo}} syntax to include the channel variable docs in the mod_loopback page w/o actually duplicating your work. See the main channel variables page for examples on how to do that. -MC On Mon, Apr 23, 2012 at 12:21 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
You should definitely help on the wiki. It's always worth it.
I did not mean that the book would teach you about L16 on loopback but codecs and setting up calls. Since you said you cannot understand why there is no early media in your conference I thought you might benefit but studying the nuances of call origination.
As for loopback, if its important enough to you to get that ring sound, its really the only choice you have. I check and it's easy enough to add a patch to let you specify the initial codec so try out git HEAD and use the new variable loopback_initial_codec you can specify it in the originate string like
originate {loopback_initial_codec=L16@16000h}loopback/1234 4321
Transcoding fees may apply.
On Mon, Apr 23, 2012 at 12:29 PM, Alex Crow <acrow@integrafin.co.uk> wrote:
On 23/04/12 16:09, Anthony Minessale wrote:
If you originate loopback channels in that manner it chooses raw PCM (L16) because it has no idea what other codec to use. You want to avoid loopback unless its absolutely necessary since it adds extra resource consumption dynamically allocating the audio for each frame.
I suggest you study the books we have (not a plug, just that's where its best documented) To get the full descriptions of how the dialplan and codec stuff works. It's very complicated and hard to describe in a simple reply.
Thanks Anthony,
I do have the FreeSwitch book and just got the cookbook. However I'd not come across any docs stating that loopback defaults to L16/8000 so far, so perhaps I should reread them.
Is there any reason why loopback can't use L16/16000 or higher so HD codecs can be of advantage? Just curious as my new dialplan seems to have solved the problem. For anyone else that is interested I have pasted it below (it is slightly adapted from the example):
<extension name="confringback"> <condition field="destination_number" expression="^confringback$"> <action application="set" data="ringback=$${uk-ring}"/> <action application="bridge" data="{ignore_early_media=true}loopback/confringback_media"/> </condition> </extension>
<extension name="confringback_media"> <condition field="destination_number" expression="^confringback_media$"> <action application="pre_answer"/> <action application="sleep" data="200000"/> <action application="hangup"/> </condition> </extension>
<extension name="Add new OB call to conference"> <condition field="destination_number" expression="^add_a_call$"> <!-- ask caller for a number + #, collect into ${target_num} variable --> <action application="play_and_get_digits" data="3 13 4 5000 #
file_string://ivr/ivr-please_enter_the_phone_number.wav!ivr/ivr-followed_by_pound.wav
ivr/ivr-that_was_an_invalid_entry.wav target_num \d+"/> <!-- add this call to the conference --> <action application="execute_extension" data="ADD_CALL_TO_CONF__${target_num}"/> </condition> </extension>
<extension name="Remove last OB call added to conference"> <condition field="destination_number" expression="^remove_a_call$"> <!-- remove a call from the conference --> <action application="play_and_get_digits" data="3 13 1 5000 #
file_string://ivr/ivr-please_enter_the_phone_number.wav!ivr/ivr-followed_by_pound.wav
ivr/ivr-that_was_an_invalid_entry.wav target_num \d+"/> <action application="set" data="res=${uuid_kill ${hash(select/domain-${domain_name}/last_user_${target_num})}}"/> <action application="set" data="res=${uuid_kill ${hash(select/domain-${domain_name}/last_user_ring_${target_num})}}"/> </condition> </extension>
<extension name="add that call"> <!-- if we have a four-digit number then attempt to dial it as a user ... --> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__(2\d{2})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="set" data="pb_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="hash" data="insert/domain-${domain_name}/last_user_ring_$1/${pb_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${pb_uuid}}loopback/confringback &conference(${conference_name})}"/> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid}}sofia/gateway/om.net/$1 &conference(${conference_name})}"/> </condition> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__(6\d{2})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid}}sofia/gateway/192.168.44.43/$1 &conference(${conference_name})}"/> </condition> <condition field="destination_number"
expression="^ADD_CALL_TO_CONF__(49\d\d|5[3-4]\d\d|74\d\d|8\d{3}|0|9\d{3,13}|0\d{10,12})$"
break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="set" data="pb_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="hash" data="insert/domain-${domain_name}/last_user_ring_$1/${pb_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${pb_uuid}}loopback/*9181 &conference(${conference_name})}"/> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid},api_on_answer='uuid_kill ${pb_uuid}'}sofia/gateway/10.10.0.2/$1&conference(${conference_name})}"/> </condition> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__(3\d{2})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid}}sofia/gateway/192.168.44.15/$1 &conference(${conference_name})}"/> </condition> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__(1\d{3}|11\d{4})$" break="on-true"> <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> <action application="set" data="pb_uuid=${create_uuid foo}" inline="true"/> <action application="hash" data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> <action application="hash" data="insert/domain-${domain_name}/last_user_ring_$1/${pb_uuid}" /> <action application="set" data="res=${bgapi originate {origination_uuid=${pb_uuid}}loopback/confringback &conference(${conference_name})}"/> <action application="set" data="res=${bgapi originate {origination_uuid=${new_uuid},api_on_answer='uuid_kill ${pb_uuid}'}user/$1 &conference(${conference_name})}"/> </condition> <!-- ... otherwise inform moderator that the operation was not exactly successful --> <condition field="destination_number" expression="^ADD_CALL_TO_CONF__$"> <action application="playback" data="ivr/ivr-please_try_again.wav"/> </condition> </extension>
So for 3 destinations (1st local extensions at 1xxx or 11xxxx, 2nd 350-399 and 3rd 600-649) we don't need to fake it, for the other 2 gateways we do.
Seems to work pretty well for now. Would it be worth getting Wiki write access to add that to the article about joining members by calling out from a conference?
Cheers
Alex
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org 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 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
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org 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 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
Michael, Anthony, Cheers guys. Really great help and also stunned with the new var! I will probably c/o head this weekend to try it out. I'm not that great on wikis (I've installed and set up MediaWiki for others but only ever added a couple of pages to it) but I will try to make a start on at least updating the conference callout example page. Cheers Alex On 23/04/12 20:29, Michael Collins wrote:
Excellent description and cool new chan var.
Alex, this is definitely something you should put on the wiki. If you need any help please let me know. Don't forget that we have a template that you can use to add a channel variable:
http://wiki.freeswitch.org/wiki/Variable_skeleton
The rest of the documentation can go in http://wiki.freeswitch.org/wiki/Mod_loopback. For bonus points you can use the wiki {{:foo}} syntax to include the channel variable docs in the mod_loopback page w/o actually duplicating your work. See the main channel variables page for examples on how to do that.
-MC
On Mon, Apr 23, 2012 at 12:21 PM, Anthony Minessale <anthony.minessale@gmail.com <mailto:anthony.minessale@gmail.com>> wrote:
You should definitely help on the wiki. It's always worth it.
I did not mean that the book would teach you about L16 on loopback but codecs and setting up calls. Since you said you cannot understand why there is no early media in your conference I thought you might benefit but studying the nuances of call origination.
As for loopback, if its important enough to you to get that ring sound, its really the only choice you have. I check and it's easy enough to add a patch to let you specify the initial codec so try out git HEAD and use the new variable loopback_initial_codec you can specify it in the originate string like
originate {loopback_initial_codec=L16@16000h}loopback/1234 4321
Transcoding fees may apply.
On Mon, Apr 23, 2012 at 12:29 PM, Alex Crow <acrow@integrafin.co.uk <mailto:acrow@integrafin.co.uk>> wrote: > On 23/04/12 16:09, Anthony Minessale wrote: >> If you originate loopback channels in that manner it chooses raw PCM >> (L16) because it has no idea what other codec to use. >> You want to avoid loopback unless its absolutely necessary since it >> adds extra resource consumption dynamically allocating the audio for >> each frame. >> >> I suggest you study the books we have (not a plug, just that's where >> its best documented) To get the full descriptions of how the dialplan >> and codec stuff works. It's very complicated and hard to describe in >> a simple reply. > > > Thanks Anthony, > > I do have the FreeSwitch book and just got the cookbook. However I'd not > come across any docs stating that loopback defaults to L16/8000 so far, > so perhaps I should reread them. > > Is there any reason why loopback can't use L16/16000 or higher so HD > codecs can be of advantage? Just curious as my new dialplan seems to > have solved the problem. For anyone else that is interested I have > pasted it below (it is slightly adapted from the example): > > <extension name="confringback"> > <condition field="destination_number" expression="^confringback$"> > <action application="set" data="ringback=$${uk-ring}"/> > <action application="bridge" > data="{ignore_early_media=true}loopback/confringback_media"/> > </condition> > </extension> > > <extension name="confringback_media"> > <condition field="destination_number" expression="^confringback_media$"> > <action application="pre_answer"/> > <action application="sleep" data="200000"/> > <action application="hangup"/> > </condition> > </extension> > > <extension name="Add new OB call to conference"> > <condition field="destination_number" expression="^add_a_call$"> > <!-- ask caller for a number + #, collect into ${target_num} variable --> > <action application="play_and_get_digits" data="3 13 4 5000 # > file_string://ivr/ivr-please_enter_the_phone_number.wav!ivr/ivr-followed_by_pound.wav > ivr/ivr-that_was_an_invalid_entry.wav target_num \d+"/> > <!-- add this call to the conference --> > <action application="execute_extension" > data="ADD_CALL_TO_CONF__${target_num}"/> > </condition> > </extension> > > <extension name="Remove last OB call added to conference"> > <condition field="destination_number" expression="^remove_a_call$"> > <!-- remove a call from the conference --> > <action application="play_and_get_digits" data="3 13 1 5000 # > file_string://ivr/ivr-please_enter_the_phone_number.wav!ivr/ivr-followed_by_pound.wav > ivr/ivr-that_was_an_invalid_entry.wav target_num \d+"/> > <action application="set" data="res=${uuid_kill > ${hash(select/domain-${domain_name}/last_user_${target_num})}}"/> > <action application="set" data="res=${uuid_kill > ${hash(select/domain-${domain_name}/last_user_ring_${target_num})}}"/> > </condition> > </extension> > > <extension name="add that call"> > <!-- if we have a four-digit number then attempt to dial it as a user > ... --> > <condition field="destination_number" > expression="^ADD_CALL_TO_CONF__(2\d{2})$" break="on-true"> > <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> > <action application="set" data="pb_uuid=${create_uuid foo}" inline="true"/> > <action application="hash" > data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> > <action application="hash" > data="insert/domain-${domain_name}/last_user_ring_$1/${pb_uuid}" /> > <action application="set" data="res=${bgapi originate > {origination_uuid=${pb_uuid}}loopback/confringback > &conference(${conference_name})}"/> > <action application="set" data="res=${bgapi originate > {origination_uuid=${new_uuid}}sofia/gateway/om.net/$1 <http://om.net/$1> > &conference(${conference_name})}"/> > </condition> > <condition field="destination_number" > expression="^ADD_CALL_TO_CONF__(6\d{2})$" break="on-true"> > <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> > <action application="hash" > data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> > <action application="set" data="res=${bgapi originate > {origination_uuid=${new_uuid}}sofia/gateway/*MailScanner warning: numerical links are often malicious:* 192.168.44.43/$1 <http://192.168.44.43/$1> > &conference(${conference_name})}"/> > </condition> > <condition field="destination_number" > expression="^ADD_CALL_TO_CONF__(49\d\d|5[3-4]\d\d|74\d\d|8\d{3}|0|9\d{3,13}|0\d{10,12})$" > break="on-true"> > <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> > <action application="set" data="pb_uuid=${create_uuid foo}" inline="true"/> > <action application="hash" > data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> > <action application="hash" > data="insert/domain-${domain_name}/last_user_ring_$1/${pb_uuid}" /> > <action application="set" data="res=${bgapi originate > {origination_uuid=${pb_uuid}}loopback/*9181 > &conference(${conference_name})}"/> > <action application="set" data="res=${bgapi originate > {origination_uuid=${new_uuid},api_on_answer='uuid_kill > ${pb_uuid}'}sofia/gateway/*MailScanner warning: numerical links are often malicious:* 10.10.0.2/$1 <http://10.10.0.2/$1> &conference(${conference_name})}"/> > </condition> > <condition field="destination_number" > expression="^ADD_CALL_TO_CONF__(3\d{2})$" break="on-true"> > <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> > <action application="hash" > data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> > <action application="set" data="res=${bgapi originate > {origination_uuid=${new_uuid}}sofia/gateway/*MailScanner warning: numerical links are often malicious:* 192.168.44.15/$1 <http://192.168.44.15/$1> > &conference(${conference_name})}"/> > </condition> > <condition field="destination_number" > expression="^ADD_CALL_TO_CONF__(1\d{3}|11\d{4})$" break="on-true"> > <action application="set" data="new_uuid=${create_uuid foo}" inline="true"/> > <action application="set" data="pb_uuid=${create_uuid foo}" inline="true"/> > <action application="hash" > data="insert/domain-${domain_name}/last_user_$1/${new_uuid}" /> > <action application="hash" > data="insert/domain-${domain_name}/last_user_ring_$1/${pb_uuid}" /> > <action application="set" data="res=${bgapi originate > {origination_uuid=${pb_uuid}}loopback/confringback > &conference(${conference_name})}"/> > <action application="set" data="res=${bgapi originate > {origination_uuid=${new_uuid},api_on_answer='uuid_kill > ${pb_uuid}'}user/$1 &conference(${conference_name})}"/> > </condition> > <!-- ... otherwise inform moderator that the operation was not exactly > successful --> > <condition field="destination_number" expression="^ADD_CALL_TO_CONF__$"> > <action application="playback" data="ivr/ivr-please_try_again.wav"/> > </condition> > </extension> > > > So for 3 destinations (1st local extensions at 1xxx or 11xxxx, 2nd > 350-399 and 3rd 600-649) we don't need to fake it, for the other 2 > gateways we do. > > Seems to work pretty well for now. Would it be worth getting Wiki write > access to add that to the article about joining members by calling out > from a conference? > > Cheers > > Alex > > _________________________________________________________________________ > Professional FreeSWITCH Consulting Services: > consulting@freeswitch.org <mailto:consulting@freeswitch.org> > 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 > FreeSWITCH-users@lists.freeswitch.org <mailto: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 <mailto:MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com <mailto:PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <mailto:sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900 <tel:%2B19193869900>
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> 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 FreeSWITCH-users@lists.freeswitch.org <mailto: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
-- This message has been scanned for viruses and dangerous content by *MailScanner* <http://www.mailscanner.info/>, and is believed to be clean.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org 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 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
-- This message is intended only for the addressee and may contain confidential information. Unless you are that person, you may not disclose its contents or use it in any way and are requested to delete the message along with any attachments and notify us immediately. "Transact" is operated by Integrated Financial Arrangements plc Domain House, 5-7 Singer Street, London EC2A 4BQ Tel: (020) 7608 4900 Fax: (020) 7608 5300 (Registered office: as above; Registered in England and Wales under number: 3727592) Authorised and regulated by the Financial Services Authority (entered on the FSA Register; number: 190856)
participants (3)
-
Alex Crow
-
Anthony Minessale
-
Michael Collins