MyWebUniversity.com Home Page
 



OpenSolaris man pages main menu


Session Initiation Protocol Library Functions  sipaddfrom(3SIP)



NAME
     sipaddfrom,  sipaddto,   sipaddcontact,   sipaddvia,
     sipaddmaxforward,       sipaddcallid,      sipaddcseq,
     sipaddcontenttype,    sipaddcontent,    sipaddaccept,
     sipaddacceptenc, sipaddacceptlang, sipaddalertinfo,
     sipaddallow,   sipaddcallinfo,    sipaddcontentdisp,
     sipaddcontentenc,   sipaddcontentlang,   sipadddate,
     sipadderrorinfo,  sipaddexpires,   sipaddinreplyto,
     sipaddmimeversion,    sipaddminexpires,   sipaddorg,
     sipaddpriority,   sipaddreplyto,   sipaddpassertedid,
     sipaddppreferredid,  sipaddrequire, sipaddretryafter,
     sipaddroute,     sipaddrecordroute,     sipaddserver,
     sipaddsubject,      sipaddsupported,     sipaddtstamp,
     sipaddunsupported,  sipadduseragent,   sipaddwarning,
     sipaddrseq, sipaddprivacy, sipaddrack, sipaddauthor,
     sipaddautheninfo,                   sipaddproxyauthen,
     sipaddproxyauthor,                 sipaddproxyrequire,
     sipaddwwwauthen,   sipaddallowevents,   sipaddevent,
     sipaddsubstate  - add specific SIP headers to the SIP mes-
     sage

SYNOPSIS
     cc [ flag ... ] file ... -lsip [ library ... ]
     #include 

     int sipaddfrom(sipmsgt sipmsg, char *displayname, char *fromuri,
          char *fromtag, booleant addaquot, char *fromparams);


     int sipaddto(sipmsgt sipmsg, char *displayname, char *touri,
          char *totag, booleant addaquot, char *toparams);


     int sipaddcontact(sipmsgt sipmsg, char *displayname,
          char *contacturi, booleant addaquot, char *contactparams);


     int sipaddvia(sipmsgt sipmsg, char *sentprotocoltransport,
          char *sentbyhost, int sentbyport, char *viaparams);


     int sipaddmaxforward(sipmsgt sipmsg, uintt maxforward);


     int sipaddcallid(sipmsgt sipmsg, char *callid);


     int sipaddcseq(sipmsgt sipmsg, sipmethodt method, uint32t cseq);


     int sipaddcontenttype(sipmsgt sipmsg, char * type, char *subtype);




SunOS 5.11          Last change: 09 Feb 2007                    1






Session Initiation Protocol Library Functions  sipaddfrom(3SIP)



     int sipaddcontent(sipmsgt sipmsg, char * content);


     int sipaddaccept(sipmsgt sipmsg, char *type, char *subtype,
          char *mediaparam, char *acceptparam);


     int sipaddacceptenc(sipmsgt sipmsg, char *code,
          char *param);


     int sipaddacceptlang(sipmsgt sipmsg, char *lang,
          char *param);


     int sipaddalertinfo(sipmsgt sipmsg, char *alert,
          char *param);


     int sipaddallow(sipmsgt sipmsg, sipmethodt methodname);


     int sipaddcallinfo(sipmsgt sipmsg, char *uri,
          char *param);


     int sipaddcontentdisp(sipmsgt sipmsg, char *distype, char *param);


     int sipaddcontentenc(sipmsgt sipmsg, char *code);


     int sipaddcontentlang(sipmsgt sipmsg, char *lang);


     int sipadddate(sipmsgt sipmsg, char *date);


     int sipadderrorinfo(sipmsgt sipmsg, char *uri, char *param);


     int sipaddexpires(sipmsgt sipmsg, int secs);


     int sipaddinreplyto(sipmsgt sipmsg, char *replyid);


     int sipaddmimeversion(sipmsgt sipmsg, char *version);


     int sipaddminexpires(sipmsgt sipmsg, int secs);




SunOS 5.11          Last change: 09 Feb 2007                    2






