Skip to content

Commit

Permalink
fix national number sending to not include leading national calling p…
Browse files Browse the repository at this point in the history
…refix
  • Loading branch information
nicpottier committed Sep 6, 2017
1 parent e6bb2ac commit 736ad03
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion handlers/kannel/kannel.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (h *handler) SendMsg(msg courier.Msg) (courier.MsgStatus, error) {
if useNational {
parsed, err := phonenumbers.Parse(msg.URN().Path(), encodingDefault)
if err == nil {
form["to"] = []string{strings.Replace(phonenumbers.Format(parsed, phonenumbers.NATIONAL), " ", "", -1)}
form["to"] = []string{fmt.Sprintf("%d", parsed.GetNationalNumber())}
}
}

Expand Down
2 changes: 1 addition & 1 deletion handlers/kannel/kannel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ var nationalSendTestCases = []ChannelSendTestCase{
Text: "success", URN: "tel:+250788383383",
Status: "W",
ResponseBody: "0: Accepted for delivery", ResponseStatus: 200,
URLParams: map[string]string{"text": "success", "to": "0788383383", "coding": "", "priority": "1"},
URLParams: map[string]string{"text": "success", "to": "788383383", "coding": "", "priority": "1"},
SendPrep: setSendURL},
}

Expand Down

0 comments on commit 736ad03

Please sign in to comment.