CHANNEL(aor) CHANNEL(contact) Return Nothing

Home » Asterisk Users » CHANNEL(aor) CHANNEL(contact) Return Nothing
Asterisk Users 3 Comments

Hi list,

I’m trying to use CHANNEL(aor) and CHANNEL(contact) on PJSIP channel, on asterisk-13.3.2, but they don’t return anything. Is this a bug, or did I
miss something?

Here is my test dialplan:

exten => *98,1,Answer same => n,NoOp(Channel=<${CHANNEL(name)}>,type=
<${CHANNEL(channeltype)}>)
same => n,NoOp(AOR=<${CHANNEL(aor)}>, contact=<${CHANNEL(contact)}>)
same => n,Set(aor=${CHANNEL(name):$[LEN(CHANNEL(channeltype)) +1]:-9})
same => n,Set(contact=${PJSIP_AOR(${aor},contact)})
same => n,NoOp(URI=<${PJSIP_CONTACT(${contact},uri)}>)
same => n,NoOp(Expiration time=
<${PJSIP_CONTACT(${contact},expiration_time)}>)
same => n,NoOp(Qualify frequency=
<${PJSIP_CONTACT(${contact},qualify_frequency)}>)
same => n,NoOp(Outbound proxy=
<${PJSIP_CONTACT(${contact},outbound_proxy)}>)
same => n,NoOp(Path=<${PJSIP_CONTACT(${contact},path)}>)
same => n,NoOp(User-Agent=<${PJSIP_CONTACT(${contact},user_agent)}>)
same => n,PJSIPNotify(,jdg,gs-idle-screen-refresh)
same => n,Hangup

And here is the result in Asterisk CLI:

x220*CLI>
— Executing [*98@public:1] Answer(“PJSIP/jdg-0000001f”, “”) in new stack
— Executing [*98@public:2] NoOp(“PJSIP/jdg-0000001f”,
“Channel=, type=“) in new stack
— Executing [*98@public:3] NoOp(“PJSIP/jdg-0000001f”, “AOR=<>, contact=<>“) in new stack
[May 19 18:44:11] NOTICE[1476][C-0000001f]: ast_expr2.y:763
compose_func_args: argbuf allocated 12 bytes;
[May 19 18:44:11] NOTICE[1476][C-0000001f]: ast_expr2.y:782
compose_func_args: argbuf uses 11 bytes;
[May 19 18:44:11] NOTICE[1476][C-0000001f]: ast_expr2.y:763
compose_func_args: argbuf allocated 6 bytes;
[May 19 18:44:11] NOTICE[1476][C-0000001f]: ast_expr2.y:782
compose_func_args: argbuf uses 5 bytes;
— Executing [*98@public:4] Set(“PJSIP/jdg-0000001f”, “aor=jdg”) in new stack
— Executing [*98@public:5] Set(“PJSIP/jdg-0000001f”,
“contact=jdg;@sip:jdg@192.168.10.131:5062”) in new stack
— Executing [*98@public:6] NoOp(“PJSIP/jdg-0000001f”,
“URI=“) in new stack
— Executing [*98@public:7] NoOp(“PJSIP/jdg-0000001f”, “Expiration time=<1432098235>“) in new stack
— Executing [*98@public:8] NoOp(“PJSIP/jdg-0000001f”, “Qualify frequency=<60>“) in new stack
— Executing [*98@public:9] NoOp(“PJSIP/jdg-0000001f”, “Outbound proxy=<>“) in new stack
— Executing [*98@public:10] NoOp(“PJSIP/jdg-0000001f”, “Path=<>“)
in new stack
— Executing [*98@public:11] NoOp(“PJSIP/jdg-0000001f”,
“User-Agent=“) in new stack
— Executing [*98@public:12] PJSIPNotify(“PJSIP/jdg-0000001f”,
“,jdg,gs-idle-screen-refresh”) in new stack
— Executing [*98@public:13] Hangup(“PJSIP/jdg-0000001f”, “”) in new stack
== Spawn extension (public, *98, 13) exited non-zero on
‘PJSIP/jdg-0000001f’

What is wrong ?

Thanks,
– —
Jean-Denis Girard

SysNux Systèmes Linux en Polynésie française http://www.sysnux.pf/ Tél: +689 40.50.10.40 / GSM: +689 87.79.75.27

—–BEGIN PGP SIGNATURE—–

iEYEARECAAYFAlVcK+MACgkQuu7Rv+oOo/hOVgCbBspmlyjRFnY3VCfjaUpcd+Vr HO4AnA8OsDYx8+lPxET53X2xRdksy2rc
=n/qH
—–END PGP SIGNATURE—–

3 thoughts on - CHANNEL(aor) CHANNEL(contact) Return Nothing

  • Jean-Denis Girard wrote:

    It looks like this is an incoming leg, in which case that information isn’t available. There is no association of an AOR and Contact on incoming legs (it MAY be possible to deduce but it certainly wouldn’t work in all cases). Since you specify one explicitly on outgoing, that’s when it is available.

  • Jean-Denis Girard wrote:

    The code to do it doesn’t directly exist. The trouble is that on an incoming call the only thing you have to absolutely bind the session to the device is the endpoint (since it was identified against it). In the case of a contact and AOR you MAY be able to deduce it by looking at the Contact flowing across the dialog. This won’t always work though since they may not match, and sometimes you have to ignore parts of the URI to make a loose match.