Call forwarding mobile external number

Good morning, I am trying to configure asterisk (FreePBX 14.0.16.4) so that when a call comes in, it is redirected to a mobile number.

I am using the option follow me so that when the call to the number 910000019 enters it is redirected to the extension 9002, if in 8 seconds I do not answer it, it tries to transfer to the mobile 666666666, but it gives two tones and the call is cut without ringing in the mobile…

I attach the trace to see if you can help me. Thanks

Line 2511515: [2021-05-25 10:54:02] VERBOSE[126460][C-00001647] pbx.c: Executing [in@sub-record-check:3] ExecIf(“PJSIP/RFC-00002035”, “9?Set(FROMEXTEN=600123456)”) in new stack
Line 2511531: [2021-05-25 10:54:02] VERBOSE[126460][C-00001647] pbx.c: Executing [910000019@from-pstn:10] ExecIf(“PJSIP/RFC-00002035”, “1 ?Set(CALLERID(name)=600123456)”) in new stack
Line 2511549: [2021-05-25 10:54:02] VERBOSE[126460][C-00001647] pbx.c: Executing [s@macro-user-callerid:2] Set(“PJSIP/RFC-00002035”, “AMPUSER=600123456”) in new stack
Line 2511565: [2021-05-25 10:54:02] VERBOSE[126460][C-00001647] pbx.c: Executing [s@macro-user-callerid:9] ExecIf(“PJSIP/RFC-00002035”, “1?Set(REALCALLERIDNUM=600123456)”) in new stack
Line 2511586: [2021-05-25 10:54:02] VERBOSE[126460][C-00001647] pbx.c: Executing [s@macro-user-callerid:50] Set(“PJSIP/RFC-00002035”, “CALLERID(number)=600123456”) in new stack
Line 2511587: [2021-05-25 10:54:02] VERBOSE[126460][C-00001647] pbx.c: Executing [s@macro-user-callerid:51] Set(“PJSIP/RFC-00002035”, “CALLERID(name)=600123456”) in new stack
Line 2511589: [2021-05-25 10:54:02] VERBOSE[126460][C-00001647] pbx.c: Executing [s@macro-user-callerid:53] Set(“PJSIP/RFC-00002035”, “CDR(cnam)=600123456”) in new stack
Line 2511590: [2021-05-25 10:54:02] VERBOSE[126460][C-00001647] pbx.c: Executing [s@macro-user-callerid:54] Set(“PJSIP/RFC-00002035”, “CDR(cnum)=600123456”) in new stack
Line 2511636: [2021-05-25 10:54:02] VERBOSE[126460][C-00001647] pbx.c: Executing [exten@sub-record-check:1] NoOp(“PJSIP/RFC-00002035”, “Exten Recording Check between 600123456 and 9002”) in new stack
Line 2511952: [2021-05-25 10:54:02] VERBOSE[126460][C-00001647] res_agi.c: dialparties.agi: Caller ID name is ‘600123456’ number is ‘600123456’
Line 2511952: [2021-05-25 10:54:02] VERBOSE[126460][C-00001647] res_agi.c: dialparties.agi: Caller ID name is ‘600123456’ number is ‘600123456’
Line 2511999: [2021-05-25 10:54:02] VERBOSE[126460][C-00001647] res_agi.c: dialparties.agi: dbset CALLTRACE/9002 to 600123456
Line 2512271: [2021-05-25 10:54:03] VERBOSE[126467][C-00001647] pbx.c: Executing [ctset@macro-dial-one:1] Set(“Local/FMPR-9002@from-internal-00021c4c;2”, “DB(CALLTRACE/9002)=600123456”) in new stack
Line 2517292: [2021-05-25 10:54:11] VERBOSE[126468][C-00001647] res_agi.c: dialparties.agi: Caller ID name is ‘600123456’ number is ‘600123456’
Line 2517292: [2021-05-25 10:54:11] VERBOSE[126468][C-00001647] res_agi.c: dialparties.agi: Caller ID name is ‘600123456’ number is ‘600123456’
Line 2517332: [2021-05-25 10:54:11] VERBOSE[126525][C-00001647] pbx.c: Executing [s@macro-user-callerid:2] Set(“Local/666666666@from-internal-00021c74;2”, “AMPUSER=600123456”) in new stack
Line 2517339: [2021-05-25 10:54:11] VERBOSE[126525][C-00001647] pbx.c: Executing [s@macro-user-callerid:9] ExecIf(“Local/666666666@from-internal-00021c74;2”, “1?Set(REALCALLERIDNUM=600123456)”) in new stack
Line 2517351: [2021-05-25 10:54:11] VERBOSE[126525][C-00001647] pbx.c: Executing [s@macro-user-callerid:50] Set(“Local/666666666@from-internal-00021c74;2”, “CALLERID(number)=600123456”) in new stack
Line 2517352: [2021-05-25 10:54:11] VERBOSE[126525][C-00001647] pbx.c: Executing [s@macro-user-callerid:51] Set(“Local/666666666@from-internal-00021c74;2”, “CALLERID(name)=600123456”) in new stack
Line 2517354: [2021-05-25 10:54:11] VERBOSE[126525][C-00001647] pbx.c: Executing [s@macro-user-callerid:53] Set(“Local/666666666@from-internal-00021c74;2”, “CDR(cnam)=600123456”) in new stack
Line 2517355: [2021-05-25 10:54:11] VERBOSE[126525][C-00001647] pbx.c: Executing [s@macro-user-callerid:54] Set(“Local/666666666@from-internal-00021c74;2”, “CDR(cnum)=600123456”) in new stack
Line 2592100: [2021-05-25 10:56:27] VERBOSE[128465][C-0000165d] pbx.c: Executing [in@sub-record-check:3] ExecIf(“PJSIP/RFC-00002054”, “9?Set(FROMEXTEN=600123456)”) in new stack

