Understanding the outgoing process to make calls.

Status
Not open for further replies.

toolfolks

Member
May 1, 2020
73
5
8
65
I have a connection to my sip provider as I am getting incoming calls on a DID. ( yipeeee).

I'm struggling to understand the workflow to dial out to a UK mobile / landline number

Under the Dial Plan
There is
Destination
DialPlan Manager
Outbound Rules

Which do I have to do and in what order to do the above please.

Idiot level would be usefull......
 

ad5ou

Active Member
Jun 12, 2018
892
204
43
Destinations page builds inbound routes (for incoming calls)
Dial plan manager is for viewing/editing internal dial plans (for features etc)
Inbound routes are the actual dial plans Freeswitch uses to route inbound calls. (Built by destinations page normally but can be manually edited)
Outbound routes are for dial plans to route calls outside of the pbx (such as to your carrier)
 

toolfolks

Member
May 1, 2020
73
5
8
65
I have now connected to my Sip provider. Incoming calls are working.
I have created the following:
Where Number = my sip provider number

1.Do I need to enable Continue and / or Destination to true ?

Screenshot 2020-06-07 at 21.25.50.jpg



I have the following

Where Destination = my sip provider number

Screenshot 2020-06-07 at 21.31.18.jpg


When trying from our app the logs show:

1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.130008 [DEBUG] switch_core_state_machine.c:749 (sofia/internal/Steipad@test.toolfolks.com) State DESTROY going to sleep
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.130008 [DEBUG] switch_core_state_machine.c:181 sofia/internal/Steipad@test.toolfolks.com Standard DESTROY
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.130008 [DEBUG] mod_sofia.c:364 sofia/internal/Steipad@test.toolfolks.com SOFIA DESTROY
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.130008 [DEBUG] switch_core_state_machine.c:749 (sofia/internal/Steipad@test.toolfolks.com) State DESTROY
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.130008 [DEBUG] switch_core_state_machine.c:739 (sofia/internal/Steipad@test.toolfolks.com) Running State Change CS_DESTROY (Cur 0 Tot 18)
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.130008 [NOTICE] switch_core_session.c:1748 Close Channel sofia/internal/Steipad@test.toolfolks.com [CS_DESTROY]
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.130008 [NOTICE] switch_core_session.c:1744 Session 18 (sofia/internal/Steipad@test.toolfolks.com) Ended
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.130008 [DEBUG] switch_core_session.c:1726 Session 18 (sofia/internal/Steipad@test.toolfolks.com) Locked, Waiting on external entities
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.130008 [DEBUG] switch_core_state_machine.c:611 (sofia/internal/Steipad@test.toolfolks.com) State Change CS_REPORTING -> CS_DESTROY
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.130008 [DEBUG] switch_core_state_machine.c:936 (sofia/internal/Steipad@test.toolfolks.com) State REPORTING going to sleep
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.130008 [DEBUG] switch_core_state_machine.c:174 sofia/internal/Steipad@test.toolfolks.com Standard REPORTING, cause: NORMAL_CLEARING
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.050035 [DEBUG] switch_core_state_machine.c:936 (sofia/internal/Steipad@test.toolfolks.com) State REPORTING
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.050035 [DEBUG] switch_core_state_machine.c:585 (sofia/internal/Steipad@test.toolfolks.com) Running State Change CS_REPORTING (Cur 1 Tot 18)
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.050035 [DEBUG] switch_core_state_machine.c:620 (sofia/internal/Steipad@test.toolfolks.com) State Change CS_HANGUP -> CS_REPORTING
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.050035 [DEBUG] switch_core_state_machine.c:850 (sofia/internal/Steipad@test.toolfolks.com) State HANGUP going to sleep
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.050035 [DEBUG] switch_core_state_machine.c:60 sofia/internal/Steipad@test.toolfolks.com Standard HANGUP, cause: NORMAL_CLEARING
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.050035 [DEBUG] mod_sofia.c:453 Channel sofia/internal/Steipad@test.toolfolks.com hanging up, cause: NORMAL_CLEARING
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.050035 [DEBUG] switch_core_state_machine.c:850 (sofia/internal/Steipad@test.toolfolks.com) State HANGUP
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.050035 [DEBUG] switch_core_state_machine.c:848 (sofia/internal/Steipad@test.toolfolks.com) Callstate Change EARLY -> HANGUP
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.050035 [DEBUG] switch_core_media_bug.c:1295 Removing BUG from sofia/internal/Steipad@test.toolfolks.com
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.050035 [DEBUG] switch_channel.c:3604 sofia/internal/Steipad@test.toolfolks.com skip receive message [AUDIO_SYNC] (channel is hungup already)
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.050035 [DEBUG] switch_core_state_machine.c:585 (sofia/internal/Steipad@test.toolfolks.com) Running State Change CS_HANGUP (Cur 1 Tot 18)
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.050035 [DEBUG] switch_core_state_machine.c:651 (sofia/internal/Steipad@test.toolfolks.com) State EXECUTE going to sleep
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.050035 [NOTICE] switch_core_state_machine.c:388 Hangup sofia/internal/Steipad@test.toolfolks.com [CS_EXECUTE] [NORMAL_CLEARING]
1fe84e81-6dc1-42bb-bebc-c0027ad4e92b 2020-06-07 21:33:54.050035 [NOTICE] switch_core_state_machine.c:386 sofia/internal/Steipad@test.toolfolks.com has executed the last dialplan instruction, hanging up.


