Project

General

Profile

Multiple lines per user.

Added by Christian Held almost 4 years ago

Hi,

We have some users with multiple phones, e.g. main office and home office.
Currently we ended up using groups as users and users as lines. Is it possible to add multiple lines to a single user?

Thanks for your help
Christian


Replies (33)

RE: Multiple lines per user. - Added by Sébastien Duthil almost 4 years ago

Hi,

what you did is the current right way to go for this case. We are currently working on a better solution.

RE: Multiple lines per user. - Added by J Az over 2 years ago

Since this is about a year old, is there any update or currently better way to do this?

My want is to set up users who have a desk phone (and possibly another at home) with a softphone or 2 (ie. on the cell phone and/or on data only devices like tablets and laptops.)

Ideally these would all carry the same extension so that there is no distinction which device they call from and they'd all share the same extension, voicemail box, etc.
Plus I'd prefer to avoid having to have so many groups (as much as 1 group per user since most users would have at least 1 desk phone and 1 softphone simultaneously connected via LAN and/or VPN)

Thanks

RE: Multiple lines per user. - Added by Sylvain Boily over 2 years ago

Hello,

Yes it possible to add multi lines on a user, but you need to use our REST API for the moment. Unicom support the multi line.

Sorry my screenshot is in french, but english is the same :)

Sylvain

RE: Multiple lines per user. - Added by J Az over 2 years ago

Thanks for the reply Sylvain but I'm afraid that I'm too new to make sense of the screenshot (language issues aside.)

I'm reading up on the API now and I have a token and figured out how to access the swagger ui thing but where in the API do I do what you've shown? On the user? On the line? Is that the only step or are there more??

Sorry for all the questions but I'm really very new at this.

On the plus side, there's really no documentation I could find anywhere on this and if I figure it all out I'll write it up as a blog post which you're welcomed to add to your wiki if you want. Seeing how little info there is through google searches I'm sure it'll help someone else out somewhere.

Thanks,

RE: Multiple lines per user. - Added by Sylvain Boily over 2 years ago

Ok, i want to be sure to understand what you are looking for?
This is a screenshot of my configuration. Is it the same way you are looking for? A user with multiple sip or sccp configuration?

RE: Multiple lines per user. - Added by J Az over 2 years ago

Yes! That would be perfect!

RE: Multiple lines per user. - Added by Sylvain Boily over 2 years ago

ok, so you need to have a tool to add second line or understand the API or waiting to have this configuration on the webi. I will write a small doc to help you tomorrow!

RE: Multiple lines per user. - Added by J Az over 2 years ago

Thank you Sylvain.
I will continue to experiment with the API and maybe I'll get lucky.

I'll look forward to your explanation tomorrow though just in case.

RE: Multiple lines per user. - Added by Sylvain Boily over 2 years ago

To help you now, you need to :

  1. Create a line (sip or sccp) (you could do this on the webi in line menu or with the API)
  2. Associate this line to an extension (same from the first it also ok) (need the API)
  3. Associate this line to your user (need the API)

To get a token simply (go to auth.wazo.community) and fill your wazo ip and use your credentials. To use the API with swagger and the token, go to http://wazo_ip/api and fill the token you get from auth web interface.

RE: Multiple lines per user. - Added by J Az over 2 years ago

Thank you Sylvain.

I've gotten as far as the auth token and making requests I'm just still floundering along trying to figure out what to do in which order.

I will try your steps 1-3 out. I expect they will be what I need.

Thank you for the fast responses! :)

RE: Multiple lines per user. - Added by J Az over 2 years ago

Sylvain Boily wrote:

To help you now, you need to :

  1. Create a line (sip or sccp) (you could do this on the webi in line menu or with the API)
  2. Associate this line to an extension (same from the first it also ok) (need the API)
  3. Associate this line to your user (need the API)

To get a token simply (go to auth.wazo.community) and fill your wazo ip and use your credentials. To use the API with swagger and the token, go to http://wazo_ip/api and fill the token you get from auth web interface.

And that was (I think) everything I needed!! Thank you so much!!!!

Clipboard02.jpg View (52.9 KB)

RE: Multiple lines per user. - Added by J Az over 2 years ago

Thank you Sylvain for your assistance and getting me on track. I spent countless hours chasing this down.
Based on your help, these are the steps I've documented for doing this. I assume the user knows how to get to the API backend.
If not, I followed the instructions here: http://documentation.wazo.community/en/latest/api_sdk/rest_api/quickstart.html

