17 lines
560 B
Go
17 lines
560 B
Go
package sipcall
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"git.ipao.vip/rogee/go-sip/internal/asterisk"
|
|
"testing"
|
|
)
|
|
|
|
func TestPreDialNativeFailureIsNotReportedAsAttemptedCall(t *testing.T) {
|
|
h := &fakeHost{dialErr: &asterisk.NativeCallFailure{Phase: "sip_bind", Cause: errors.New("capture disappeared before Dial")}}
|
|
r, err := run(context.Background(), fixtureConfig(t), "18601010101", false, h, nil)
|
|
if err == nil || r.Status != "not_dialed" || r.AnsweredAt != nil || h.restores != 1 {
|
|
t.Fatalf("never submitted Dial must remain not-dialed: %+v %v", r, err)
|
|
}
|
|
}
|