Session Initiation Protocol Library Functions  sipaddfrom(3SIP)



     int sipaddorg(sipmsgt sipmsg, char *org);


     int sipaddpriority(sipmsgt sipmsg, char *prio);


     int sipaddreplyto(sipmsgt sipmsg, char *displayname,
          char *addr, char *param, booleant addaquot);


     int sipaddpassertedid(sipmsgt sipmsg, char *displayname,
          char *addr, booleant addaqout);


     int sipaddppreferredid(sipmsgt sipmsg, char *displayname,
          char *addr, booleant addaquot);


     int sipaddrequire(sipmsgt sipmsg, char *req);


     int sipaddretryafter(sipmsgt sipmsg, int secs, char *cmt,
          char *param);


     int sipaddroute(sipmsgt sipmsg, char *displayname, char *uri,
          char *routeparams);


     int sipaddrecordroute(sipmsgt sipmsg, char *displayname,
          char *uri, char *routeparams);


     int sipaddserver(sipmsgt sipmsg, char *svr);


     int sipaddsubject(sipmsgt sipmsg, char *subject);


     int sipaddsupported(sipmsgt sipmsg, char *support);


     int sipaddtstamp(sipmsgt sipmsg, char *time, char *delay);


     int sipaddunsupported(sipmsgt sipmsg, char *unsupport);


     int sipadduseragent(sipmsgt sipmsg, char *usr);






SunOS 5.11          Last change: 09 Feb 2007                    3






Session Initiation Protocol Library Functions  sipaddfrom(3SIP)



     int sipaddwarning(sipmsgt sipmsg, int code, char *addr, char *msg);


     int sipaddprivacy(sipmsgt sipmsg, char *privval);


     int sipaddrseq(sipmsgt sipmsg, int respnum);


     int sipaddrack(sipmsgt sipmsg, int respnum, int cseq,
          sipmethodt method);


     int sipaddauthor(sipmsgt sipmsg, char *scheme, char *param);


     int sipaddautheninfo(sipmsgt sipmsg, char *ainfo);


     int sipaddproxyauthen(sipmsgt sipmsg, char *pascheme,
          char *param);


     int sipaddproxyauthor(sipmsgt sipmsg, char *pascheme,
          char *param);


     int sipaddproxyrequire(sipmsgt sipmsg, char *opt);


     int sipaddwwwauthen(sipmsgt sipmsg, char *wascheme,
          char *param);


     int sipaddallowevents(sipmsgt sipmsg, char *events);


     int sipaddevent(sipmsgt sipmsg, char *event, char *param);


     int sipaddsubstate(sipmsgt sipmsg, char *sub, char *param);


DESCRIPTION
     For each of the following functions that add a header  to  a
     SIP  message,  the function adds a CRLF before appending the
     header to the SIP message.


     The sipaddfrom() and sipaddto() functions appends a FROM
     and  TO  header respectively to the SIP message sipmsg. The
     header is created using the displayname, if  non-null,  and



SunOS 5.11          Last change: 09 Feb 2007                    4






Session Initiation Protocol Library Functions  sipaddfrom(3SIP)



     the  uri  values. The addaquot parameter is used to specify
     whether the  uri  should  be  enclosed  within  '<>'.  If  a
     displayname  is  provided then addaquot cannot be BFALSE.
     The displayname parameter, if provided, is enclosed  within
     quotes  before creating to the SIP header. Tag value for the
     FROM/TO header can be specified which will be added  to  the
     SIP  header by prefixing it with "TAG=". Any generic parame-
     ters can be specified as the last argument,  which  will  be
     added, as is, to the SIP header.


     Either the tag or the generic parameter can be specified not
     both,  if  both are specified, the resulting header contains
     only the tag parameter.


     The sipaddcontact() function appends a CONTACT  header  to
     the   SIP   message   sipmsg  using  the  displayname  and
     contacturi. The addaquot parameter has the same  semantics
     as  in  sipaddfrom()/sipaddto().  Any contact parameters
     specified in contactparam is added to  the  CONTACT  header
     before appending the header to the message.


     The sipaddvia() function appends a VIA header to  the  SIP
     message   sipmsg.  The  VIA  header  is  constructed  using
     sentprotocoltransport, sentbyhost  and  sentbyport.  A
     value  of 0 for sentbyport means that the port information
     is not present in the resulting VIA header. The  VIA  header
     that  is  created  has the protocol set to "SIP" and version
     set to "2.0". Any parameters specific in viaparams is added
     to  the  VIA  header  before appending the header to the SIP
     message.


     The sipaddmaxforward()  function  appends  a  MAX-FORWARDS
     header to the SIP message sipmsg using the value in maxfor-
     ward. The maxforward value is a positive integer.


     The sipaddcallid() function appends a  CAL-ID  header  to
     the  SIP  message sipmsg using the value in callid, if non-
     null. If callid is null, this  function  creates  a  CAL-ID
     header using a randomly generated value.


     The sipaddcseq() function appends a CSEQ header to the SIP
     message  using  the  values  in method and cseq. Permissible
     values for method include:
       INVITE
       ACK
       OPTIONS



