Scenario
Asterisk FreePBX 1.6.2.11 used as a IVR to play an outgoing warning message for users so that they are aware that they are making an external call.
The source IP PBX is a Mitel 3300 and the call is passed over SIP trunks to the Asterisk, The FreePBX then plays a short message before passing the call back to the Mitel 3300. Once the call is back on the Mitel 3300 the call is then passed over to an external PSTN SIP gateway.
We are trying to get the OLI (originating calling line ID) to present correctly
Currently when dialling a call through the Asterisk I can see that the extension dialling the external number has a from field populated with it’s full PSTN number
however when the call is passed back to the Mitel SIP gateway and then passed to the external SIP gateway the OLI has now changed to the calling number that was dialled.
e.g extension 59990 dials 901234567890
this routed in to the Asterisk with the leading 9 stripped off
I can see in the SIP trace that the from field has the full PSTN number of the extn
From: <sip:01234559990@IP address of Mitel 3300>
Then I can see the calling number
To: <sip:01234567890@IP address of Asterisk>
then there is the Contact
Contact: “Handset Username” <sip:01234567890@IP address of Mitel 3300>
Later once the call has passed through the Asterisk I see
REFER sip:01234567890@IP address of Mitel 3300
From <sip:01234567890@IP address of Asterisk>
To “Handset Username” <sip:01234559990@IP address of Mitel 3300>
Contact: <sip:01234567890@IP address of Asterisk>
Refer-To: sip:7701234567890@Mitel1 (77 is the new routing digits when passing back to the Mitel 3300)
Referred-By: <sip:01234567890@IP address of Asterisk>
Then I get a Makecall
To :sip:01234567890@IP address of external SIP gateway
From :<sip:IP address of Mitel 3300>
RequestUri :sip:01234567890@IP address of external SIP gateway
So now I have lost the OLI as the calling number is now the called number 01234567890
This in turn prevents the OLI from being displayed as a caller ID
My extension.conf file has the following
[to-Asterisk]
include => from-internal
exten => _.,1,Noop(Destination number found ${EXTEN})
exten => _.,n,Noop(${CALLERID(num)}===${CALLERID(name)})
exten => _.,n,Answer
exten => _.,n,Playback(/var/lib/asterisk/sounds/custom/externalwarning)
exten => _.,n,Transfer(SIP/ 77${EXTEN}@Mitel1)
exten => _.,n,Hangup
exten => h,1,Hangup()
I think that the CALLERID may have to be changed but do not know all the context variables other that Set or Noop
Do you have any ideas as how we might get the correct CLI displayed?