Get an ext to use a certain caller ID

23260	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@macro-dialout-trunk:25] Set("PJSIP/200-00000300", "__CRM_DESTINATION=07861486831") in new stack	
23261	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@macro-dialout-trunk:26] Set("PJSIP/200-00000300", "__CRM_SOURCE=200") in new stack	
23262	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@macro-dialout-trunk:27] AGI("PJSIP/200-00000300", "agi://127.0.0.1/sangomacrm.agi") in new stack	
23263	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] res_agi.c: <PJSIP/200-00000300>AGI Script agi://127.0.0.1/sangomacrm.agi completed, returning 0	
23264	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@macro-dialout-trunk:28] Set("PJSIP/200-00000300", "CHANNEL(hangup_handler_push)=crm-hangup,s,1") in new stack	
23265	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@macro-dialout-trunk:29] NoOp("PJSIP/200-00000300", "CRM Finished") in new stack	
23266	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@macro-dialout-trunk:30] GotoIf("PJSIP/200-00000300", "0?bypass,1") in new stack	
23267	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@macro-dialout-trunk:31] ExecIf("PJSIP/200-00000300", "1?Set(CONNECTEDLINE(num,i)=07861486831)") in new stack	
23268	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@macro-dialout-trunk:32] ExecIf("PJSIP/200-00000300", "1?Set(CONNECTEDLINE(name,i)=CID:01618261804)") in new stack	
23269	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@macro-dialout-trunk:33] ExecIf("PJSIP/200-00000300", "0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)01618261804)") in new stack	
23270	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@macro-dialout-trunk:34] GotoIf("PJSIP/200-00000300", "0?customtrunk") in new stack	
23271	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@macro-dialout-trunk:35] ExecIf("PJSIP/200-00000300", "0?Set(DIAL_TRUNK_OPTIONS=)") in new stack	
23272	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@macro-dialout-trunk:36] Set("PJSIP/200-00000300", "HASH(__SIPHEADERS,Alert-Info)=unset") in new stack	
23273	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@macro-dialout-trunk:37] Dial("PJSIP/200-00000300", "PJSIP/[email protected],300,Tb(func-apply-sipheaders^s^1,(1))U(sub-send-obroute-email^07861486831^07861486831^1^1680011004^^01618261804)") in new stack	
23274	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] app_stack.c: PJSIP/xinix.com-00000301 Internal Gosub(func-apply-sipheaders,s,1(1)) start	
23275	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@func-apply-sipheaders:1] ExecIf("PJSIP/xinix.com-00000301", "0?Set(CHANNEL(hangup_handler_push)=crm-hangup,s,1)") in new stack	
23276	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@func-apply-sipheaders:2] NoOp("PJSIP/xinix.com-00000301", "Applying SIP Headers to channel PJSIP/xinix.com-00000301") in new stack	
23277	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@func-apply-sipheaders:3] Set("PJSIP/xinix.com-00000301", "TECH=PJSIP") in new stack	
23278	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@func-apply-sipheaders:4] Set("PJSIP/xinix.com-00000301", "SIPHEADERKEYS=Alert-Info") in new stack	
23279	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@func-apply-sipheaders:5] While("PJSIP/xinix.com-00000301", "1") in new stack	
23280	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@func-apply-sipheaders:6] Set("PJSIP/xinix.com-00000301", "sipheader=unset") in new stack	
23281	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@func-apply-sipheaders:7] ExecIf("PJSIP/xinix.com-00000301", "1?Set(PJSIP_HEADER(remove,Alert-Info)=)") in new stack	
23282	[2023-03-28 14:43:24] ERROR[10810] res_pjsip_header_funcs.c: No headers had been previously added to this session.	
23283	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@func-apply-sipheaders:8] ExecIf("PJSIP/xinix.com-00000301", "0?Set(sipheader=<http://127.0.0.1>;info=unset)") in new stack	
23284	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@func-apply-sipheaders:9] ExecIf("PJSIP/xinix.com-00000301", "0?Set(sipheader=<http://127.0.0.1>unset)") in new stack	
23285	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@func-apply-sipheaders:10] ExecIf("PJSIP/xinix.com-00000301", "0?Set(PJSIP_HEADER(add,Alert-Info)=unset)") in new stack	
23286	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@func-apply-sipheaders:11] EndWhile("PJSIP/xinix.com-00000301", "") in new stack	
23287	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@func-apply-sipheaders:5] While("PJSIP/xinix.com-00000301", "0") in new stack	
23288	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@func-apply-sipheaders:12] Return("PJSIP/xinix.com-00000301", "") in new stack	
23289	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] app_stack.c: Spawn extension (from-pstn, 07861486831, 1) exited non-zero on 'PJSIP/xinix.com-00000301'	
23290	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] app_stack.c: PJSIP/xinix.com-00000301 Internal Gosub(func-apply-sipheaders,s,1(1)) complete GOSUB_RETVAL=	
23291	[2023-03-28 14:43:24] VERBOSE[20321][C-000001b0] app_dial.c: Called PJSIP/[email protected]	
23292	[2023-03-28 14:43:26] VERBOSE[20321][C-000001b0] app_dial.c: PJSIP/xinix.com-00000301 is making progress passing it to PJSIP/200-00000300	
23293	[2023-03-28 14:43:28] VERBOSE[20321][C-000001b0] app_macro.c: Spawn extension (macro-dialout-trunk, s, 37) exited non-zero on 'PJSIP/200-00000300' in macro 'dialout-trunk'	
23294	[2023-03-28 14:43:28] VERBOSE[20321][C-000001b0] pbx.c: Spawn extension (restrictedroute-eccbc87e4b5ce2fe28308fd9f2a7baf3, 07861486831, 12) exited non-zero on 'PJSIP/200-00000300'	
23295	[2023-03-28 14:43:28] VERBOSE[20321][C-000001b0] pbx.c: Executing [h@restrictedroute-eccbc87e4b5ce2fe28308fd9f2a7baf3:1] Hangup("PJSIP/200-00000300", "") in new stack	
23296	[2023-03-28 14:43:28] VERBOSE[20321][C-000001b0] pbx.c: Spawn extension (restrictedroute-eccbc87e4b5ce2fe28308fd9f2a7baf3, h, 1) exited non-zero on 'PJSIP/200-00000300'	
23297	[2023-03-28 14:43:28] VERBOSE[20321][C-000001b0] app_stack.c: PJSIP/200-00000300 Internal Gosub(crm-hangup,s,1) start	
23298	[2023-03-28 14:43:28] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@crm-hangup:1] NoOp("PJSIP/200-00000300", "Sending Hangup to CRM") in new stack	
23299	[2023-03-28 14:43:28] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@crm-hangup:2] NoOp("PJSIP/200-00000300", "HANGUP CAUSE: 127") in new stack	
23300	[2023-03-28 14:43:28] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@crm-hangup:3] ExecIf("PJSIP/200-00000300", "0?Set(__CRM_VOICEMAIL=)") in new stack	
23301	[2023-03-28 14:43:28] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@crm-hangup:4] NoOp("PJSIP/200-00000300", "MASTER CHANNEL: 1680011004.1826 = 1680011004.1826") in new stack	
23302	[2023-03-28 14:43:28] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@crm-hangup:5] GotoIf("PJSIP/200-00000300", "0?return") in new stack	
23303	[2023-03-28 14:43:28] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@crm-hangup:6] Set("PJSIP/200-00000300", "__CRM_HANGUP=1") in new stack	
23304	[2023-03-28 14:43:28] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@crm-hangup:7] AGI("PJSIP/200-00000300", "agi://127.0.0.1/sangomacrm.agi") in new stack	
23305	[2023-03-28 14:43:28] VERBOSE[20321][C-000001b0] res_agi.c: <PJSIP/200-00000300>AGI Script agi://127.0.0.1/sangomacrm.agi completed, returning 0	
23306	[2023-03-28 14:43:28] VERBOSE[20321][C-000001b0] pbx.c: Executing [s@crm-hangup:8] Return("PJSIP/200-00000300", "") in new stack	
23307	[2023-03-28 14:43:28] VERBOSE[20321][C-000001b0] app_stack.c: Spawn extension (restrictedroute-eccbc87e4b5ce2fe28308fd9f2a7baf3, h, 1) exited non-zero on 'PJSIP/200-00000300'	
23308	[2023-03-28 14:43:28] VERBOSE[20321][C-000001b0] app_stack.c: PJSIP/200-00000300 Internal Gosub(crm-hangup,s,1) complete GOSUB_RETVAL=	
23309	[2023-03-28 14:43:28] VERBOSE[20322][C-000001b0] app_mixmonitor.c: MixMonitor close filestream (mixed)	
23310	[2023-03-28 14:43:28] VERBOSE[20322][C-000001b0] app_mixmonitor.c: End MixMonitor Recording PJSIP/200-00000300

