herlesupreeth / kamailio

Kamailio - The Open Source SIP Server for large VoIP and real-time communication platforms -
https://www.kamailio.org
Other
16 stars 18 forks source link

Kamailio with Asterisk integration #7

Open M-Nusrat-Ullah opened 10 months ago

M-Nusrat-Ullah commented 10 months ago

I am working on integrating asterisk with kamailio IMS. I am quite new in this field. Any idea on how can I start doing it? It would be a great help.

herlesupreeth commented 10 months ago

Hey, sorry for the delayed response. I dont have much experience integrating IMS with Asterisk. Can you please let me know how you plan to use Asterisk in that setup? as a MMTEL you mean?

All I have tried so far was to direct INVITE SIP message to Asterisk but that itself wont be enough since Asterisk wont have any registration information so I had to direct REGISTER SIP message as well. In order to do so you have to configure the Initial Filter Criteria in your HSS (the one connected to I-CSCF and S-CSCF).

M-Nusrat-Ullah commented 10 months ago

Sorry for the delayed reply from my part too. My final goal is to integrate IMS with asterisk in such a way where if UE registered in IMS calls a registered UE in asterisk, they can communicate with each other and vice versa. But now, I am starting with a simple echo-test of IMS to check latency of IMS calls. Scenario I have imagined for this test is like, I will make a call in IMS, then IMS will send it to asterisk server, then asterisk will send it back to IMS server to the UE that made the call, and I can hear my own voice. If you can help me achieve these two scenarios, it will be great. Also, you have any other good approach for the echo test, it is also welcome. Thank you very much in advance.

herlesupreeth commented 10 months ago

I am not sure whether I can help you in this regard since I dont have much experience in Asterisk. All I can suggest is to refer to this video - https://www.youtube.com/watch?v=3nVRpzkUbIg&t=2s

M-Nusrat-Ullah commented 10 months ago

The problem isn't solved in his video as he mentioned it in the details of the video. No problem, I will try my best to make them working. In the meantime, if you get anything on integrating them, please share it here. Thank you for your time.

herlesupreeth commented 10 months ago

For that third-party registration information here is an issue highlighting the commits with fixes - https://github.com/herlesupreeth/docker_open5gs/issues/141

NUCLEAR-WAR commented 2 months ago

Hi @M-Nusrat-Ullah,

I know this is a late answer, but hope it could help. If you plan to integrate Asterisk as AS in Kamailio IMS the key in this is to preserves at least the second Route Header which contains the Identifier for the call leg, so that the S-CSCF can recognize the call leg and know it comes from the AS so he don't need to trigger the IFC again, asterisk has some functions to read incoming headers and add it to the outgoing invite, the main function is PJSIP_HEADER, I did not test it with Route header but you may try it. Here is the docs regarding it. Modifying the code to make it also look for Route Header should not be so hard.

I also recommend Asterisk to FreeSWITCH in regarding for codec specially AMR, as it deal better with AMR than FreeSWITCH and its more stable and can support EVS. Please note that AMR/EVS support use external code not maintained from Asterisk, see here for AMR and here for EVS.