[Freeswitch-users] call fails when cli starts with 00 and is replaced with a +

Panagiotis Skoulikaritis pskoul at gmail.com
Tue Jul 5 12:37:09 MSD 2016


Dear all

I'm trying to add a "+" sign in front of the cli before it is send out.
If the cli contains already a "+" sign or if the cli starts with 1-9 
everything works, but if the cli starts with 00 the call fails with 480.


Any idea what might cause this ?

Bellow is the dialplan


<extension name="test_cli">
<condition field="network_addr" 
expression="^(^xx\.xx\.xx\.xx|^xx\.xx\.xx\.xx)$"/>
<condition field="destination_number" expression="^1234#(\d+)$">
<condition field="caller_id_number" expression="^(00)(\d+)$" break="never">
<action inline="true" application="set" 
data="effective_caller_id_number=+$2"/>
<action inline="true" application="set" 
data="effective_caller_id_name=+$2"/>
</condition>
<condition field="caller_id_number" expression="^([1-9]\d+)$" break="never">
<action inline="true" application="set" 
data="effective_caller_id_number=+$1"/>
<action inline="true" application="set" 
data="effective_caller_id_name=+$1"/>
</condition>
<action application="set" data="call_direction=outgoing"/>
<action application="set" data="hangup_after_bridge=true"/>
<action application="set" data="continue_on_fail=true"/>
<action application="set" data="sip_cid_in_1xx=false"/>
<action application="set" data="inherit_codec=true"/>
<action application="set" data="accountcode=${sip_h_X-ACCOUNTCODE}" 
inline="true"/>
<action application="export" 
data="nolocal:accountcode=${sip_h_X-ACCOUNTCODE}" inline="true"/>
<action application="unset" data="sip_h_X-ACCOUNTCODE" inline="true"/>
<action application="set" data="execute_on_answer=sched_hangup +21600 
alloted_timeout"/>
<action application="bridge" data="sofia/external/+$1 at yy.yy.yy.yy:5060"/>
<action application="bridge" data="sofia/external/+$1 at zz.zz.zz.zz:5060"/>
</condition>
</extension>


the logs I'm getting when the call fails

