3CX Modifiy Trunk Patton

Alle CTEC

Silver Partner
Advanced Certified
Joined
Sep 11, 2023
Messages
356
Reaction score
44
Hi I created a patton trunk using the following patton 3CX template

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<doc>
<header>
<name>Patton Generic Gateway</name>
<time>2024-10-14T09:38:52.9161215Z</time>
<template>
<!--Do not change this field-->generic.gw.xml</template>
<type>
<!--Do not change this field-->gateway-template</type>
</header>
<data>
<device>
<field name="Name">Custom Patton Generic Gateway</field>
<type>provider</type>
<manufacturer></manufacturer>
<model>provider</model>
<field name="RegistrarHost">[Gateway IP address]</field>
<field name="RegistrarPort">5060</field>
<field name="SecondaryRegistrar"></field>
<field name="IPRestriction">ANY</field>
<field name="TransportRestriction">ANY</field>
<field name="RequireAuthFor">4</field>
<field name="IpInContactRegValue"></field>
<field name="RegistrarInvite">0</field>
<field name="IsSupportReinvite">1</field>
<field name="IsSupportReplaces">1</field>
<field name="DisableVideo">1</field>
<field name="SRTPMode">0</field>
<field name="IsBindToMS">0</field>
<codecs>
<codec rfcname="PCMU" />
<codec rfcname="PCMA" />
<codec rfcname="G729" />
</codecs>
<field name="ParameterIn" custom="" parameter="ContactHost">$DevHostPort</field>
<field name="ParameterIn" custom="" parameter="ToDisplayName">$CalledName</field>
<field name="ParameterIn" custom="" parameter="ToUserPart">$CalledNum</field>
<field name="ParameterIn" custom="" parameter="FromDisplayName">$CallerName</field>
<field name="ParameterIn" custom="" parameter="FromUserPart">$CallerNum</field>
<field name="ParameterOut" custom="" parameter="RequestLineURIUser">$CalledNum</field>
<field name="ParameterOut" custom="" parameter="RequestLineURIHost">$DevHostPort</field>
<field name="ParameterOut" custom="" parameter="ContactUser">$AuthID</field>
<field name="ParameterOut" custom="" parameter="ContactHost">$ContactUri</field>
<field name="ParameterOut" custom="" parameter="ToDisplayName">$CalledName</field>
<field name="ParameterOut" custom="" parameter="ToUserPart">$CalledNum</field>
<field name="ParameterOut" custom="" parameter="ToHostPart">$DevHostPort</field>
<field name="ParameterOut" custom="" parameter="FromDisplayName">$CallerName</field>
<field name="ParameterOut" custom="" parameter="FromUserPart">$OutboundCallerId</field>
<field name="ParameterOut" custom="" parameter="FromHostPart">$ContactUri</field>
</device>
</data>
</doc>

But if I now wanted to change one of these parameters, how can I do it without redoing the trunk which currently has 100 DIDs associated with already set paths?

Thank you
 
  • Like
Reactions: daniele.talami
Sorry, @fxbastler but is it only available with an enterprise license?
 
I have a professional license, the problem is that the trunk has a pass-through selection with 1000 numbers assigned and recreating the trunk with a modified template means recreating all the routing paths
 
but is it only available with an enterprise license?
no:
Note: Everything (and a bit more) that you can click on in the 3CX Admin menu can be automated. You can use the browser development tools to see how 3CX does it themselves.
You have to use sysowner credentials.
You only need another or bigger license if you want to delagate functions to other than sysowners or want to use the 3CX Call Control API (both defined in Admin / Integaration / API).

sample script (with parameter explanation in the post above) to change sip trunk parameter 'live' (after restart sip service or the 3CX)
https://www.3cx.de/forum/threads/si...edata-ausgehende-rufnummer.119683/post-445951

how to look at specific API calls
https://www.3cx.de/forum/threads/ap...keine-aktuellen-ergebnisse.125293/post-458337

but ...
... with 1000 numbers assigned ...
one can import did, destination and name - if one have a proper import file ...
 
Last edited:
  • Like
Reactions: Evolute IT
Hi, the export/import of additional trunk numbers gives an error during import. It can't associate the number with the extension because the number hasn't been assigned yet during import, so it can't associate it. Basically, you create it and then assign it; it doesn't allow you to create and assign it at the same time.
 
Do you have a valid import CSV file with DID, destination and name? If so, all data will be imported (create DID, assign it to the destination, set the name). If a DID already exists then it throws an error.

I recommend editing the trunk via the xapi.
 
Before recreating the trunk we performed an export and the same file generates an error in the
 
Hello @Alle CTEC
If your concern is the number of DIDs you have configured, please note that you can easily export your DIDs (Reports > System > Inbound Rules) before re-adding the provider. Simply create a CSV file with three columns (DID, Destination, Name of the DID), so the file should look like this
attachment


After re-adding the provider, you can import this CSV file and all of your DIDs will be added back and assigned automatically.
 
I've been searching how to format the CSV for import for 2 days! Thank you for providing an example and showing us how it should be imported. I think it would be very helpful if there was a tooltip on the SIP Trunk DID page near the import button that explains the CSV format needed, or even a download button that gives a template file. I tried exporting from the Reports > System > Inbound Rules and then importing that but it didn't work probably because my CSV had headers (DID, Name, Destination) and the Destination column had extension and its name "4000 My Extension". I tried to order my CSV columns to mirror how the UI has them layed out: DID, Name, Assigned To since there was no other guidance.