Change virtual extension to SIP

When I initially set my PBX up, I created virtual extensions for all users, then added a FollowMe for different SIP endpoints. It was (mostly) functional, but has created a fair share of headaches in implementation.

Now, with the understanding that chan_pjsip can have multiple endpoints for a single extension, which would simplify my dialplans, ring groups, queues, etc. immensely. I upgraded the system to Asterisk 13, set up a test extension using chan_pjsip, and it seems to behave exactly the way I’m expecting.

My question is this: Can I change the virtual extension, which houses all of the user’s voicemail, and is already set up in the dialplan, to be a SIP extension? I’m reasonably sure I could go into the database and change the “technology” setting, but will this cause other issues?

I don’t mind doing this individually for each extension, but I’m hoping to avoid deleting and re-creating the extension as a SIP or PJSIP extension. If I did it that way, I would need to re-create all of the custom settings, re-add to dial plans, migrate voicemail, etc. Much easier if I could just add “This extension uses chan_pjsip technology” to an existing virtual extension. Even better if there were maybe a script or a GUI method that could accomplish the same end-goal.

Looking through the database, it seems that virtual extensions don’t get any sort of entry in the asterisk.sip table, so it would seem that there is no direct way to do it in the database. However, I’ve noticed in the bulkextensions export, there is a “technology” column. I could probably export it using bulkextensions, change the “technology” column, then re-import it over top of the old one.

However, this suggests that somewhere, there exists a script that can insert the values from a bulkextensions export into valid FreePBX extensions. Does there exist perhaps a version of this script that could perform the same functions without the need to exporting to a CSV, then importing back into the system?

Thanks in advance!

No reply on this for a while, so on our test system, I just used the bulkextensions module to export all of the extensions, then edit them on a spreadsheet to “merge” the virtual extension with the physical extensions. It’s a little bit cumbersome, but it only needs to be done once per employee, and seems to be working pretty well.

I am very much looking forward to being able to deploy Asterisk 13 (along with chan_pjsip) in our production system!

@cmhxaktsoft, I’d be very interested in hearing how this worked out for you. Any other details to know about converting?

My situation is slightly different… I started with all pjsip extensions, but there a some that need to be converted to virtual extensions. I’m presuming your technique will work in the other direction if it worked for you going from virtual to pjsip.

Clever idea - how did you edit the two exported extensions (Virtual and PJSIP) to reimport as one extension using the original Virtual extension? Or maybe since this post date, there is a better way to convert a Virtual Extension to PJSIP in order to preserve the virtual voicemail for the new PJSIP phone?

I went ahead and tried this: All the current extensions in this system were virtual. I first created a low numbered PJSIP extension (so it would be top of the exported CSV), and created a new (higher number) test Virtual extension.

Then, enabled voicemail on the virtual extension and set up the greetings and called it to record a message. Did not enable voicemail on the new PJSIP extension.

Then, export the extensions, then leaving the field names line, and delete all but the 2 text extensions from the CSV.

Leave the voicemail field as default in the Virtual extension
Compared all the other fields of the 2 records, changing only the fields of the Virtual extension that don’t already have data. Edit / enter data using the other record as a guide (but changing the extension).

When finished, I deleted the PJSIP test extension, leaving only the Field Name line and edited Virtual extension line. Saved and Imported the 1-line CSV file and selected. (make sure Replace data is Yes). Applied changes and tested the extension that was virtual and successfully connected to a phone. Made sure greetings and test message was there. Worked well !.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.