[Freeswitch-users] ESL: not bein able to determine when SIP gateway is down when originating a call

Bill W. freeswitch at aastral.net
Tue Aug 2 08:38:40 MSD 2011


Hey Anton,

I'm running in to this same issue.  Did you ever find a result?

Thanks,
Bill

On 5/14/11 1:17 PM, Anton VG wrote:
> I'm trying to catch an error, in case I would dial wrong (non
> existent) gateway (intentionally!)
> 
> I'm running ESL outbound listener, subscribing to all events,
> if I do bgapi 'originate' to a live gateway - there are normal events
> flow, and I
> can track what is happening.
> But if I issue originate to a gateway, which is not configured or
> simply down - there
> are no any events fired.
> 
> I only have an error on FS console
> 
> 2011-05-14 20:58:13.072927 [ERR] mod_sofia.c:4044 Invalid Gateway
> following by
> 2011-05-14 20:58:13.072927 [ERR] switch_ivr_originate.c:2447 Cannot
> create outgoing channel of type [sofia] cause: [INVALID_NUMBER_FORMAT]
> 
> But HOW to catch the given in ESL?
> 
> sofia.c seems just does not have event code for that cases
> 
> if (profile_name && !profile_found) {
> switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "No Such
> Profile '%s'\n", profile_name);
>> status = SWITCH_STATUS_FALSE;
> }
> 
> logically there should be a proper way to determine that gateway is bad in my
> ESL dialplan, by catching the proper event/reply/whatever,
> For the moment i did trick: esl.api('sofia status gateway
> GatewayWhichIsDown')
> 
> When in production, and there is more than a single route, there will
> be plenty of cases, when you dial a bad gateway, so there should be a
> way for ESL dialplan to determine that a gateway is not callable for a
> moment, the reason WHY and  to retry with another one.
> 
> The trick above is bad, since:
> 1. blocking api query, before evey single gateway call attempt.
> 2. Gateway maybe known in UP state, but the state is stale, in dial in
> fact will go to DOWN gateway. So, ESL dialplan will screw in that case
> 
> Any clue?
> 
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org



More information about the FreeSWITCH-users mailing list