Depending on the provider, outbound caller ID is handled in 3 ways. Simplest is in the From header. I donât think that will work, because you have (and presumably need)
fromuser=USERP
You can try removing that and see whether outbound calls still work. If so, caller ID might work.
Next is in the P-Asserted-Identity header. Unfortunately, you have already tried that and it didnât help. But confirm (with pjsip logger) that you are indeed sending this header correctly.
Unfortunately, some providers require you to send both the pilot number and the desired caller ID with each call. The idea is you must declare âIâm sending [desired CLI] on behalf of [pilot number]â. There is usually a Diversion header involved, but the exact rules vary by provider. If Du is one of these, they should supply documentation as to what is needed, or at least an example of a valid INVITE. If they havenât and you canât find it online, I suggest opening a ticket with them.
Iâm very puzzled about outbound calls dropping. If itâs for lack of RTP, there would also be no or one-way audio on these calls. The other is ACK (to their 200 OK) not being properly sent, but itâs hard to see why that would happen. A complete log of the call (including sip debug) may be useful.
Your present routing seems to be sending everything over the private network; AFAICT there is no internet access at all. You couldnât have any external extensions, or even update the software. If this is the case, we need to sort out what routes are required.
I donât understand why chan_sip is not recognizing the outboundproxy address for the incoming call, making it look like a âguestâ. You could force that with a separate entry, in /etc/asterisk/sip_custom.conf, add something like:
[Du-in]
disallow=all
allow=alaw
host=10.59.108.25 (use actual address they send INVITE from)
type=friend
insecure=port,invite
context=from-pstn-toheader
canreinvite=no
qualify=no
Iâd like to revisit pjsip; perhaps some of the changes you made will cause audio to work. If not, it shouldnât be hard to troubleshoot, because we have a working example (with chan_sip) for comparison.