SunOS 5.11          Last change: 09 Feb 2007                    5






Session Initiation Protocol Library Functions  sipaddfrom(3SIP)



       BYE
       CANCEL
       REGISTER
       REFER
       SUBSCRIBE
       NOTIFY
       PRACK
       INFO


     The cseq value is a positive integer.


     The sipaddcontenttype() function appends  a  CONTENT-TYPE
     to  the  SIP  message  sipmsg.  The CONTENT-TYPE is created
     using the type and subtype, both should be non-null.


     The sipaddcontent() function adds a message  body  to  the
     SIP  message  sipmsg. The message body is given by the null
     terminated string contents. Once the function  returns,  the
     caller  may  reuse  or  delete contents as sipaddcontent()
     creates a new buffer and copies over contents for its use.


     The sipaddaccept() function appends an  ACEPT  header  to
     the  SIP message sipmsg. The ACEPT header is created using
     type and subtype. If both type and subtype are null, then an
     empty  ACEPT header is added to the SIP message. If type is
     non-null, but subtype is null, then the  ACEPT  header  has
     the  specified  type  and  sets the subtype in the header to
     '*'. Any acceptparam or mediaparam, if provided, are added
     to  the ACEPT header before appending the header to the SIP
     message.


     The sipaddacceptenc() function appends an ACEPT-ENCODING
     header  to  the  SIP message sipmsg. The ACEPT-ENCODING is
     created using code. Any  parameter  specified  in  param  is
     added  to  the  ACEPT-ENCODING  header before appending the
     header to the SIP message.


     The  sipaddacceptlang()  function  appends   an   ACEPT-
     LANGUAGE  header  to  the  SIP  message sipmsg. The ACEPT-
     LANGUAGE header is created using lang. Any parameter  speci-
     fied  in param is added to the ACEPT-LANGUAGE header before
     appending the header to the SIP message.


     The  sipaddalertinfo()  function  appends  an  ALERT-INFO
     header  to the SIP message sipmsg. The ALERT-INFO header is



SunOS 5.11          Last change: 09 Feb 2007                    6






Session Initiation Protocol Library Functions  sipaddfrom(3SIP)



     created using alert. Any parameter  specified  in  param  is
     added  to  the ALERT-INFO header before appending the header
     to the SIP message.


     The sipaddallow() function appends an ALOW header to  the
     SIP message sipmsg. The ALOW header is created using alert
     and method. Permissible values for method include:
       INVITE
       ACK
       OPTIONS
       BYE
       CANCEL
       REGISTER
       REFER
       INFO
       SUBSCRIBE
       NOTIFY
       PRACK


     The sipaddcallinfo() function appends a CAL-INFO  header
     to  the SIP message sipmsg. The CAL-INFO header is created
     using uri. Any parameter specified in param is added to  the
     CAL-INFO before appending the header to the SIP message.


     The  sipaddcontentdisp()  function  appends  a   CONTENT-
     DISPOSITION  header to the SIP message sipmsg. The CONTENT-
     DISPOSITION header is created using disptype. Any parameter
     specified  in  param  is  added  to  the CONTENT-DISPOSITION
     header before appending the header to the SIP message.


     The  sipaddcontentenc()  function  appends   a   CONTENT-
     ENCODING  header  to  the  SIP message sipmsg. The CONTENT-
     ENCODING header is created using code.


     The  sipaddcontentlang()  function  appends  a   CONTENT-
     LANGUAGE  header  to  the  SIP message sipmsg. The CONTENT-
     LANGUAGE header is created using lang.


     The sipadddate() appends a DATE header to the SIP  message
     sipmsg.  The DATE header is created using the date informa-
     tion specified in date. The semantics for the date string is
     given is RFC 3261, section 25.1.


     The  sipadderrorinfo()  function  appends  an  EROR-INFO
     header  to the SIP message sipmsg. The EROR-INFO header is



SunOS 5.11          Last change: 09 Feb 2007                    7






