&app(arg) removes the requirement for "inline"

inline is a special dialplan that uses a list of apps as the extension input

I think I made a typo in my example

api originate <dialstring> conference:conf_uuid-TEST_CONF inline

the app args should be connected to the app name with a : char when using the inline dp

The 2 inputs to originate following the dialstring are

&app(args) OR <extension> <dialplan> <context>


so conference:foo inline is equiv to &conference(foo)




On Wed, Mar 10, 2010 at 4:38 PM, Gledhill, James <james.gledhill@sipstorm.com> wrote:

Thanks Anthony –

 

I got it to work with the following:

 

FS Version : 16852 and later 16963M

 

"api originate sofia/10.50.48.232/+{my_tn_here}@10.50.50.50:5060 &conference(conf_uuid-TEST_CON) inline"

 

If I used api originate <dialstring> conference conf_uuid-TEST_CONF inline then FS tried to make a conference of conf_uuid-TEST_CON@inline .. using &conference(conf_uuid-TEST_CON) inline fixed that

 

2010-03-10 17:03:36.463558 [NOTICE] switch_ivr.c:1447 Transfer sofia/internal/+{my_tn}@{my_gw} to conf_uuid-TEST_CON[conference@inline]

2010-03-10 17:03:36.465638 [DEBUG] switch_core_state_machine.c:133 No Dialplan, changing state to CONSUME_MEDIA

 

 

---------

 

For others that may look at this later, my test code to get “start-talking” and “stop-talking” events during Early Media using esl lua (freesiwtch_src/libs/esl/lua) is

 

 

#!/usr/local/bin/lua

require("ESL")

 

local con = ESL.ESLconnection("localhost", "8021", "ClueCon");

 

con:sendRecv("event plain ALL")

ob_session_string = string.format("originate sofia/internal/{MY_TN_NUMBER_HERE}@{MY_GATEWAY_HERE} &conference(conf_uuid-TEST_CON) inline")

 

ff = con:api( ob_session_string )

print("** sent api")

 

if ff then

    print(ff:getBody())

    print(ff: getHeader("result"))

else

    print("no body")

end

 

 

cnt = 0

while cnt <= 40 do

 

    print("loop = " .. cnt )

    cnt = cnt + 1

    ev = con:recvEventTimed(1000)

    print( ev and ev:serialize("plain") or "no event this time" )

 

end


From: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org] On Behalf Of Anthony Minessale
Sent: Wednesday, March 10, 2010 2:36 PM

Subject: Re: [Freeswitch-dev] error events for failed calls using'conferenceconf_name bgdial sofia/ip/user'

 

Some of your findings are incorrect.

The default behavior of originate is to return as soon as there is early media. (sip 183)
Adding ignore_early_media=true is the opposite effect so you do not want that.

bgapi just does the command in a separate thread so you don't want that either.

api originate <dialstring> conference conf_uuid-TEST_CONF inline
will put the call in the conference the very instant it sees a 183

If you see anything other than this, make sure you are on latest trunk and do a console trace demonstrating otherwise.

use these commands for more details.

console loglevel debug
sofia profile internal siptrace on


On Wed, Mar 10, 2010 at 1:29 PM, Gledhill, James <james.gledhill@sipstorm.com> wrote:

Anthony –

 

The problem with api originate <dialstring> conference conf_uuid-TEST_CONF inline is that it does not return until after the call is answered – so I do not have events during early media.  I did try to add {ignore_early_media=true} but it still did not return until after I answered the phone (using esl lua for this test)

 

I also tried "bgapi originate {ignore_early_media=true,origination_uuid=my_uuid_my_uuid_my_test_uuid}sofia/internal/+18015551212@10.50.40.50:5060 &conference(conf_uuid-TEST_CONF) inline”, (I used a different TN, but changed it for privacy) which makes the call and returns events before I answer the call, BUT the conf bridge does not get involved (called) until AFTER the origination call is answered.

 

Neither of these allows me to get “start-talking” and “stop-talking” events during Early Media from the conf bridge because the conference is not involved during the early media part of the call.

 

Brian –

 

I should have been more detailed in my sofia string in the subject.  I am aware that sofia/ip/user is not valid. Two examples sofia string I use are below.

