You would be authenticating the calls TWICE, is this what you want?
I found the easiest would be to just configure in your asterisk the Kamailio gateway as the proxy.

I haven’t worked with asterisk in a while, but in freeswitch al that’s needed is adding a parameter called “proxy” and set the Kamailio’s up address. All this with Kamailio’s default configuration.

This would only work if both asterisk and Kamailio have public addresses. No RTP proxying, they’d go straight to the provider.

Regards,

David
On Wed, 14 Nov 2018 at 02:07, Valter Nogueira <valter@fastway.com.br> wrote:
Hi Henning,

thanks for your tip.

I just checked it and I am sure it will be valuable.





Atenciosamente,



2018-11-13 19:04 GMT-02:00 Henning Westerholt <hw@kamailio.org>:
Am Freitag, 9. November 2018, 21:25:15 CET schrieb Valter Nogueira:
> Today, I use Asterisk as a SIP/RTP PROXY
>
> I proxy from customers Asterisks to a VOIP provider, in a multi-homed
> server.
>
> Now, I want to move to Kamailio without any rupture in customer's
> configuration.
>
> As anyone can imagine I am kind of lost.
>
> USER ACCOUNTS
>
> In Asterisk, I create a dynamic host account named ACCOUNT1 and I receive
> in *FROM HEADER sip:ACCOUNT1@customer_ip_address*
>
> In Kamailio, I have to define the account's domain like *kamctl add
> ACCOUNT1@mydomain.com <ACCOUNT1@mydomain.com> password. *Kamailio just
> accepts a REGISTER/INVITE from *ACCOUNT1@mydomain.com
> <ACCOUNT1@mydomain.com>*
>
>
> SIP/RTP PROXY
>
> In Asterisk, I just dialout to the VOIP PROVIDER like *dial
> (SIP/VOIP_ACCOUNT/${EXTENSION})*
>
> Asterisk does all the magic (it is a B2BUA). It bridges the new call and
> media to the original call. Moreover, user don't know anything about how
> call are completed, nor how credentials are setup and soon.
>
> In Kamailio, I guess that I have to use nat, tm and rtpproxy modules and
> maybe uac. I am not sure how to setup it.
>
> Can someone send me a clue?

Hello Valter,

did you already looked into this tutorials? They are for a bit older version
of Kamailio and asterisk, but should give you ideas about the direction.

https://kb.asipto.com/asterisk:index

Best regards,

Henning

--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://skalatan.de/services
Kamailio security assessment - https://skalatan.de/de/assessment

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users