[asterisk-bugs] [JIRA] (ASTERISK-15572) [patch] SIP call documentation - feel free to edit

Sean Bright (JIRA) noreply at issues.asterisk.org
Mon Feb 13 16:34:10 CST 2017


     [ https://issues.asterisk.org/jira/browse/ASTERISK-15572?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Bright updated ASTERISK-15572:
-----------------------------------

    Send back to Developer?: I'm done. Send it back!
                     Status: Waiting for Feedback  (was: Waiting for Feedback)

> [patch] SIP call documentation - feel free to edit
> --------------------------------------------------
>
>                 Key: ASTERISK-15572
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-15572
>             Project: Asterisk
>          Issue Type: Bug
>          Components: Documentation
>            Reporter: Moises Silva
>            Assignee: Sean Bright
>            Severity: Minor
>         Attachments: sipdoc.txt
>
>
>  1. A SIP call usually starts in sipsock_read() in channels/chan_sip.c, that is a callback function executed when the SIP socket has stuff to be read.
>    2 .When a valid SIP request is read, it continues to
> handle_request_do(), wich will perform the requested method. In the case
> of a new call, this is SIP_INVITE and then the call passes to
> handle_request_invite(), where the call is attended and, if
> authorized, will proceed to ast_pbx_start() at main/pbx.c
>    3. In ast_pbx_start()  the channel starts execution in a brand new
> thread and the call will start to advance through extensions in
> extensions.conf designed context. In the case it founds the Dial()
> dial plan command, the call will proceed to dial_exec() and dial_exec_full() on
> apps/app_dial.c
>   4. Here app_dial will create a new channel in the same thread
> according to the endpoint string specified in extensions.conf Dial()
> command with a call to ast_request() in main/channel.c
>   5. In the case that the endpoint is other SIP device, the call will
> proceed to to create a new SIP technology channel with a call to
> sip_request_call() at channels/chan_sip.c again.
>   6. Just after leaving sip_request_call(), apps/app_dial.c code will
> execute a call to ast_call() at main/channel.c to place the outgoing SIP
> call, which maps to sip_call() in channels/chan_sip.c for the SIP technology, which takes care of sending the INVITE to the other party.
>   7. At this point the call has been placed and apps/app_dial.c will be in a loop calling ast_read() to read frames from the outgoing channel waiting for control frames to monitor the progress of the call, when answered (AST_CONTROL_ANSWER frame), apps/app_dial.c code will make a call to
> ast_bridge_call() in main/features.c to connect the 2 channels (the
> incoming and the outgoing).
>    8. ast_bridge_call() will call core function ast_channel_bridge() which calls ast_generic_bridge() in main/channel.c that will transmit all audio frames from the caller to the callee and viceversa.
>    9. In case that native bridge exists (ast_channel_bridge checks the tech->bridge function pointers of the 2 channels to see if native bridge can be done), then ast_rtp_instance_bridge() will be called for SIP/RTP native bridging, that is the SIP technology interface for bridging as defined in channels/chan_sip.c sip_tech structure. The code in app_dial.c will be blocked until something breaks the bridge (native or not), for example, some party hangs up.
>    10. In the case where the originated channel hangs up, apps/app_dial.c code will call ast_hangup() in the outgoing channel, which in turns calls the SIP technology interface for hangup, sip_hangup() in channels/chan_sip.c obviously, that method takes care of sending the SIP BYE message.
>    11. The original channel will return to PBX extensions execution in
> extensions.conf, ready to execute other commands such as Playback() or
> even other Dial().



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list