What am I missing here please.

Or what I am doing dumb here please.
 

ad5ou

Active Member
Jun 12, 2018
892
204
43
The "destination" page is usually only for inbound route programming.

To create an outbound route select "Dialplans>Outbound Routes" then create a new one from that page.

Also note, digits are matched using Regex not the Asterisk style of "xxxx"
There are example dial plan options on the edit page. "North America" example will accept any 10 digit number or 11 digits starting with "1". In the example, it will send 10 digits to the gateway selected.
 

toolfolks

Member
May 1, 2020
73
5
8
65
What would the regex for uk Numbers.
11 digits beginning with 0
01613308447
Or 13 with international format
+441613308447
 

toolfolks

Member
May 1, 2020
73
5
8
65
I have found this regex

^(?:(?:\(?(?:0(?:0|11)\)?[\s-]?\(?|\+)44\)?[\s-]?(?:\(?0\)?[\s-]?)?)|(?:\(?0))(?:(?:\d{5}\)?[\s-]?\d{4,5})|(?:\d{4}\)?[\s-]?(?:\d{5}|\d{3}[\s-]?\d{3}))|(?:\d{3}\)?[\s-]?\d{3}[\s-]?\d{3,4})|(?:\d{2}\)?[\s-]?\d{4}[\s-]?\d{4}))(?:[\s-]?(?:x|ext\.?|\#)\d{3,4})?$

from here


The outgoing calls are not made.

What are the various settings and which do I set ?
Number
Hostname
Continue
Destination

Log when dialling from an IP phone.

1 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.129996 [DEBUG] switch_core_state_machine.c:749 (sofia/internal/HomeIP@test.toolfolks.com:10060) State DESTROY going to sleep
2 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.129996 [DEBUG] switch_core_state_machine.c:181 sofia/internal/HomeIP@test.toolfolks.com:10060 Standard DESTROY
3 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.129996 [DEBUG] mod_sofia.c:364 sofia/internal/HomeIP@test.toolfolks.com:10060 SOFIA DESTROY
4 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.129996 [DEBUG] switch_core_state_machine.c:749 (sofia/internal/HomeIP@test.toolfolks.com:10060) State DESTROY
5 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.129996 [DEBUG] switch_core_state_machine.c:739 (sofia/internal/HomeIP@test.toolfolks.com:10060) Running State Change CS_DESTROY (Cur 0 Tot 102)
6 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.129996 [NOTICE] switch_core_session.c:1748 Close Channel sofia/internal/HomeIP@test.toolfolks.com:10060 [CS_DESTROY]
7 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.129996 [NOTICE] switch_core_session.c:1744 Session 102 (sofia/internal/HomeIP@test.toolfolks.com:10060) Ended
8 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.129996 [DEBUG] switch_core_session.c:1726 Session 102 (sofia/internal/HomeIP@test.toolfolks.com:10060) Locked, Waiting on external entities
9 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.129996 [DEBUG] switch_core_state_machine.c:611 (sofia/internal/HomeIP@test.toolfolks.com:10060) State Change CS_REPORTING -> CS_DESTROY
10 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.129996 [DEBUG] switch_core_state_machine.c:936 (sofia/internal/HomeIP@test.toolfolks.com:10060) State REPORTING going to sleep
11 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.129996 [DEBUG] switch_core_state_machine.c:174 sofia/internal/HomeIP@test.toolfolks.com:10060 Standard REPORTING, cause: NORMAL_CLEARING
12 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.070004 [DEBUG] switch_core_state_machine.c:936 (sofia/internal/HomeIP@test.toolfolks.com:10060) State REPORTING
13 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.070004 [DEBUG] switch_core_state_machine.c:585 (sofia/internal/HomeIP@test.toolfolks.com:10060) Running State Change CS_REPORTING (Cur 1 Tot 102)
14 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.070004 [DEBUG] switch_core_state_machine.c:620 (sofia/internal/HomeIP@test.toolfolks.com:10060) State Change CS_HANGUP -> CS_REPORTING
15 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.070004 [DEBUG] switch_core_state_machine.c:850 (sofia/internal/HomeIP@test.toolfolks.com:10060) State HANGUP going to sleep
16 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.070004 [DEBUG] switch_core_state_machine.c:60 sofia/internal/HomeIP@test.toolfolks.com:10060 Standard HANGUP, cause: NORMAL_CLEARING
17 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.070004 [DEBUG] mod_sofia.c:598 Responding to INVITE with: 480
18 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.070004 [DEBUG] mod_sofia.c:453 Channel sofia/internal/HomeIP@test.toolfolks.com:10060 hanging up, cause: NORMAL_CLEARING
19 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.070004 [DEBUG] switch_core_state_machine.c:850 (sofia/internal/HomeIP@test.toolfolks.com:10060) State HANGUP
20 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.070004 [DEBUG] switch_core_state_machine.c:848 (sofia/internal/HomeIP@test.toolfolks.com:10060) Callstate Change EARLY -> HANGUP
21 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.070004 [DEBUG] switch_core_media_bug.c:1295 Removing BUG from sofia/internal/HomeIP@test.toolfolks.com:10060
22 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.070004 [DEBUG] switch_ivr_async.c:1520 Channel is hung up
23 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.049995 [DEBUG] switch_ivr_async.c:1445 Stop recording file /var/lib/freeswitch/recordings/test.toolfolks.com/archive/2020/Jun/08/402de214-ae23-49f2-8e61-64a69cd40041.wav
24 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.049995 [DEBUG] switch_channel.c:3604 sofia/internal/HomeIP@test.toolfolks.com:10060 skip receive message [AUDIO_SYNC] (channel is hungup already)
25 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.049995 [DEBUG] switch_core_state_machine.c:585 (sofia/internal/HomeIP@test.toolfolks.com:10060) Running State Change CS_HANGUP (Cur 1 Tot 102)
26 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.049995 [DEBUG] switch_core_state_machine.c:651 (sofia/internal/HomeIP@test.toolfolks.com:10060) State EXECUTE going to sleep
27 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.049995 [NOTICE] switch_core_state_machine.c:388 Hangup sofia/internal/HomeIP@test.toolfolks.com:10060 [CS_EXECUTE] [NORMAL_CLEARING]
28 402de214-ae23-49f2-8e61-64a69cd40041 2020-06-08 11:11:38.049995 [NOTICE] switch_core_state_machine.c:386 sofia/internal/HomeIP@test.toolfolks.com:10060 has executed the last dialplan instruction, hanging up.
29 h=0] sofia/internal/HomeIP@test.toolfolks.com:10060 eval(not_secure)



Screenshot 2020-06-08 at 10.58.44.jpg
 

toolfolks

Member
May 1, 2020
73
5
8
65
Looks like its trying to call but the regex is failing.


/HomeIP@test.toolfolks.com:10060 parsing [test.toolfolks.com->operator] continue=false
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 Regex (FAIL) [operator] destination_number(01613308446) =~ /^0$|^operator$/ break=on-false
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 parsing [test.toolfolks.com->operator-forward] continue=false
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 Regex (FAIL) [operator-forward] destination_number(01613308446) =~ /^\*000$/ break=on-false
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 parsing [test.toolfolks.com->do-not-disturb] continue=false
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 Regex (FAIL) [do-not-disturb] destination_number(01613308446) =~ /^\*77$/ break=on-true
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 Regex (FAIL) [do-not-disturb] destination_number(01613308446) =~ /^\*78$|\*363$/ break=on-true
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 Regex (FAIL) [do-not-disturb] destination_number(01613308446) =~ /^\*79$/ break=on-true
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 Regex (FAIL) [do-not-disturb] destination_number(01613308446) =~ /^dnd\+1000$/ break=on-true
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 parsing [test.toolfolks.com->call_screen] continue=true
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 Regex (FAIL) [call_screen] ${call_screen_enabled}(false) =~ /^true$/ break=on-false
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 parsing [test.toolfolks.com->follow-me-destinations] continue=false
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 Regex (FAIL) [follow-me-destinations] ${user_exists}(false) =~ /^true$/ break=on-false
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 parsing [test.toolfolks.com->call-forward] continue=false
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 Regex (FAIL) [call-forward] destination_number(01613308446) =~ /^\*72(\d*)$/ break=on-true
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 Regex (FAIL) [call-forward] destination_number(01613308446) =~ /^\*73$/ break=on-true
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 Regex (FAIL) [call-forward] destination_number(01613308446) =~ /^\*74$/ break=on-true
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 Regex (FAIL) [call-forward] destination_number(01613308446) =~ /^forward\+(\Q1000\E)(?:\/(\d+))?$/ break=on-true
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 parsing [test.toolfolks.com->call-forward-all] continue=
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 Regex (FAIL) [call-forward-all] ${user_exists}(false) =~ /true/ break=on-false
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 parsing [test.toolfolks.com->call-forward-not-registered] continue=
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 Regex (FAIL) [call-forward-not-registered] ${user_exists}(false) =~ /true/ break=on-false
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 parsing [test.toolfolks.com->follow-me] continue=false
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 Regex (FAIL) [follow-me] destination_number(01613308446) =~ /^\*21$/ break=on-false
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 parsing [test.toolfolks.com->talking clock date and time] continue=
402de214-ae23-49f2-8e61-64a69cd40041 Dialplan: sofia/internal/HomeIP@test.toolfolks.com:10060 Regex (FAIL) [talking clock date and time] destination_number(01613308446) =~ /^\*9172$/ break=on-false
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,070
577
113
Just stop trying the fancy regex and create multiple outbound routes, it also depends on your provider.

For example, mine look like:

^00(.*)^ International
^0(.*)$ and prefix 44 for inland
 

toolfolks

Member
May 1, 2020
73
5
8
65
Thanks for the info Daz.
I'm still not getting outgoing calls.

1. What are the various settings and which do I set ?
Number
Hostname
Continue
Destination

2. Are my settings in the image correct.
3. Do I simply add ^0(.*)$ to the condition and this allows all 11 digit numbers beginning with 0 ie 01613308447

My provide states they need a number just as 01613308447.

4. How do I trace where the error is ?
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,070
577
113
If your provider wants it in the format 01613308447 then you need this:

^(0.*)$

Who's your provider, you should be using us :) Cross datacenter failover etc :D
 
Status
Not open for further replies.