Is this what you need? If not how do I get the INVITE log working via the GUI

https://wiki.freepbx.org/display/FPG/Asterisk+CLI+Module

The command, for chan_pjsip, is:

pjsip set logger on

Hi David,

I have done that already via Asterix CLI and added to pjsip.endpoint_custom_post.conf

[global]
endpoint_custom_post.log_invites = yes
endpoint_custom_post.log_request_responses = yes

What else do I need to do please

Make sure verbose logging is on and look at the full log.

I can find no evidence that these options exist.

Remove the manual customizations; they are not needed.
At the Asterisk command prompt, type
pjsip set logger on
You should see a response:
PJSIP Logging enabled
Note that this gets turned off by any config reload, such as the Apply Config button in the GUI, so make your failing test call right after turning on pjsip logger. Then look in /var/log/asterisk/full for the results.

1 Like

Log files ( finally)

https://www.toolfolks.com/docs/Log1.txt

At the first line in Log1.txt, the call has already failed. Please paste from the beginning of the call.

https://www.toolfolks.com/docs/Log2.txt

Cheers

|215771|INVITE sip:[email protected]:5060 SIP/2.0||
|---|---|---|
|215772|Via: SIP/2.0/UDP 92.27.68.65:5060;rport;branch=z9hG4bKPj2a955157-34ac-445a-af58-6e793cb79f9c||
|215773|From: <sip:[email protected]>;tag=eafbd359-5e58-47b5-86e9-8186e39c3e92||
|215774|To: <sip:[email protected]>||
|215775|Contact: <sip:[email protected]:5060>||
|215776|Call-ID: dc192fb2-000f-4e17-826a-a5b966800542||
|215777|CSeq: 18326 INVITE||
|215778|Allow: OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, MESSAGE, REFER||
|215779|Supported: 100rel, timer, replaces, norefersub, histinfo||
|215780|Session-Expires: 1800||
|215781|Min-SE: 90||
|215782|Max-Forwards: 70||
|215783|User-Agent: FPBX-16.0.33(18.13.0)||
|215784|Content-Type: application/sdp||
|215785|Content-Length: 337||
|215786|||
|215787|v=0||
|215788|o=- 1364323657 1364323657 IN IP4 92.27.68.65||
|215789|s=Asterisk||
|215790|c=IN IP4 92.27.68.65||
|215791|t=0 0||
|215792|m=audio 17522 RTP/AVP 0 8 111 9 3 101||
|215793|a=rtpmap:0 PCMU/8000||
|215794|a=rtpmap:8 PCMA/8000||
|215795|a=rtpmap:111 G726-32/8000||
|215796|a=rtpmap:9 G722/8000||
|215797|a=rtpmap:3 GSM/8000||
|215798|a=rtpmap:101 telephone-event/8000||
|215799|a=fmtp:101 0-16||
|215800|a=ptime:20||
|215801|a=maxptime:150||
|215802|a=sendrecv||

