Hello,
My proposal to solve your issue is based on two parts.
1/ Add on your user line on wazo-ui two variables:
2/ Add a dialplan subroutine like this:
[xivo-subrgbl-outcall]
exten = s,1,NoOp(This is an example for all my outcalls)
same = n,GotoIf($[${XIVO_DSTNUM} == 911]?:return)
same = n,Set(CALLERID(num)=${EMERGENCY_NUMBER})
same = n,Set(_EMERGENCY_ROOM=${EMERGENCY_ROOM})
same = n,GoSub(wazo-add-pre-dial-hook,s,1(ng911))
same = n(return),Return()
[ng911]
exten = s,1,NoOp(Set ng911)
same = n,Set(PJSIP_HEADER(add,X-ng911)=${EMERGENCY_ROOM})
same = n,Return()