Skip to content

Commit 99cef84

Browse files
InterLinked1Friendly Automation
authored andcommitted
res_pjsip_session.c: Map empty extensions in INVITEs to s.
Some SIP devices use an empty extension for PLAR functionality. Rather than rejecting these empty extensions, we now use the s extension for such calls to mirror the existing PLAR functionality in Asterisk (e.g. chan_dahdi). ASTERISK-30265 #close Change-Id: I0861a405cd49bbbf532b52f7b47f0e2810832590
1 parent af5f3da commit 99cef84

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

res/res_pjsip_session.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3665,6 +3665,11 @@ static enum sip_get_destination_result get_destination(struct ast_sip_session *s
36653665
}
36663666

36673667
ast_copy_pj_str(session->exten, ast_sip_pjsip_uri_get_username(ruri), sizeof(session->exten));
3668+
if (ast_strlen_zero(session->exten)) {
3669+
/* Some SIP devices send an empty extension for PLAR: this should map to s */
3670+
ast_debug(1, "RURI contains no user portion: defaulting to extension 's'\n");
3671+
ast_copy_string(session->exten, "s", sizeof(session->exten));
3672+
}
36683673

36693674
/*
36703675
* We may want to match in the dialplan without any user

0 commit comments

Comments
 (0)