* If I used sofia/10.50.48.222/1002 AND that user is registered and answers, then all works well.  If that user is not registered, I need to get USER_NOT_REGISTERED

* If I use sofia/internal/+18015@10.50.40.50 (which is not a valid E.164 TN) then I should get DESTINATION_OUT_OF_ORDER or some other error message.

 

 


From: freeswitch-dev-bounces@lists.freeswitch.org [mailto:freeswitch-dev-bounces@lists.freeswitch.org] On Behalf Of Anthony Minessale
Sent: Wednesday, March 10, 2010 12:16 PM
To: freeswitch-dev@lists.freeswitch.org
Subject: Re: [Freeswitch-dev] error events for failed calls using'conference conf_name bgdial sofia/ip/user'

 

consider

api originate <dialstring> conference
conf_uuid-TEST_CONF inline

this returns success+uuid or fail

On Wed, Mar 10, 2010 at 12:04 PM, Brian West <brian@freeswitch.org> wrote:

http://wiki.freeswitch.org/wiki/Dialplan_XML#SIP-Specific_Dialstrings  

 

Please read that there is no such thing as sofia/ip/user  (unless the ip is an alias on the profile)

 

/b

 

On Mar 10, 2010, at 11:23 AM, Gledhill, James wrote:

 

 

My goals are:

1)       To get “start-talking” and “stop-talking” events during Early Media (before the call is answered) as well as after the call is answered. 

2)       If there are problems with the call, get events that tell me why the call failed.

 

The way I am doing it accomplishes the start/stop talking (in early media) BUT if the call fails, I do not get events back letting me know it failed and why.  I DO get CHANNEL_DESTROY and CHANNEL_STATE events that IF I had the UUID, I could match against, but at this point in the call I do NOT have that UUID AND when setting the UUID via “origination_uuid=my_uuid_my_uuid_my_test_uuid”, my UUID has not yet been set, so as far as I can tell there is no way to match those events with details my application has at the time. 

 

The console shows the errors (Below are two examples of calls that failed in I entered “bad” sofia locations), but they do not come back as events.

2010-03-05 14:52:20.109497 [ERR] switch_ivr_originate.c:2389 Cannot create outgoing channel of type [sofia] cause: [USER_NOT_REGISTERED]

2010-03-05 16:34:13.669509 [ERR] switch_ivr_originate.c:2389 Cannot create outgoing channel of type [sofia] cause: [DESTINATION_OUT_OF_ORDER]

 

So … I am wondering is there a better/different way to do it, is there a work-around, should I get events to tell me the dial had problems, etc.

 

I am using esl/lua and esl/java to experiment with this.  Both get the same results (as I would expect).

 

I have had this as a ~take-a-number on IRC for about a week, so I thought I would add more detail and open it up to this group.  I realize many of the same people do both, but hoped more eyes may look at it here and give thoughts.

 

 

===== From Pastebin ====

 

