<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 19, 2015 at 4:58 PM, Mi Ke <span dir="ltr"><<a href="mailto:mi.ke@null.net" target="_blank">mi.ke@null.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-family:Verdana;font-size:12px"><div>
<div>Dear Brian,</div>
<div> </div>
<div>I have tuned escaping as per your advise and variable parsing looks OK now:</div>
<div> </div>
<div>2015-02-20 00:20:27.057113 [DEBUG] switch_ivr_originate.c:2100 Parsing global variables<br>
2015-02-20 00:20:27.057113 [DEBUG] switch_event.c:1688 Parsing variable [fail_on_single_reject]=[USER_BUSY,NO_ANSWER,NO_USER_RESPONSE,RECOVERY_ON_TIMER_EXPIRE,ORIGINATOR_CANCEL] <---properly escaped now<br>
2015-02-20 00:20:27.057113 [DEBUG] switch_ivr_originate.c:2550 Parsing session specific variables<br>
2015-02-20 00:20:27.057113 [DEBUG] switch_event.c:1688 Parsing variable [rtp_secure_media]=[true]<br>
2015-02-20 00:20:27.057113 [DEBUG] switch_event.c:1688 Parsing variable [sdp_secure_savp_only]=[true]<br>
2015-02-20 00:20:27.057113 [DEBUG] switch_event.c:1688 Parsing variable [origination_caller_id_number]=[1111]<br>
2015-02-20 00:20:27.057113 [DEBUG] switch_event.c:1688 Parsing variable [origination_caller_id_name]=[aaaa]</div>
<div> </div>
<div>However a failover's behaviour in console and in dialplan is still different:</div>
<div> </div>
<div>2015-02-20 00:20:27.057113 [NOTICE] switch_channel.c:1055 New Channel sofia/external/<a href="mailto:5555@1.1.1.1" target="_blank">5555@1.1.1.1</a> [45088610-b896-11e4-99d1-858de6bd5367]<br>
2015-02-20 00:20:27.057113 [DEBUG] mod_sofia.c:4701 (sofia/external/<a href="mailto:5555@1.1.1.1" target="_blank">5555@1.1.1.1</a>) State Change CS_NEW -> CS_INIT</div>
<div>
<div> </div>
<div>call originates and hit 1.1.1.1</div>
<div> </div>
<div>
<div>2015-02-20 00:20:27.117077 [DEBUG] sofia.c:5845 Remote Reason: 17<br>
2015-02-20 00:20:27.117077 [DEBUG] sofia.c:6617 Channel sofia/external/<a href="mailto:5555@1.1.1.1" target="_blank">5555@1.1.1.1</a> entering state [terminated][486]<br>
2015-02-20 00:20:27.117077 [NOTICE] sofia.c:7533 Hangup sofia/external/<a href="mailto:5555@1.1.1.1" target="_blank">5555@1.1.1.1</a> [CS_CONSUME_MEDIA] [USER_BUSY]<br>
2015-02-20 00:20:27.117077 [DEBUG] switch_channel.c:3222 Send signal sofia/external/<a href="mailto:5555@1.1.1.1" target="_blank">5555@1.1.1.1</a> [KILL]</div>
<div> </div>
<div>
<div>2015-02-20 00:20:27.117077 [DEBUG] switch_core_state_machine.c:823 (sofia/external/<a href="mailto:5555@1.1.1.1" target="_blank">5555@1.1.1.1</a>) State REPORTING<br>
2015-02-20 00:20:27.117077 [DEBUG] switch_ivr_originate.c:3720 Originate Resulted in Error Cause: 17 [USER_BUSY]</div>
<div> </div>
<div>it should stop here since USER_BUSY is in fail_on_single_reject list, but hunting continues:</div>
<div><br>
2015-02-20 00:20:27.117077 [DEBUG] switch_ivr_originate.c:2550 Parsing session specific variables<br>
2015-02-20 00:20:27.117077 [DEBUG] switch_event.c:1688 Parsing variable [rtp_secure_media]=[true]<br>
2015-02-20 00:20:27.117077 [DEBUG] switch_event.c:1688 Parsing variable [sdp_secure_savp_only]=[true]<br>
2015-02-20 00:20:27.117077 [DEBUG] switch_event.c:1688 Parsing variable [origination_caller_id_number]=[2222]<br>
2015-02-20 00:20:27.117077 [DEBUG] switch_event.c:1688 Parsing variable [origination_caller_id_name]=[bbbb]</div>
<div>
<div>and the same continues for gw 2.2.2.2</div>
<div> </div>
<div>Meanwhile from console everything is OK:</div>
<div> </div>
<div>
<div>freeswitch@internal> originate {fail_on_single_reject=CALL_REJECTED\,USER_BUSY\,NO_ANSWER}error/NO_ANSWER|error/USER_BUSY|error/CALL_REJECTED 999<br>
-ERR NO_ANSWER</div>
<div>2015-02-20 00:35:15.057125 [DEBUG] switch_ivr_originate.c:2100 Parsing global variables<br>
2015-02-20 00:35:15.057125 [DEBUG] switch_event.c:1688 Parsing variable [fail_on_single_reject]=[CALL_REJECTED,USER_BUSY,NO_ANSWER]<br>
2015-02-20 00:35:15.057125 [NOTICE] switch_ivr_originate.c:2732 Cannot create outgoing channel of type [error] cause: [NO_ANSWER]</div>
<div> </div>
</div>
<div>My dialplan is:</div>
<div> </div>
<div>
<div> <extension name="outbound"><br>
<condition field="destination_number" expression="^\d{4}$"><span class=""><br>
<action application="set" data="bridge_answer_timeout=120"/><br></span><span class="">
<action application="set" data="bridge_early_media=true"/><br>
<action application="set" data="hangup_after_bridge=true"/><br></span>
<action application="set" data="sip_jitter_buffer_during_bridge=true"/><span class=""><br>
<action application="odbc_query" inline="true" data="route_out"/><br>
<action application="bridge" data="${bridge_to}"/><br>
<action application="hangup" data="${last_bridge_hangup_cause}"/><br>
<anti-action application="hangup" data="INVALID_NUMBER_FORMAT"/><br>
</condition><br>
</extension></span></div>
<div> </div>
<div>bridge data var as returned from the db backend is:</div>
<div> </div>
<div>
<div>{fail_on_single_reject=USER_BUSY\,NO_ANSWER\,NO_USER_RESPONSE\,RECOVERY_ON_TIMER_EXPIRE\,ORIGINATOR_CANCEL}[rtp_secure_media=true,sdp_secure_savp_only=true,origination_caller_id_number=1111,origination_caller_id_name=aaaa,called_id=5555]sofia/external/<a href="mailto:5555@1.1.1.1" target="_blank">5555@1.1.1.1</a>;transport=tls|[rtp_secure_media=true,sdp_secure_savp_only=true,origination_caller_id_number=2222,origination_caller_id_name=bbbb,called_id=5555]sofia/external/<a href="mailto:5555@2.2.2.2" target="_blank">5555@2.2.2.2</a>;transport=tls</div>
<div> </div>
<div>a testing sites at 1.1.1.1 and 2.2.2.2 are doing nothing but hangup incoming calls with code 17</div>
<div> </div>
<div>Any ideas?</div>
<div> </div>
<div>Thanks / Mike</div>
</div>
<div> </div>
</div>
</div>
</div>
<div> <br></div></div></div></div></div></div></blockquote><div>One thing I think you should try is to use the set application instead of using the curly brackets in the bridge line. I strongly recommend that you get it working manually with hard-coded values and then add the database lookup after that. I'd create a separate extension and test it. Something like this:<br><br> <extension name="outbound"><br>
<condition field="destination_number" expression="^\d{4}$"><span class=""><br>
<action application="set" data="bridge_answer_timeout=120"/><br></span><span class="">
<action application="set" data="bridge_early_media=true"/><br>
<action application="set" data="hangup_after_bridge=true"/><br></span>
<action application="set" data="sip_jitter_buffer_<div>during_bridge=true"/><span class=""><br>
<action application="set" data="</span><span class="">fail_on_single_reject=USER_</span><div>BUSY,NO_ANSWER,NO_USER_RESPONSE,RECOVERY_ON_TIMER_EXPIRE,ORIGINATOR_CANCEL"/><br></div><span class="">
<action application="bridge" data="</span><span class="">[</span>rtp_secure_media=true,sdp_secure_savp_only=true,origination_caller_id_number=1111,origination_caller_id_name=aaaa,called_id=5555]sofia/external/<a href="mailto:5555@1.1.1.1" target="_blank">5555@1.1.1.1</a>;transport=tls|[rtp_secure_media=true,sdp_secure_savp_only=true,origination_caller_id_number=2222,origination_caller_id_name=bbbb,called_id=5555]sofia/external/<a href="mailto:5555@2.2.2.2" target="_blank">5555@2.2.2.2</a>;transport=tls"/><br><span class="">
<action application="hangup" data="${last_bridge_hangup_cause}"/><br>
<anti-action application="hangup" data="INVALID_NUMBER_FORMAT"/><br>
</condition><br>
</extension></span></div><br></div><div>I have a hunch that once you get it working with predictable, hard-coded values that the rest of it will fall into place.<br><br></div><div>-MC<br></div><div> <br></div></div></div></div>