The value it is actually using is 202217. As that doesn’t appear anywhere in the logged dialplan, I have to assume that it is coming from a from user setting for the trunk endpoint, and is, possibly, the account name.

You are not sending P-Asserted-Identity or Remote-Party-iD, the common alternatives to the from user field, for caller ID, when from user is being used to identify the account. It should be possible to enable these through the GUI, although they would need to be supported by the provider.

Thanks for the update David.

Where in the GUI do I male these changes. I can’t find them.

It looks as though it is only available for extensions, not trunks, which seems a strange limitation.

Unless someone points out that I have missed something you will have to add send_rpid=yes and/or send_pai=yes as customisations to the end point.

It is available in PJSIP Trunks. Trunks → Trunk → Advanced.

2 Likes

Thanks for the help so far.

I have deleted the second outgoing route.
I have no CID in the trunk or the outbound route.
I have set the CID in the ext.
ext 100 01618261804
ext 210 01628261272

If I call my Three mobile number I get the 2 different CIDs however If I dial a Sky mobile number I get an operator message ‘The destination dialled is not supported’

Which I have posted in Syntax for a custom Destination

So one step further.

This sounds like the mobile operator is not ‘happy’ with the caller ID provided. :roll_eyes:

Any more avenues to try please.

Is the number you are presenting on the same provider as you are using to make the call? Sky may be rejecting caller ID that do not match the immediate source of the call.