I am not getting 'error' events in ESL [that match a UUID I can track] when there is a problem with conference <conf_name> dial sofia/myip/1006, so I can not tell what went wrong.  Is there a work-around? 

 

 I start a call in a conference from ESL (conference conf_uuid-TEST_CONF bgdial [origination_uuid=my_uuid_my_uuid_my_test_uuid]sofia/10.50.48.232/1006)

 

 If the 'dial' works (meaning does not get an error) then I get the events I want and expect.  If it errors (not able to make the call ( [USER_NOT_REGISTERED] | [DESTINATION_OUT_OF_ORDER] | etc. ) then I do not get any events that tell me something went wrong.

 

 Is there a work-around for this?

 

=====================

LUA Code  run from ./freeswitch.trunk/libs/esl/lua

 

#!/usr/local/bin/lua

require("ESL")

 

myip = "10.50.48.239"  -- change this to your IP address

myExt = 1006  -- change to one that is registered, then rerun with an unregistered

 

con = ESL.ESLconnection("localhost", "8021", "ClueCon");

 

str = string.format("conference conf_uuid-TEST_CONF bgdial [origination_uuid=my_uuid_my_uuid_my_test_uuid]sofia/%s/%s", myip, myExt)

 

con:sendRecv("event plain ALL")

 

 

ff = con:api( str )

 

print("** sent " .. str )

 

print( (ff and ff:getBody() or "no body" ))

 

cnt = 0

while cnt <= 30 do

 

    print("loop = " .. cnt )

    cnt = cnt + 1

    ev = con:recvEventTimed(1000)

    print( ev and ev:serialize("plain") or "no event this time" )

 

end

 

==============

 

The printout is :

 

** sent conference conf_uuid-TEST_CONF bgdial [origination_uuid=my_uuid_my_uuid_my_test_uuid]sofia/10.50.48.239/1006

OK Job-UUID: a5d57b34-9205-483c-ae64-60601d8178d7

 

loop = 0

Event-Name: CHANNEL_DESTROY

Core-UUID: 438a66f9-8e41-4c6a-bbfd-1b0e8527cec1

FreeSWITCH-Hostname: tpa-es-rh-232.dev.sipstorm.com

FreeSWITCH-IPv4: 10.50.48.232

FreeSWITCH-IPv6: %3A%3A1

Event-Date-Local: 2010-03-05%2017%3A06%3A52

Event-Date-GMT: Fri,%2005%20Mar%202010%2022%3A06%3A52%20GMT

Event-Date-Timestamp: 1267826812571550

Event-Calling-File: switch_core_session.c

Event-Calling-Function: switch_core_session_perform_destroy

Event-Calling-Line-Number: 1051

Channel-State: CS_NEW

Channel-State-Number: 0

Channel-Name: N/A

Unique-ID: ff9f875e-941f-438a-b384-844a6da23f66

Call-Direction: outbound

Presence-Call-Direction: outbound

Answer-State: ringing

 

 

loop = 1

Event-Name: CHANNEL_STATE

Core-UUID: 438a66f9-8e41-4c6a-bbfd-1b0e8527cec1

FreeSWITCH-Hostname: tpa-es-rh-232.dev.sipstorm.com

FreeSWITCH-IPv4: 10.50.48.232

FreeSWITCH-IPv6: %3A%3A1

Event-Date-Local: 2010-03-05%2017%3A06%3A52

Event-Date-GMT: Fri,%2005%20Mar%202010%2022%3A06%3A52%20GMT

Event-Date-Timestamp: 1267826812571550

Event-Calling-File: switch_channel.c

Event-Calling-Function: switch_channel_perform_set_running_state

Event-Calling-Line-Number: 1301

Channel-State: CS_DESTROY

Channel-State-Number: 12

Channel-Name: _undef_

Unique-ID: ff9f875e-941f-438a-b384-844a6da23f66

Call-Direction: outbound

Presence-Call-Direction: outbound

Answer-State: ringing

 

 

loop = 2

Event-Name: API

Core-UUID: 438a66f9-8e41-4c6a-bbfd-1b0e8527cec1

FreeSWITCH-Hostname: tpa-es-rh-232.dev.sipstorm.com

FreeSWITCH-IPv4: 10.50.48.232

FreeSWITCH-IPv6: %3A%3A1

Event-Date-Local: 2010-03-05%2017%3A06%3A52

Event-Date-GMT: Fri,%2005%20Mar%202010%2022%3A06%3A52%20GMT

Event-Date-Timestamp: 1267826812571550

Event-Calling-File: switch_loadable_module.c

Event-Calling-Function: switch_api_execute

Event-Calling-Line-Number: 1581

API-Command: conference

API-Command-Argument: conf_uuid-TEST_CONF%20bgdial%20%5Borigination_uuid%3Dmy_uuid_my_uuid_my_test_uuid%5Dsofia/10.50.48.239/1006%20

 

 

loop = 3

no event this time

loop = 4

_______________________________________________
FreeSWITCH-dev mailing list
FreeSWITCH-dev@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
http://www.freeswitch.org

 


_______________________________________________
FreeSWITCH-dev mailing list
FreeSWITCH-dev@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
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
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org
pstn:+19193869900


_______________________________________________
FreeSWITCH-dev mailing list
FreeSWITCH-dev@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
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
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org
pstn:+19193869900


_______________________________________________
FreeSWITCH-dev mailing list
FreeSWITCH-dev@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-dev
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
iax:guest@conference.freeswitch.org/888
googletalk:conf+888@conference.freeswitch.org
pstn:+19193869900