Asterisk Prefix Code To Dial A High Fraud Country – Security Mechanism

Home » Asterisk Users » Asterisk Prefix Code To Dial A High Fraud Country – Security Mechanism
Asterisk Users 9 Comments

Hello, I would to allow users to place calls overseas such as India and Malaysia but only with a security code. if they don’t have a security code I want to be able to drop the calls.

can someone point me to a right direction to achieve this goal?

Thanks, Motty

9 thoughts on - Asterisk Prefix Code To Dial A High Fraud Country – Security Mechanism

  • Hello motty,

    Thursday, September 18, 2014, 6:35:40 PM, you wrote:

    I use this

    exten => _0041,1,Log(NOTICE,Pin Code for Switzerland calls)
    same => n,Playback(silence/1)
    same => n,Authenticate(9084,,4)
    same => n,Macro(outgoingTrunk,${EXTEN})
    same => n,Hangup()

    It uses a fixed PIN number which calls a macro which deals with the actual dialling, but a standard Dial command would work here too. Quick and easy, but there are lots of options. If the correct PIN is not entered, the call is not made.


    Best regards, Julian mailto:jb_soft@trink.co.uk

  • Thank you Julian,

    would it be possible to block calls to international calls except certain countries? I just want to make sure that if attackers try to place calls outside the states they not succeed.

    Thanks, Motty

  • WW91ciBxdWVzdGlvbiBkZW1vbnN0cmF0ZXMgYSBmdW5kYW1lbnRhbCBsYWNrIG9mIEFzdGVyaXNr IGNvbmNlcHRzIGFuZCBrbm93bGVkZ2UuICBZb3Ugc2hvdWxkIHN0YXJ0IGJ5IHJlYWRpbmcgaHR0
    cDovL3d3dy5hc3Rlcmlza2RvY3Mub3JnLyBhbmQgZ28gZnJvbSB0aGVyZS4gICAgQXN0ZXJpc2sg aXMgbm90IHNvbWV0aGluZyB5b3UgY2FuIGxlYXJuIGluIGEgZmV3IGRheXMuDQoNCkZyb206IGFz dGVyaXNrLXVzZXJzLWJvdW5jZXNAbGlzdHMuZGlnaXVtLmNvbSBbbWFpbHRvOmFzdGVyaXNrLXVz ZXJzLWJvdW5jZXNAbGlzdHMuZGlnaXVtLmNvbV0gT24gQmVoYWxmIE9mIG1vdHR5IGNydXoNClNl bnQ6IFRodXJzZGF5LCBTZXB0ZW1iZXIgMTgsID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aHVyczoNCiAgICAgICAgICAgICAgIGh0dHA6Ly93d3cuYXN0
    ZXJpc2sub3JnL2hlbGxvDQoNCmFzdGVyaXNrLXVzZXJzIG1haWxpbmcgbGlzdA0KVG8gVU5TVUJT
    Q1JJQkUgb3IgdXBkYXRlIG9wdGlvbnMgdmlzaXQ6DQogICBodHRwOi8vbGlzdHMuZGlnaXVtLmNv bS9tYWlsbWFuL2xpc3RpbmZvL2FzdGVyaXNrLXVzZXJzDQoNCg=

  • Thanks Eric, for respectfully pointing that link, it is the reason why I am posting my question for lack of knowledge. I had been working on Asterisk for the last 4 years, I am always learning something knew.

    – Motty

  • SXQgaXMgdW5mb3J0dW5hdGUgaHR0cDovL3d3dy5hc3Rlcmlza2RvY3Mub3JnL2VuLzNyZF9FZGl0
    aW9uL2FzdGVyaXNrLWJvb2staHRtbC9hc3Rlcmlzay1ib29rLmh0bWwjYXN0ZXJpc2stRFAtQmFz aWNzLVNFQ1QtMy42IGlzIG5vdCBoZWxwZnVsIHRvIHlvdS4NCg0KRnJvbTogYXN0ZXJpc2stdXNl cnMtYm91bmNlc0BsaXN0cy5kaWdpdW0uY29tIFttYWlsdG86YXN0ZXJpc2stdXNlcnMtYm91bmNl c0BsaXN0cy5kaWdpdW0uY29tXSBPbiBCZWhhbGYgT2YgbW90dHkgY3J1eg0KU2VudDogVGh1cnNk YXksIFNlcHRlbWJlciAxOCwgMjAxNCA1OjI3IFBNDQpUbzogQXN0ZXJpc2sgVXNlcnMgTWFpbGlu ZyBMaXN0IC0gTm9uLUNvbW1lcmNpYWwgRGlzY3Vzc2lvbg0KU3ViamVjdDogUmU6IFthc3Rlcmlz ay11c2Vyc10gQXN0ZXJpc2sgcHJlZml4IGNvZGUgdG8gZGlhbCBhIGhpZ2ggZnJhdWQgY291bnRy eSAtIHNlY3VyaXR5IG1lY2hhbmlzbQ0KDQpUaGFua3MgRXJpYywgZm9yIHJlc3BlY3RmdWxseSBw b2ludGluZyB0aGF0IGxpbmssIGl0IGlzIH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GFzIEluZGlhDQo+IGFuZCBNYWxheXNpYSBidXQgb25seSB3aXRoIGEgc2VjdXJpdHkg Y29kZS4gaWYgdGhleSBkb24ndCBoYXZlIGENCj4gc2VjdXJpdHkgY29kZSBJIHdhbnQgdG8gYmUg YWJsZSB0byBkcm9wIHRoZSBjYWxscy4NCg0KSSB1c2UgdGhpcw0KDQpleHRlbiA9PiBfMDA0MSwx LExvZyhOT1RJQ0UsUGluIENvZGUgZm9yIFN3aXR6ZXJsYW5kIGNhbGxzKQ0KICAgICAgICBzYW1l ID0+IG4sUGxheWJhY2soc2lsZW5jZS8xKQ0KICAgICAgICBzYW1lID0+IG4sQXV0aGVudGljYXRl KDkwODQsLDQpDQogICAgICAgIHNhbWUgPT4gbixNYWNybyhvdXRnb2luZ1RydW5rLCR7RVhURU59
    KQ0KICAgICAgICBzYW1lID0+IG4sSGFuZ3VwKCkNCg0KSXQgIHVzZXMgIGEgIGZpeGVkIFBJTiBu dW1iZXIgd2hpY2ggY2FsbHMgYSBtYWNybyB3aGljaCBkZWFscyB3aXRoIHRoZQ0KYWN0dWFsICBk aWFsbGluZywgIGJ1dCAgYSAgc3RhbmRhcmQgIERpYWwgY29tbWFuZCB3b3VsZCB3b3JrIGhlcmUg dG9vLg0KUXVpY2sgIGFuZCAgZWFzeSwgYnV0IHRoZXJlIGFyZSBsb3RzIG9mIG9wdGlvbnMuIElm IHRoZSBjb3JyZWN0IFBJTiBpcw0Kbm90IGVudGVyZWQsIHRoZSBjYWxsIGlzIG5vdCBtYWRlLg0K
    DQotLQ0KQmVzdCByZWdhcmRzLA0KIEp1bGlhbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBt YWlsdG86amJfc29mdEB0cmluay5jby51azxtYWlsdG86amJfc29mdEB0cmluay5jby51az4NCg0K
    DQotLQ0KX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fDQotLSBCYW5kd2lkdGggYW5kIENvbG9jYXRpb24gUHJvdmlkZWQg YnkgaHR0cDovL3d3dy5hcGktZGlnaXRhbC5jb20gLS0NCk5ldyB0byBBc3Rlcmlzaz8gSm9pbiB1
    cyBmb3IgYSBsaXZlIGludHJvZHVjdG9yeSB3ZWJpbmFyIGV2ZXJ5IFRodXJzOg0KICAgICAgICAg ICAgICAgaHR0cDovL3d3dy5hc3Rlcmlzay5vcmcvaGVsbG8NCg0KYXN0ZXJpc2stdXNlcnMgbWFp bGluZyBsaXN0DQpUbyBVTlNVQlNDUklCRSBvciB1cGRhdGUgb3B0aW9ucyB2aXNpdDoNCiAgIGh0
    dHA6Ly9saXN0cy5kaWdpdW0uY29tL21haWxtYW4vbGlzdGluZm8vYXN0ZXJpc2stdXNlcnMNCg0K
    DQotLQ0KX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fDQotLSBCYW5kd2lkdGggYW5kIENvbG9jYXRpb24gUHJvdmlkZWQg YnkgaHR0cDovL3d3dy5hcGktZGlnaXRhbC5jb20gLS0NCk5ldyB0byBBc3Rlcmlzaz8gSm9pbiB1
    cyBmb3IgYSBsaXZlIGludHJvZHVjdG9yeSB3ZWJpbmFyIGV2ZXJ5IFRodXJzOg0KICAgICAgICAg ICAgICAgaHR0cDovL3d3dy5hc3Rlcmlzay5vcmcvaGVsbG8NCg0KYXN0ZXJpc2stdXNlcnMgbWFp bGluZyBsaXN0DQpUbyBVTlNVQlNDUklCRSBvciB1cGRhdGUgb3B0aW9ucyB2aXNpdDoNCiAgIGh0
    dHA6Ly9saXN0cy5kaWdpdW0uY29tL21haWxtYW4vbGlzdGluZm8vYXN0ZXJpc2stdXNlcnMNCg0K
    DQotLQ0KX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fDQotLSBCYW5kd2lkdGggYW5kIENvbG9jYXRpb24gUHJvdmlkZWQg YnkgaHR0cDovL3d3dy5hcGktZGlnaXRhbC5jb20gLS0NCk5ldyB0byBBc3Rlcmlzaz8gSm9pbiB1
    cyBmb3IgYSBsaXZlIGludHJvZHVjdG9yeSB3ZWJpbmFyIGV2ZXJ5IFRodXJzOg0KICAgICAgICAg ICAgICAgaHR0cDovL3d3dy5hc3Rlcmlzay5vcmcvaGVsbG8NCg0KYXN0ZXJpc2stdXNlcnMgbWFp bGluZyBsaXN0DQpUbyBVTlNVQlNDUklCRSBvciB1cGRhdGUgb3B0aW9ucyB2aXNpdDoNCiAgIGh0
    dHA6Ly9saXN0cy5kaWdpdW0uY29tL21haWxtYW4vbGlzdGluZm8vYXN0ZXJpc2stdXNlcnMNCg0K

  • Not many people are going to want to answer this definitively, I suspect, for fear of being blamed if you copy what they did, it doesn’t work for you and you get landed with huge bills for calls you didn’t make. Securing Asterisk is never as easy as you think.

    However, if you look back through my own posts, I did post some dialplan code a short while ago, relating to a PIN entry. Feel free to borrow that and play around with it; but note, I will not accept any responsibility for it not being as secure as you thought!

    Another thing to consider would be only allowing overseas calls from a particulat context; any extension that does not require the ability to call abroad should be placed in a different default context. If you know you will only ever need to call a restricted range of foreign numbers, consider giving them “short codes” — endpoints effectively within your own internal numbering scheme — and sending calls to _00X. to a recorded message.

    [overseas-offices]
    ; this context is only for phones which need the ability to call overseas

    ; 8000 is office in France exten => 8000,1,Set(CALLERID(num)=${OUTGOING_IDENT})
    exten => 8000,n,Dial(${OUT_TRUNK}/0033251478820,180)
    exten => 8000,n,Hangup()

    ; 8010 is office in India exten => 8010,1,Set(CALLERID(num)=${OUTGOING_IDENT})
    exten => 8010,n,Dial(${OUT_TRUNK}/00918322494200,180)
    exten => 8010,n,Hangup()

    ; …..

    [default]
    ; play suitably sarchastic announcement to chancers
    _00X.,1,Play(ajs-not_allowed)
    _00X.,n,Hangup()

    Basically, be paranoid; and even then, don’t forget, you probably aren’t being paranoid enough.

  • Thank you AJ, I will certainly not copy and past; I want to believe I
    understand the risk. I needed some kind of direction, thank you for your support.

    -Motty