diff --git a/docs/SubmittingPatches b/docs/SubmittingPatches index a7d2347aeb..f60483fc0b 100644 --- a/docs/SubmittingPatches +++ b/docs/SubmittingPatches @@ -14,8 +14,8 @@ Ensure Git is Setup # real name and not a username ./scripts/setup-git.sh -Create Your Patch ------------------ +Create Your Commits +------------------- # create a topic/feature branch in your local repository git checkout -b myfeature @@ -34,17 +34,55 @@ Create Your Patch # review changes; ensure your author name is correct git log -p - # create patch files - git format-patch origin/master..HEAD - - # you'll now have a number of *.patch files in your current - # directory +Create a Pull Request +--------------------- # navigate to the FreeSWITCH JIRA chromium http://jira.freeswitch.org/ - # create an account in JIRA and create a new issue; - # attach the patch file(s) you created to the issue + # create an account in JIRA and create a new issue + + # navigate to FreeSWITCH Stash + chromium http://stash.freeswitch.org/ + + # create an account in Stash; create a forked FS repository; read + # the details here: + chromium https://confluence.freeswitch.org/display/FREESWITCH/Pull+Requests + + # add your repository as a remote (change to your username) + git remote add stash ssh://git@stash.freeswitch.org:7999/~johndoe/freeswitch.git + + # push your changes to a branch + git push stash +HEAD:myfeature + + # create a pull request as described here: + chromium https://confluence.freeswitch.org/display/FREESWITCH/Pull+Requests + +Guidelines for a Good Commit +---------------------------- + +To the extent possible and appropriate, address only one issue per +commit. When we review your commit, anything that doesn't need to be +there will only create confusion. + +This means that, for example, unrelated refactoring or whitespace +cleanups should generally happen in separate commits. Whitespace +cleanup commits should not change anything other than whitespace, and +refactoring commits should strive to preserve identical behavior. + +However, don't go overboard. A commit should do some identifiable +thing completely. If you're adding a new module, the build changes +for that module should go in the commit that adds the module itself. +If you're adding a feature, the feature should work after applying +that commit. + +We don't need to see your missteps and corrections. Use `git rebase +-i` to squash those out of your history before submitting the commit +series to us. It should look like you got everything right the first +time. + +Use `git log -p` to verify that each diff is correct and minimal, and +that your git author name is correct and complete. Writing a Good Commit Message ----------------------------- @@ -76,19 +114,23 @@ The commit subject is the first line of your commit message, then there is an empty line, then your commit body starts. A good commit message might look like this: -> Add frobinator support to mod_sofia -> -> Without proper frobinator support users had to make multiple calls -> to shell scripts to do the sort of frobbing needed in high call -> volume environments. -> -> With this change, we now link to libfrob and support the IETF -> draft-cross-voip-frobbing API. -> -> After appropriate amounts of frobbing have been done, a new variable -> `frobbing_done` is set in the caller's channel. -> -> FS-XXXX #resolve + commit b5c64234ea5d4417abe02b282d6f41c019f2252f + Author: John Doe + Date: Tue Jan 19 03:14:07 2014 +0000 + + Add frobinator support to mod_sofia + + Without proper frobinator support users had to make multiple calls + to shell scripts to do the sort of frobbing needed in high call + volume environments. + + With this change, we now link to libfrob and support the IETF + draft-cross-voip-frobbing API. + + After appropriate amounts of frobbing have been done, a new variable + `frobbing_done` is set in the caller's channel. + + FS-XXXX #resolve Patches Related to JIRA Issues ------------------------------ @@ -100,9 +142,37 @@ before "Signed-off-by:" and "Thanks-to:" lines. This helps our JIRA bot do useful things by relating the commit to the issue. If you believe your patch resolves the issue in question, follow the -issue number with a space and the "--resolve" directive as in the +issue number with a space and the "#resolve" directive as in the example above. +Avoid Merges +------------ + +When you've created a local git branch to make and test your changes, +it can be tempting to merge that branch periodically against our git +HEAD, particularly if the branch lingers for some time. Don't do +this. Instead, please rebase your branch onto our tree before +submitting the commits to us. Random "update branch to master" merges +make our history hard to understand and make it more difficult to +isolate regressions with `git-bisect`. + +Do As We Say... +--------------- + +When you look in our git history, you'll find not all commits follow +the guidelines here. Don't be fooled by this. These guidelines are +what we want, and your commits should follow them. + +It's always difficult to counsel, "do as we say and not as we do," but +the truth is that the format of your commits will be held to a +different standard than the commits of people who have written the +majority of the code in FS. For one thing, your commits will be +reviewed, so following a careful format helps us to review and merge +your patches quickly and efficiently. + +We want a clean and sensible git history, and over time more +contributors will be following the guidelines here. + Where to Go for Help -------------------- @@ -118,7 +188,7 @@ submitted to JIRA. You can also reach us on freenode.net at: -> #freeswitch-dev +> \#freeswitch-dev Finally, feel free to join us in our weekly conference call. Many of the core developers are often on the call and you'll have an diff --git a/html5/verto/demo/js/verto-min.js b/html5/verto/demo/js/verto-min.js index 01ee8b57a4..7f249bd894 100644 --- a/html5/verto/demo/js/verto-min.js +++ b/html5/verto/demo/js/verto-min.js @@ -219,5 +219,5 @@ dialog.rtc.createAnswer(dialog.params.sdp);dialog.answered=true;}};$.verto.dialo if(dialog.state.val>=$.verto.enum.state.early.val){dialog.setState($.verto.enum.state.active);}else{if(dialog.gotEarly){console.log("Dialog "+dialog.callID+"Got answer while still establishing early media, delaying...");}else{console.log("Dialog "+dialog.callID+"Answering Channel");dialog.rtc.answer(params.sdp,function(){dialog.setState($.verto.enum.state.active);},function(e){console.error(e);dialog.hangup();});console.log("Dialog "+dialog.callID+"ANSWER SDP",params.sdp);}}};$.verto.dialog.prototype.cidString=function(enc){var dialog=this;var party=dialog.params.remote_caller_id_name+(enc?" <":" <")+dialog.params.remote_caller_id_number+(enc?">":">");return party;};$.verto.dialog.prototype.sendMessage=function(msg,params){var dialog=this;if(dialog.callbacks.onMessage){dialog.callbacks.onMessage(dialog.verto,dialog,msg,params);}};$.verto.dialog.prototype.handleInfo=function(params){var dialog=this;dialog.sendMessage($.verto.enum.message.info,params.msg);};$.verto.dialog.prototype.handleDisplay=function(params){var dialog=this;if(params.display_name){dialog.params.remote_caller_id_name=params.display_name;} if(params.display_number){dialog.params.remote_caller_id_number=params.display_number;} dialog.sendMessage($.verto.enum.message.display,{});};$.verto.dialog.prototype.handleMedia=function(params){var dialog=this;if(dialog.state.val>=$.verto.enum.state.early.val){return;} -dialog.gotEarly=true;dialog.rtc.answer(params.sdp,function(){console.log("Dialog "+dialog.callID+"Establishing early media");dialog.setState($.verto.enum.state.early);if(dialog.gotAnswer){console.log("Dialog "+dialog.callID+"Answering Channel");dialog.setState($.verto.enum.state.active);}},function(e){console.error(e);dialog.hangup();});console.log("Dialog "+dialog.callID+"EARLY SDP",params.sdp);};$.verto.ENUM=function(s){var i=0,o={};s.split(" ").map(function(x){o[x]={name:x,val:i++};});return Object.freeze(o);};$.verto.enum={};$.verto.enum.states=Object.freeze({new:{requesting:1,recovering:1,ringing:1,destroy:1,answering:1},requesting:{trying:1,hangup:1},recovering:{answering:1,hangup:1},trying:{active:1,early:1,hangup:1},ringing:{answering:1,hangup:1},answering:{active:1,hangup:1},active:{hangup:1,held:1},held:{hangup:1,active:1},early:{hangup:1,active:1},hangup:{destroy:1},destroy:{},purge:{destroy:1}});$.verto.enum.state=$.verto.ENUM("new requesting trying recovering ringing answering early active held hangup destroy purge");$.verto.enum.direction=$.verto.ENUM("inbound outbound");$.verto.enum.message=$.verto.ENUM("display info pvtEvent");$.verto.enum=Object.freeze($.verto.enum);$.verto.saved=[];$(window).bind('beforeunload',function(){for(var i in $.verto.saved){var verto=$.verto.saved[i];if(verto){verto.logout();verto.purge();}} +dialog.gotEarly=true;dialog.rtc.answer(params.sdp,function(){console.log("Dialog "+dialog.callID+"Establishing early media");dialog.setState($.verto.enum.state.early);if(dialog.gotAnswer){console.log("Dialog "+dialog.callID+"Answering Channel");dialog.setState($.verto.enum.state.active);}},function(e){console.error(e);dialog.hangup();});console.log("Dialog "+dialog.callID+"EARLY SDP",params.sdp);};$.verto.ENUM=function(s){var i=0,o={};s.split(" ").map(function(x){o[x]={name:x,val:i++};});return Object.freeze(o);};$.verto.enum={};$.verto.enum.states=Object.freeze({new:{requesting:1,recovering:1,ringing:1,destroy:1,answering:1},requesting:{trying:1,hangup:1},recovering:{answering:1,hangup:1},trying:{active:1,early:1,hangup:1},ringing:{answering:1,hangup:1},answering:{active:1,hangup:1},active:{answering:1,requesting:1,hangup:1,held:1},held:{hangup:1,active:1},early:{hangup:1,active:1},hangup:{destroy:1},destroy:{},purge:{destroy:1}});$.verto.enum.state=$.verto.ENUM("new requesting trying recovering ringing answering early active held hangup destroy purge");$.verto.enum.direction=$.verto.ENUM("inbound outbound");$.verto.enum.message=$.verto.ENUM("display info pvtEvent");$.verto.enum=Object.freeze($.verto.enum);$.verto.saved=[];$(window).bind('beforeunload',function(){for(var i in $.verto.saved){var verto=$.verto.saved[i];if(verto){verto.logout();verto.purge();}} return $.verto.warnOnUnload;});})(jQuery); \ No newline at end of file diff --git a/html5/verto/js/src/jquery.verto.js b/html5/verto/js/src/jquery.verto.js index c09d4f5756..583e3a62a7 100644 --- a/html5/verto/js/src/jquery.verto.js +++ b/html5/verto/js/src/jquery.verto.js @@ -1951,6 +1951,8 @@ hangup: 1 }, active: { + answering: 1, + requesting: 1, hangup: 1, held: 1 }, diff --git a/scripts/setup-git.sh b/scripts/setup-git.sh index 369c118560..54d30219d6 100755 --- a/scripts/setup-git.sh +++ b/scripts/setup-git.sh @@ -82,6 +82,9 @@ EOF EOF cat 1>&2 <channel, SWITCH_FALSE); switch_channel_presence(session->channel, "unknown", "unhold", NULL); - switch_rtp_clear_flag(a_engine->rtp_session, SWITCH_RTP_FLAG_PAUSE); + if (a_engine->rtp_session) { + switch_rtp_clear_flag(a_engine->rtp_session, SWITCH_RTP_FLAG_PAUSE); + } + if (v_engine->rtp_session) { switch_rtp_clear_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_PAUSE); } diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 475f804675..086d7b0e1c 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -1803,11 +1803,11 @@ static void rtcp_generate_sender_info(switch_rtp_t *rtp_session, struct switch_r uint32_t sec, ntp_sec, ntp_usec; switch_time_exp_t now_hr; now = switch_time_now(); - sec = now/1000000; /* convert to seconds */ + sec = (uint32_t)(now/1000000); /* convert to seconds */ ntp_sec = sec+NTP_TIME_OFFSET; /* convert to NTP seconds */ sr->ntp_msw = htonl(ntp_sec); /* store result in "most significant word" */ - ntp_usec = now - (sec*1000000); /* remove seconds to keep only the microseconds */ - sr->ntp_lsw = htonl(ntp_usec*(double)(((uint64_t)1)<<32)*1.0e-6); /* convert microseconds to fraction of 32bits and store result in "least significatn word" */ + ntp_usec = (uint32_t)(now - (sec*1000000)); /* remove seconds to keep only the microseconds */ + sr->ntp_lsw = htonl((u_long)(ntp_usec*(double)(((uint64_t)1)<<32)*1.0e-6)); /* convert microseconds to fraction of 32bits and store result in "least significatn word" */ sr->ts = htonl(rtp_session->last_write_ts); sr->pc = htonl(rtp_session->stats.outbound.packet_count); @@ -1832,9 +1832,9 @@ static void rtcp_generate_report_block(switch_rtp_t *rtp_session, struct switch_ int32_t pkt_lost; uint32_t ntp_sec, ntp_usec, lsr_now, sec; now = switch_time_now(); - sec = now/1000000; /* convert to seconds */ + sec = (uint32_t)(now/1000000); /* convert to seconds */ ntp_sec = sec+NTP_TIME_OFFSET; /* convert to NTP seconds */ - ntp_usec = now - (sec*1000000); /* remove seconds to keep only the microseconds */ + ntp_usec = (uint32_t)(now - (sec*1000000)); /* remove seconds to keep only the microseconds */ /* Packet loss */ if (stats->rtcp_rtp_count == 0) { @@ -3865,7 +3865,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_activate_rtcp(switch_rtp_t *rtp_sessi switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_DEBUG, "RTCP send rate is: %d and packet rate is: %d Remote Port: %d\n", send_rate, rtp_session->ms_per_packet, rtp_session->remote_rtcp_port); rtp_session->rtcp_interval = send_rate; - rtp_session->rtcp_send_rate = send_rate/1000; + rtp_session->rtcp_send_rate = (uint16_t)(send_rate/1000); rtp_session->next_rtcp_send = switch_time_now() + (rtp_session->rtcp_interval * 1000); } @@ -5088,9 +5088,9 @@ static switch_status_t process_rtcp_packet(switch_rtp_t *rtp_session, switch_siz uint32_t lsr; uint32_t packet_ssrc; now = switch_time_now(); /* number of microseconds since 00:00:00 january 1, 1970 UTC */ - sec = now/1000000; /* converted to second (NTP most significant bits) */ + sec = (uint32_t)(now/1000000); /* converted to second (NTP most significant bits) */ ntp_sec = sec+NTP_TIME_OFFSET; /* 32bits most significant */ - ntp_usec = now - (sec*1000000); /* micro seconds */ + ntp_usec = (uint32_t)(now - (sec*1000000)); /* micro seconds */ lsr_now = (uint32_t)(ntp_usec*0.065536) | (ntp_sec&0x0000ffff)<<16; // 0.065536 is used for convertion from useconds if (rtp_session->rtcp_recv_msg.header.type == 200) { /* Sender report */