Session Initiation Protocol Library Functions  sipaddfrom(3SIP)



     created using uri. An parameters specified in param is added
     to the EROR-INFO header before adding the header to the SIP
     message.


     The sipaddexpires() function appends an EXPIRES header  to
     the SIP message sipmsg. The EXPIRES header is created using
     the seconds specified in secs.


     The sipaddinreplyto()  function  appends  a  IN-REPLY-TO
     header to the SIP message sipmsg. The IN-REPLY-TO header is
     created using the call-id value specified in replyid.


     The sipaddmimeversion() function appends  a  MIME-VERSION
     header  to  the SIP message sipmsg. The MIME-VERSION header
     is created using version.


     The sipaddminexpires()  function  appends  a  MIN-EXPIRES
     header  to  the  SIP  message  sipmsg.  The  MIN-EXPIRES is
     created using the time in seconds specified in secs.


     The sipaddorg() function appends a ORGANIZATION header  to
     the  SIP message sipmsg. The ORGANIZATION header is created
     using the information specified in org.


     The sipaddpriority() function appends a PRIORITY header to
     the  SIP  message  sipmsg.  The  PRIORITY header is created
     using the value specified in prio.


     The sipaddreplyto() function appends a REPLY-TO header to
     the  SIP  message  sipmsg.  The  REPLY-TO header is created
     using the displayname, if provided, and addr. The addaquot
     parameter     has     the     same     semantics    as    in
     sipaddfrom()/sipaddto().  Any  parameters  specified  in
     param  is added to the  REPLY-TO header before appending the
     header to the SIP message.


     The sipaddpassertedid()  function  appends  a  P-ASERTED-
     IDENTITY  header to the SIP message sipmsg. The P-ASERTED-
     IDENTITY header is created using the displayname,  if  pro-
     vided,  and  the  addr. The addaquot parameter has the same
     semantics as in sipaddfrom()/sipaddto().






SunOS 5.11          Last change: 09 Feb 2007                    8






Session Initiation Protocol Library Functions  sipaddfrom(3SIP)



     The sipaddppreferredid() function appends  a  P-PREFERED-
     IDENTITY   header   to  the  SIP  message  sipmsg.  The  P-
     PREFERED-IDENTITY header is created using the displayname,
     if  provided,  and the addr. The addaquot parameter has the
     same semantics as in sipaddfrom()/sipaddto().


     The sipaddrequire() function appends a REQUIRE  header  to
     the SIP message sipmsg. The REQUIRE header is created using
     the information in req.


     The sipaddretryafter()  function  appends  a  RETRY-AFTER
     header  to  the  SIP  message  sipmsg.  The  RETRY-AFTER is
     created using the time in seconds  specified  in  secs  com-
     ments, if any, in cmt. Any parameters specified in param, if
     provided, is added to the RETRY-AFTER header before  append-
     ing the header to the SIP message.


     The sipaddroute() function appends a ROUTE header  to  the
     SIP  message  sipmsg. The ROUTE header is created using the
     displayname, if any, and the uri. The uri  is  enclosed  in
     '<>'  before  adding  to the header. Parameters specified in
     routeparams are added to the ROUTE header before  appending
     the header to the SIP message.


     The sipaddrecordroute() function appends  a  RECORD-ROUTE
     header  to  the SIP message sipmsg. The RECORD-ROUTE header
     is created using the displayname, if any, and the uri.  The
     uri  parameter  is  enclosed  in  '<>'  before adding to the
     header. Any parameters specified in routeparams is added to
     the ROUTE header before appending the header to the SIP mes-
     sage.


     The sipaddserver() function appends a SERVER header to the
     SIP  message sipmsg. The SERVER header is created using the
     information in srv.


     The sipaddsubject() function appends a SUBJECT  header  to
     the SIP message sipmsg. The SUBJECT header is created using
     the information in subject.


     The sipaddsupported() function appends a SUPORTED  header
     to  the SIP message sipmsg. The SUPORTED header is created
     using the information in support.





SunOS 5.11          Last change: 09 Feb 2007                    9






