Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] Finding all active calls belonging to the same phone


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
john at feith.com
Guest





PostPosted: Wed Jun 10, 2009 7:32 pm    Post subject: [Freeswitch-users] Finding all active calls belonging to the Reply with quote

To duplicate our old PBX park functionality I need for a user who's
on a call to be able to pick up a second line and dial a number to
park the other call which is on his phone. I have something working,
however am curious if there's a better way to accomplish this.

Specifically I'm curious if there's a recommended way to find all the
calls to / from the same phone / channel.

I ended up configuring *5 to call a javascript program which:

a) Gets the uuid from the session and uses it to search "show channels"
to find the channel name.

b) Normalizes the channel name and uses it to search "show channels"
to find an uuid associated with the channel which is different from
the one that invoked *5.

c) Uses the uuid from "b" to search "show calls" to find the peer
uuid.

d) Uses uuid_setvar to set hangup_after_bridge=false and uuid_transfer
to transfer the peer uuid to the proper fifo.

One of the problems I ran into is the channel name has slightly different
formats depending on whether it is an inbound or outbound channel. E.g.:

sofia/internal/1003@XXX.XXX.XXX.XXX
sofia/internal/1003@XXX.XXX.XXX.XXX:5060
sofia/internal/sip:1003@YYY.YYY.YYY.YYY:5060;transport=udp;...

where XXX is the freeswitch box and YYY is the phone. I created the
following function to normalize the channel name for comparison:

function normalize_channel_name (name, direction, ip_addr)
{
var re = /^sofia\//g;
var length = name.search (re);
var new_name = name;

if (length == -1)
return new_name;

if (direction == "inbound") {
re = /@.*$/g;

new_name = name.replace (re, "@" + ip_addr);
}
else if (direction == "outbound") {
re = /\/sip:(.*@[^:]*):.*$/g;

new_name = name.replace (re, "/$1");
}

return new_name;
}

Suggestions for a better approach? Keep in mind that my existing user
population expects (for better or worse) to use *5 to park the call on
their phone so I'm somewhat limited in what I can do.

-- John
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com |
| John Wehle | Fax: 1-215-540-5495 | |
-------------------------------------------------------------------------


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
brian at freeswitch.org
Guest





PostPosted: Wed Jun 10, 2009 9:32 pm    Post subject: [Freeswitch-users] Finding all active calls belonging to the Reply with quote

Why not use the presence events to keep that state?

/b

On Jun 10, 2009, at 7:31 PM, John Wehle wrote:

Quote:
To duplicate our old PBX park functionality I need for a user who's
on a call to be able to pick up a second line and dial a number to
park the other call which is on his phone. I have something working,
however am curious if there's a better way to accomplish this.

Specifically I'm curious if there's a recommended way to find all the
calls to / from the same phone / channel.

I ended up configuring *5 to call a javascript program which:

a) Gets the uuid from the session and uses it to search "show
channels"
to find the channel name.

b) Normalizes the channel name and uses it to search "show channels"
to find an uuid associated with the channel which is different
from
the one that invoked *5.

c) Uses the uuid from "b" to search "show calls" to find the peer
uuid.

d) Uses uuid_setvar to set hangup_after_bridge=false and
uuid_transfer
to transfer the peer uuid to the proper fifo.

One of the problems I ran into is the channel name has slightly
different
formats depending on whether it is an inbound or outbound channel.
E.g.:

sofia/internal/1003@XXX.XXX.XXX.XXX
sofia/internal/1003@XXX.XXX.XXX.XXX:5060
sofia/internal/sip:1003@YYY.YYY.YYY.YYY:5060;transport=udp;...

where XXX is the freeswitch box and YYY is the phone. I created the
following function to normalize the channel name for comparison:

function normalize_channel_name (name, direction, ip_addr)
{
var re = /^sofia\//g;
var length = name.search (re);
var new_name = name;

if (length == -1)
return new_name;

if (direction == "inbound") {
re = /@.*$/g;

new_name = name.replace (re, "@" + ip_addr);
}
else if (direction == "outbound") {
re = /\/sip:(.*@[^:]*):.*$/g;

new_name = name.replace (re, "/$1");
}

return new_name;
}

Suggestions for a better approach? Keep in mind that my existing user
population expects (for better or worse) to use *5 to park the call on
their phone so I'm somewhat limited in what I can do.

-- John
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email:
john@feith.com |
| John Wehle | Fax: 1-215-540-5495
| |
-------------------------------------------------------------------------


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services