<p>There is always a result to originate and its always in a background job event success or fail. In the body of the event you will find the return value.</p>
<div class="gmail_quote">On May 14, 2011 1:52 PM, "Anton VG" <<a href="mailto:anton.vazir@gmail.com">anton.vazir@gmail.com</a>> wrote:<br type="attribution">> Yes, it does :) And I can use it to test is gw is up or down.<br>
> But question digs slightly deeper, it looks a kind odd, that when I<br>> issue the non-working 'originate' or 'bridge' - there is no ERROR<br>> event at least. So seems there is no way to determine in ESL, that<br>
> 'originate' or other command have fauiled have failed. On successful<br>> execution - there is "BACKGROUD_JOB" event. But no event on error.<br>> Don't you think that errors should fire events either, to inform ESL<br>
> dialplan that issued command have failed?<br>> <br>> <br>> 2011/5/14 Anthony Minessale <<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>>:<br>>> It works with mod sofia dialplan app to test if a gw is down.<br>
>> That's your hint ;)<br>>><br>>> On May 14, 2011 1:19 PM, "Anton VG" <<a href="mailto:anton.vazir@gmail.com">anton.vazir@gmail.com</a>> wrote:<br>>>> If I'm not wrong mod_distribute just provides a list for dialing the<br>
>>> set of gateways, but not generating events itself. So seems not for<br>>>> the case anyway...<br>>>><br>>>> 2011/5/14 Anton VG <<a href="mailto:anton.vazir@gmail.com">anton.vazir@gmail.com</a>>:<br>
>>>> That good one, but not for the my case.<br>>>>><br>>>>> i use originate &park, and than bridge_uuid, when there is an<br>>>>> early_media.<br>>>>> I have a number of gateways, which support specific destinations each,<br>
>>>> so it's up to my billing to decide what gateway should be dialed and<br>>>>> in which order. But I still need to determine if gateway could be<br>>>>> reached or not, or if while calling, it gives an error, and which one.<br>
>>>><br>>>>> I see gwlist down could be used for bridge, but bridge does not give<br>>>>> flexibility I try to achieve. Will see what it gives if used for<br>>>>> originate...<br>
>>>><br>>>>> So, considering your brief reply, there just no support for the case I<br>>>>> need, so will try to get inside sofia.c ...<br>>>>><br>>>>> Regards,<br>
>>>> Anton.<br>>>>><br>>>>> 2011/5/14 Anthony Minessale <<a href="mailto:anthony.minessale@gmail.com">anthony.minessale@gmail.com</a>>:<br>>>>>> Read up on mod distributor on the wiki.<br>
>>>>><br>>>>>> On May 14, 2011 12:12 PM, "Anton VG" <<a href="mailto:anton.vazir@gmail.com">anton.vazir@gmail.com</a>> wrote:<br>>>>>>> You did not understand. I INTENTIONALLY dialing the bad gateway, and<br>
>>>>>> I'm looking for a proper way to determine that gateway is bad in my<br>>>>>>> ESL dialplan, by catching the proper event/reply/whatever,<br>>>>>>> And much preferably without tricks, like esl.api('sofia status gateway<br>
>>>>>> GatewayWhichIsDown')<br>>>>>>><br>>>>>>> When in production, and there is more than a single route, there will<br>>>>>>> be plenty of cases, when you dial a bad gateway, so there should be a<br>
>>>>>> way for ESL dialplan to determine that a gateway is not callable for a<br>>>>>>> moment, the reason WHY and to retry with another one.<br>>>>>>><br>>>>>>> The trick above is bad, since:<br>
>>>>>> 1. blocking api query, before evey single gateway call attempt.<br>>>>>>> 2. Gateway maybe known in UP state, but the state is stale, in dial in<br>>>>>>> fact will go to DOWN gateway. So, dialplan will screw<br>
>>>>>><br>>>>>>> Possibly I should ask in DEV list...<br>>>>>>><br>>>>>>> 2011/5/14 Madovsky <<a href="mailto:infos@madovsky.org">infos@madovsky.org</a>>:<br>
>>>>>>> maybe your gateway is blocking some numbers<br>>>>>>>><br>>>>>>>> ----- Original Message -----<br>>>>>>>> From: "Anton VG" <<a href="mailto:anton.vazir@gmail.com">anton.vazir@gmail.com</a>><br>
>>>>>>> To: "FreeSWITCH Users Help" <<a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a>><br>>>>>>>> Sent: Saturday, May 14, 2011 12:23 PM<br>
>>>>>>> Subject: Re: [Freeswitch-users] ESL: No events fired when there is<br>>>>>>>> error<br>>>>>>>> on<br>>>>>>>> submitted API command, like originate sofia to non-existent gateway<br>
>>>>>>><br>>>>>>>><br>>>>>>>>> The same goes for gateway, which is just down. No events, signalling<br>>>>>>>>> that call will not succeed. And no events fired.<br>
>>>>>>>><br>>>>>>>>> 2011-05-14 21:19:32.002929 [ERR] mod_sofia.c:4050 Gateway is down!<br>>>>>>>>> 2011-05-14 21:19:32.002929 [ERR] switch_ivr_originate.c:2447 Cannot<br>
>>>>>>>> create outgoing channel of type [sofia] cause: [NETWORK_OUT_OF_ORDER]<br>>>>>>>>><br>>>>>>>>> Am I missing the way to get info in the ESL about gateways, which are<br>
>>>>>>>> out of order, or there is simple no way, without hacking the code?<br>>>>>>>>><br>>>>>>>>> _______________________________________________<br>
>>>>>>>> FreeSWITCH-users mailing list<br>>>>>>>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>>>>>>>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>>>>>>>><br>>>>>>>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>>>>>>>>> <a href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>
>>>>>>><br>>>>>>>><br>>>>>>>> _______________________________________________<br>>>>>>>> FreeSWITCH-users mailing list<br>>>>>>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
>>>>>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>>>>>>>><br>>>>>>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>>>>>>> <a href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>>>>>>>><br>>>>>>><br>>>>>>> _______________________________________________<br>
>>>>>> FreeSWITCH-users mailing list<br>>>>>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>>>>>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>>>>>><br>>>>>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>>>>>>> <a href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>
>>>>><br>>>>>> _______________________________________________<br>>>>>> FreeSWITCH-users mailing list<br>>>>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
>>>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>>>>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>>>>> <a href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>>>>>><br>>>>>><br>>>>><br>>>><br>>>> _______________________________________________<br>
>>> FreeSWITCH-users mailing list<br>>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>>>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>>>> <a href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>
>><br>>> _______________________________________________<br>>> FreeSWITCH-users mailing list<br>>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
>> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
>> <a href="http://www.freeswitch.org">http://www.freeswitch.org</a><br>>><br>>><br>> <br>> _______________________________________________<br>> FreeSWITCH-users mailing list<br>> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> <a href="http://www.freeswitch.org">http://www.freeswitch.org</a><br></div>