Hi Aaron,
I’m using a Nokia Windows 8 Phone and would like a SIP softphone that runs in the background but Microsoft doesn't like this.
Linphone have a feature for “Audio incoming calls in background mode using push notifications (only for sip.linphone.org accounts)”. This didn't work for me. Anyway I would prefer to use my SipSorcery account.
Zoiper softphone have push notifications but I need help with a dial plan.
http://www.windowsphone.com/en-ie/store ... 8fa1660737
Thanks, Stephen.
Push Notifications
-
- Posts: 3
- Joined: Tue Feb 09, 2010 11:02 am
- Location: Dublin
- Contact:
Re: Push Notifications
I've had a look at http://www.zoiper.com/en/tutorials/push-notifications and that should be feasible with sipsorcery. It will take a few days to put the script together and I'll post back when I have something.
Re: Push Notifications
The code snippet below will iterate through your sipsorcery SIP account bindings and if it finds the Zoiper X-PUSH-URI string in the binding will send a HTTP GET request to the URL. You will need to add this snippet to the extension that you want to use to place calls to your Zoiper softphone.
Code: Select all
bindings = sys.GetBindings("your_zoiper_account", "sipsorcery.com")
if bindings != nil then
bindings.each { |binding|
sys.Log("binding contact=#{binding.ContactURI.ToString()}")
if binding.ContactURI.ToString() =~ /X-PUSH-URI=(.*)/ then
sys.WebGet($1)
sleep(2)
end
}
end
Re: Push Notifications
Hi Aaron, Thanks for this work, some time ago, for Push notification. I have tried to use this code in my Dial Plan. The code line,
if binding.ContactURI.ToString() =~ /X-PUSH-URI=(.*)>/ then
does not find the string and does not execute the following statements. However the string "X-PUSH-URI=" does exist, and if I change the code to,
if binding.ContactURI.ToString() =~ /X-PUSH-URI=/ then
the string is found.
I am not sure what the (.*)< is mean to do and the relationship to the $1, but it seems to stop the string from being found.
An example of the binding contact string is below, truncated.
sip:xxxxxxx@nnn.nnn.nnn.nnn:16980;transport=UDP;rinstance=089abc1ee935cc85;X-PUSH-URI=http://s.notify.live.net/u/1/hk2/H2QAAA ... UcIANFwdXk
if binding.ContactURI.ToString() =~ /X-PUSH-URI=(.*)>/ then
does not find the string and does not execute the following statements. However the string "X-PUSH-URI=" does exist, and if I change the code to,
if binding.ContactURI.ToString() =~ /X-PUSH-URI=/ then
the string is found.
I am not sure what the (.*)< is mean to do and the relationship to the $1, but it seems to stop the string from being found.
An example of the binding contact string is below, truncated.
sip:xxxxxxx@nnn.nnn.nnn.nnn:16980;transport=UDP;rinstance=089abc1ee935cc85;X-PUSH-URI=http://s.notify.live.net/u/1/hk2/H2QAAA ... UcIANFwdXk
Re: Push Notifications
How about if you just remove the '>' character from the end of the regular expression? Looks like it might have been a typo.
Example:
The (.*) is a regular expression grouping expression and the line of code that specifies $1 is using the captured value.
Example:
Code: Select all
if binding.ContactURI.ToString() =~ /X-PUSH-URI=(.*)/ then
....
Re: Push Notifications
Thanks very much. That works.