Dialplan: sofia/external/00123456789 at 192.168.157.14 parsing 
[public->test_cli] continue=false
Dialplan: sofia/external/00123456789 at 192.168.157.14 Regex (PASS) 
[test_cli] network_addr(192.168.160.10) =~ 
/^(^192\.168\.160\.10|^192\.168\.170\.10)$/ break=on-false
|--- Dialplan: Processing recursive conditions level:1 
[test_cli_recur_1] require-nested=TRUE
|--- Dialplan: sofia/external/00123456789 at 192.168.157.14 Regex (PASS) 
[test_cli_recur_1] caller_id_number(00123456789) =~ /^(00)(\d+)$/ 
break=never
|--- Dialplan: sofia/external/00123456789 at 192.168.157.14 Action 
set(effective_caller_id_number=+123456789) INLINE
EXECUTE sofia/external/00123456789 at 192.168.157.14 
set(effective_caller_id_number=+123456789)
2016-07-05 04:12:06.258273 [DEBUG] mod_dptools.c:1469 
sofia/external/00123456789 at 192.168.157.14 SET 
[effective_caller_id_number]=[+123456789]
|--- Dialplan: sofia/external/00123456789 at 192.168.157.14 Action 
set(effective_caller_id_name=+123456789) INLINE
EXECUTE sofia/external/00123456789 at 192.168.157.14 
set(effective_caller_id_name=+123456789)
2016-07-05 04:12:06.258273 [DEBUG] mod_dptools.c:1469 
sofia/external/00123456789 at 192.168.157.14 SET 
[effective_caller_id_name]=[+123456789]
|--- Dialplan: sofia/external/00123456789 at 192.168.157.14 Regex (FAIL) 
[test_cli_recur_1] caller_id_number(00123456789) =~ /^([1-9]\d+)$/ 
break=never
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:216 
(sofia/external/00123456789 at 192.168.157.14) State Change CS_ROUTING -> 
CS_EXECUTE
2016-07-05 04:12:06.258273 [DEBUG] switch_core_session.c:1396 Send 
signal sofia/external/00123456789 at 192.168.157.14 [BREAK]
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:528 
(sofia/external/00123456789 at 192.168.157.14) State ROUTING going to sleep
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:472 
(sofia/external/00123456789 at 192.168.157.14) Running State Change CS_EXECUTE
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:535 
(sofia/external/00123456789 at 192.168.157.14) State EXECUTE
2016-07-05 04:12:06.258273 [DEBUG] mod_sofia.c:178 
sofia/external/00123456789 at 192.168.157.14 SOFIA EXECUTE
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:258 
sofia/external/00123456789 at 192.168.157.14 Standard EXECUTE
EXECUTE sofia/external/00123456789 at 192.168.157.14 set(outside_call=true)
2016-07-05 04:12:06.258273 [DEBUG] mod_dptools.c:1469 
sofia/external/00123456789 at 192.168.157.14 SET [outside_call]=[true]
EXECUTE sofia/external/00123456789 at 192.168.157.14 
export(RFC2822_DATE=Tue, 05 Jul 2016 04:12:06 +0000)
2016-07-05 04:12:06.258273 [DEBUG] switch_channel.c:1267 EXPORT 
(export_vars) [RFC2822_DATE]=[Tue, 05 Jul 2016 04:12:06 +0000]
2016-07-05 04:12:06.258273 [NOTICE] switch_core_state_machine.c:315 
sofia/external/00123456789 at 192.168.157.14 has executed the last dialplan 
instruction, hanging up.
2016-07-05 04:12:06.258273 [NOTICE] switch_core_state_machine.c:317 
Hangup sofia/external/00123456789 at 192.168.157.14 [CS_EXECUTE] 
[NORMAL_CLEARING]
2016-07-05 04:12:06.258273 [DEBUG] switch_channel.c:3242 Send signal 
sofia/external/00123456789 at 192.168.157.14 [KILL]
2016-07-05 04:12:06.258273 [DEBUG] switch_core_session.c:1396 Send 
signal sofia/external/00123456789 at 192.168.157.14 [BREAK]
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:535 
(sofia/external/00123456789 at 192.168.157.14) State EXECUTE going to sleep
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:472 
(sofia/external/00123456789 at 192.168.157.14) Running State Change CS_HANGUP
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:735 
(sofia/external/00123456789 at 192.168.157.14) Callstate Change RINGING -> 
HANGUP
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:737 
(sofia/external/00123456789 at 192.168.157.14) State HANGUP
2016-07-05 04:12:06.258273 [DEBUG] mod_sofia.c:413 Channel 
sofia/external/00123456789 at 192.168.157.14 hanging up, cause: NORMAL_CLEARING
2016-07-05 04:12:06.258273 [DEBUG] mod_sofia.c:549 Responding to INVITE 
with: 480
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:60 
sofia/external/00123456789 at 192.168.157.14 Standard HANGUP, cause: 
NORMAL_CLEARING
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:737 
(sofia/external/00123456789 at 192.168.157.14) State HANGUP going to sleep
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:504 
(sofia/external/00123456789 at 192.168.157.14) State Change CS_HANGUP -> 
CS_REPORTING
2016-07-05 04:12:06.258273 [DEBUG] switch_core_session.c:1396 Send 
signal sofia/external/00123456789 at 192.168.157.14 [BREAK]
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:472 
(sofia/external/00123456789 at 192.168.157.14) Running State Change 
CS_REPORTING
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:823 
(sofia/external/00123456789 at 192.168.157.14) State REPORTING
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:104 
sofia/external/00123456789 at 192.168.157.14 Standard REPORTING, cause: 
NORMAL_CLEARING
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:823 
(sofia/external/00123456789 at 192.168.157.14) State REPORTING going to sleep
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:498 
(sofia/external/00123456789 at 192.168.157.14) State Change CS_REPORTING -> 
CS_DESTROY
2016-07-05 04:12:06.258273 [DEBUG] switch_core_session.c:1396 Send 
signal sofia/external/00123456789 at 192.168.157.14 [BREAK]
2016-07-05 04:12:06.258273 [DEBUG] switch_core_session.c:1623 Session 
40729659 (sofia/external/00123456789 at 192.168.157.14) Locked, Waiting on 
external entities
2016-07-05 04:12:06.258273 [NOTICE] switch_core_session.c:1641 Session 
40729659 (sofia/external/00123456789 at 192.168.157.14) Ended
2016-07-05 04:12:06.258273 [NOTICE] switch_core_session.c:1645 Close 
Channel sofia/external/00123456789 at 192.168.157.14 [CS_DESTROY]
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:626 
(sofia/external/00123456789 at 192.168.157.14) Running State Change CS_DESTROY
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:636 
(sofia/external/00123456789 at 192.168.157.14) State DESTROY
2016-07-05 04:12:06.258273 [DEBUG] mod_sofia.c:323 
sofia/external/00123456789 at 192.168.157.14 SOFIA DESTROY
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:111 
sofia/external/00123456789 at 192.168.157.14 Standard DESTROY
2016-07-05 04:12:06.258273 [DEBUG] switch_core_state_machine.c:636 
(sofia/external/00123456789 at 192.168.157.14) State DESTROY going to sleep
2016-07-05 04:13:01.618279 [NOTICE] mod_cdr_csv.c:123 Rotated CDR 
logfile /usr/local/freeswitch/log/cdr-csv/cdr-csv/Master.csv
freeswitch at internal>



Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list