[asterisk-bugs] [JIRA] (ASTERISK-20638) SIP dialog matching is incorrect when multiple provisional responses are received with pedantic SIP checking

Eelco Brolman (JIRA) noreply at issues.asterisk.org
Thu Nov 22 03:47:45 CST 2012


    [ https://issues.asterisk.org/jira/browse/ASTERISK-20638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=200008#comment-200008 ] 

Eelco Brolman commented on ASTERISK-20638:
------------------------------------------

I have tested the following scenario with asterisk 1.8, and it *does* fail. Look at the following scheme:

|| Action || Asterisk callid || Asterisk fromtag || Asterisk totag ||
| Asterisk dials SIP proxy | callid001 | fromtag001 | _(none)_ |
| SIP proxy dials phone A  | callid001 | fromtag001 | _(none)_ |
| phone A is ringing and sends 180 (totagA)  | callid001 | fromtag001 | totagA |
| SIP proxy stops dialing phone A and dials phone B  | callid001 | fromtag001 | totagA |
| phone B is ringing and sends 180 (totagB)  | callid001 | fromtag001 | *totagA* |
| phone C does callpickup of ringing phone B (callid001, fromtag001, totagB)  | callid001 | fromtag001 |  *totagA* |
| Since asterisk has not updated the totag againg, call pickup fails in pedantic mode  | callid001 | fromtag001 |  *totagA* |

Things get worse and not solvable for asterisk when the proxy decides to simultaneously dial multiple phones. Asterisk receives multiple totags (via the 180 response), and has no means to store them all. So a callpickup for a phone is likely to fail (wrong totag). 


                
> SIP dialog matching is incorrect when multiple provisional responses are received with pedantic SIP checking
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-20638
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-20638
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_sip/Interoperability
>    Affects Versions: 1.8.17.0
>            Reporter: Eelco Brolman
>            Assignee: Eelco Brolman
>         Attachments: pedantic-call-pickup-from-tag.patch
>
>
> When an external call pickup (INVITE with Replaces: header) is sent to asterisk, asterisk tries to find the call ({{get_sip_pvt_byid_locked}}) based on the {{callid}}, {{fromtag}} and {{totag}} in pedantic mode.
> The match will fail in certain situations since the fromtag is not definite (final) as long as only Provisional responses have been received.
> When asterisk dials a SIP proxy which does ring group dialing for instance, multiple {{180 Ringing}} responses will be received, and the dialog within asterisk cannot be matched against a single fromtag.
> So as long as only provisional responses are received (i.e. when flag {{SIP_PAGE2_DIALOG_ESTABLISHED}} is not set), asterisk should not reject the match based on the fromtag.
> The patch for this specific situation is easy of course, you need to test if the dialog is established when checking the fromtag:
> {code}
> if ((frommismatch && ast_test_flag(&sip_pvt_ptr->flags[1], SIP_PAGE2_DIALOG_ESTABLISHED)) || tomismatch) {
> {code}
> but I don't know if this breaks other checks.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list