|
@@ -294,7 +294,10 @@ fromuser,fromdomain,contact,voipsecret,qualify,qualifyfreq,transport,context,\
|
|
|
strcpy(trunkObject[trunk_size].qualifyfreq, g_row[13]);
|
|
|
strcpy(trunkObject[trunk_size].transport, g_row[14]);
|
|
|
strcpy(trunkObject[trunk_size].context, g_row[15]);
|
|
|
- strcpy(trunkObject[trunk_size].dtmfmode, g_row[16]);
|
|
|
+ if(strcmp(g_row[16],"rfc2833") == 0)
|
|
|
+ strcpy(trunkObject[trunk_size].dtmfmode, "rfc4733");
|
|
|
+ else
|
|
|
+ strcpy(trunkObject[trunk_size].dtmfmode, g_row[16]);
|
|
|
strcpy(trunkObject[trunk_size].videosupport, g_row[17]);
|
|
|
strcpy(trunkObject[trunk_size].encryption, g_row[18]);
|
|
|
strcpy(trunkObject[trunk_size].srtpcapable, g_row[19]);
|
|
@@ -493,13 +496,15 @@ mytime()\
|
|
|
|
|
|
while(i < trunk_size){
|
|
|
if(strcmp(trunkObject[i].trunkactive, "yes") == 0){
|
|
|
- if(strcmp(trunkObject[i].trunkstyle, "Peer") != 0 && strlen(trunkObject[i].voipusername) > 0)
|
|
|
+ if(strcmp(trunkObject[i].trunkstyle, "Peer") != 0)
|
|
|
{
|
|
|
- fprintf(conf_trunk_regs, "\
|
|
|
+ if(strlen(trunkObject[i].voipusername) > 0)
|
|
|
+ {
|
|
|
+ fprintf(conf_trunk_regs, "\
|
|
|
[%s]\n\
|
|
|
type = registration\n\
|
|
|
transport = transport-%s\n\
|
|
|
-outbound_auth = %s_auth\n\
|
|
|
+outbound_auth = auth_%s\n\
|
|
|
server_uri = sip:%s:%s\n\
|
|
|
client_uri = sip:%s@%s\n\
|
|
|
contact_user = %s\n\
|
|
@@ -521,8 +526,8 @@ trunkObject[i].contact,\
|
|
|
trunkObject[i].outbound_proxy,\
|
|
|
trunkObject[i].trunk\
|
|
|
);
|
|
|
- fprintf(conf_trunk_auths, "\
|
|
|
-[%s_auth]\n\
|
|
|
+ fprintf(conf_trunk_auths, "\
|
|
|
+[auth_%s]\n\
|
|
|
type = auth\n\
|
|
|
auth_type = userpass\n\
|
|
|
password = %s\n\
|
|
@@ -532,7 +537,7 @@ trunkObject[i].trunk,\
|
|
|
trunkObject[i].voipsecret,\
|
|
|
trunkObject[i].authuser\
|
|
|
);
|
|
|
- fprintf(conf_trunk_eps, "\
|
|
|
+ fprintf(conf_trunk_eps, "\
|
|
|
[%s]\n\
|
|
|
type = endpoint\n\
|
|
|
transport = transport-%s\n\
|
|
@@ -549,7 +554,7 @@ dtmf_mode = %s\n\
|
|
|
force_rport = no\n\
|
|
|
ice_support = no\n\
|
|
|
identify_by = %s\n\
|
|
|
-outbound_auth = %s_auth\n\
|
|
|
+outbound_auth = auth_%s\n\
|
|
|
outbound_proxy = %s\n\
|
|
|
rewrite_contact = no\n\
|
|
|
rtp_symmetric = no\n\
|
|
@@ -590,7 +595,97 @@ trunkObject[i].outbound_proxy,\
|
|
|
trunkObject[i].fromdomain,\
|
|
|
trunkObject[i].fromuser\
|
|
|
);
|
|
|
- fprintf(conf_trunk_aors, "\
|
|
|
+ fprintf(conf_trunk_aors, "\
|
|
|
+[%s]\n\
|
|
|
+type=aor\n\
|
|
|
+contact=%s\n\
|
|
|
+default_expiration=600\n\
|
|
|
+max_contacts=100\n\
|
|
|
+minimum_expiration=60\n\
|
|
|
+remove_existing=no\n\
|
|
|
+qualify_frequency=%s\n\
|
|
|
+authenticate_qualify=no\n\
|
|
|
+maximum_expiration=3600\n\
|
|
|
+outbound_proxy=%s\n\
|
|
|
+qualify_timeout=%s\n\
|
|
|
+\n",\
|
|
|
+trunkObject[i].trunk,\
|
|
|
+trunkObject[i].contact_uri,\
|
|
|
+trunkObject[i].qualifyfreq,\
|
|
|
+trunkObject[i].outbound_proxy,\
|
|
|
+trunkObject[i].qualify\
|
|
|
+);
|
|
|
+ fprintf(conf_trunk_idfs, "\
|
|
|
+[%s]\n\
|
|
|
+type=identify\n\
|
|
|
+endpoint=%s\n\
|
|
|
+match=%s\n\
|
|
|
+",\
|
|
|
+trunkObject[i].trunk,\
|
|
|
+trunkObject[i].trunk,\
|
|
|
+trunkObject[i].match\
|
|
|
+);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ fprintf(conf_trunk_eps, "\
|
|
|
+[%s]\n\
|
|
|
+type = endpoint\n\
|
|
|
+transport = transport-%s\n\
|
|
|
+context = %s\n\
|
|
|
+disallow = all\n\
|
|
|
+allow = %s\n\
|
|
|
+aors = %s\n\
|
|
|
+direct_media = yes\n\
|
|
|
+connected_line_method = update\n\
|
|
|
+direct_media_method = update\n\
|
|
|
+direct_media_glare_mitigation = incoming\n\
|
|
|
+disable_direct_media_on_nat = yes\n\
|
|
|
+dtmf_mode = %s\n\
|
|
|
+force_rport = no\n\
|
|
|
+ice_support = no\n\
|
|
|
+identify_by = %s\n\
|
|
|
+outbound_auth =\n\
|
|
|
+outbound_proxy = %s\n\
|
|
|
+rewrite_contact = no\n\
|
|
|
+rtp_symmetric = no\n\
|
|
|
+send_diversion = no\n\
|
|
|
+send_pai = no\n\
|
|
|
+send_rpid = no\n\
|
|
|
+media_encryption = no\n\
|
|
|
+inband_progress = no\n\
|
|
|
+device_state_busy_at = 0\n\
|
|
|
+allow_transfer = yes\n\
|
|
|
+allow_subscribe = yes\n\
|
|
|
+sdp_session = IP Audio Center\n\
|
|
|
+tos_audio = ef\n\
|
|
|
+tos_video = AF41\n\
|
|
|
+from_domain = %s\n\
|
|
|
+from_user = %s\n\
|
|
|
+cos_audio = 5\n\
|
|
|
+cos_video = 4\n\
|
|
|
+user_eq_phone = no\n\
|
|
|
+rtp_keepalive = 60\n\
|
|
|
+rtp_timeout = 60\n\
|
|
|
+rtp_timeout_hold = 300\n\
|
|
|
+rtcp_mux = no\n\
|
|
|
+codec_prefs_incoming_answer = prefer:pending, operation:intersect, keep:all, transcode:allow\n\
|
|
|
+codec_prefs_incoming_offer = prefer:pending, operation:intersect, keep:all, transcode:allow\n\
|
|
|
+codec_prefs_outgoing_answer = prefer:pending, operation:intersect, keep:all, transcode:allow\n\
|
|
|
+codec_prefs_outgoing_offer = prefer:pending, operation:union, keep:all, transcode:allow\n\
|
|
|
+\n",\
|
|
|
+trunkObject[i].trunk,\
|
|
|
+trunkObject[i].transport,\
|
|
|
+trunkObject[i].context,\
|
|
|
+trunkObject[i].allow,\
|
|
|
+trunkObject[i].trunk,\
|
|
|
+trunkObject[i].dtmfmode,\
|
|
|
+trunkObject[i].identify_by,\
|
|
|
+trunkObject[i].outbound_proxy,\
|
|
|
+trunkObject[i].fromdomain,\
|
|
|
+trunkObject[i].fromuser\
|
|
|
+);
|
|
|
+ fprintf(conf_trunk_aors, "\
|
|
|
[%s]\n\
|
|
|
type=aor\n\
|
|
|
contact=%s\n\
|
|
@@ -610,7 +705,7 @@ trunkObject[i].qualifyfreq,\
|
|
|
trunkObject[i].outbound_proxy,\
|
|
|
trunkObject[i].qualify\
|
|
|
);
|
|
|
- fprintf(conf_trunk_idfs, "\
|
|
|
+ fprintf(conf_trunk_idfs, "\
|
|
|
[%s]\n\
|
|
|
type=identify\n\
|
|
|
endpoint=%s\n\
|
|
@@ -620,11 +715,12 @@ trunkObject[i].trunk,\
|
|
|
trunkObject[i].trunk,\
|
|
|
trunkObject[i].match\
|
|
|
);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
fprintf(conf_trunk_auths, "\
|
|
|
-[%s_auth]\n\
|
|
|
+[auth_%s]\n\
|
|
|
type = auth\n\
|
|
|
auth_type = userpass\n\
|
|
|
password = %s\n\
|
|
@@ -642,6 +738,7 @@ context = %s\n\
|
|
|
disallow = all\n\
|
|
|
allow = %s\n\
|
|
|
aors = %s\n\
|
|
|
+auth = auth_%s\n\
|
|
|
direct_media = yes\n\
|
|
|
connected_line_method = update\n\
|
|
|
direct_media_method = update\n\
|
|
@@ -651,7 +748,7 @@ dtmf_mode = %s\n\
|
|
|
force_rport = no\n\
|
|
|
ice_support = no\n\
|
|
|
identify_by = %s\n\
|
|
|
-outbound_auth = %s_auth\n\
|
|
|
+outbound_auth = auth_%s\n\
|
|
|
rewrite_contact = no\n\
|
|
|
rtp_symmetric = no\n\
|
|
|
send_diversion = no\n\
|
|
@@ -683,6 +780,7 @@ trunkObject[i].transport,\
|
|
|
trunkObject[i].context,\
|
|
|
trunkObject[i].allow,\
|
|
|
trunkObject[i].voipusername,\
|
|
|
+trunkObject[i].voipusername,\
|
|
|
trunkObject[i].dtmfmode,\
|
|
|
trunkObject[i].identify_by,\
|
|
|
trunkObject[i].voipusername,\
|
|
@@ -812,13 +910,12 @@ mytime()\
|
|
|
if (did_size > 0){
|
|
|
while(m < did_size){
|
|
|
if (strcmp(didObject[m].didnumber, "") != 0 && strcmp(didObject[m].type, "") != 0){
|
|
|
-
|
|
|
- //exten => _didnumber,1,Goto(default,_destexten,1)
|
|
|
if(strcmp(didObject[m].type, "extension") == 0){
|
|
|
fprintf(did_fp, "\
|
|
|
-exten => %s,1,Goto(default,%s,1)\
|
|
|
+exten => %s,1,Gosub(stdexten,s,1(%s,PJSIP/%s))\
|
|
|
\n", \
|
|
|
didObject[m].didnumber,\
|
|
|
+didObject[m].exten,\
|
|
|
didObject[m].exten\
|
|
|
);
|
|
|
}else if(strcmp(didObject[m].type, "ivr") == 0){
|