[asterisk-bugs] [Asterisk 0016765]: [patch] SIP call documentation - feel free to edit

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Feb 4 08:58:43 CST 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=16765 
====================================================================== 
Reported By:                moy
Assigned To:                oej
====================================================================== 
Project:                    Asterisk
Issue ID:                   16765
Category:                   Documentation
Reproducibility:            N/A
Severity:                   minor
Priority:                   normal
Status:                     assigned
Asterisk Version:           SVN 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-02-03 15:18 CST
Last Modified:              2010-02-04 08:58 CST
====================================================================== 
Summary:                    [patch] SIP call documentation - feel free to edit
Description: 
 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().
====================================================================== 

---------------------------------------------------------------------- 
 (0117708) moy (reporter) - 2010-02-04 08:58
 https://issues.asterisk.org/view.php?id=16765#c117708 
---------------------------------------------------------------------- 
SIP documentation uploaded associated to my license agreement. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-02-04 08:58 moy            Note Added: 0117708                          
======================================================================




More information about the asterisk-bugs mailing list