Once you have your api token all of the following are done from the XIVO_Confd section of the api / swagger ui

I hope this helps someone else and please Sylvain or Wazo project feel free to use this in a wiki or docs if you find any of it helpful.
Thanks again,
J.


1. Create a new line or lines (easier done in UI - I had problems passing the right info through the API but ymmv)
    user and pass will already be populated (random)
    context is default
    language eg. "en-us" 
    Caller ID name & <extension> eg. "John Smith <701>" 
    NAT as needed eg. "Yes (force rport+comedia)" 
    DTMF as appropriate eg. "RFC 2833" 
    Monit'g as needed "yes" typically needed for NAT

2. Associate the new Line(s) to an Extension and then to a User
    a) Look up the User's ID
        Wazo API, Users, GET /users
        use the 'search' field to restrict search to one user.  Partial names seem to work
        In the returned data you want the "id": field two fields above the "firstname": and "lastname": fields of your user. (there is a "uuid": field in between)
        Write it down.  eg. User John Smith = ID 1

    b) Look up the extension ID
        Wazo API, Extensions, GET /extensions, 
        in 'exten' field enter the extension number, 'Try it out!'
        In the returned data you want the "id": at the top
            (there are more ID's further down, these are in the "lines" section and are id's of other lines already set up.  Ignore them)
        Write it down.  eg. Exten 701= ID 34

    c) Look up the [new] Line ID (or IDs if you added more than one)
        Wazo API, Lines, GET /lines
            You can just hit 'try it out' to return all lines or use the 'search' field to return one at a time
            Suggest using the username / identity field (use the part after "SIP/") as search term
        Enter a search term in 'search' field if wanted
        In the returned data you want the "id": that's just above the "name": field(s)
        Write it/them down.  eg. Line rvxxrw = ID 8, Line aqq8zr = ID 9, Line 1yxb5l = ID 10

    d) Finally, create the line/extension association(s)
        1) Associate your Line(s) to Extensions:
            Wazo API, Lines, PUT /lines/{line_id}/extensions/{extension_id}
            Enter the Line ID
            Enter the Extension ID
            'Try it out' - "Response Code" section should return 204, otherwise you have an error
            Repeat if/as necessary
        2) Associate your Line(s) to the User:
            Wazo API, Lines, PUT /users/{user_id}/lines/{line_id}
            Enter the user_id
            Enter the line_id
            'Try it out' - "Response Code" section should return 204, otherwise you have an error
            Repeat if/as necessary

    e) Check your work
        In Wazo UI go Services>IPBX>IPBX settings>users
        Edit the user and go "Lines" tab
        If all your lines are listed you are good to go.
        Go back to IPBX settings>Lines and get your user/pass or provisioning code

RE: Multiple lines per user. - Added by Sylvain Boily over 2 years ago

Great thank you for your feedback!

RE: Multiple lines per user. - Added by J Az over 2 years ago

You're welcomed.

Not sure if I should start another thread but is related to this multi-lines to one user setup so let me know if I should please.

One of the things I was hoping to gain from this (as opposed to using groups) was that if I reject a call on one of the lines/phones that the call would be rejected on all of the lines/phones at once. At the moment that is not the case. Is there any additional configuration or some way that I can get that to work?
My hard phones are Aastra 6731 (and I reject the call by pressing the red 'Goodbye' button) and my softphones are so far all Zoiper (and I reject the call with the red 'reject' button on the incoming call screen).

Thank you.
J.

RE: Multiple lines per user. - Added by Etienne Lessard over 2 years ago

J Az wrote:

One of the things I was hoping to gain from this (as opposed to using groups) was that if I reject a call on one of the lines/phones that the call would be rejected on all of the lines/phones at once. At the moment that is not the case. Is there any additional configuration or some way that I can get that to work?

None that I know of. Technically, calling a user with two lines use the Dial application with two device (e.g. Dial(SIP/alice&SIP/bob)), and there does not seem to be an option for Dial to do the kind of thing you want. Maybe it's possible to do something really contrived, but I doubt this would be the right solution.

RE: Multiple lines per user. - Added by Speederyoyo . over 2 years ago

Hello.

Will this functionality be made available in the webi from here can of time ?

Bye.

RE: Multiple lines per user. - Added by J Az over 2 years ago

Etienne Lessard wrote:

J Az wrote:

One of the things I was hoping to gain from this (as opposed to using groups) was that if I reject a call on one of the lines/phones that the call would be rejected on all of the lines/phones at once. At the moment that is not the case. Is there any additional configuration or some way that I can get that to work?