Is your provider really in the UK? UK numbers arriving from overseas are likely to get rejected.

(I assume it isn’t a well known financial or governmental number, which are likely to get widely rejected in the UK.)

Sky is a consumer brand, and consumers are particularly likely to be the target of caller ID spoofing and unlikely to be using it themselves, so they may well be more strict on what they will allow.

It is also possible that Sky’s number block is unknown to your provider.

+447861 shows up as Three rather than Sky on my Voxbeam rate sheet. Was this number ported, or is the example you posted in Log2 not a failing case?

+447359 shown in your Custom Destination is assigned to Sky, though the number is partly redacted. If you’d like to test this with various trunks, please PM me the complete number.

Edit: I see that you did post the full number. Would you like me to attempt to call it?

Yes please try. I have the mobile with me.

FYI
07861486831 is Three. My personal number with no issues.
07359627216 is Sky ( I believe is O2) This is the one I cannot call from the PBX

First, the good news: The call using Voxbeam’s Platinum route went through as expected, sent the correct caller ID and was good quality. They sent it via BT, so it’s probably also reliable.

The bad news is that the Voxbeam rate sheet doesn’t have current number assignments for Sky. They show only (+447) 3590-3593, 3681-3689, 3692, 4482-4483. So while my normal rate to Sky is $0.0072/min., the call was charged at the ‘fallback’ rate to +447 of $0.3833, more than 50 times as much!

I assume that if you signed up with them and opened a ticket, they would fix the number ranges for Sky. Then, they might route directly to O2; with luck you could enjoy HD (wideband) calls when connected via VoLTE. However, if their route/rate maintenance is bad in general, you could be in for lots of surprises. The portal does allow you to set a maximum per-minute rate (they reject calls that exceed), so you could fail over to another trunk with a sane rate. However, if they don’t accept your caller ID that won’t help.

If you do decide to sign up with these clowns, on request they will provide $1 credit, so you can test without making a payment or even supplying any financial information.

I have other trunks on the system that could be tried, though they are with US providers and the media server would probably be on the wrong side of the Pond, with awful latency.

Hi Stewart thanks for the call. So what setting did you use to make the call.

I am confused as to what the issue is here.

I am presuming the SKY network does not like the format of the CID ??? Are there any other settings I can try.

I set the Outbound CID as
"Test Test" <+441618261804>

I still get Destination not supported… :angry: