Sending USSD over E1/ISDN

I have a setup where I am using FreePBX-64bit-10.13.66 with a Digium TE110P E1 card. The setup is working flawlessly without any issues. However, our carrier has assigned us some call barring codes, where you can bar or unbar international calls at will that are supposed to be sent over the E1 line in the format 5412345# to let’s say bar international calls.
The carrier sent a technician on site and demonstrated how to do it with his portable Panasonic PBX and the USSD codes could work without a problem.
My question is how one can achieve this with my setup. I have tried from the extensions, overlapdial option with no success.
Is there a way of “selecting” the line to get the secondary dial tone to do this?

1 Like

The easiest way is a custom context using the PlayDTMF() function.

Is it possible you expound on this further or possible give me an example?

Can you please explain your issue in more detail?

Do you just need to send 5412345# as a “destination number” on the trunk? Or, is DTMF required? Or, some special signaling format?

If your issue is that your IP phones use ‘#’ for ‘send now’ and so # can’t be included in a number, you could set up an Outbound Route to accept and rewrite the number. For example:
prepend: 5412345#
prefix: 5412345
match pattern: (leave blank)
Trunk Sequence: (your E1 trunk)
Then, you dial 5412345 from an extension and 5412345# gets sent on the trunk.

Or, just set up an Outbound Route to pass the USSD codes and call from a softphone such as PhonerLite that permits including # in a number.

However, could you please explain your overall goal? For restricting international calls, it’s much easier and more flexible to use password-protected outbound routes, routes limited to specific extensions or groups of extensions, or (for a large system) the commercial Extension Routes module. Blocking expensive destinations at the carrier level could limit the damage if your PBX got hacked, but it would provide meaningful protection only if the unbar code is ‘secret’ (customized by the carrier for your organization). Otherwise, the attacker could issue the unbar code himself.

In an E1 the dial is signalled over the d-channel and a b-channel is returned with the results of your dial which gives back whatever, so it would depend on what you mean by ‘sent over the E1 line’ if it is needed inband over the b-channel after the number then add D(5412345#) to your dial command

http://www.asteriskdocs.org/en/2nd_Edition/asterisk-book-html-chunk/asterisk-APP-B-53.html

If needed inline over the d-channel then prepend 5412345# to your E1 trunk dialing .

Thanks for taking your time to reply on this. What we want to achieve is send DTMF to the E1 line. The carrier has some sort of a USSD code that works like this;
The first two digits 54 separated by stars/asterisks is the unlock code parameter while 53 is lock parameter then the next after the asterisk/star 5 digits are the unique pin assigned to you by the provider and then the pound/hash is to complete the USSD transaction. If I send the number as it is over the E1 line, the call is automatically rejected by the carrier, so I wanted to know how I could send the DTMF to the E1 instead of a destination number.
I hope I am clear enough

Thanks Dicko, I will try with the D(5412345#). Does this mean it will send DMTF to the E1 line?

IMO a piece of the picture is missing. If you have a ‘dumb’ (non ISDN) E1, it looks similar to 32 POTS lines. You could take one of them ‘off hook’, get a dial tone from the carrier and send *54*12345# on the line. But in the ISDN world you can’t do that – you must first send a ‘setup’ over the D channel to even get one of the B channels assigned to your call. Conceivably, a null destination string will do it, or an access code must first be sent as the destination number, before the carrier responds with dial tone and awaits the USSD code.

Please describe in as much detail as possible what the carrier tech did when he demonstrated this feature. Did he first press some keys to get a dial tone (played by the carrier, not by his PBX)? Then, what happened after he dialed *54*12345# ? Was there any sort of audible or other confirmation (announcement, beeps, message)?

The Asterisk dial command D option sends DTMF after a call is answered. A typical use would be to automatically dial an extension number after calling a remote system. Do you know whether the technician’s test call appeared to be answered before he sent the *54*12345# ?

If you don’t need to automate this function (a human will do the lock or unlock when required), the D option may not be a problem. He would dial a code that puts the trunk into the correct state for accepting the USSD code and would then press the keys on his phone.

It depends on whether that “USSD” (which is really a cell phone thing), is “Channel Associative” or trunk Associative. I would assume from your description it is a one-off CAS code. so should either be dial prepend or a post dial inband signal.
The D() thing will send those dtmf tones on the b-channel chosen by the d-channel after the b-channel is connected , initially to your providers routing engine, so the order of which of number/routingcode should be sent/received and on d or b channel would be carrier specific.

I suggest you just try it and see, if no-go then call the carrier.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.