Network set up like below.
End User ------- Kamailio -------- Freeswitch ----- Sip Server A
But freeswitch replies back to kamailio as 480 temporary unavailable and call is getting dropped.
End User ------ Kamailio ----------- Freeswitch -------- SIP Server A
REGISTER -------> | ---------------------------------------------->|
| -----------> | <----------------------- 200 OK
INVITE -------------> | --------------------->| --------------------> |
|<----------- 407
(Proxy Auth Req.)
ACK ---------> |
| <--------- | <-------- 480
(Temporary Unavailable)
So here is my question ,
Need suggestions...
FreeSWITCH is not a SIP-proxy, FreeSWITCH is B2BUA. It means that FreeSWITCH trying to make independent call to SIP Server A. If it will be successful, then FreeSWITCH will bridge it with call from End User (not from kamailio, because kamailio is a SIP-proxy in this scheme, not B2BUA). It can't resend 407 to kamailio because it haven`t appropriate mechanism. But you can store authentication information in gateways on a FreeSWITCH side and instruct FreeSWITCH to make appropriate calls for each user throw dialplan.
It will work, if you write somthing like this in your external.xml SIP-profile config:
<gateway name="asterlink.com">
<param name="username" value="cluecon"/>
<param name="password" value="2007"/>
<!--/// do not register ///-->
<param name="register" value="false"/>
</gateway>
and something like this in dialplan default.xml:
<extension name="end-user">
<condition field="${sip_from_user}" expression="<end_user_caller_id_number>">
<action application="bridge" data="sofia/gateway/asterlink.com/${destination_number}"/>
</condition>
</extension>