freeswitch/libs/sofia-sip/libsofia-sip-ua/nta/invite.msc

160 lines
8.0 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#
# MSCs Illustrating NTA Usage
#
User Agent Client Initiating a Call
-----------------------------------
APP ¦ NTA
User ¦
Agent ¦
| ¦
| nta = nta_agent_create
|- - - - - - - - - - - - - - - - -> NTA
| (msg_cb, contact) ¦ agent
| ¦ |
| ¦ |
|- - ->Call ¦ |
| | ¦ |
| | leg = nta_leg_create |
| |- - - - - - -¦- - - - - - -|- - - -> leg
| |(nta, leg_cb, ..., To, From, ... ) |
| | ¦ | |
| | ¦ | |
| | oreq = nta_outgoing_create| |
| |- - - - - - -¦- - - - - - -|- - - - - | - - -> outgoing
| | (leg, response_cb, INVITE, url, headers...) |
| | ¦ | | |
| | ¦ | | | INVITE
| | ¦ | | |---->
| | ¦ | | |
| | ¦ | | | 100 Trying
| | ¦ | | |<----
| | ¦ | | |
| | ¦ | | | 180 Ringing
| | ¦ | response_cb(180) |<----
| ALERT |<--------------------------|----------|------------|
|<-------| ¦ | | | 200 OK
| | ¦ | response_cb(200) |<----
|OFFHOOK |<--------------------------|----------|------------|
|<-------| ¦ | | |
| | nta_outgoing_destroy | | |
| |---------------------------|----------|----------->|
| | ¦ | | X
| | nta_leg_destroy | |
| |---------------------------|--------->|
| | ¦ | X
| | leg = nta_leg_create |
| |- - - - - - -¦- - - - - - -|- - - -> leg
| |(nta, leg_cb, ..., To+tag, From, ...) |
| | ¦ | |
| | oreq = nta_outgoing_create| |
| |- - - - - - -¦- - - - - - -|- - - - - | - - -> outgoing
| | (leg, ..., ACK, url, headers) | |
| | ¦ | | | ACK
| | ¦ | | |---->
| | nta_outgoing_destroy | | |
| |---------------------------|----------|----------->|
| | ¦ | | X
User Agent Client Releasing a Call
-----------------------------------
APP ¦ NTA
User Call ¦ NTA leg
Agent | ¦ agent |
| | ¦ | |
|ONHOOK | ¦ | |
|------->| ¦ | |
| |oreq = nta_outgoing_create | |
| |- - - - - - -¦- - - - - - -|- - - - - | - - -> outgoing
| | (leg, ..., BYE, url, headers) | |
| | ¦ | | | BYE
| | ¦ | | |---->
| | ¦ | | |
| | ¦ | | | 180 Ringing
| | ¦ | response_cb(180) |<----
| |<--------------------------|----------|------------|
| | ¦ | | | 200 OK
| | ¦ | response_cb(200) |<----
| |<--------------------------|----------|------------|
| | ¦ | | |
| |nta_outgoing_destroy | | |
| |---------------------------|----------|----------->|
| | ¦ | | X
| |nta_leg_destroy | |
| |---------------------------|--------->|
| | ¦ | X
| X ¦ |
User Agent Server Accepting a Call
----------------------------------
APP ¦ NTA
User ¦ NTA
Agent ¦ agent
| ¦ | INVITE
| ¦ |<----------------------
| ¦ |
| msg_cb(leg, msg) |
|<-----------------------------------|
| ¦ |
|- - -> Call ¦ |
| | nta_msg_leg ¦ |
| |-------------------------->|- - - -> leg
| | (msg, request_cb) | |
| | ¦ | |- - - -> incoming
| | nta_leg_tag ¦ | | |
| |---------------------------|--------->| |
| | (tag) ¦ | | |
| | ¦ | request_cb(reply) |
| |<--------------------------|----------|------------|
| | ¦ | | |
| | nta_incoming_bind(ireq, ack_cb) | |
| |---------------------------|----------|----------->|
| | ¦ | | |
| | nta_incoming_reply(180) | | |
| ALERT |---------------------------|----------|----------->| 180 Ringing
|<-------| ¦ | | |---->
| | ¦ | | |
|OFFHOOK | ¦ | | |
|------->| nta_incoming_reply | | |
| |---------------------------|----------|----------->| 200 Ok
| | (200, sdp) ¦ | | |---->
| | ¦ | | |
| | ¦ | | | ACK
| | ¦ | |ack_cb(ACK) |<----
| |<--------------------------|----------|------------|
| | ¦ | | |
| | nta_incoming_destroy(ireq)| | |
| |---------------------------|----------|----------->|
| | ¦ | | X
User Agent Server Receiving a Call Release
------------------------------------------
APP ¦ NTA
User Call ¦ NTA leg
Agent | ¦ agent |
| | ¦ | | BYE
| | ¦ | |<------------------
| | ¦ | |
| | ¦ | |- - - -> Incoming
| | ¦ | | |
| | ¦ | request_cb(reply) |
| ONHOOK |<--------------------------|----------|------------|
|<-------| ¦ | | |
| | nta_incoming_reply(200) | | |
| |---------------------------|----------|----------->| 200 Ok
| | (200, sdp) ¦ | | |---->
| | ¦ | | |
| | nta_incoming_destroy(ireq)| | |
| |---------------------------|----------|----------->|
| | ¦ | | X
| |nta_leg_destroy | |
| |---------------------------|--------->|
| X ¦ | X