None that I know of. Technically, calling a user with two lines use the Dial application with two device (e.g. Dial(SIP/alice&SIP/bob)), and there does not seem to be an option for Dial to do the kind of thing you want. Maybe it's possible to do something really contrived, but I doubt this would be the right solution.

Thanks Etienne. It's a bit of a disappointment but I guess that's my fault for assuming how it would work.

I will have to dig in to that link when I have more time as at the moment this is a part-time pursuit and my "actual" day job needs me. I did look at it briefly and got the impression that maybe there is some way to make it work but that could just be my own bias (or wishful thinking.) I will circle back around once I've had a bit more time to invest in reading and consider options.

In any case thanks for all of your help thus far.
J.

RE: Multiple lines per user. - Added by J Az over 2 years ago

Sylvain,

In another thread you said

Your issue is not with the configuration files but with the application Dial. I think there is two solutions. The first is patching the app_dial.c in asterisk to have what you like. The second is using asterisk AMI with an external program to execute the hangup on each channel. In wazo we have websocket and REST API to interact with Asterisk, so maybe it would be more simple for you to write a new program. In wazo we are using asterisk 14. Why is so important for you? Maybe you could explain your story and we can help you to find the better solution for your case.

I don't know enough about it to agree or disagree, only that I read the other thread and some things looked encouraging but it will take me time and learning to understand better if or how to apply them.

One question you can answer for me is this: When a call comes in and user rejects it (on the desk using aastra 6700 phones with red 'goodbye' button, on softphones - so far zoiper or x-lite - using red 'reject' button) is any signal sent back to Wazo that this has happened? In other words, does the PBX get any signal that call was rejected on some device?

Now to answer you about the use case -
I have set up Wazo to use as my home/office phone system (I work out of my house and my GV number has been my work number for some time). I expect to be able to make and receive these calls everywhere and, including my laptop, I have/carry anywhere from 1 to 5 devices (cellphone, Windows laptop, 1 iPad and 2 Android wifi only devices (tablet and phone sized.) I also have 2 desk phones at the moment (Aastra 6731.)

Because I do not want to have multiple voicemail boxes I chose to give all these devices the same extension (eg. 701) I thought this was a better way than having them all have different extensions as I will not ever need to call between them. In essence, they are all my phone as I'm the only user of them.

The problem begins however when a call comes in. If I'm in the office as many as all 7 devices ring (both deskphones and every device that is charged is connected to the network.)
If I'm out of the office (say on site at a clients) I have a hotspot running and so as many devices as I have with me will be connected and will ring.
If I choose to reject a call, I have to reject it on every single device or they will continue ringing. This is especially annoying if for example I'm in front of a client. If I have 3 devices with me, I have to reject call on 3 devices.

If you can suggest a better way to configure these I'm open to it. Afaik, I can choose either to give them each an extension and make a group or assign them all to the same extension. In either case, call reject on one device does not reject on the others. I'd love to hear about a 3rd option unknown to me :)

As far as patching app_dial.c or doing anything with AMI, neither is in my skill set at the moment. I am not a programmer, more a sys admin guy with some knowledge of programming and logic but with no language skill that matters today. To get what I want I could choose to learn/add those skills but they are not a priority relative to work and other commitments so would not happen quickly.

Thanks for any help and consideration.
J.

RE: Multiple lines per user. - Added by J Az over 2 years ago

Here is something I thought was encouraging - taken from: https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+Application_Dial

Example: Dial alice and bob and send NO_ANSWER to bob instead of ANSWERED_ELSEWHERE when alice answers

same => n,Dial(PJSIP/alice&PJSIP/bob,,Q(NO_ANSWER))

Arguments:
> Q( cause ) - Specify the Q.850/Q.931 cause to send on unanswered channels when another channel answers the call. 
As with Hangup(), cause can be a numeric cause code or a name such as NO_ANSWER, USER_BUSY, CALL_REJECTED 
or ANSWERED_ELSEWHERE (the default if Q isn't specified). You can also specify 0 or NONE to send no cause. See the causes.h file for the full list of valid causes and names.

I realize this is predicated on Alice answering the call, but perhaps there's some way to extend this to the Alice rejecting a call.
Then again perhaps that is what you meant by patching app_dial.c - patching it to act on a rejected call?

J.

RE: Multiple lines per user. - Added by Sylvain Boily over 2 years ago

Hello,

Well i understand... but patching app_dial is not trivial ;-)

