[SR-Users] Set $uac_req(body) to raw hex value

Daniel-Constantin Mierla miconda at gmail.com
Mon May 3 08:34:29 CEST 2021


Hello,

still not very clear for me: if you want to set the body to hex string,
it should work, the hex string should not create any problem.

It is good that smsops cover those cases now. If you want to investigate
other directions, then:

If you have a multi-part body, there is another function that can be
useful, see:

  *
https://www.kamailio.org/docs/modules/stable/modules/textops.html#textops.f.append_body_part_hex

Moreover, there are transformations to encode/decode hex strings, they
may be useful. And, at the end, adding a function to set any type of
body should be not much C coding, you can look at the functions from
textops module.

Cheers,
Daniel

On 02.05.21 23:41, Nick wrote:
> Hi Daniel,
> This is to do with sending IMS SMS, where the SIP Body is encoded as
> GSM A (GSM 03.38) containing the SMS TPDU.
> There's a few things the *smsops* module couldn't handle, I'm using
> Kemi so I was able to correctly encode / decode the values we needed
> using an external library but then couldn't encode this as the message
> body.
> Ideally I'd be able to take the output of the external library to
> encode as the message body (in hex as it would be on the wire) and set
> it as the message body, but I imagine this is a bit of an edge-case so
> probably not much demand for it.
> In the end some recent commits that addressed the same issues with
> smsops I was facing enabled me to use the smsops module to do
> everything I needed,
> Cheers,
> Nick
>
>
>
>
> On Mon, Apr 26, 2021 at 6:52 PM Daniel-Constantin Mierla
> <miconda at gmail.com <mailto:miconda at gmail.com>> wrote:
>
>     Hello,
>
>     On 24.04.21 12:32, Nick wrote:
>     > Hi all,
>     >
>     > It seems in the UAC module the $uac_req(body) PV is evaluated as
>     a string,
>     >
>     > How can I set the value of the request body of a generated
>     request, to
>     > a raw hex value without it being interpreted as a string?
>
>     Kamailio configuration file works only with integer and strings.
>
>     Can you give an explicit example of what you try and what you
>     expect to
>     happen?
>
>     Cheers,
>     Daniel
>
>     -- 
>     Daniel-Constantin Mierla -- www.asipto.com <http://www.asipto.com>
>     www.twitter.com/miconda <http://www.twitter.com/miconda> --
>     www.linkedin.com/in/miconda <http://www.linkedin.com/in/miconda>
>     Kamailio Advanced Training - Online
>     May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone)
>       * https://www.asipto.com/sw/kamailio-advanced-training-online/
>     <https://www.asipto.com/sw/kamailio-advanced-training-online/>
>
-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - Online
May 17-20, 2021 (Europe Timezone) - June 7-10, 2021 (America Timezone)
  * https://www.asipto.com/sw/kamailio-advanced-training-online/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20210503/2d62689b/attachment.htm>


More information about the sr-users mailing list