username => $username,
useralias => $username,
uipass => $svc->_password,
- credit => $cust_main->credit_limit || $self->option('credit') || 0,
+ creditlimit => $cust_main->credit_limit || $self->option('credit') || 0,
tariff => $part_pkg->option('a2billing_tariff'),
status => 1,
lastname => $cust_main->last, # $svc->finger?
zipcode => $location->zip,
simultaccess => $part_pkg->option('a2billing_simultaccess'),
typepaid => $part_pkg->option('a2billing_type'),
+ email_notification => $cust_main->invoicing_list_emailonly_scalar,
+ notify_email => ($cust_main->invoicing_list_emailonly_scalar ? 1 : 0),
+ credit_notification => $cust_main->credit_limit || $self->option('credit') || 0,
sip_buddy => 1,
company_name => $cust_main->company,
activated => 't',
id_cc_didgroup => $self->option('didgroup'),
id_cc_country => $cc_country_id,
iduser => $cc_card_id,
- did => $svc->phonenum,
+ did => $svc->countrycode. $svc->phonenum,
billingtype => ($self->option('billtype') eq 'Dial Out Rate' ? 2 : 3),
activated => 1,
+ aleg_carrier_cost_min_offp => $part_pkg->option('a2billing_carrier_cost_min'),
+ aleg_carrier_initblock_offp => $part_pkg->option('a2billing_carrier_initblock_offp'),
+ aleg_carrier_increment_offp => $part_pkg->option('a2billing_carrier_increment_offp'),
+ aleg_retail_cost_min_offp => $part_pkg->option('a2billing_retail_cost_min_offp'),
+ aleg_retail_initblock_offp => $part_pkg->option('a2billing_retail_initblock_offp'),
+ aleg_retail_increment_offp => $part_pkg->option('a2billing_retail_increment_offp'),
);
# use 'did' as the key here so that if the DID already exists, we
my $cc_did_id = $self->a2b_find('cc_did', 'svcnum', $svc->svcnum);
- my $destination = 'SIP/' . $svc->phonenum . '@' . $svc_acct->username;
+ my $destination = 'SIP/user-'. $svc_acct->username. '@'. $svc->sip_server. "!". $svc->countrycode. $svc->phonenum;
my %cc_did_destination = (
destination => $destination,
priority => 1,
id_cc_card => $cc_card_id,
id_cc_did => $cc_did_id,
+ validated => 1,
+ voip_call => 1,
);
# and if there's already a destination, change it to point to
} elsif ( $new->isa('FS::svc_phone') ) {
# if the phone number has changed, need to create a new DID.
- if ( $new->phonenum ne $old->phonenum ) {
+ if ( $new->phonenum ne $old->phonenum || $new->countrycode ne $old->countrycode ) {
# deactivate/unlink/close the old DID
# and create/link the new one
$error = $self->export_delete($old)