Skip to content

Commit 2156cc6

Browse files
committed
add SDP management for Re-Invite and reply
1 parent b556af0 commit 2156cc6

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/sip/kamailio.cfg

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,9 @@ route[WITHINDLG] {
518518
if (is_method("BYE")) {
519519
setflag(FLT_ACC); # do accounting ...
520520
setflag(FLT_ACCFAILED); # ... even if the transaction fails
521-
} else if ( is_method("ACK|UPDATE") ) {
521+
} else if ( is_method("ACK|INVITE|UPDATE") ) {
522522
# ACK is forwarded statelessly and UPDATE will be used to update the SDP INVITE in dialog
523-
if (is_method("UPDATE")) {
523+
if (is_method("INVITE|UPDATE")) {
524524
route(RTPE);
525525
}
526526
route(NATMANAGE);
@@ -849,6 +849,16 @@ onreply_route[MANAGE_REPLY] {
849849
route(NATMANAGE);
850850
}
851851

852+
if (has_body("application/sdp")) {
853+
if (route(MSG_RECV_EXTERNAL)) {
854+
xinfo("rtpe answer from external\n");
855+
rtpengine_answer("replace-origin replace-session-connection direction=external direction=internal");
856+
} else {
857+
xinfo("rtpe answer from internal\n");
858+
rtpengine_answer("replace-origin replace-session-connection direction=internal direction=external");
859+
}
860+
}
861+
852862
return;
853863
}
854864

0 commit comments

Comments
 (0)