Do you have outbound route for your mobile?
Also could you print all the trace?

yes i have outbound route and i can call to my mobile phone… works

I atach a call trace: https://pastebin.com/raw/Ayq4AEyz

Thanx

you need to put a # after an external number:

9002
666666666#

I already had the phone number configured that way.

The call ends up hanging up within 2 seconds of transferring it to the mobile.

Thanks for your help

Outbound leg of the call flow starts on line 433 and the log entries on lines 461-462 indicate that there is no matching outbound route for the call. If you are able to dial that number, but not forward the call, then I would guess that you have dial patterns in your outbound routes with CID defined that don’t match.

I had seen the error, but I don’t know how to fix it. From the extension I can call abroad … how do I dial the forwarding?

Thanx for your help!

As @lgaetz said… How do you call from the extension itself?

You have to make the followme number match exactly.

If you dial 8 + number to make calls from a phone, then the follow me needs to be 8 + number

1 Like

The forwarding failed because there was no Outbound Route available. Note that by default, Follow Me sends the number of the original caller as caller ID on the outbound leg. So, as @lgaetz said, if the required Outbound Route is restricted (by a value in the CallerID field, Extension Routes, Class of Service), the call will fail.

Possible fixes:

  1. If your system doesn’t need calling restrictions to the destination, remove them.
  2. Set up a new unrestricted Outbound Route with a prefix, then use that prefix in the Follow Me destination.
  3. Set Follow Me to send e.g. the main company number instead of the original caller’s number as caller ID. Set the Outbound Route to permit calls from that number.
1 Like

Thanks for your help, I think it is something very obvious what is happening to me … I have been with asterisk for a short time and I think the problem is in the outgoing route.

From my extension I can call my mobile without problems … but when I follow me, the call does not go out for some reason.

You should not do well the transfer of the incoming call, to the extension and then you can not get it back to the mobile …

Any manual out there on how to do it that is detailed?

Thanks

No, because there are many reasons such a call might fail. The two most common are an Outbound Route that does not match the incoming caller because of a restriction, and the trunking provider disallowing a caller ID that is not yours.

In your case, it appears that a restriction blocked the call. Please post a screenshot of the Dial Patterns tab of the route that should match the number to which you are forwarding.

i have the same setup and its working fine for me. The most probable reason for this problem is outbound route and prefix match also check what CID you are using in that outbound route or you have set cid in extension itself.

Thank you guys!

This is my outbound router pattern:

Thanks for your help!

That says only extension 9002 can make that call, so the call from outside will fail. Leave that field blank. Also, be sure that the forwarded-to number is entered as 999666666666#

If no luck, paste a new log.

1 Like

Wow!! works fine!!

I only have one question left. Is it unsafe to leave the extension field empty?

Any number could make a call, right?

Thank you very much, I was already desperate!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.