veronix

changeset 7:f72f6021afba

Chat support
author derdouri@adriana
date Thu Oct 25 17:14:55 2007 +0200 (2007-10-25)
parents cf66111bcf57
children d133aa031a1c
files VeroniXPS.vcproj.vspscc VeronixCtl.cpp VeronixCtl.h phapi.h phapi.lib
line diff
     1.1 --- a/VeroniXPS.vcproj.vspscc	Fri Oct 05 13:59:09 2007 +0200
     1.2 +++ b/VeroniXPS.vcproj.vspscc	Thu Oct 25 17:14:55 2007 +0200
     1.3 @@ -3,10 +3,7 @@
     1.4  "FILE_VERSION" = "9237"
     1.5  "ENLISTMENT_CHOICE" = "NEVER"
     1.6  "PROJECT_FILE_RELATIVE_PATH" = ""
     1.7 -"NUMBER_OF_EXCLUDED_FILES" = "3"
     1.8 -"EXCLUDED_FILE0" = "_VeroniX_p.c"
     1.9 -"EXCLUDED_FILE1" = "dlldata.c"
    1.10 -"EXCLUDED_FILE2" = "_VeroniX_i.c"
    1.11 +"NUMBER_OF_EXCLUDED_FILES" = "0"
    1.12  "ORIGINAL_PROJECT_FILE_PATH" = ""
    1.13  "NUMBER_OF_NESTED_PROJECTS" = "0"
    1.14  "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"
     2.1 --- a/VeronixCtl.cpp	Fri Oct 05 13:59:09 2007 +0200
     2.2 +++ b/VeronixCtl.cpp	Thu Oct 25 17:14:55 2007 +0200
     2.3 @@ -736,3 +736,14 @@
     2.4  	return S_OK;
     2.5  }
     2.6  
     2.7 +
     2.8 +STDMETHODIMP CVeronixCtl::PhCallSendMessage(ULONG _cid, BSTR _msg)
     2.9 +{
    2.10 +	// TODO: Add your implementation code here
    2.11 +	CString tmp(_msg);
    2.12 +	const char *msg =  (LPCTSTR) tmp;
    2.13 +
    2.14 +	::phCallSendMessage(_cid, msg, "text/plain");
    2.15 +
    2.16 +	return S_OK;
    2.17 +}
     3.1 --- a/VeronixCtl.h	Fri Oct 05 13:59:09 2007 +0200
     3.2 +++ b/VeronixCtl.h	Thu Oct 25 17:14:55 2007 +0200
     3.3 @@ -43,6 +43,7 @@
     3.4  	[id(20), helpstring("method PhAddVline2")] HRESULT PhAddVline2(void);
     3.5  	[id(21), helpstring("method PhSendMessage")] HRESULT PhSendMessage([in] ULONG _vlid, [in] BSTR _num, [in] BSTR _Msg);
     3.6  	[id(22), helpstring("method PhAddVline3")] HRESULT PhAddVline3([in] BSTR _User);
     3.7 +	[id(23), helpstring("method PhCallSendMessage")] HRESULT PhCallSendMessage([in] ULONG _cid, [in] BSTR _msg);
     3.8  };
     3.9  
    3.10  
    3.11 @@ -258,5 +259,6 @@
    3.12  	STDMETHOD(PhAddVline2)(void);
    3.13  	STDMETHOD(PhSendMessage)(ULONG _vlid, BSTR _num, BSTR _Msg);
    3.14  	STDMETHOD(PhAddVline3)(BSTR _User);
    3.15 +	STDMETHOD(PhCallSendMessage)(ULONG _cid, BSTR _msg);
    3.16  };
    3.17  
     4.1 --- a/phapi.h	Fri Oct 05 13:59:09 2007 +0200
     4.2 +++ b/phapi.h	Thu Oct 25 17:14:55 2007 +0200
     4.3 @@ -133,7 +133,7 @@
     4.4  #endif
     4.5  
     4.6  #ifndef PHAPI_VERSION 
     4.7 -#define PHAPI_VERSION "0.2.0"
     4.8 +#define PHAPI_VERSION "0.3.0"
     4.9  #endif
    4.10  
    4.11  #ifdef __cplusplus
    4.12 @@ -167,9 +167,11 @@
    4.13  #define PH_STREAM_AUDIO (1 << 0)
    4.14  #define PH_STREAM_VIDEO_RX (1 << 1)
    4.15  #define PH_STREAM_VIDEO_TX (1 << 2)
    4.16 +#define PH_STREAM_VIDEO (PH_STREAM_VIDEO_RX|PH_STREAM_VIDEO_TX)
    4.17  #define PH_OVERRIDE_AUDIO_ADDR (1 << 3)
    4.18  #define PH_OVERRIDE_VIDEO_ADDR (1 << 4)
    4.19  #define PH_NOMEDIA_STREAMS (1 << 5)
    4.20 +#define PH_STREAM_DATA (1 << 6)
    4.21  
    4.22  /********************TELEPHONY*********************/
    4.23  
    4.24 @@ -186,10 +188,12 @@
    4.25   *                     through this proxy) 
    4.26   * @param  regTimeout  registration timeout  (when 0 will NOT use registrations)
    4.27   *                     to unergister one should do phDelVline (or phUnregister -- depreciated)
    4.28 + * @param  mobility    mobility value from enum ph_line_mobility
    4.29   * @return             -1 in case of error vlid  in case of success
    4.30   */
    4.31  MY_DLLEXPORT int phAddVline(const char* username, const char *host, const char*  proxy,  int regTimeout);
    4.32  MY_DLLEXPORT int phAddVline2(const char* displayname, const char* username, const char *host, const char*  proxy, int regTimeout);
    4.33 +MY_DLLEXPORT int phAddVline3(const char* displayname, const char* username, const char *host, const char*  proxy, int regTimeout, int mobility);
    4.34   
    4.35  /**
    4.36   * Delete virtual line 
    4.37 @@ -220,6 +224,7 @@
    4.38    struct 
    4.39    {
    4.40      int localport, remoteport;
    4.41 +    char remoteip[32];
    4.42    } audio, video;
    4.43  
    4.44  };
    4.45 @@ -239,8 +244,8 @@
    4.46   */
    4.47  MY_DLLEXPORT int phLinePlaceCall(int vlid, const char *uri, void *userData, int rcid);
    4.48  MY_DLLEXPORT int phLinePlaceCall2(int vlid, const char *uri, void *userData, int rcid, int streams);
    4.49 -MY_DLLEXPORT int phLinePlaceCall4(int vlid, const char *uri, void *userdata, int rcid, int streams, char *adev, const char *audio_addr, const char *video_addr);
    4.50 -MY_DLLEXPORT int phLinePlaceCall5(int vlid, const char *uri, void *userdata, int rcid, int streams, char *adev, ...);
    4.51 +MY_DLLEXPORT int phLinePlaceCall4(int vlid, const char *uri, void *userdata, int rcid, int streams, const char *adev, const char *audio_addr, const char *video_addr);
    4.52 +MY_DLLEXPORT int phLinePlaceCall5(int vlid, const char *uri, void *userdata, int rcid, int streams, const char *adev, ...);
    4.53  
    4.54  /**
    4.55   * Accept an incoming a call.
    4.56 @@ -323,6 +328,15 @@
    4.57  MY_DLLEXPORT int phCallStartMedia(int cid, int streamFlags);
    4.58  MY_DLLEXPORT int phCallGetMediaInfo(int cid, struct ph_confirmed_media_info *mi);
    4.59  
    4.60 +/**
    4.61 + * Get the SIP CallID for the given call
    4.62 + *
    4.63 + * @param cid  call id
    4.64 + * @param idbuf where to store the SIP  CallID string
    4.65 + * @param  bufsize size of te idbuf
    4.66 + */
    4.67 +MY_DLLEXPORT int phCallGetSipCallID(int cid, char *idbuf,  int bufsize);
    4.68 +
    4.69  
    4.70  
    4.71  /**
    4.72 @@ -359,39 +373,68 @@
    4.73   *
    4.74   * @param vlid    virtual line id
    4.75   * @param to      uri to put in the To: header
    4.76 + * @param target  request target-uri
    4.77   * @param message  message to send
    4.78   * @param mime	message mime type
    4.79 + * @param sipcid optional value for SIP CallID header
    4.80 + * @param cid  callid (used to send a message inside a dialog as per RFC 3428)
    4.81   * @return  if positive msgid
    4.82  */
    4.83  MY_DLLEXPORT int phLineSendMessage(int vlid, const char *uri, 
    4.84 -								   const char *buff, const char *mime);
    4.85 +				   const char *buff, const char *mime);
    4.86 +MY_DLLEXPORT int phLineSendMessage2(int vlid, const char *target, const char *uri, 
    4.87 +				   const char *buff, const char *mime, 
    4.88 +				    const char *sipcid);
    4.89 +MY_DLLEXPORT int phCallSendMessage(int cid, const char *buff, const char *mime);
    4.90  
    4.91 -/* 
    4.92 -   winfo = 0 -> subscribe with event = presence
    4.93 -   winfo = 1 -> subscribe with event = presence.winfo
    4.94 -*/
    4.95 +
    4.96 +enum ph_subs_type 
    4.97 +{ 
    4.98 +  PH_SUBS_PRESENCE,    /*  regular presence events */ 
    4.99 +  PH_SUBS_WINFO,        /* presence+watcher info */  
   4.100 +  PH_SUBS_PRESENCE_LIST, /* batched presence notifications */  
   4.101 +  PH_SUBS_CONFLIST,    /*  server based conerence list */ 
   4.102 +  PH_SUBS_SIPPROFILE   /* server based contact list */ 
   4.103 +};
   4.104 +
   4.105 +
   4.106 +
   4.107  
   4.108  /**
   4.109   * Subscribe to presence
   4.110   *
   4.111   * @param vlid virtual line id
   4.112   * @param to subscribe to
   4.113 - * @param winfo message to send
   4.114 + * @param winfo value from enum ph_subs_type specifying subscription kind
   4.115   * @return 0 if success else -1
   4.116  */
   4.117  MY_DLLEXPORT int phLineSubscribe(int vlid, const char *to, const int winfo);
   4.118  
   4.119  /**
   4.120 + * Unsubscribe to presence
   4.121 + *
   4.122 + * @param vlid virtual line id
   4.123 + * @param to subscribe to
   4.124 + * @param winfo value from enum ph_subs_type specifying subscription kind
   4.125 + * @return 0 if success else -1
   4.126 +*/
   4.127 +MY_DLLEXPORT int phLineUnsubscribe(int vlid, const char *to, const int winfo);
   4.128 +
   4.129 +/**
   4.130   * Publish my presence
   4.131   *
   4.132   * @param vlid virtual line id
   4.133   * @param to subscribe to
   4.134 - * @param winfo message to send
   4.135 + * @param winfo message type to send
   4.136 + * @param evt value for Event  SIP header
   4.137   * @param content_type content type ("application/pidf+xml", for example)
   4.138   * @param content content
   4.139 + * @param expires  expiration timeout
   4.140   * @return 0 if success else -1
   4.141  */
   4.142  MY_DLLEXPORT int phLinePublish(int vlid, const char *to, const int winfo, const char * content_type, const char * content);
   4.143 +MY_DLLEXPORT int phLinePublish2(int vlid, const char *to, const char *evt, const char * content_type, const char * content,
   4.144 +				int expires);
   4.145  
   4.146  
   4.147  
   4.148 @@ -474,6 +517,27 @@
   4.149  MY_DLLEXPORT int phChangeAudioDevices(const char *devstr);
   4.150  
   4.151  
   4.152 +
   4.153 +/**
   4.154 + * Set the value for UserAgent header
   4.155 + *
   4.156 + * @param uastring		value ut use in UserAgent header
   4.157 + * @return	0 if succeeds, an error value otherwise
   4.158 + */
   4.159 +MY_DLLEXPORT int  phSetUaString(const char *uastr);
   4.160 +
   4.161 +
   4.162 +/**
   4.163 +  * add customization rule for given header, for given request types
   4.164 +  * @param reqnames  comma separated list of SIP REQUEST NAMES in capital letters  to which this rule apply ("*" means all requests)
   4.165 +  * @param hdrname   the header name to add
   4.166 +  * @param hdrval 	header value to add
   4.167 +  * @return	0 if succeeds, an error value otherwise
   4.168 +  */  
   4.169 +MY_DLLEXPORT int phAddCustomHeader(const char *reqnames, const char *hdrname,  const char *hdrval);
   4.170 +
   4.171 +
   4.172 +
   4.173  /********************CONFERENCING*********************/
   4.174  
   4.175  /*
   4.176 @@ -614,6 +678,23 @@
   4.177   */
   4.178  MY_DLLEXPORT int phGetNatInfo(char *natType, int ntlen, char *fwip, int fwiplen);
   4.179  
   4.180 +enum ph_line_mobility
   4.181 +{
   4.182 +
   4.183 +  PH_LINE_MOBILITY_DEFAULT,
   4.184 +  PH_LINE_MOBILITY_FIXED,
   4.185 +  PH_LINE_MOBILITY_MOBILE
   4.186 +};
   4.187 +
   4.188 +/**
   4.189 + * Set mobility flag on the vilrual line
   4.190 + *
   4.191 + * @param vlid virtual line id
   4.192 + * @param mobility value from enum ph_line_mobility
   4.193 + * @return mobility value or negative error code
   4.194 + *
   4.195 + */
   4.196 +MY_DLLEXPORT int phLineGetMobility(int vlid);
   4.197  
   4.198  
   4.199  /**
   4.200 @@ -661,8 +742,10 @@
   4.201    void *userData;              /*!< used to match placeCall with callbacks */ 
   4.202    const char *localUri;        /*!< valid for all events execpt CALLCLOSED and DTMF */
   4.203    int   newcid;                /*!< valid for CALLREPLACED and XFERREQ */
   4.204 -  int   vlid;                  /*! virtual line id */
   4.205 -  int   streams;               /*!  proposed (for phINCALL) and active (for other events) streams for the call */
   4.206 +  int   oldcid;                /*!< in case of CALL OK specifies the old CALL which was target of XFRERREQ */
   4.207 +  int   vlid;                  /*!< virtual line id */
   4.208 +  int   streams;               /*!< proposed (for phINCALL) and active (for other events) streams for the call */
   4.209 +  char  *callinfo;             /*! pointer to Call-Info header value if available */ 
   4.210    union {
   4.211      const char  *remoteUri;    /*!< valid for all events execpt CALLCLOSED, DTMF and CALLERROR */
   4.212      int   errorCode;           /*!< valid for CALLERROR */
   4.213 @@ -690,6 +773,8 @@
   4.214    const char *ctype;
   4.215    const char *subtype;
   4.216    const char *content;
   4.217 +  const char *rawctt;
   4.218 +  int   cid;     /*!<  when non-zero this is message inside a dialog corresponding to call 'cid' */
   4.219  };
   4.220  typedef struct phMsgStateInfo  phMsgStateInfo_t;
   4.221  
   4.222 @@ -802,7 +887,7 @@
   4.223    void  (*confProgress)(int cfid, const phConfStateInfo_t *info);        /*!< conference progress callback routine */
   4.224    void  (*regProgress)(int regid, int regStatus);                       /*!< registration status (0 - OK, else SIP error code */
   4.225    void  (*msgProgress)(int mid,  const phMsgStateInfo_t *info);
   4.226 -  void  (*onNotify) (const char* event, const char* from, const char* content);
   4.227 +  void  (*onNotify) (const char* event, const char* from, const char *ctt, const char* content);
   4.228    void  (*subscriptionProgress)(int sid,  const phSubscriptionStateInfo_t *info);
   4.229    phFrameDisplayCbk onFrameReady;
   4.230    void  (*errorNotify) (enum phErrors error);
     5.1 Binary file phapi.lib has changed