summaryrefslogtreecommitdiff
path: root/toxav
diff options
context:
space:
mode:
authorirungentoo <irungentoo@tox.im>2014-02-19 17:43:42 -0500
committerirungentoo <irungentoo@tox.im>2014-02-19 17:43:42 -0500
commit0a73a6268921f97eb2ee3a2fb8febdcd2869b28e (patch)
tree30a202ba666964a1445f41d26e51792b56fcdbb1 /toxav
parent098df5ae319d15672480fcd17cd4b98c2433e457 (diff)
parentbc61d969e0f4c1d0652b1141b1cc8e51df970bd5 (diff)
Merge pull request #749 from mannol1/master
Removed user agent header from msi and fixed travis build stuff
Diffstat (limited to 'toxav')
-rw-r--r--toxav/msi.c16
-rw-r--r--toxav/msi.h5
-rw-r--r--toxav/phone.c2
-rw-r--r--toxav/toxav.c9
-rw-r--r--toxav/toxav.h5
5 files changed, 12 insertions, 25 deletions
diff --git a/toxav/msi.c b/toxav/msi.c
index 6cc9cf12..fda0dd3e 100644
--- a/toxav/msi.c
+++ b/toxav/msi.c
@@ -84,7 +84,6 @@ GENERIC_HEADER ( Version )
84GENERIC_HEADER ( Request ) 84GENERIC_HEADER ( Request )
85GENERIC_HEADER ( Response ) 85GENERIC_HEADER ( Response )
86GENERIC_HEADER ( CallType ) 86GENERIC_HEADER ( CallType )
87GENERIC_HEADER ( UserAgent )
88GENERIC_HEADER ( CallId ) 87GENERIC_HEADER ( CallId )
89GENERIC_HEADER ( Info ) 88GENERIC_HEADER ( Info )
90GENERIC_HEADER ( Reason ) 89GENERIC_HEADER ( Reason )
@@ -103,7 +102,6 @@ typedef struct _MSIMessage {
103 MSIHeaderRequest request; 102 MSIHeaderRequest request;
104 MSIHeaderResponse response; 103 MSIHeaderResponse response;
105 MSIHeaderCallType calltype; 104 MSIHeaderCallType calltype;
106 MSIHeaderUserAgent useragent;
107 MSIHeaderInfo info; 105 MSIHeaderInfo info;
108 MSIHeaderReason reason; 106 MSIHeaderReason reason;
109 MSIHeaderCallId callid; 107 MSIHeaderCallId callid;
@@ -128,7 +126,6 @@ static MSICallback callbacks[10] = {0};
128#define INFO_FIELD "INFO" 126#define INFO_FIELD "INFO"
129#define REASON_FIELD "Reason" 127#define REASON_FIELD "Reason"
130#define CALLTYPE_FIELD "Call-type" 128#define CALLTYPE_FIELD "Call-type"
131#define USERAGENT_FIELD "User-agent"
132#define CALLID_FIELD "Call-id" 129#define CALLID_FIELD "Call-id"
133#define CRYPTOKEY_FIELD "Crypto-key" 130#define CRYPTOKEY_FIELD "Crypto-key"
134#define NONCE_FIELD "Nonce" 131#define NONCE_FIELD "Nonce"
@@ -277,10 +274,9 @@ int parse_raw_data ( MSIMessage *msg, const uint8_t *data, uint16_t length )
277 } 274 }
278 break; 275 break;
279 276
280 case 10: { /* User-agent, Crypto-key headers */ 277 case 10: { /* Crypto-key headers */
281 if ON_HEADER ( _it, msg->useragent, USERAGENT_FIELD, 10 ) 278 if ON_HEADER ( _it, msg->cryptokey, CRYPTOKEY_FIELD, 10 )
282 else if ON_HEADER ( _it, msg->cryptokey, CRYPTOKEY_FIELD, 10 ) 279 }
283 }
284 break; 280 break;
285 281
286 default: 282 default:
@@ -315,7 +311,6 @@ void free_message ( MSIMessage *msg )
315 free ( msg->calltype.header_value ); 311 free ( msg->calltype.header_value );
316 free ( msg->request.header_value ); 312 free ( msg->request.header_value );
317 free ( msg->response.header_value ); 313 free ( msg->response.header_value );
318 free ( msg->useragent.header_value );
319 free ( msg->version.header_value ); 314 free ( msg->version.header_value );
320 free ( msg->info.header_value ); 315 free ( msg->info.header_value );
321 free ( msg->cryptokey.header_value ); 316 free ( msg->cryptokey.header_value );
@@ -484,7 +479,6 @@ uint16_t message_to_string ( MSIMessage *msg, uint8_t *dest )
484 CLEAN_ASSIGN ( _size, _iterated, REQUEST_FIELD, msg->request ); 479 CLEAN_ASSIGN ( _size, _iterated, REQUEST_FIELD, msg->request );
485 CLEAN_ASSIGN ( _size, _iterated, RESPONSE_FIELD, msg->response ); 480 CLEAN_ASSIGN ( _size, _iterated, RESPONSE_FIELD, msg->response );
486 CLEAN_ASSIGN ( _size, _iterated, CALLTYPE_FIELD, msg->calltype ); 481 CLEAN_ASSIGN ( _size, _iterated, CALLTYPE_FIELD, msg->calltype );
487 CLEAN_ASSIGN ( _size, _iterated, USERAGENT_FIELD, msg->useragent );
488 CLEAN_ASSIGN ( _size, _iterated, INFO_FIELD, msg->info ); 482 CLEAN_ASSIGN ( _size, _iterated, INFO_FIELD, msg->info );
489 CLEAN_ASSIGN ( _size, _iterated, CALLID_FIELD, msg->callid ); 483 CLEAN_ASSIGN ( _size, _iterated, CALLID_FIELD, msg->callid );
490 CLEAN_ASSIGN ( _size, _iterated, REASON_FIELD, msg->reason ); 484 CLEAN_ASSIGN ( _size, _iterated, REASON_FIELD, msg->reason );
@@ -505,7 +499,6 @@ void msi_msg_set_##header ( MSIMessage* _msg, const uint8_t* header_value, uint1
505 ALLOCATE_HEADER( _msg->header, header_value, _size )} 499 ALLOCATE_HEADER( _msg->header, header_value, _size )}
506 500
507GENERIC_SETTER_DEFINITION ( calltype ) 501GENERIC_SETTER_DEFINITION ( calltype )
508GENERIC_SETTER_DEFINITION ( useragent )
509GENERIC_SETTER_DEFINITION ( reason ) 502GENERIC_SETTER_DEFINITION ( reason )
510GENERIC_SETTER_DEFINITION ( info ) 503GENERIC_SETTER_DEFINITION ( info )
511GENERIC_SETTER_DEFINITION ( callid ) 504GENERIC_SETTER_DEFINITION ( callid )
@@ -1191,14 +1184,13 @@ void msi_register_callback ( MSICallback callback, MSICallbackID id )
1191 * @return MSISession* The created session. 1184 * @return MSISession* The created session.
1192 * @retval NULL Error occured. 1185 * @retval NULL Error occured.
1193 */ 1186 */
1194MSISession *msi_init_session ( Messenger *messenger, const uint8_t *ua_name ) 1187MSISession *msi_init_session ( Messenger* messenger )
1195{ 1188{
1196 assert ( messenger ); 1189 assert ( messenger );
1197 1190
1198 MSISession *_retu = calloc ( sizeof ( MSISession ), 1 ); 1191 MSISession *_retu = calloc ( sizeof ( MSISession ), 1 );
1199 assert ( _retu ); 1192 assert ( _retu );
1200 1193
1201 _retu->ua_name = ua_name;
1202 _retu->messenger_handle = messenger; 1194 _retu->messenger_handle = messenger;
1203 _retu->agent_handler = NULL; 1195 _retu->agent_handler = NULL;
1204 1196
diff --git a/toxav/msi.h b/toxav/msi.h
index 84a30f63..a70685f8 100644
--- a/toxav/msi.h
+++ b/toxav/msi.h
@@ -103,8 +103,6 @@ typedef struct _MSISession {
103 int last_error_id; /* Determine the last error */ 103 int last_error_id; /* Determine the last error */
104 const uint8_t *last_error_str; 104 const uint8_t *last_error_str;
105 105
106 const uint8_t *ua_name;
107
108 void *agent_handler; /* Pointer to an object that is handling msi */ 106 void *agent_handler; /* Pointer to an object that is handling msi */
109 Messenger *messenger_handle; 107 Messenger *messenger_handle;
110 108
@@ -152,11 +150,10 @@ void msi_register_callback(MSICallback callback, MSICallbackID id);
152 * @brief Start the control session. 150 * @brief Start the control session.
153 * 151 *
154 * @param messenger Tox* object. 152 * @param messenger Tox* object.
155 * @param user_agent User agent, i.e. 'Venom'; 'QT-gui'
156 * @return MSISession* The created session. 153 * @return MSISession* The created session.
157 * @retval NULL Error occured. 154 * @retval NULL Error occured.
158 */ 155 */
159MSISession *msi_init_session ( Messenger *messenger, const uint8_t *ua_name ); 156MSISession *msi_init_session ( Messenger *messenger );
160 157
161 158
162/** 159/**
diff --git a/toxav/phone.c b/toxav/phone.c
index ec7dd143..98e97873 100644
--- a/toxav/phone.c
+++ b/toxav/phone.c
@@ -1019,7 +1019,7 @@ av_session_t *av_init_session()
1019 fraddr_to_str( _byte_address, _retu->_my_public_id ); 1019 fraddr_to_str( _byte_address, _retu->_my_public_id );
1020 1020
1021 1021
1022 _retu->av = toxav_new(_retu->_messenger, _retu, _USERAGENT, width, height); 1022 _retu->av = toxav_new(_retu->_messenger, _retu, width, height);
1023 1023
1024 /* ------------------ */ 1024 /* ------------------ */
1025 1025
diff --git a/toxav/toxav.c b/toxav/toxav.c
index e0ddc731..977415dc 100644
--- a/toxav/toxav.c
+++ b/toxav/toxav.c
@@ -75,14 +75,13 @@ typedef struct _ToxAv {
75 * it will result in undefined behaviour. 75 * it will result in undefined behaviour.
76 * 76 *
77 * @param messenger The messenger handle. 77 * @param messenger The messenger handle.
78 * @param useragent The agent handling A/V session (i.e. phone). 78 * @param userdata The agent handling A/V session (i.e. phone).
79 * @param ua_name Useragent name.
80 * @param video_width Width of video frame. 79 * @param video_width Width of video frame.
81 * @param video_height Height of video frame. 80 * @param video_height Height of video frame.
82 * @return ToxAv* 81 * @return ToxAv*
83 * @retval NULL On error. 82 * @retval NULL On error.
84 */ 83 */
85ToxAv *toxav_new( Tox *messenger, void *useragent, const char *ua_name , uint16_t video_width, uint16_t video_height) 84ToxAv *toxav_new( Tox *messenger, void *userdata, uint16_t video_width, uint16_t video_height)
86{ 85{
87 ToxAv *av = calloc ( sizeof(ToxAv), 1); 86 ToxAv *av = calloc ( sizeof(ToxAv), 1);
88 87
@@ -91,7 +90,7 @@ ToxAv *toxav_new( Tox *messenger, void *useragent, const char *ua_name , uint16_
91 90
92 av->messenger = (Messenger *)messenger; 91 av->messenger = (Messenger *)messenger;
93 92
94 av->msi_session = msi_init_session(av->messenger, (const unsigned char *) ua_name ); 93 av->msi_session = msi_init_session(av->messenger);
95 av->msi_session->agent_handler = av; 94 av->msi_session->agent_handler = av;
96 95
97 av->rtp_sessions[0] = av->rtp_sessions [1] = NULL; 96 av->rtp_sessions[0] = av->rtp_sessions [1] = NULL;
@@ -102,7 +101,7 @@ ToxAv *toxav_new( Tox *messenger, void *useragent, const char *ua_name , uint16_
102 av->cs = codec_init_session(AUDIO_BITRATE, AUDIO_FRAME_DURATION, AUDIO_SAMPLE_RATE, AUDIO_CHANNELS, video_width, 101 av->cs = codec_init_session(AUDIO_BITRATE, AUDIO_FRAME_DURATION, AUDIO_SAMPLE_RATE, AUDIO_CHANNELS, video_width,
103 video_height, VIDEO_BITRATE); 102 video_height, VIDEO_BITRATE);
104 103
105 av->agent_handler = useragent; 104 av->agent_handler = userdata;
106 105
107 return av; 106 return av;
108} 107}
diff --git a/toxav/toxav.h b/toxav/toxav.h
index 40cd90db..df5acfc6 100644
--- a/toxav/toxav.h
+++ b/toxav/toxav.h
@@ -110,14 +110,13 @@ typedef enum {
110 * it will result in undefined behaviour. 110 * it will result in undefined behaviour.
111 * 111 *
112 * @param messenger The messenger handle. 112 * @param messenger The messenger handle.
113 * @param useragent The agent handling A/V session (i.e. phone). 113 * @param userdata The agent handling A/V session (i.e. phone).
114 * @param ua_name Useragent name.
115 * @param video_width Width of video frame. 114 * @param video_width Width of video frame.
116 * @param video_height Height of video frame. 115 * @param video_height Height of video frame.
117 * @return ToxAv* 116 * @return ToxAv*
118 * @retval NULL On error. 117 * @retval NULL On error.
119 */ 118 */
120ToxAv *toxav_new(Tox *messenger, void *useragent, const char *ua_name, uint16_t video_width, uint16_t video_height); 119ToxAv *toxav_new(Tox *messenger, void *userdata, uint16_t video_width, uint16_t video_height);
121 120
122/** 121/**
123 * @brief Remove A/V session. 122 * @brief Remove A/V session.