Session Initiation Protocol Library Functions  sipaddfrom(3SIP)



     The sipaddtstamp() function appends a TIMESTAMP header  to
     the  SIP  message  sipmsg.  The TIMESTAMP header is created
     using the time value in time and the delay  value,  if  pro-
     vided, in delay.


     The sipaddunsupported() function  appends  an  UNSUPORTED
     header to the SIP message sipmsg. The UNSUPORTED header is
     created using the option-tag value in unsupport.


     The  sipadduseragent()  function  appends  an  USER-AGENT
     header  to the SIP message sipmsg. The USER-AGENT header is
     created using the server-val specified in usr.


     The sipaddwarning() function appends a WARNING  header  to
     the SIP message sipmsg. The WARNING header is created using
     the warn-code in code, warn-agent in addr and  warn-test  in
     msg.


     The sipaddprivacy() function appends a PRIVACY  header  to
     the  SIP  message  sipmsg.  The  PRIVACY header  is created
     using the privacy value specified in privval.


     The sipaddrseq() function appends a RSEQ header to the SIP
     message  sipmsg.  The  RSEQ  header  is  created  using the
     sequence number specified in respnum.


     The sipaddrack() function appends a RACK header to the SIP
     message  sipmsg.  The  RACK  header  is  created  using the
     sequence number in respnum, the SIP method  in  method  and
     the  CSEQ  number  in  cseq.  Permissible  values for method
     include: INVITE, ACK, OPTIONS, BYE, CANCEL, REGISTER, REFER,
     INFO, SUBSCRIBE, NOTIFY, PRACK.


     The  sipaddauthor()  function  appends  an   AUTHORIZATION
     header  to the SIP message sipmsg. The AUTHORIZATION header
     is created using scheme. Any parameter specified in param is
     added  to  the  AUTHORIZATION  header  before  the header is
     appended to the SIP message.


     The    sipaddautheninfo()     function     appends     an
     AUTHENTICATION-INFO() header to the SIP message sipmsg. The
     AUTHENTICATION-INFO header is created using the  authentica-
     tion information in ainfo.




SunOS 5.11          Last change: 09 Feb 2007                   10






Session Initiation Protocol Library Functions  sipaddfrom(3SIP)



     The  sipaddproxyauthen()  function   appends   a   PROXY-
     AUTHENTICATE  header  to the SIP message sipmsg. The PROXY-
     AUTHENTICATE  is  created  using  the  value  specified   in
     psacheme.  Any  parameter  in  param  is added to the PROXY-
     AUTHENTICATE header before adding the header to the SIP mes-
     sage.


     The  sipaddproxyauthor()  function   appends   a   PROXY-
     AUTHORIZATION  header to the SIP message sipmsg. The PROXY-
     AUTHORIZATION header is created using the value specified in
     pascheme.  Any  parameter  in  param  is added to the PROXY-
     AUTHORIZATION header before adding the  header  to  the  SIP
     message.


     The sipaddproxyrequire() function appends a PROXY-REQUIRE
     header  to the SIP message sipmsg. The PROXY-REQUIRE header
     is created using the option-tag in opt.


     The sipaddwwwauthen() function appends a W-AUTHENTICATE
     header  to  the  SIP  message  sipmsg. The W-AUTHENTICATE
     header is created  using  the  challenge  in  wascheme.  Any
     parameter  in  param is added to the W-AUTHENTICATE header
     before adding the header to the SIP message.


     The sipaddallowevents() function appends an  ALOW-EVENTS
     header to the SIP message The ALOW-EVENTS header is created
     using the event specified in events.


     The sipaddevent() function appends an EVENT header to  the
     SIP  message.  The  EVENT  header is created using the value
     specified in event. Any parameter in param is added  to  the
     EVENT header before appending the header to the SIP message.


     The sipaddsubstate() function appends a SUBSCRIPTION-STATE
     header  to the SIP message. The SUBSCRIPTION-STATE header is
     created using the state specified in sub. Any  parameter  in
     param  is  added  to  the  SUBSCRIPTION-STATE  header before
     appending the header to the SIP message.

RETURN VALUES
     These functions return 0  on  success  and  the  appropriate
     error value on failure.

ERORS
     On failure, functions that return an error value can  return
     one of the following:



SunOS 5.11          Last change: 09 Feb 2007                   11






Session Initiation Protocol Library Functions  sipaddfrom(3SIP)



     EINVAL    Mandatory parameters are not provided, i.e. null.

               For         sipaddfrom(),          sipaddto(),
               sipaddcontact(),             sipaddreplyto(),
               sipaddpassertedid(),  sipaddppreferredid()  if
               displayname is non-null and addaquot is BFALSE.

               For  sipaddbranchidtovia()  the  topmost   VIA
               header  already has a branch param or the SIP mes-
               sage does not have a VIA header.


     EPERM     The message cannot be modified.


     ENOMEM    There is an error allocating memory  for  creating
               headers/parameters.


ATRIBUTES
     See attributes(5) for descriptions of the  following  attri-
     butes:



     
           ATRIBUTE TYPE               ATRIBUTE VALUE       
    
     Interface Stability          Committed                   
    
     MT-Level                     MT-Safe                     
    


SEE ALSO
     libsip(3LIB)



















SunOS 5.11          Last change: 09 Feb 2007                   12



OpenSolaris man pages main menu

Contact us      |       About us      |       Term of use      |       Copyright © 2000-2010 MyWebUniversity.com ™