| Send a voice frame to force audio flow, fixes #38 - warvox - VoIP based wardial… | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| commit 48debf5ff874498ac73db2273708fcd65ebe90dc | |
| parent 19c15827759ba27da70d307c63ecb6998f8e6833 | |
| Author: HD Moore <[email protected]> | |
| Date: Sun, 28 Feb 2016 18:56:58 -0600 | |
| Send a voice frame to force audio flow, fixes #38 | |
| Diffstat: | |
| M lib/warvox/proto/iax2/call.rb | 1 + | |
| M lib/warvox/proto/iax2/client.rb | 6 ++++++ | |
| 2 files changed, 7 insertions(+), 0 deletions(-) | |
| --- | |
| diff --git a/lib/warvox/proto/iax2/call.rb b/lib/warvox/proto/iax2/call.rb | |
| @@ -254,6 +254,7 @@ class Call | |
| self.state = :answered | |
| self.ring_finish = ::Time.now.to_i | |
| end | |
| + self.client.send_voice(self, "\xff" * 160) | |
| when IAX_CTRL_PROGRESS | |
| dprint("PROGRESS") | |
| diff --git a/lib/warvox/proto/iax2/client.rb b/lib/warvox/proto/iax2/client.rb | |
| @@ -153,6 +153,12 @@ class Client | |
| send_data( call, create_pkt( call.scall, call.dcall, call.timestamp, call.… | |
| end | |
| + def send_voice(call, audio) | |
| + # TODO: Replace with the server-selected codec | |
| + data = [IAX_CODEC_G711_MULAW].pack("C") + audio | |
| + send_data( call, create_pkt( call.scall, call.dcall, call.timestamp, call.… | |
| + end | |
| + | |
| def send_new(call, number) | |
| data = [ IAX_SUBTYPE_NEW ].pack('C') | |