Hi now I change my config like this:

Request_route{

….

 

….

if (is_method("INVITE")) {                                                                                                                                                                                                          

         dlg_manage();                                                                                                                                                                                                                   

         setflag(FLT_ACC); # do accounting                                                                                                                                                                                               

         setflag(FLT_ACCFAILED); # -- this is added to record failed calls                                                                                                                                                               

         setflag(FLT_ACCMISSED);                                                                                                                                                                                                         

         route(SERVICES);              # Sems Media Server Block                                                                                                                                                                         

         route(DROUTING);              # Call Routing Block                                                                                                                                                                              

  }                                                             

}

 

route[SERVICES] {

             $ru = "sip:" + $rU + "@" + "192.168.100.120:5080";                                                                                                                                                                         

             remove_hf("P-App-Name");                                                                                                                                                                                                   

             append_hf("P-App-Name: early_announce\r\n");                                                                                                                                                                               

             append_hf("P-App-Param: B2B=yes\r\n");                                                                                                                                                                                      

             $var(semsuri)=$ru;                                                                                                                                                                                                          

             revert_uri();                                                                                                                                                                                                               

             append_branch("$var(semsuri)");

}

The call routes to the callee and 183 message sent back to the caller but the calle don’t hear media and when calle picks up the call the calle keeps sending 200 ok with no media

 

 

From: Pavel Eremin
Sent: Monday, June 20, 2022 11:18 AM
To: Kamailio (SER) - Users Mailing List
Subject: Re: [SR-Users] kamailio + sems for early media

 

If I understand correctly, when you receive 200 Ok, all branches will be finished. So, you don't need to cancel them. 

 

сб, 18 июн. 2022 г. в 23:59, mohsen khashei <mkhashei@gmail.com>:

Hi I want to use kamailio with sems for early media generation. For that purpose I write a service route that when an invite received by kamailio  it triggers that route in that route I fork the call to the sems and continue to the calle when I receive 200 ok cancel all other branches. But no media between 2 call ends please help me. I know something is wrong in my logic

 

route[SERVICES] {

rewritehostport("127.0.0.1:5080");

             append_branch();

             t_on_branch("1");

             t_on_reply("catch_200");

}

branch_route[1] {

            remove_hf("P-App-Name");

            append_hf("P-App-Name: early_announce\r\n");

            append_hf("P-App-Param: B2B=no\r\n");

    }

 

    onreply_route[catch_200] {

                 if(status=="200") {

                         if (t_cancel_branches("others")) {

                         xlog("cancelled all branches\n");

                         }

                }

    }

 

Thanks.

 

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
  * https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users