Comments (1)
While there is no simple built in solution to directly use MWI right now, you
can easily just implement your own MWI subscription using the subscribe
function. Tested this method with Asterisk and it works just fine. If someone
feels like it they can just create wrapper functions in the sipml5 source code
to use the below logic, but I'm sure testing is needed for use with other PBX
platforms. The stuff in sip_caps is probably not needed.
function SubscribeMWI() {
console.log("Softphone: Subscribing to MWI");
var softphoneMWISession = softphoneSIPStack.newSession('subscribe', {
expires: 300,
events_listener: {
events: '*', listener:
function (e) {
if (e.type == 'i_notify' && e.getContentType() == 'application/simple-message-summary') {
var matches = e.getContentString().match(/Voice\-Message: ([0-9]+)\/([0-9]+)/);
if (matches.length == 3) {
var newMessages = matches[1],
oldMessages = matches[2];
//TODO: Use newMessages and oldMessages however you please, you probably only care about newMessages
}
} else if (e.type == 'connected') {
console.log('Softphone: Subscription to MWI successful');
} else if (e.type == 'terminated') {
console.log('Softphone: Subscription to MWI failed');
//TODO: Attempt to subscribe again in a couple minutes? Or bail out.
}
}
},
sip_headers: [
{ name: 'Event', value: 'message-summary' },
{ name: 'Accept', value: 'application/simple-message-summary' }
],
sip_caps: [
{ name: '+g.oma.sip-im', value: null },
{ name: '+audio', value: null },
{ name: 'language', value: '\"en\"' }
]
});
softphoneMWISession.subscribe('PUT_THE_CURRENT_USERS_AUTH_ID_OR_EXTENSION_HERE');
}
Original comment by [email protected]
on 8 Jan 2015 at 5:27
from sipml5.
Related Issues (20)
- SUBSCRIBE does not contain route headers
- Sipml5 not connecting HOT 1
- No Audio on Firefox 34+
- dtmf('#') and dtmf('*') are not detected correctly
- Called in wrong state: STATE_INPROGRESS HOT 8
- startBfcpShare not working
- Content length for SIP INFO packets is incorrect in latest release HOT 1
- Firefox ICE resolution to incorrect 0.0.0.0 address HOT 2
- Video stream doesnt add in SipML5
- Export to GitHub
- Available on main package managers
- sipml5 unable to play remote audio HOT 2
- No early audio in outgoing sipml call to an extension. HOT 2
- Parameters send to Event Listener Function HOT 2
- Outbound call hangs up after 1 minute with FreeSwitch Session-Expire
- Problem in BYE send from SIPML5 - Webrtc2sip (Version 2.6.0)
- Temporary failure in name resolution
- Call.info() result is logged to console instead of given to user HOT 1
- One way video, any browser, webrtc2sip and Asterisk to softphone HOT 2
- call disconnection in api version SIPML5 API version = 1.5.230
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sipml5.