[Freeswitch-dev] error events for failed calls using 'conference conf_name bgdial sofia/ip/user'
Gledhill, James
james.gledhill at sipstorm.com
Wed Mar 10 09:23:42 PST 2010
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20100310/de4773a9/attachment-0001.html
More information about the FreeSWITCH-dev
mailing list