I am running: Asterisk 20.7.0 built by pi @ raspberrypi on aarch64 running Linux built on 2024-04-02 16:50:39 UT. I am constructing a “domestic” digital exchange using two sip channels (not trunks) and perhaps 20 endpoints including mobiles and SIP softphones. By definition I do not have DID numbers.
I wish to ring a number of endpoints, the first to pick up answers.
Just using something like: same => n,Dial(PJSIP/70&PJIP/63&PJSIP/84)
But, the callees are a mixture:
simple internal extensions as above
some will be pstn numbers 01234567890-
some will be sip: addresses i.e. firstname.lastname@sip.linphone.com
Mostly the callee numbers are harvested from the contact = of some AOR entries
My exchange is not visible for inbound connections from the internet. For a sip return call it is necessary to use sip:id at my sip service provider e.g. 12345678@sip.aql.com.
In order to place outbound calls destined for PSTN my sip service provider needs the CALLERID(num) to be my sip id. They replace that with the appropriate PSTN number.
Asterisk seems to contact firstname.lastname@sip.linphone.org directly, not passing through the sip service provider.
I am trying to find a way of changing the CALLERID(num) of the caller depending on called number.
I have tried pre dial subroutines. If I use the “caller” subroutine it changes it once to the 12345678 of my sip provider id which works well for PSTN numbers. It is then used in the From line for all dials.
Not so good for either internal extensions or for firstname.lastname@sip.linphone.org receivers.
If I use the callee subroutine, it would appear to be too late to change the callerid in the “from” header so PSTN numbers fail and firstname.lastname@sip.linphone.org recipients get an internal number like 93@sip.myinternalserver.com which cannot be called.
So, the ring group sort-of works in that all the phones ring out, but the callerid means nothing to most of them.
Can anyone help in suggesting a method of changing the outbound header “From” depending on the destination channel to be used i.e. internal, sipservice or directly on the internet when using dial() list of callees?