SIP INVITEs | Twilio

文章推薦指數: 80 %
投票人數:10人

A SIP INVITE is a SIP request message that initiates a SIP call. A SIP INVITE is made up of lines of text. The first line in an INVITE is called a ... TwilioDocs SMS Voice Runtime Video Studio Alldocs... SDKs Help Login Signup SMS Voice Runtime Video Studio Alldocs... SDKs Help Login Signup ASIPINVITEisaSIPrequestmessagethatinitiatesaSIPcall.    ASIPINVITEismadeupoflinesoftext.ThefirstlineinanINVITEiscalledaRequest-Line,whichisfollowed bymorelinesoftextcalled"headers".TheheaderscontaininformationabouttheINVITE,suchastheidentityofthecaller,whethertheINVITEwasforwardedbeforebeingsenttotherecipient,andthenumberoftimesacallmaybeforwarded.  TableofContents: ExampleSIPINVITE SIPURIs SIPUser SIPHostorSIPDomain SIPPort SIPRequest-Line Request-URI CommonSIPINVITEHeaders Viaheader Max-Forwardsheader Toheader Fromheader Call-IDheader CSeqheader Contactheader Diversionheader P-Asserted-Identityheader OtherSIPINVITEHeaders Remote-Party-Id(RPID)header P-Charge-Infoheader ExampleSIPINVITE BelowisanexampleofaSIPINVITErequestmessage,whichincludessomecommonly-usedSIPINVITEheaders. INVITEsip:[email protected]/2.0 Via:SIP/2.0/UDP192.168.10.10:5060;branch=z9hG4bK776asdhds Max-Forwards:70 To:"Bob" From:"Alice";tag=1 Call-ID:a84b4c76e66710 CSeq:1INVITE Contact:"Alice" Diversion:"Sales" P-Asserted-Identity:"Alice" Content-Length:0 SIPURIs IntheINVITEabove,youcanseeseveralexamplesofwhatarecalledSIPURIsthatlooklikee-mailaddresses.ASIPURIidentifiesausers'contactinformationbyindicatingaspecificuserataspecifichost/domain.ASIPURIcouldbeanidentifierforaspecificperson,avoicemailbox,agroupwithinanorganization(like"sales"or"marketing"),etc. sip:[email protected] ThepartsofaSIPURIaredescribedbelow. SIPUser Theuserisaphonenumber,word,orusernamethatsitsbetweenthesip:andthe@inaSIPURI. sip:[email protected] sip:[email protected] sip:[email protected] SIPHostorSIPDomain Thehostordomainfollowsthe@inaSIPURIandcanbeadomainorIPaddress. sip:[email protected] sip:[email protected] SIPPort ASIPURIcanalsocontainaportnumber.Itiswrittenaftera:followingthehost.IfnoportisincludedintheSIPURI,thedefaultSIPport5060isused. sip:[email protected]:6000 SIPRequest-Line ASIPINVITEisatypeofSIPrequest.ThefirstlineinanySIPrequestiscalledtheRequest-Line. INVITEsip:[email protected]/2.0 Via:SIP/2.0/UDP192.168.10.10:5060;branch=z9hG4bK776asdhds Max-Forwards:70 To:"Bob" From:"Alice";tag=1 Call-ID:a84b4c76e66710 CSeq:1INVITE Contact:"Alice" Diversion:"Sales" P-Asserted-Identity:"Alice" Content-Length:0 TheRequest-Linecontainsthreeparts: Therequestmethodname: INVITEsip:[email protected]/2.0 TheRequest-URI: INVITEsip:[email protected]/2.0 TheSIPprotocolversion: INVITEsip:[email protected]/2.0 Request-URI TheRequest-URIisthecontactinformationfortherecipientoftheSIPINVITE.ItisfoundwithintheRequest-LineoftheINVITE. TheRequest-URI: INVITEsip:[email protected]/2.0 TheRequest-URIUser: INVITEsip:[email protected]/2.0 TheRequest-URIHost: INVITEsip:[email protected]/2.0 CommonSIPINVITEHeaders SIPheaderscontaininformationabouttheSIPmessage. INVITEsip:[email protected]/2.0 Via:SIP/2.0/UDP192.168.10.10:5060;branch=z9hG4bK776asdhds Max-Forwards:70 To:"Bob" From:"Alice";tag=1 Call-ID:a84b4c76e66710 CSeq:1INVITE Contact:"Alice" Diversion:"Sales" P-Asserted-Identity:"Alice" Content-Length:0 TheSIPheadersinaSIPrequestfollowtheRequest-Line. ASIPheaderhasanameandavalue.Theheadernameisbeforethecolon(:),theheadervalueiswhatfollowsthecolon.Fortheheaderonline7above,theheaderwouldbecalledthe"CSeqheader",andvalueoftheCSeqheaderis1INVITE. Viaheader INVITEsip:[email protected]/2.0 Via:SIP/2.0/UDP192.168.10.10:5060;branch=z9hG4bK776asdhds Max-Forwards:70 To:"Bob" From:"Alice";tag=1 Call-ID:a84b4c76e66710 CSeq:1INVITE Contact:"Alice" Diversion:"Sales" P-Asserted-Identity:"Alice" Content-Length:0 Thisheaderfielddescribesthetransportusedforthetransaction(SIP/2.0/UDP)andidentifieswhereresponsesshouldbesent(to192.168.10.10onport5060).ThebranchparameterisauniquevalueusedtoidentifythetransactionthatiscreatedbytheSIPrequest. Max-Forwardsheader INVITEsip:[email protected]/2.0 Via:SIP/2.0/UDP192.168.10.10:5060;branch=z9hG4bK776asdhds Max-Forwards:70 To:"Bob" From:"Alice";tag=1 Call-ID:a84b4c76e66710 CSeq:1INVITE Contact:"Alice" Diversion:"Sales" P-Asserted-Identity:"Alice" Content-Length:0 Thisheaderlimitsthenumberofhopsarequestcanmakeonthewaytoitsdestination.Thevalueisanintegerthatdecreasesbyoneateachhop.IfthevalueoftheMax-Forwardsheaderreaches0beforetheSIPrequestreachesitsdestination,therequestwillberejectedwitha483error(TooManyHops). Toheader INVITEsip:[email protected]/2.0 Via:SIP/2.0/UDP192.168.10.10:5060;branch=z9hG4bK776asdhds Max-Forwards:70 To:"Bob" From:"Alice";tag=1 Call-ID:a84b4c76e66710 CSeq:1INVITE Contact:"Alice" Diversion:"Sales" P-Asserted-Identity:"Alice" Content-Length:0 TheToheadercontainsthecontactinformationforthecalledparty(therecipientoftheSIPINVITE). Todisplayname: To:“Bob” ToURI: To:“Bob” Touser: To:“Bob” Tohost: To:“Bob” Fromheader INVITEsip:[email protected]/2.0 Via:SIP/2.0/UDP192.168.10.10:5060;branch=z9hG4bK776asdhds Max-Forwards:70 To:"Bob" From:"Alice";tag=1 Call-ID:a84b4c76e66710 CSeq:1INVITE Contact:"Alice" Diversion:"Sales" P-Asserted-Identity:"Alice" Content-Length:0 TheFromheadercontainsthecontactinformationforthepartythatinitiatedtheSIPINVITE. Fromdisplayname: From:“Alice”;tag=1 FromURI: From:“Alice”;tag=1 Fromuser: From:“Alice”;tag=1 Fromhost: From:“Alice”;tag=1 Call-IDheader INVITEsip:[email protected]/2.0 Via:SIP/2.0/UDP192.168.10.10:5060;branch=z9hG4bK776asdhds Max-Forwards:70 To:"Bob" From:"Alice";tag=1 Call-ID:a84b4c76e66710 CSeq:1INVITE Contact:"Alice" Diversion:"Sales" P-Asserted-Identity:"Alice" Content-Length:0 TheCall-IDheaderactsasauniqueidentifierthathelpsgroupaseriesofmessagestogether.Itmustbethesameforallrequestsandresponsessentbyeitherpartyinadialog(anexchangeofrelatedmessagesbetweentwouser-agents).Thevalueshouldbeacryptographicallyrandomgroupofcharacters,andcanbefollowedby@andahost/domain. CSeqheader INVITEsip:[email protected]/2.0 Via:SIP/2.0/UDP192.168.10.10:5060;branch=z9hG4bK776asdhds Max-Forwards:70 To:"Bob" From:"Alice";tag=1 Call-ID:a84b4c76e66710 CSeq:1INVITE Contact:"Alice" Diversion:"Sales" P-Asserted-Identity:"Alice" Content-Length:0 TheCSeqheaderservesasawaytoidentifyandordertransactions.ItismadeupofanintegerandaSIPmethod. Contactheader INVITEsip:[email protected]/2.0 Via:SIP/2.0/UDP192.168.10.10:5060;branch=z9hG4bK776asdhds Max-Forwards:70 To:"Bob" From:"Alice";tag=1 Call-ID:a84b4c76e66710 CSeq:1INVITE Contact:"Alice" Diversion:"Sales" P-Asserted-Identity:"Alice" Content-Length:0 TheContactheaderprovidesaSIPorSIPSURIthatshouldbeusedtocontacttheuseragentthatsenttheINVITE. Contactdisplayname: Contact:"Alice" ContactURI: Contact:“Alice” Contactuser: Contact:“Alice” Contacthost: Contact:“Alice” Diversionheader INVITEsip:[email protected]/2.0 Via:SIP/2.0/UDP192.168.10.10:5060;branch=z9hG4bK776asdhds Max-Forwards:70 To:"Bob" From:"Alice";tag=1 Call-ID:a84b4c76e66710 CSeq:1INVITE Contact:"Alice" Diversion:"Sales" P-Asserted-Identity:"Alice" Content-Length:0 TheDiversionheadercontainsinformationaboutanyre-directing/forwardingthecallhasundergone.Itincludesthecontactinformationforthepartythatforwardedthecall. Diversiondisplayname: Diversion:"Sales" DiversionURI: Diversion:“Sales” Diversionuser: Diversion:“Sales” Diversionhost: Diversion:“Sales” P-Asserted-Identityheader INVITEsip:[email protected]/2.0 Via:SIP/2.0/UDP192.168.10.10:5060;branch=z9hG4bK776asdhds Max-Forwards:70 To:"Bob" From:"Alice";tag=1 Call-ID:a84b4c76e66710 CSeq:1INVITE Contact:"Alice" Diversion:"Sales" P-Asserted-Identity:"Alice" Content-Length:0 TheP-Asserted-IdentityheadercontainstheCallerIDinformationforthecallthatwasauthenticatedinsomeway.Thisheadermaybeusedwhenforwardingcallswithintrusteddomains,inordertomaintaintheoriginalcaller'scallerIDratherthantheforwardingentity's. P-Asserted-Identitydisplayname: P-Asserted-Identity:"Alice" P-Asserted-IdentityURI: P-Asserted-Identity:“Alice” P-Asserted-Identityuser: P-Asserted-Identity:“Alice” P-Asserted-Identityhost: P-Asserted-Identity:“Alice” OtherSIPINVITEHeaders Remote-Party-Id(RPID)header Remote-Party-Id:“Alice” TheRemote-Party-Id(RPID)headeridentifiestheoriginatorofthecall. Remote-Party-Id(RPID)displayname: Remote-Party-Id:"Alice" Remote-Party-Id(RPID)URI: Remote-Party-Id:“Alice” Remote-Party-Id(RPID)user: Remote-Party-Id:“Alice” Remote-Party-Id(RPID)host: Remote-Party-Id:“Alice” P-Charge-Infoheader P-Charge-Info:“Alice” TheP-Charge-Infoheadercontainsinformationabouttheidentityofthepartytobecharged. P-Charge-Infodisplayname: P-Charge-Info:"Alice" P-Charge-InfoURI: P-Charge-Info:“Alice” P-Charge-Infouser: P-Charge-Info:“Alice” P-Charge-Infohost: P-Charge-Info:“Alice” Readytostartbuilding?Signupnow. Ratethispage: ⬅Backtoglossary Contributors: Thankyouforyourfeedback! Pleaseselectthereason(s)foryourfeedback.Theadditionalinformationyouprovidehelpsusimproveourdocumentation: IfapplicablefillinthecountrieswhereyouareusingTwilio Missinginformationorcode Contentisconfusingorhardtofollow Inaccurateoroutdatedinformation Brokenlinkortypo Didnotsolvemyproblem Contentiseasytofollow Solvedmyproblem Other Sendyoursuggestions Needhelp?TalktoSupport ProtectedbyreCAPTCHA–Privacy-Terms Sendingyourfeedback... 🎉Thankyouforyourfeedback! Somethingwentwrong.Pleasetryagain. Thanksforyourfeedback! Referusandget$10in3simplesteps! Step1 Getlink Getafreepersonalreferrallinkhere Step2 Give$10 Yourusersignsupandupgradeusinglink Step3 Get$10 1,250freeSMSesOR1,000freevoiceminsOR12,000chatsORmore Learnmoreaboutthereferralprogram



請為這篇文章評分?