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

160 lines
8.0 KiB
Plaintext
Raw Normal View History

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