I did a small program for you https://github.com/sboily/hangupsecondline
It's simple but it use the wazo api and it do (i think) what you want. This is only a simple exemple for you with your specific user, so you need to add a login in your user on the web interface and fill it instead sylvain/sylvain in the script and the wazo host. Maybe 127.0.0.1 will be easier to start, but you can use it on another server.

Sylvain

RE: Multiple lines per user. - Added by J Az over 2 years ago

Sylvain,

Deeply grateful that you would take the time to write this just for me.

Unfortunately as new as I am I have no idea how to use it.

If I understood correctly I need to add login info to my existing user so I go:

Services > IPBX > IPBX settings > Users > edit (pencil icon for my existing user)

The only login info I see is if I enable "Wazo Client" so I enable it and creat a user and password and set profile as 'Supervisor'

Am I right so far?

Then I would put that user info in the 'mail.py' file on github. But then where do I put the 'main.py'? And does the 'requirements.txt' file have to be with it too?

Sorry for my ignorance and again thank you so much for your time, effort and assistance.

J.

RE: Multiple lines per user. - Added by Sylvain Boily over 2 years ago

Ok, you only need to get the main.py on your wazo or on a linux machine, you fill the host, username and password at the top of the file and;

chmod +x main.py
./main.py

The requirements.txt is only the python dependences. On a wazo this dependies is already installed, on other server, you need to install it with:

pip install -r requirements.txt

You could also create a virtualenv before to install it if you prefer to chroot this dependencies.

Your cti user is correct with a profil client. (it's wazo client user, yes, but for your user who have 2 or mores lines)

RE: Multiple lines per user. - Added by J Az over 2 years ago

Sylvain!

That works wonderfully! Cancels all the handsets within about .5 second of rejecting a call. It's fantastic! :)

Now I have just two more questions about how to keep this working please -

When I run it, I see it runs continuously on the command line and needs to keep running to work. Is there any way to run this as a background process (is the correct Linux term 'fork'?) so I don't have to keep a terminal open for it?
And second, if I can run it in the background, I would want it to start up and run automatically (to survive reboots.) What would be the correct place to put the script to run automatically?

This works really well and hopefully you can incorporate this work somehow into Wazo proper so it works for more than just one user. In the not-too-far future I'd like to set up a Wazo box for my brother's office (5 users, IVR, 4 lines (call channels)). At least 2 users there would be in a situation like mine with multiple devices and would benefit from this. Hopefully I can adapt this solution for multiple users or better yet, it'll be part of the distribution by then.

Thanks again for all your help. I'm sure to be back soon as I have time to tinker and break more stuff ;)

J.

RE: Multiple lines per user. - Added by Sylvain Boily over 2 years ago

Yep it's only a POC i did yesterday to be sure that you want. So Yes it would be nice to have a deamon and a init service inside. But i will discuss with the other guy in the wazo team about this case to think about the futur of this request.

RE: Multiple lines per user. - Added by J Az over 2 years ago

Got it, thank you then for the time doing a POC for me.

Presently I'm running it like this

/root/hangup-helper/main.py > /root/hangup-helper/main.py.log 2>&1 &

in a 'screen' session and detaching so it continues to run when I close my ssh session. That seems to be working nicely to run it in the background and in a day or two I'll switch out the 'main.py.log' for /dev/null as I don't think I need the message trail.

I do have to remember to re-do it manually in case I reboot the server but that's not so bad. Frankly I'd be perfectly with running the PoC script as is for a while if I could just figure out how to get it to autostart w/o me having to login. I tried putting it in /etc/rc.local but got errors, presumably because Wazo wasn't yet running. I'm trying to wrap my head around making it a script for systemctl but there's just too much to figure out about sytemctl and LSB scripts for a newbie like me. My Linux fu is not strong (but I'm working on it) :)

Maybe I'll have more time to play with systemctl over the weekend or maybe, off the top of your head, do you know an easier way to maybe start and run this simply? One thing I read suggested maybe using cron with @reboot. I might try that if I have time later today.

If I can figure out how to start and run it autonomously then next I will try to see if I can run two instances of the script (i.e for two users.)

In any case thanks again for all your help so far. As it is, it works quite nicely and I'll continue to tinker with it as time permits.

I think for the road warrior it's a great feature so I do hope you merge it into the main development. Maybe not many ppl will have 5 devices like me but anyone who has a desk phone with a laptop softphone or even just a cell would benefit from this imo.

J.

(1-25/33)