Quang Minh Phan wrote:
This is inexact....Hi Vadim,Great goal, ALL functions returns int except 3 which are void... (phTerminate, phSetDebugLevel, phRefresh - which are actually internal function). All these ints are error codes from the same enum except phGetVersion which return phApi version The error codes are arranged so that 0 means success I don't really think there is much incoherency and that this particular aspect needs further simplification I completley disagree with the idea thatNow, every function in the new API will return OWPL_RESULT_SUCCESS in case of success, or another value of type OWPL_RESULT in case of failure, that makes error checking more coherent. Hence, the code would appear clearer to readers. if (call() == OWPL_RESULT_SUCCESS) { bla; bla; bla; } is more readable than if (!call()) { bla;bla;bla; } in the second case signal to noice ratio is much better than in the first case This kind of problem can be solved by adding ENCRYPTION bit to streams parameter inFor the new API set, some missing functions are be added and some are simply renamed to describe better what it does. For example, in the old phapi, there was no easy way to just create a call handle and set properties to the call before actually dial. The only functions intended for the purpose of making a call were phPlaceCallx, that dial and returned a call handle. With these function, we could not ask phapi to encrypt the call before dialing. This is now possible with the new API set: OWPL_LINE hLine OWPL_CALL hCall; .... owplCallCreate(hLine, &hCall); // Create a new call without dialing owplCallSetEncrypt(hCall, 1); // Set the call to crypted mode ... //Set other properties for the call here owplCallConnect(hLine, "sip:[EMAIL PROTECTED]"); // Dial the call phLinePlaceCall2 IMO owplXXXX approach is more complicated to use (but one can argue that it is matter of taste) It is definetevly more consice to write phLinePlaceCall2(vl, uri, 0, 0, PH_STREAM_ENCRYPTION|PH_STREAM_ALL) than: owplCallCreate(hLine, &hCall); // Create a new call without dialing owplCallSetEncrypt(hCall, 1); // Set the call to crypted mode ... //Set other properties for the call owplCallSetStreams(hCall, PH_STREAM_ALL) owplCallConnect(hLine, "sip:[EMAIL PROTECTED]"); // Dial the call I understand that this owplXXXX stuff was needed in order to implement non A/V media types but as i argue IMO there is NO actual need to implement non A/V media types in phApi You mean you added 5th weel to the phApi only to handle timeouts? wengophone already handle various timeouts, it is pretty easy given usage of boost to add another timeout to handle this specific problem. I REALLY don't understand the reasoning, it was SO MUCH SIMPLER to do it using SIP MESSAGE request and HTTP transfer, than to develop SDP plugin framework for phApi The price/performance ratio with respect of developpement effort of your approach is abysmall...
Well i'm actually already maintaining a branch which is independent of Wengophone.... so if you wish you simply need to take it Thanks Vadim P.S. Folks may be i'm a simply stubborn dumbass so please voice your opinions on the issue.... I don't want this discussion simply to be pissing contest between me an Minh |
_______________________________________________ Wengophone-devel mailing list [email protected] http://dev.openwengo.com/mailman/listinfo/wengophone-devel
